OSDN Git Service

Partly ported plcore.dtx to LuaTeX-ja. Now we can output "tombow".
authorKazuki Maeda <kmaeda@users.sourceforge.jp>
Sun, 4 Sep 2011 17:21:49 +0000 (02:21 +0900)
committerKazuki Maeda <kmaeda@users.sourceforge.jp>
Sun, 4 Sep 2011 17:21:49 +0000 (02:21 +0900)
src/lltjcore.sty [new file with mode: 0644]
src/lltjfont.sty
src/luatexja-compat.sty
src/luatexja-core.sty
src/luatexja-latex.sty
test/test08-tombow.pdf [new file with mode: 0644]
test/test08-tombow.tex [new file with mode: 0644]

diff --git a/src/lltjcore.sty b/src/lltjcore.sty
new file mode 100644 (file)
index 0000000..90b3a8f
--- /dev/null
@@ -0,0 +1,153 @@
+%%
+%% lltjcore.sty: derived from plcore.dtx in pLaTeX.
+%% 
+\makeatletter
+\newif\iftombow \tombowfalse
+\newif\iftombowdate \tombowdatetrue
+\newdimen\@tombowwidth
+\setlength{\@tombowwidth}{.1\p@}
+\newbox\@TL\newbox\@Tl
+\newbox\@TC
+\newbox\@TR\newbox\@Tr
+\newbox\@BL\newbox\@Bl
+\newbox\@BC
+\newbox\@BR\newbox\@Br
+\newbox\@CL
+\newbox\@CR
+\font\@bannerfont=cmtt9
+\newtoks\@bannertoken
+\@bannertoken{}
+\def\maketombowbox{%
+  \setbox\@TL\hbox to\z@{\yoko\hss
+      \vrule width13mm height\@tombowwidth depth\z@
+      \vrule height10mm width\@tombowwidth depth\z@
+      \iftombowdate
+        \raise4pt\hbox to\z@{\hskip5mm\@bannerfont\the\@bannertoken\hss}%
+      \fi}%
+  \setbox\@Tl\hbox to\z@{\yoko\hss
+      \vrule width10mm height\@tombowwidth depth\z@
+      \vrule height13mm width\@tombowwidth depth\z@}%
+  \setbox\@TC\hbox{\yoko
+      \vrule width10mm height\@tombowwidth depth\z@
+      \vrule height10mm width\@tombowwidth depth\z@
+      \vrule width10mm height\@tombowwidth depth\z@}%
+  \setbox\@TR\hbox to\z@{\yoko
+      \vrule height10mm width\@tombowwidth depth\z@
+      \vrule width13mm height\@tombowwidth depth\z@\hss}%
+  \setbox\@Tr\hbox to\z@{\yoko
+      \vrule height13mm width\@tombowwidth depth\z@
+      \vrule width10mm height\@tombowwidth depth\z@\hss}%
+  \setbox\@BL\hbox to\z@{\yoko\hss
+      \vrule width13mm depth\@tombowwidth height\z@
+      \vrule depth10mm width\@tombowwidth height\z@}%
+  \setbox\@Bl\hbox to\z@{\yoko\hss
+      \vrule width10mm depth\@tombowwidth height\z@
+      \vrule depth13mm width\@tombowwidth height\z@}%
+  \setbox\@BC\hbox{\yoko
+      \vrule width10mm depth\@tombowwidth height\z@
+      \vrule depth10mm width\@tombowwidth height\z@
+      \vrule width10mm depth\@tombowwidth height\z@}%
+  \setbox\@BR\hbox to\z@{\yoko
+      \vrule depth10mm width\@tombowwidth height\z@
+      \vrule width13mm depth\@tombowwidth height\z@\hss}%
+  \setbox\@Br\hbox to\z@{\yoko
+      \vrule depth13mm width\@tombowwidth height\z@
+      \vrule width10mm depth\@tombowwidth height\z@\hss}%
+  \setbox\@CL\hbox to\z@{\yoko\hss
+      \vrule width10mm height.5\@tombowwidth depth.5\@tombowwidth
+      \vrule height10mm depth10mm width\@tombowwidth}%
+  \setbox\@CR\hbox to\z@{\yoko
+      \vrule height10mm depth10mm width\@tombowwidth
+      \vrule height.5\@tombowwidth depth.5\@tombowwidth width10mm\hss}%
+}
+\def\@outputtombow{%
+  \iftombow
+  \vbox to\z@{\kern-13mm\relax
+    \moveleft3mm\vbox to\@@paperheight{%
+      \hbox to\@@paperwidth{\hskip3mm\relax
+         \copy\@TL\hfill\copy\@TC\hfill\copy\@TR\hskip3mm}%
+      \kern-10mm
+      \hbox to\@@paperwidth{\copy\@Tl\hfill\copy\@Tr}%
+      \vfill
+      \hbox to\@@paperwidth{\copy\@CL\hfill\copy\@CR}%
+      \vfill
+      \hbox to\@@paperwidth{\copy\@Bl\hfill\copy\@Br}%
+      \kern-10mm
+      \hbox to\@@paperwidth{\hskip3mm\relax
+         \copy\@BL\hfill\copy\@BC\hfill\copy\@BR\hskip3mm}%
+    }\vss
+  }%
+  \fi
+}
+\newdimen\@@paperheight
+\newdimen\@@paperwidth
+\newdimen\@@topmargin
+\def\@outputpage{%
+\begingroup % the \endgroup is put in by \aftergroup
+  \iftdir
+    \dimen\z@\textwidth \textwidth\textheight \textheight\dimen\z@
+  \fi
+  \let \protect \noexpand
+  \@resetactivechars
+  \global\let\@@if@newlist\if@newlist
+  \global\@newlistfalse
+  \@parboxrestore
+  \shipout\vbox{\yoko
+    \set@typeset@protect
+    \aftergroup\endgroup
+    \aftergroup\set@typeset@protect
+     \if@specialpage
+       \global\@specialpagefalse\@nameuse{ps@\@specialstyle}%
+     \fi
+     \if@twoside
+       \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
+          \iftdir\let\@themargin\evensidemargin
+          \else\let\@themargin\oddsidemargin\fi
+       \else \let\@thehead\@evenhead
+          \let\@thefoot\@evenfoot
+           \iftdir\let\@themargin\oddsidemargin
+           \else\let\@themargin\evensidemargin\fi
+     \fi\fi
+     \@@topmargin\topmargin
+     \iftombow
+       \@@paperwidth\paperwidth \advance\@@paperwidth 6mm\relax
+       \@@paperheight\paperheight \advance\@@paperheight 16mm\relax
+       \advance\@@topmargin 1in\relax \advance\@themargin 1in\relax
+     \fi
+     \reset@font
+     \normalsize
+     \normalsfcodes
+     \let\label\@gobble
+     \let\index\@gobble
+     \let\glossary\@gobble
+     \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@
+    \@begindvi
+    \@outputtombow
+    \vskip \@@topmargin
+    \moveright\@themargin\vbox{%
+      \setbox\@tempboxa \vbox to\headheight{%
+        \vfil
+        \color@hbox
+          \normalcolor
+          \hb@xt@\textwidth{\@thehead}%
+        \color@endbox
+      }%                        %% 22 Feb 87
+      \dp\@tempboxa \z@
+      \box\@tempboxa
+      \vskip \headsep
+      \box\@outputbox
+      \baselineskip \footskip
+      \color@hbox
+        \normalcolor
+        \hb@xt@\textwidth{\@thefoot}%
+      \color@endbox
+    }%
+  }%
+  \global\let\if@newlist\@@if@newlist
+  \global \@colht \textheight
+  \stepcounter{page}%
+  \let\firstmark\botmark
+}
+\newcommand\printglossary{\@input@{\jobname.gls}}
+
+\endinput
index c635560..203b4a6 100644 (file)
@@ -1,5 +1,5 @@
 %%
