OSDN Git Service

platex/#95
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 25 Feb 2023 21:25:07 +0000 (06:25 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 25 Feb 2023 21:25:07 +0000 (06:25 +0900)
src/patches/lltjcore.sty

index af49aef..470a8f9 100644 (file)
 \patchcmd\@outputpage{\reset@font}{\@tombowreset@@paper\reset@font}{}{}
 \patchcmd\@outputpage{\@begindvi}{\@begindvi\@outputtombow}{}{}
 
+%
+\pretocmd\@floatboxreset{\pltx@save@float@dir}{}{}
+\patchcmd\@endfloatbox{\outer@nobreak}{\outer@nobreak\pltx@check@float@dir}{}{}
+\def\pltx@save@float@dir{%
+  \edef\pltx@float@dir@first{\ltjgetparameter{direction}}}
+\def\pltx@check@float@dir{%
+  \ifx\pltx@float@dir@first\@undefined\else
+    \ifnum\ltjgetparameter{direction}=\pltx@float@dir@first\else
+      \pltx@err@float@dir
+    \fi
+  \fi}
+\def\pltx@err@float@dir{%
+  \@latex@error{Direction change inside float!?\MessageBreak
+    Use \noexpand\layoutcaption provided in \string\usepackage{lltjext}}\@ehc}
 %%% Remove extra xkanjiskip
 \renewcommand\@makefnmark{%
   \unless\ifnum\ltjgetparameter{direction}=3