X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=test%2Ftest51-vtest.tex;h=e20bc90d9efab1ce5dbf80cf5d2e127e7f7ecaf0;hb=f078ac2f7998a102c7ec765e725f2269eed9f872;hp=a325f5961e3976fc82ad01796224cf245db21af3;hpb=2e1c111353a84b661363f6129d126c61a38ca761;p=luatex-ja%2Fluatexja.git diff --git a/test/test51-vtest.tex b/test/test51-vtest.tex index a325f59..e20bc90 100644 --- a/test/test51-vtest.tex +++ b/test/test51-vtest.tex @@ -1,9 +1,10 @@ -%#!luatex +%#!luajittex \directlua{luatexja_debug = 1} \input luatexja.sty %\input lua-visual-debug.sty + \catcode`\@=11 \newdimen\@tempdima \newbox\@tempboxa @@ -43,15 +44,16 @@ \kern-.15em% \TeX} -\tentgt +\tentgt\hfuzz10000pt\relax\vfuzz10000pt \def\H{\vrule width 2pt height 10pt depth 0pt% \vrule width 4pt height 0pt depth 4pt} -\message{^^JTATE, DTOU IN YOKO (HMODE))^^J} +\message{^^JTATE, DTOU, UTOD IN YOKO (HMODE))^^J} +\yoko \hbox{\yoko 横水平\H\vrule\hbox{\yoko 横水平\H }\vrule かき◆ - \vrule\hbox{\tate 縦水平\H }◆おおおお\vrule + \vrule\hbox{\tate 縦水平\H }\message{HOGE}◆おおおお\vrule \vbox{\yoko\hsize=30mm 横垂直\H ああああああああああ\hfill\H}かき◆% \vrule \vbox{\tate\hsize=30mm 縦垂直\H ああああああああああ\hfill\H}% @@ -63,9 +65,21 @@ \vbox{\dtou\hsize=30mm 下垂直\H ああああああああああ\hfill\H}% \vrule かき◆ } +\hbox{\yoko\vrule + 横水平\H\vrule\hbox{\utod 上水平\H }\vrule ◆おおおお + \H\vrule + \vbox{\utod\hsize=30mm 上垂直\H ああああああああああ\hfill\H}% + \vrule かき◆ +} +\hbox{\yoko + ああ\setbox0=\vtop{\yoko\hsize=30mm \ifhmode\message{H}\else\message{V}\fi 横垂直\H ああああああああああ\hfill\H}% +% {\tracingonline1\showboxdepth2\showboxbreadth100\showbox0}% + かき◆\copy0 ◆ +} + \vfill\eject -\message{^^JYOKO, DTOU IN TATE (HMODE)^^J} +\message{^^JYOKO, DTOU, UTOD IN TATE (HMODE)^^J} \leavevmode \hbox{\tate 縦水平\H\vrule \hbox{\yoko 横水平\H }\vrule かき◆\vrule @@ -78,10 +92,34 @@ 縦水平\H\vrule\hbox{\dtou 下水平\H }\vrule ◆おおおお\H\vrule \vbox{\dtou\hsize=30mm 下垂直\H ああああああああああ\hfill\H}% \vrule\H ◆ああああ} +\hbox{\tate +縦水平\H\vrule\hbox{\utod 上水平\H }\vrule ◆おおおお\H\vrule +\vbox{\utod\hsize=30mm 上垂直\H ああああああああああ\hfill\H}% +\vrule\H ◆ああああ} + +\vfill\eject +\message{^^JYOKO, TATE, DTOU,IN UTOD (HMODE)^^J} +\leavevmode +\hbox{\utod +上水平\H\vrule \hbox{\yoko 横水平\H }\vrule かき◆\vrule +\hbox{\tate 縦水平\H }\vrule◆おおおお\H\vrule +\vbox{\yoko\hsize=30mm 横垂直\H ああああああああああ\hfill\H}\vrule +かき◆\H\vrule +\vbox{\tate\hsize=30mm 縦垂直\H ああああああああああ\hfill\H}\vrule +◆ああああ} +\hbox{\utod +上水平\H\vrule\hbox{\dtou 下水平\H }\vrule ◆おおおお\H\vrule +\vbox{\dtou\hsize=30mm 下垂直\H ああああああああああ\hfill\H}% +\vrule\H ◆ああああ} +\hbox{\utod +上水平\H\vrule\hbox{\utod 上水平\H }\vrule ◆おおおお\H\vrule +\vbox{\utod\hsize=30mm 上垂直\H ああああああああああ\hfill\H}% +\vrule\H ◆ああああ} \vfill\eject -\message{^^JYOKO, TATE IN DTOU (HMODE)^^J} + +\message{^^JYOKO, TATE, UTOD IN DTOU (HMODE)^^J} \leavevmode \hbox{\dtou 下水平\H\vrule\hbox{\yoko 横水平\H }\vrule かき◆\H\vrule @@ -95,6 +133,10 @@ 下水平\H\vrule\hbox{\dtou 下水平\H }\vrule◆おおおお\vrule \vbox{\dtou\hsize=30mm 下垂直\H ああああああああああ\hfill\H}% \vrule ◆ああああ} +\hbox{\dtou +下水平\H\vrule\hbox{\utod 上水平\H }\vrule◆おおおお\vrule +\vbox{\utod\hsize=30mm 上垂直\H ああああああああああ\hfill\H}% +\vrule ◆ああああ} \vfill\eject @@ -116,7 +158,7 @@ これは,意味のないサンプルテキストです.\vrule \hbox{\dtou 下水平\H }\vrule\H おおおお これは,意味のないサンプルテキストです. -\vrule\vbox{\dtou\hsize=50mm 縦垂直\H ああああああああああ% +\vrule\vbox{\dtou\hsize=50mm 下垂直\H ああああああああああ% あああああああああ\hfill\H}% \vrule\H これは,意味のないサンプルテキストです. } @@ -139,7 +181,7 @@ これは,意味のないサンプルテキストです.\vrule \hbox{\dtou 下水平\H }\vrule\H おおおお これは,意味のないサンプルテキストです. -\vrule\vbox{\dtou\hsize=50mm 縦垂直\H ああああああああああ% +\vrule\vbox{\dtou\hsize=50mm 下垂直\H ああああああああああ% あああああああああ\hfill\H}% \vrule\H これは,意味のないサンプルテキストです. } @@ -161,16 +203,17 @@ これは,意味のないサンプルテキストです.\vrule \hbox{\dtou 下水平\H }\vrule\H おおおお これは,意味のないサンプルテキストです. -\vrule\vbox{\dtou\hsize=50mm 縦垂直\H ああああああああああ% +\vrule\vbox{\dtou\hsize=50mm 下垂直\H ああああああああああ% あああああああああ\hfill\H}% \vrule\H これは,意味のないサンプルテキストです. } +\vfill\eject \vbox{\tate\hsize100mm -\tfont\f=KozMinPr6N-Regular.otf:+vert;jfm=ujisv \f +\tfont\f=[KozMinPr6N-Regular.otf]:jfm=ujisv \f -\ltjsetparameter{yalbaselineshift=.25em}\baselineskip15pt +\ltjsetparameter{yalbaselineshift=.25em}\baselineskip15pt\parindent\zw \LaTeX の特徴として、テキストファイルであるソースコードを入力として処理することでDVIや PDFなどの表示形式を出力として得ることが挙げられる。 @@ -187,13 +230,17 @@ PDFなどの表示形式を出力として得ることが挙げられる。 変えることができるなど、文書内容データの再利用性が高い。一度スタイル設定を決めてしまえば、 あとは文書内容の記述に専念することができるという利点もある。論文などの投稿では、学術雑 誌のスタイルを記述したファイル(パッケージファイル)を Web からダウンロードして利用するこ -とで、統一されたスタイルで論文xを投稿することができ、論文の投稿者と雑誌の編集者とのやり取り +とで、統一されたスタイルで論文を投稿することができ、論文の投稿者と雑誌の編集者とのやり取り を簡略化できる。Kile、TeXShop、TeXworks、EasyTeX、WinShell などの \TeX 用エ ディタや、野鳥(やてふ、YaTeX)、TeXlipse、KaTeX(花鳥、かてふ)、祝鳥 (のりてふ)、M's TeX Helper 2など の\TeX 用テキストエディタマクロを兼用することに よって、より効率的な文章作成が可能ともなる。またMapleやMathematicaなどでドキュメントを 作成し、\TeX 形式で出力することも可能である。 +\null\hfill +(Wikipediaの「\LaTeX」の記事より.8/13現在) + +左⇦⇧⇩⇨⬅⬆⬇➡右 } \message{^^Jget/set box dimension^^J} @@ -203,18 +250,18 @@ PDFなどの表示形式を出力として得ることが挙げられる。 \tate\ltjsetparameter{talbaselineshift=0pt}Htp} 縦ボックス\hbox{\vrule\copy12288\vrule}寸法\quad \vbox{\hsize=80pt\yoko\noindent - WD: \the\ltjgetwd{12288}, \\HT: \the\ltjgetht{12288}, \\DP: \the\ltjgetdp{12288}% + WD: \the\ltjgetwd12288, \\HT: \the\ltjgetht12288, \\DP: \the\ltjgetdp12288% } \vbox{\hsize=80pt\tate\noindent - WD: \the\ltjgetwd{12288}, \\HT: \the\ltjgetht{12288}, \\DP: \the\ltjgetdp{12288}% + WD: \the\ltjgetwd12288, \\HT: \the\ltjgetht12288, \\DP: \the\ltjgetdp12288% } \ltjsetwd12288=100pt \setbox0=\hbox{\tate\ltjsetht12288=10pt} \vbox{\hsize=80pt\yoko\noindent - WD: \the\ltjgetwd{12288}, \\HT: \the\ltjgetht{12288}, \\DP: \the\ltjgetdp{12288}% + WD: \the\ltjgetwd12288, \\HT: \the\ltjgetht12288, \\DP: \the\ltjgetdp12288% } \vbox{\hsize=80pt\tate\noindent - WD: \the\ltjgetwd{12288}, \\HT: \the\ltjgetht{12288}, \\DP: \the\ltjgetdp{12288}% + WD: \the\ltjgetwd12288, \\HT: \the\ltjgetht12288, \\DP: \the\ltjgetdp12288% } @@ -223,21 +270,21 @@ PDFなどの表示形式を出力として得ることが挙げられる。 \yoko\ltjsetparameter{yalbaselineshift=0pt}Htp} 横ボックス\hbox{\vrule\copy12288\vrule}寸法\quad \vbox{\hsize=80pt\yoko\noindent - WD: \the\ltjgetwd{12288}, \\HT: \the\ltjgetht{12288}, \\DP: \the\ltjgetdp{12288}% + WD: \the\ltjgetwd12288, \\HT: \the\ltjgetht12288, \\DP: \the\ltjgetdp12288% } \vbox{\hsize=80pt\tate\noindent - WD: \the\ltjgetwd{12288}, \\HT: \the\ltjgetht{12288}, \\DP: \the\ltjgetdp{12288}% + WD: \the\ltjgetwd12288, \\HT: \the\ltjgetht12288, \\DP: \the\ltjgetdp12288% } \ltjsetwd12288=100pt \setbox0=\hbox{\tate\ltjsetht12288=10pt} \vbox{\hsize=80pt\yoko\noindent - WD: \the\ltjgetwd{12288}, \\HT: \the\ltjgetht{12288}, \\DP: \the\ltjgetdp{12288}% + WD: \the\ltjgetwd12288, \\HT: \the\ltjgetht12288, \\DP: \the\ltjgetdp12288% } \vbox{\hsize=80pt\tate\noindent - WD: \the\ltjgetwd{12288}, \\HT: \the\ltjgetht{12288}, \\DP: \the\ltjgetdp{12288}% + WD: \the\ltjgetwd12288, \\HT: \the\ltjgetht12288, \\DP: \the\ltjgetdp12288% } -dimexpr でも使えるかな?\the \dimexpr2\ltjgetwd{` }+\ltjgetwd{200}+1pt\relax +dimexpr でも使えるかな?\the \dimexpr2\ltjgetwd` +\ltjgetwd200+1pt\relax \vfill\eject @@ -276,21 +323,175 @@ abc&かきくけこ&xyz\cr}}% \vfill\eject \message{^^Jdir node^^J} +\font\seventt=cmtt10 at 7pt +\font\fivett=cmtt10 at 5pt + +\setbox0=\hbox{\yoko pF} +\setbox1=\hbox{\tate\copy0} +\fbox{\copy1} +\setbox1=\copy0 +{\obeylines\seventt\baselineskip=10pt +\directlua{luatexja.ext_show_node_list(tex.box[1], 'lastbox> ', tex.print)}\par} +\setbox0=\hbox{\yoko \ltjsetwd1=50pt} +{\obeylines\seventt\baselineskip=10pt +\directlua{luatexja.ext_show_node_list(tex.box[1], 'dir node1> ', tex.print)}\par} +\setbox0=\hbox{\dtou \ltjsetwd1=2pt} +{\obeylines\seventt\baselineskip=10pt +\directlua{luatexja.ext_show_node_list(tex.box[1], 'dir node2> ', tex.print)}\par} + +\setbox0=\hbox{\yoko \ltjsetht1=30pt} +{\obeylines\seventt\baselineskip=10pt +\directlua{luatexja.ext_show_node_list(tex.box[1], 'alter Yht> ', tex.print)}\par} + +\setbox0=\hbox{\tate \ltjsetwd1=50pt} +{\obeylines\seventt\baselineskip=10pt +\directlua{luatexja.ext_show_node_list(tex.box[1], 'alter Twd> ', tex.print)}\par} + +\setbox0=\hbox{\utod \ltjsetht1=50pt} +{\obeylines\seventt\baselineskip=10pt +\directlua{luatexja.ext_show_node_list(tex.box[1], 'alter Uht> ', tex.print)}\par} + +\setbox0=\hbox{\yoko \ltjsetht1=70pt} +{\obeylines\seventt\baselineskip=10pt +\directlua{luatexja.ext_show_node_list(tex.box[1], 'alter Yht> ', tex.print)}\par} + +%% unwrap +\setbox2=\hbox{\yoko \copy1} +\setbox2=\hbox{\yoko \unhbox2\global\setbox1=\lastbox} +{\obeylines\seventt +\directlua{luatexja.ext_show_node_list(tex.box[1], 'unwrapped> ', tex.print)}} + +\setbox0=\hbox{\utod \ltjsetht1=50pt} +{\obeylines\seventt\baselineskip=10pt +\directlua{luatexja.ext_show_node_list(tex.box[1], 'alter Uht> ', tex.print)}\par} + + + +\setbox0\hbox{\yoko a あ }\setbox1=\hbox{\tate\ltjsetht0=2pt} + +\fbox{\copy0} +\vbox{\yoko\hsize=60pt\noindent\the\ltjgetwd0,\\\the\ltjgetht0,\\\the\ltjgetdp0} +\vbox{\tate\hsize=60pt\noindent\the\ltjgetwd0,\\\the\ltjgetht0,\\\the\ltjgetdp0} +\vbox{\dtou\hsize=60pt\noindent\the\ltjgetwd0,\\\the\ltjgetht0,\\\the\ltjgetdp0} +\vbox{\utod\hsize=60pt\noindent\the\ltjgetwd0,\\\the\ltjgetht0,\\\the\ltjgetdp0} +% +\ltjsetwd0=40pt +\setbox9\hbox{\utod \ltjsetdp0=10pt} +\vbox{\yoko\hsize=60pt\noindent\the\ltjgetwd0,\\\the\ltjgetht0,\\\the\ltjgetdp0} +\vbox{\tate\hsize=60pt\noindent\the\ltjgetwd0,\\\the\ltjgetht0,\\\the\ltjgetdp0} +\vbox{\dtou\hsize=60pt\noindent\the\ltjgetwd0,\\\the\ltjgetht0,\\\the\ltjgetdp0} +\vbox{\utod\hsize=60pt\noindent\the\ltjgetwd0,\\\the\ltjgetht0,\\\the\ltjgetdp0} -\setbox0=\hbox{\tate ABCD} -\setbox1=\hbox{\yoko\box0} -\unhcopy1 -\setbox1=\lastbox %% box1: dir_node -\ltjsetdp1=100pt -\setbox2=\hbox{\tate \ltjsetdp1=42pt\copy1}%% unwrap +\vfill\eject +\message{^^Jothers^^J} -{\obeylines\tentt -\directlua{luatexja.ext_show_node_list(tex.box[2], 'A> ', tex.print)}} -\setbox2=\hbox{\tate \unhbox2\global\setbox1=\lastbox}%% unwrap -{\obeylines\tentt -\directlua{luatexja.ext_show_node_list(tex.box[1], 'B> ', tex.print)}} +p\kern-.15em\TeX\ bug (2011-02-24) +\setbox0=\hbox{\tate a}\fbox{\copy0}% +\hbox{\yoko\ltjsetht0=30pt +\hbox{\dtou\dimen0=\ltjgetht0} +\the\ltjgetht0}% OK. 30pt + +\def\R{012345678901234567890123456789} +\vbox{\tate\hsize=4\zw\R\R\R\R} -\the\ltjgetdp{1}\hbox{\tate \the\ltjgetdp{1}} -\end +%\tracingall +\def\showdir{\ifcase\ltjgetparameter{direction} % +?\or D\or ?\or T\or Y\or ?\or ?\or?\or?\or?\or?\or U\fi} +\showdir +\hbox{\tate {\dtou 感じ\showdir}\showdir} +\showdir + + +\vbox{\tate\hsize=100mm +日本語中に数式を打ってみる% +$\ltjgetparameter{talbaselineshift}abc\hbox{にほんごABC\hbox{\tate たて\showdir}}\showdir$ +$$ + \ltjgetparameter{talbaselineshift}abc\hbox{にほんごABC\hbox{\tate たて\showdir}}\showdir +$$ +あいうえお} + +\vsize250mm +\def\F#1{% +\medskip +\setbox0=\hbox{\csname #1\endcsname + \hbox{\yoko Y}\hbox{\tate T}\hbox{\dtou D}\hbox{\utod U}} +{\obeylines\fivett\baselineskip=7pt +\directlua{luatexja.ext_show_node_list(tex.box[0], 'hbox #1> ', tex.print)}\par}} + +\F{yoko} +\F{tate} +\F{dtou} +\F{utod} + +\hbox{\inhibitglue\tate} +\hbox{\ltjsetparameter{kanjiskip=0pt}\tate} + +\leavevmode\hbox{A}% +\setbox0\hbox{}% +\setbox1=\lastbox\the\wd1 + + +\vfill\eject + +\def\TEST#1{% + \tfont\A={#1;jfm=ujisv} + \noindent\vbox{\tate\hsize=200mm\A\parindent0pt + {\tentt #1}\par + あ,いーう.え「お」”か”左←↑→↓下 + }\ +} + +\TEST{IPAexMincho:} +\TEST{[hgrkk.ttc]:} +\TEST{[hgrkk.ttc]:script=kana} +\TEST{[hgrkk.ttc]:script=kana;language=jan} +\TEST{[hgrkk.ttc]:script=hani} +\TEST{[KozMinPr6N-Regular.otf]:} +\TEST{[KozMinPr6N-Regular.otf]:script=kana} +\TEST{[KozMinPr6N-Regular.otf]:script=kana;language=jan} +\TEST{[KozMinPr6N-Regular.otf]:script=hani} + +\def\X#1#2#3{% +漢字\hbox{#1◆あい#2えお◆}漢字 +\raise10pt\hbox{#1◆あい#2えお◆}漢字 +\lower10pt\hbox{#1◆あい#2えお◆}漢字#3 +漢字\hbox{\hbox{#1◆あい#2えお◆}}漢字 +\raise10pt\hbox{\hbox{#1◆あい#2えお◆}}漢字 +\lower10pt\hbox{\hbox{#1◆あい#2えお◆}}漢字#3 +漢字\vbox{\hsize80pt#1\vrule◆あい#2えお◆\hfil\vrule}漢字 +\raise10pt\vbox{\hsize80pt#1\noindent\vrule◆あい#2えお◆\hfil\vrule}漢字 +\lower10pt\vbox{\hsize80pt#1\vrule◆あい#2えお◆\hfil\vrule}漢字 +} + +\vfil\eject +\vbox{\yoko +\X\yoko Y{\hfil\break}\par\X\tate T{}\par\X\dtou D{}\par +\X\utod U{}} + +\vbox{\tate +\X\yoko Y{}\par\X\tate T{\hfil\break}\par\X\dtou D{\hfil\break}\par +\X\utod U{\hfil\break}} + + +\vfill\eject +\directlua{luatexja.jfont.register_vert_replace{ + ['あ']='い', %[',']=false, ['.']='ゐ', +}} +%\def\T{[KozMinPr6N-Regular.otf]} +\def\T{SourceHanSerif-Regular} +%\def\T{[ipaexm.ttf]} +%\def\T{[HiraMinProN-W3.otf]} +\jfont\X=\T:jfm=ujis;language=latn;script=latn +\tfont\V=\T:jfm=ujisv;+vert;jpotf;language=latn;script=latn +\tfont\VM=\T:jfm=ujisv;+vert;language=latn;script=latn + +\noindent +\def\ts{\char"301Dあ\char"301Dあ「」あ\char"301Eあ\char"301F% + ---“あああ,あああ.”} +\vbox{\yoko\X\hsize=20\zw\ts}\vadjust{\vskip.5\baselineskip}\\ +\vbox{\tate\V\hsize=20\zw\ts}\quad +\vbox{\tate\VM\hsize=20\zw\ts} + +\end