-%% luatexja-latex-fonts.sty: derived from plfonts.dtx in pLaTeX.
+%% lltjfont.sty: derived from plfonts.dtx in pLaTeX.
 %% 
 \makeatletter
 \let\k@encoding\@empty
 \newbox\tstrutbox
 \newbox\zstrutbox
 \def\strut{\relax
-%  \ifydir
+  \ifydir
     \ifmmode\copy\strutbox\else\unhcopy\strutbox\fi
-%  \else
-%    \ifmmode\copy\tstrutbox\else\unhcopy\tstrutbox\fi
-%  \fi
+  \else
+    \ifmmode\copy\tstrutbox\else\unhcopy\tstrutbox\fi
+  \fi
 }
 \def\tstrut{\relax\hbox{\tate
    \ifmmode\copy\tstrutbox\else\unhcopy\tstrutbox\fi}}
index 37b7d08..f521763 100644 (file)
 \ltjsetparameter{kansujichar={8,`八}}
 \ltjsetparameter{kansujichar={9,`九}}
 
+\newcount\hour
+\newcount\minute
+
 %%------------------ all done
 \ltj@compat@AtEnd
 \endinput
index 66e03aa..bfd28c2 100644 (file)
 %%%%%%%% \inhibitglue
 \protected\def\inhibitglue{\directlua{luatexja.jfmglue.create_inhibitglue_node()}}
 
