OSDN Git Service

More LaTeX codes for vertical writing
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 6 Sep 2014 14:16:51 +0000 (23:16 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 6 Sep 2014 14:16:51 +0000 (23:16 +0900)
 lltjext.sty: fix ``unnatural'' behavior of \rensuji
 lltjcore.sty: add codes related to \footnote from plcore
 lltjfont.sty: use `漢' instead of `あ'

src/lltjext.sty
src/patches/lltjcore.sty
src/patches/lltjfont.sty

index 9c5bf9a..5d74fb3 100644 (file)
@@ -1,9 +1,10 @@
 %
 % lltjext.sty: derived from plext.sty in pLaTeX.
 %
+
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{lltjext}
-   [2014/08/11 v1.2-ltj-2 Macros for vertical writing]
+   [2014/09/06 v1.2-ltj-3 Macros for vertical writing]
 \RequirePackage{luatexja}
 
 \let\ltj@lltjext@orig@tabular=\tabular
   \hbox{#2}\else
   \hskip\rensujiskip
   \ifvmode\leavevmode\fi
+  \setbox\tw@\hbox{漢}% 「あ」では仮名書体使用時がまずそう
+  \@tempdimb\ltjgetht\tw@ \advance\@tempdimb\ltjgetdp\tw@
   \ifnot@advanceline\not@advancelinefalse\else
     \setbox\z@\hbox{\yoko#2}%
     \@tempdima\ltjgetht\z@ \advance\@tempdima\ltjgetdp\z@
     \ifnum\ltjgetparameter{direction}=1\relax
-      \if #1c\relax\vrule \@width \z@ \@height.5\@tempdima \@depth.5\@tempdima
-      \else\if #1l\relax\vrule\@width \z@\@height\z@ \@depth\@tempdima
-      \else\vrule\@width \z@ \@height\@tempdima \@depth\z@
+      % 周囲が dtou の場合には,高さ \ltjgetht\tw@, 深さ \ltjgetdp\tw@ のボックスを基準としている.
+      \if #1c\relax\vrule \@width 1pt \@height\dimexpr.5\@tempdima+.5\ltjgetht\tw@-.5\ltjgetdp\tw@
+                          \@depth\dimexpr.5\@tempdima-.5\ltjgetht\tw@+.5\ltjgetdp\tw@
+      \else\if #1l\relax\vrule\@width 1pt\@height\ltjgetht\tw@ \@depth\dimexpr\@tempdima-\ltjgetht\tw@
+      \else\vrule\@width 1pt \@height\dimexpr\@tempdima-\ltjgetdp\tw@ \@depth\ltjgetdp\tw@
       \fi\fi
     \else
-      \if #1c\relax\vrule \@width \z@ \@height.5\@tempdima \@depth.5\@tempdima
-      \else\if #1r\relax\vrule\@width \z@\@height\z@ \@depth\@tempdima
-      \else\vrule\@width \z@ \@height\@tempdima \@depth\z@
+      % 周囲が tate, utod の場合も同じ
+      \if #1c\relax\vrule \@width 1pt \@height\dimexpr.5\@tempdima+.5\ltjgetht\tw@-.5\ltjgetdp\tw@
+                          \@depth\dimexpr.5\@tempdima-.5\ltjgetht\tw@+.5\ltjgetdp\tw@
+      \else\if #1r\relax\vrule\@width 1pt\@height\ltjgetht\tw@ \@depth\dimexpr\@tempdima-\ltjgetht\tw@
+      \else\vrule\@width 1pt \@height\dimexpr\@tempdima-\ltjgetdp\tw@ \@depth\ltjgetdp\tw@
       \fi\fi
     \fi
   \fi
   \ifnum\ltjgetparameter{direction}=1\relax
-    \if #1c\relax\hbox to\zw{\yoko\hss#2\hss}%
-    \else\if #1r\relax\vbox{\hbox to\zw{\yoko\hss#2}\kern\z@}%
-    \else\vtop{\kern\z@\hbox to\zw{\yoko#2\hss}}%
+    \if #1c\relax\hbox to\@tempdimb{\yoko\hss#2\hss\kern-\ltjgetdp\tw@}%
+    \else\if #1r\relax\vbox{\hbox to\@tempdimb{\yoko\hss#2\kern-\ltjgetdp\tw@}}%
+    \else\lower\ltjgetdp\tw@\vtop{\hbox to\@tempdimb{\yoko#2\hss}}%
     \fi\fi
   \else
-    \if #1c\relax\hbox to\zw{\yoko\hss#2\hss}%
-    \else\if #1r\relax\vtop{\kern\z@\hbox to\zw{\yoko\hss#2}}%
-    \else\vbox{\hbox to\zw{\yoko #2\hss}\kern\z@}%
+    \if #1c\relax\raise\dimexpr.5\@tempdimb-\ltjgetdp\tw@
+        \hbox to\@tempdimb{\yoko \hss#2\hss}%
+    \else\if #1r\relax\raise\dimexpr.5\@tempdimb-\ltjgetdp\tw@
+        \vbox{\hbox to\@tempdimb{\yoko\hss#2}}%
+    \else\raise\dimexpr.5\@tempdimb-\ltjgetdp\tw@
+         \vtop{\hbox to\@tempdimb{\yoko #2\hss}}%
     \fi\fi
   \fi
   \hskip\rensujiskip
   \RequirePackage{filehook}
   \AtEndOfPackageFile{array}{\ltj@lltjext@patch@array}
 }
+
+
 \endinput
\ No newline at end of file
index c4acde8..c1b28d5 100644 (file)
@@ -6,7 +6,18 @@
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{lltjcore}[2013/05/14 Patch to LaTeX2e Kernel for LuaTeX-ja]
 
-\makeatletter
+\def\cleardoublepage{\clearpage\if@twoside
+  \ifodd\c@page
+    \ifnum\ltjgetparameter{direction}=3
+      \hbox{}\thispagestyle{empty}\newpage
+      \if@twocolumn\hbox{}\newpage\fi
+    \fi
+  \else
+    \ifnum\ltjgetparameter{direction}=4
+      \hbox{}\thispagestyle{empty}\newpage
+      \if@twocolumn\hbox{}\newpage\fi
+    \fi
+  \fi\fi}
 \newif\iftombow \tombowfalse
 \newif\iftombowdate \tombowdatetrue
 \newdimen\@tombowwidth
   \stepcounter{page}%
   \let\firstmark\botmark
 }
-
+\renewcommand\@makefnmark{\hbox{%
+  \unless\ifnum\ltjgetparameter{direction}=3
+    \@textsuperscript{\normalfont\@thefnmark}%
+  \else\hbox{\yoko \@textsuperscript{\normalfont\@thefnmark}}\fi}}
+\long\def\@footnotetext#1{%
+  \ifcase\ltjgetparameter{direction}%
+    \or   \let\@tempa\dtou
+    \or\or\let\@tempa\tate
+    \or   \let\@tempa\yoko
+    \else \let\@tempa\utod
+  \fi
+  \insert\footins{\@tempa%
+    \reset@font\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth \@parboxrestore
+    \protected@edef\@currentlabel{%
+       \csname p@footnote\endcsname\@thefnmark
+    }%
+    \color@begingroup
+      \@makefntext{%
+        \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+    \color@endgroup}}
+\def\@footnotemark{\leavevmode
+  \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi
+  \unless\ifnum\ltjgetparameter{direction}=3 \@makefnmark
+  \else\hbox to\z@{\hskip-.25\zw\raise.9\zh\@makefnmark\hss}\fi
+  \ifhmode\spacefactor\@x@sf\fi\relax}
 \def\@setref#1#2#3{%
   \ifx#1\relax
     \protect\G@refundefinedtrue
     \verb@eol@error \let\do\@makeother \dospecials
     \verbatim@font\@noligs
     \@ifstar\@sverb\@verb}
-\def\@makefnmark{\hbox{}\hbox{\@textsuperscript{\normalfont\@thefnmark}}\hbox{}}
 \fi
 \gdef\@stopfield{\null\color@endgroup\egroup}
 \newcount\hour
index 48c8857..3c7ad64 100644 (file)
 \newdimen\adjust@dimen
 \def\adjustbaseline{%
     \setbox\adjust@box\hbox{%
-      \ltj@ykblshift=0 \ltj@tkblshift=0}%
+      \ltj@ykblshift=0 \ltj@tkblshift=0}%
     \cht\ht\adjust@box
     \cdp\dp\adjust@box
     \cwd\wd\adjust@box
     \cvs\normalbaselineskip
     \chs\cwd
     \cHT\cht \advance\cHT\cdp
-    \setbox0\hbox{\tate\ltj@tkblshift=0 あ}%
+    \setbox0\hbox{\tate\ltj@tkblshift=0}%
     \setbox\adjust@box\hbox{\tate\ltj@tablshift=0 M}%
     \adjust@dimen\ht\adjust@box
     \advance\adjust@dimen\dp\adjust@box