+%%%%%%%% \yoko, \tate, \ifydir, \iftdir
+%% At this moment, tategaki mode is not implemented; 
+%% there is only yokogaki mode now.
+\let\yoko\relax
+\let\tate\relax
+\let\ifydir\iftrue
+\let\iftdir\iffalse
+
 %%%%%%%% \ltjdefcharrange<name>{100-200,3000-,5000,...}
 \protected\def\ltjdefcharrange#1#2{%
   \ltj@tempcntc=#1 \expandafter\ltj@@dcrange#2,,\ignorespaces}
 %%------------------ all done
 \ltj@core@AtEnd
 \endinput
-%% EOF
\ No newline at end of file
+%% EOF
index 98c656f..5183456 100644 (file)
@@ -20,6 +20,7 @@
 %%% patch for LaTeX (similar to plfonts.dtx)
 \input{lltjfont.sty}
 \input{lltjdefs.sty}
+\input{lltjcore.sty}
 
 %%% parameter
 
diff --git a/test/test08-tombow.pdf b/test/test08-tombow.pdf
new file mode 100644 (file)
index 0000000..319f5b0
Binary files /dev/null and b/test/test08-tombow.pdf differ
diff --git a/test/test08-tombow.tex b/test/test08-tombow.tex
new file mode 100644 (file)
index 0000000..d77b590
--- /dev/null
@@ -0,0 +1,127 @@
+\documentclass[twocolumn]{bxjsarticle}
+
+\usepackage{fontspec}
+\usepackage{luatexja}
+
+% from jsclasses
+\DeclareRobustCommand\sffamily
+        {\romanfamily\sfdefault\kanjifamily\gtdefault\selectfont}
+
+\makeatletter
+\hour\time \divide\hour by 60\relax
+\@tempcnta\hour \multiply\@tempcnta 60\relax
+\minute\time \advance\minute-\@tempcnta
+
+\tombowtrue \tombowdatetrue
+\setlength{\@tombowwidth}{.1\p@}%
+\@bannertoken{%
+   \jobname\space(\number\year-\two@digits\month-\two@digits\day
+   \space\two@digits\hour:\two@digits\minute)}%
+\maketombowbox
+
+\setlength\Cvs{\baselineskip}
+
+\begin{document}
+
+\addtolength{\pdfpagewidth}{2in}
+\addtolength{\pdfpageheight}{2in}
+
+\section{トンボのテスト}
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+ああああああああああああああああああああああああああああああああああああああああ
+あああああああああああああああああああああああああああああああああああああああ.
+
+\end{document}