summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-09-01 22:16:58 +0000
committerKarl Berry <karl@freefriends.org>2018-09-01 22:16:58 +0000
commit7296fc79309858e6bcb41b7e4e28dfa73e3dd773 (patch)
treea14049ee3ff57d81b1e5e3cff8c6d1820ca25db8 /Master/texmf-dist/tex/latex
parent6680343d25dad119fdee522e6395982d66d24153 (diff)
jlreq (1sep18)
git-svn-id: svn://tug.org/texlive/trunk@48535 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty75
-rw-r--r--Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty88
-rw-r--r--Master/texmf-dist/tex/latex/jlreq/jlreq.cls131
3 files changed, 189 insertions, 105 deletions
diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty b/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
index 9532669172a..9bf28042489 100644
--- a/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
+++ b/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
@@ -162,14 +162,14 @@
% もしカンマがない場合は\ifjlreq@resultがfalseになる.
\newcommand*{\jlreq@helper@dividebycomma}[1]{\jlreq@helper@dividebycomma@#1,\jlreq@endmark}
\def\jlreq@helper@dividebycomma@#1,#2\jlreq@endmark{%
- \jlreq@remove@spaceandbracket{#1}{\jlreq@resulta}%
- \jlreq@remove@spaceandbracket{#2}{\jlreq@resultb}%
+ \jlreq@helper@trim{#1}{\jlreq@resulta}%
+ \jlreq@helper@trim{#2}{\jlreq@resultb}%
\ifx\jlreq@resultb\@empty\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{%
\jlreq@resultfalse
}{%
\jlreq@resulttrue
\expandafter\def\expandafter\jlreq@resultb\expandafter{\jlreq@helper@removelastcomma#2\jlreq@endmark}%
- \expandafter\jlreq@remove@spaceandbracket\expandafter{\jlreq@resultb}{\jlreq@resultb}%
+ \expandafter\jlreq@helper@trim\expandafter{\jlreq@resultb}{\jlreq@resultb}%
}%
}
\def\jlreq@helper@removelastcomma#1,\jlreq@endmark{#1}
@@ -245,6 +245,7 @@
% キー指定しないkeyval(独自実装)
% \jlreq@parsekeyval@nokey{<action>}{<parse対象>}
% action内では#1=key, #2=val
+% <parse対象>は一回だけ展開される.
\newcommand{\jlreq@parsekeyval@nokey}[2]{%
\begingroup
\def\jlreq@do{}%
@@ -265,11 +266,10 @@
\long\def\jlreq@parsekeyval@nokey@iii#1#2{%
\jlreq@remove@spaceandbracket{#1}{\jlreq@tempa}%
\jlreq@remove@spaceandbracket{#2}{\jlreq@tempb}%
- \ifx\jlreq@tempa\@empty\expandafter\@gobble\else\expandafter\@firstofone\fi
- {%
- \edef\@tempa{\noexpand\jlreq@parsekeyval@nokey@iv{\expandonce{\jlreq@tempb}}{\expandonce{\jlreq@tempa}}}%
- \@tempa
- }%
+ \ifx\jlreq@tempb\@empty\else
+ \edef\@tempa{\noexpand\jlreq@parsekeyval@nokey@iv{\expandonce{\jlreq@tempb}}{\expandonce{\jlreq@tempa}}}%
+ \@tempa
+ \fi
\jlreq@parsekeyval@nokey@i
}
\long\def\jlreq@parsekeyval@nokey@iv#1#2{%
@@ -280,29 +280,36 @@
% #1の先頭のスペースを削除し,#2に入れる.ただし#1={ X}の時は" X"が入る.
\def\jlreq@do#1{% #1 = " "として後で実行
- \long\def\jlreq@remove@spaceandbracket##1##2{%
- \begingroup
- \def\jlreq@tempa{}%
- \futurelet\jlreq@nextchar\jlreq@remove@spaceandbracket@i##1\jlreq@uniqtoken#1\jlreq@uniqtoken\jlreq@endmark
- \edef\jlreq@do{\noexpand\edef\noexpand##2{\noexpand\unexpanded{\expandonce{\jlreq@tempa}}}}%
- \expandafter\endgroup
- \jlreq@do
+ \long\def\jlreq@helper@trim##1##2{\edef##2{\jlreq@helper@trim@i{##1}}}
+ \long\def\jlreq@helper@trim@i##1{%
+ \jlreq@iffirsttoken{##1}{#1}%
+ % 先頭スペースの除去.{}を外さないために\jlreq@uniqtokenを前後にいったん挟む.
+ {\jlreq@helper@trim@ii##1\jlreq@uniqtoken\jlreq@endmark}%
+ % 後方スペースの除去.先頭に\jlreq@uniqtokenを加えて{}が外れるのを防ぐ.
+ {\jlreq@helper@trim@iii\jlreq@uniqtoken##1\jlreq@uniqtoken#1\jlreq@uniqtoken\jlreq@endmark}%
}
- \def\jlreq@remove@spaceandbracket@i{%
- \ifx#1\jlreq@nextchar\expandafter\jlreq@remove@spaceandbracket@ii\else\expandafter\jlreq@remove@spaceandbracket@iii\fi
- }%
- \def\jlreq@remove@spaceandbracket@ii#1{\futurelet\jlreq@nextchar\jlreq@remove@spaceandbracket@i}%
- \long\def\jlreq@remove@spaceandbracket@iii##1#1\jlreq@uniqtoken##2\jlreq@endmark{%
- \jlreq@ifempty{##2}{%
- \expandafter\jlreq@remove@spaceandbracket@iv\expandafter{\jlreq@removelastuniqtoken##1}%
- }{%
- \jlreq@remove@spaceandbracket@iv{##1}%
- }%
+ \long\def\jlreq@helper@trim@ii#1##1\jlreq@endmark{%
+ \expandafter\expandafter\expandafter\jlreq@helper@trim@i\jlreq@helper@trim@vi\jlreq@uniqtoken##1\jlreq@endmark
+ }
+ \long\def\jlreq@helper@trim@iii##1#1\jlreq@uniqtoken##2\jlreq@endmark{%
+ \jlreq@ifempty{##2}%
+ {\expandafter\jlreq@helper@trim@iv\jlreq@helper@trim@v##1\jlreq@endmark}%
+ {\jlreq@helper@trim@iii##1\jlreq@uniqtoken#1\jlreq@uniqtoken\jlreq@endmark}%
}%
+ \long\def\jlreq@helper@trim@iv##1{\expandafter\unexpanded\expandafter{\@gobble ##1}}
+ \long\def\jlreq@helper@trim@v##1\jlreq@uniqtoken\jlreq@endmark{{##1}}
+ \long\def\jlreq@helper@trim@vi##1\jlreq@uniqtoken\jlreq@endmark{\expandafter{\@gobble ##1}}
}
\jlreq@do{ }
-\long\def\jlreq@removelastuniqtoken#1\jlreq@uniqtoken{#1}
-\long\def\jlreq@remove@spaceandbracket@iv#1{\edef\jlreq@tempa{\unexpanded{#1}}}
+
+\long\def\jlreq@remove@spaceandbracket#1#2{%
+ \begingroup
+ \jlreq@helper@trim{#1}{\jlreq@tempa}%
+ \edef\jlreq@do{\unexpanded{\jlreq@remove@spaceandbracket@{#2}}\expandonce{\jlreq@tempa}\noexpand\jlreq@endmark}%
+ \expandafter\endgroup
+ \jlreq@do
+}
+\long\def\jlreq@remove@spaceandbracket@#1#2\jlreq@endmark{\edef#1{\unexpanded{#2}}}
% \jlreq@switch{str}{
% {str}{abcd}
@@ -507,11 +514,17 @@
\def\jlreq@for@noexpand#1:={\@for#1:=\@empty}
-\def\jlreq@swap#1#2{%
- \let\jlreq@swaptoken=#1%
+\def\jlreq@helper@swap#1#2{%
+ \let\jlreq@helper@swaptoken=#1%
\let#1=#2%
- \let#2=\jlreq@swaptoken
- \let\jlreq@swaptoken=\@undefined
+ \let#2=\jlreq@helper@swaptoken
+ \let\jlreq@helper@swaptoken=\@undefined
+}
+\def\jlreq@helper@swap@register#1#2{%
+ \edef\jlreq@helper@swaptoken{\the#1}%
+ #1=#2%
+ #2=\jlreq@helper@swaptoken\relax
+ \let\jlreq@helper@swaptoken=\@undefined
}
\endinput
diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty b/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty
index d6242c6c56d..e5d13f08ff7 100644
--- a/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty
+++ b/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{jlreq-trimmarks}[2018/08/08 jlreq-trimmarks]
+\ProvidesPackage{jlreq-trimmarks}[2018/09/01 jlreq-trimmarks]
\RequirePackage{xkeyval,etoolbox}
\RequirePackage{jlreq-helpers}
@@ -123,12 +123,17 @@
\newif\ifjlreq@trimmarks@show \jlreq@trimmarks@showtrue
\newif\ifjlreq@trimmarks@show@artbox \jlreq@trimmarks@show@artboxfalse
\tombowdatetrue
+% flag: `show` is specified or not
+\newif\ifjlreq@trimmarks@option@show \jlreq@trimmarks@option@showfalse
+
\DeclareOptionX{show}{%
+ \jlreq@trimmarks@showtrue
\jlreq@ifempty{#1}{
\jlreq@trimmarks@showtrue\tombowdatetrue\jlreq@trimmarks@digitaltrue
}{
\jlreq@trimmarks@showfalse\tombowdatefalse\jlreq@trimmarks@digitalfalse
\@for\jlreq@trimmarks@tempa:=#1\do{%
+ \expandafter\jlreq@helper@trim\expandafter{\jlreq@trimmarks@tempa}{\jlreq@trimmarks@tempa}
\jlreq@switch{\jlreq@trimmarks@tempa}{
{trimmarks}{\jlreq@trimmarks@showtrue}
{banner}{\tombowdatetrue}
@@ -139,6 +144,10 @@
}
}
}
+\def\jlreq@trimmarks@bleed{3mm}
+\DeclareOptionX{bleed_margin}{\def\jlreq@trimmarks@bleed{#1}}
+
+
\newif\ifjlreq@trimmarks@landscape \jlreq@trimmarks@landscapefalse
\jlreq@trimmarks@DeclareOption{landscape}{\jlreq@trimmarks@landscapetrue}
\jlreq@trimmarks@afterpkg@addtodeleteif{\ifjlreq@trimmarks@landscape}
@@ -149,27 +158,37 @@
\let\@removeelement=\jlreq@temporary@original@@removeelement
\let\jlreq@temporary@original@@removeelement=\@undefined
-\def\jlreq@trimmarks@setpapersize#1{%
+\ifjlreq@trimmarks@option@show\else
+ \ifx o\jlreq@trimmarks@driver
+ \jlreq@trimmarks@digitalfalse
+ \jlreq@trimmarks@showtrue
+ \jlreq@trimmarks@show@artboxfalse
+ \fi
+\fi
+
+\def\jlreq@trimmarks@setpapersize#1{
\jlreq@ifcontains{#1}{+}{
- \def\@tempa##1+##2\jlreq@endmark{%
- \jlreq@ifempty{##1}{
+ \def\@tempa##1+##2\jlreq@endmark{
+ \jlreq@helper@trim{##1}{\jlreq@trimmarks@tempa}
+ \jlreq@helper@trim{##2}{\jlreq@trimmarks@tempb}
+ \ifx\jlreq@trimmarks@tempa\@empty
\let\jlreq@tempa=\paperwidth
\let\jlreq@tempb=\paperheight
- }{
- \jlreq@trimmarks@analyzepapersize{##1}
+ \else
+ \expandafter\jlreq@trimmarks@analyzepapersize\expandafter{\jlreq@trimmarks@tempa}
\let\jlreq@tempa=\jlreq@resulta
\let\jlreq@tempb=\jlreq@resultb
- \ifjlreq@trimmarks@landscape\jlreq@swap{\jlreq@tempa}{\jlreq@tempb}\fi
- }
- \jlreq@trimmarks@analyzepapersize{##2}
- \ifjlreq@trimmarks@landscape\jlreq@swap{\jlreq@resulta}{\jlreq@resultb}\fi
+ \ifjlreq@trimmarks@landscape\jlreq@helper@swap{\jlreq@tempa}{\jlreq@tempb}\fi
+ \fi
+ \expandafter\jlreq@trimmarks@analyzepapersize\expandafter{\jlreq@trimmarks@tempb}
+ \ifjlreq@trimmarks@landscape\jlreq@helper@swap{\jlreq@resulta}{\jlreq@resultb}\fi
\edef\jlreq@trimmarks@paperwidth{\the\dimexpr\jlreq@tempa + \jlreq@resulta\relax}
\edef\jlreq@trimmarks@paperheight{\the\dimexpr\jlreq@tempb + \jlreq@resultb\relax}
}
\@tempa#1\jlreq@endmark
}{
\jlreq@trimmarks@analyzepapersize{#1}
- \ifjlreq@trimmarks@landscape\jlreq@swap{\jlreq@resulta}{\jlreq@resultb}\fi
+ \ifjlreq@trimmarks@landscape\jlreq@helper@swap{\jlreq@resulta}{\jlreq@resultb}\fi
\edef\jlreq@trimmarks@paperwidth{\jlreq@resulta}
\edef\jlreq@trimmarks@paperheight{\jlreq@resultb}
}
@@ -186,7 +205,6 @@
\newcommand{\jlreqtrimmarkssetup}[1]{%
\jlreq@parsekeyval{%
{banner}{\@bannertoken{##1}\maketombowbox}
- {bleed_margin}{\def\jlreq@trimmarks@bleed{##1}\maketombowbox}
{trimmarks_width}{\setlength{\@tombowwidth}{##1}\maketombowbox}
{color}{
\jlreq@ifempty{##1}{
@@ -231,7 +249,6 @@
\jobname\space(\number\year-\two@digits\month-\two@digits\day
\space\two@digits\hour:\two@digits\minute)%
},
- bleed_margin=3mm,
color={}
}
@@ -257,18 +274,41 @@
\setlength{\pdfpageheight}{\dimexpr\jlreq@trimmarks@paperheight\relax}
\fi
-\hoffset=\dimexpr(\jlreq@trimmarks@paperwidth - \paperwidth)/2 - 1in\relax
-\voffset=\dimexpr(\jlreq@trimmarks@paperheight - \paperheight)/2 - 1in\relax
+\hoffset=\dimexpr(\jlreq@trimmarks@paperwidth - \paperwidth)/2 - \ifx l\jlreq@engine 1in\else 1truein\fi\relax
+\voffset=\dimexpr(\jlreq@trimmarks@paperheight - \paperheight)/2 - \ifx l\jlreq@engine 1in\else 1truein\fi\relax
+\ifx l\jlreq@engine\else
+ \@ifundefined{@tombowreset@@paper}{
+ \AtBeginDocument{%
+ \addtolength{\oddsidemargin}{\dimexpr 1truein - 1in\relax}%
+ \addtolength{\evensidemargin}{\dimexpr 1truein - 1in\relax}%
+ \addtolength{\topmargin}{\dimexpr 1truein - 1in\relax}%
+ }
+ }{
+ \def\@tombowreset@@paper{%
+ \@@topmargin\topmargin
+ \iftombow
+ \@@paperwidth\paperwidth
+ \advance\@@paperwidth 2\dimexpr\@tombowbleed\relax
+ \@@paperheight\paperheight \advance\@@paperheight 10mm\relax
+ \advance\@@paperheight 2\dimexpr\@tombowbleed\relax
+ % 1in -> 1truein
+ \advance\@@topmargin 1truein\relax \advance\@themargin 1truein\relax
+ \fi
+ }
+ }
+\fi
\ifx l\jlreq@trimmarks@driver\else
- \edef\@tempa{\noexpand\AtBeginDvi{\noexpand\special{papersize=\the\dimexpr\jlreq@trimmarks@paperwidth\relax,\the\dimexpr\jlreq@trimmarks@paperheight\relax}}}
+ \jlreq@helper@divide{\the\mag pt}{1000pt}
+ \edef\@tempa{\noexpand\AtBeginDvi{\noexpand\special{papersize=\the\dimexpr\strip@pt\jlreq@resultdimen\dimexpr\jlreq@trimmarks@paperwidth\relax\relax, \the\dimexpr\strip@pt\jlreq@resultdimen\dimexpr\jlreq@trimmarks@paperheight\relax\relax}}}
\@tempa
\fi
-\@ifundefined{stockwidth}{\newdimen\stockwidth}{}
-\@ifundefined{stockheight}{\newdimen\stockheight}{}
+\@ifundefined{stockheight}{\newlength{\stockheight}}{}
+\@ifundefined{stockwidth}{\newlength{\stockwidth}}{}
\setlength{\stockwidth}{\dimexpr\jlreq@trimmarks@paperwidth\relax}
\setlength{\stockheight}{\dimexpr\jlreq@trimmarks@paperheight\relax}
+
\def\maketombowbox{%
\setbox\@TL\hbox to\z@{\yoko\hss
\vrule width\dimexpr 10mm + \jlreq@trimmarks@bleed\relax height\@tombowwidth depth\z@
@@ -313,7 +353,7 @@
\vrule height.5\@tombowwidth depth.5\@tombowwidth width10mm\hss}%
}
\def\@outputtombow{%
- % 6mm: from plcore
+ % 6mm = \@tombowbleed: from plcore
\@@paperwidth=\dimexpr\@@paperwidth - 6mm + 2\dimexpr\jlreq@trimmarks@bleed\relax\relax
\@@paperheight=\dimexpr\@@paperheight - 6mm + 2\dimexpr\jlreq@trimmarks@bleed\relax\relax
\ifjlreq@trimmarks@show
@@ -338,7 +378,13 @@
}
\ifjlreq@trimmarks@digital
- \def\jlreq@trimmarks@pttobp#1{\strip@pt\dimexpr0.9963\dimexpr#1\relax\relax}
+ \ifx l\jlreq@engine
+ \setlength\jlreq@resultdimen{1pt}
+ \else
+ \jlreq@helper@divide{\the\mag pt}{1000pt}
+ \fi
+ % 0.9963 = 1pt/1bp (almost)
+ \edef\jlreq@trimmarks@pttobp#1{\noexpand\strip@pt\noexpand\dimexpr\strip@pt\jlreq@resultdimen\noexpand\dimexpr0.9963\noexpand\dimexpr#1\unexpanded{\relax\relax\relax}}
\edef\jlreq@trimmarks@trimboxsize{%
[%
\jlreq@trimmarks@pttobp{(\jlreq@trimmarks@paperwidth - \paperwidth)/2}
@@ -374,7 +420,7 @@
\fi
\ifx s\jlreq@trimmarks@driver
\edef\@tempa{\noexpand\special{ps:SDict begin
- [ /TrimBox \jlreq@trimmarks@trimboxsize /PAGE pdfmark
+ [ /TrimBox \jlreq@trimmarks@trimboxsize /PAGE pdfmark
\ifjlreq@trimmarks@show@artbox [ /ArtBox \jlreq@trimmarks@trimboxsize /PAGE pdfmark \fi
[ /BleedBox \jlreq@trimmarks@bleedboxsize /PAGE pdfmark
end}}%
diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq.cls b/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
index d513a760f98..d3712ede72a 100644
--- a/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
+++ b/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
@@ -5,7 +5,7 @@
%%
% (based on JLReq 20120403 https://www.w3.org/TR/2012/NOTE-jlreq-20120403/ja/)
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jlreq}[2018/08/15 jlreq]
+\ProvidesClass{jlreq}[2018/09/01 jlreq]
\RequirePackage{xkeyval,everyhook,filehook,etoolbox,ifthen}
\RequirePackage{jlreq-helpers}
@@ -406,18 +406,28 @@
% 現在行の残りを得る.
\ifx l\jlreq@engine
- % 以下のコードはおかしい.
+ % 以下のコードはLuaTeX-jaのバグ?に依存している
+ % https://ja.osdn.net/projects/luatex-ja/ticket/36489
\newcommand*{\jlreq@calc@current@linewidth@onecolumn}{%
- \dimexpr\zposx{jlreq@rest@width.pos.\the\jlreq@zref@reference@count} sp - \@totalleftmargin -
- \ifodd\jlreq@currentpage
- \oddsidemargin
- \else
- \evensidemargin
- \fi
- \iftombow - 1in\fi
- - 1in - \hoffset\relax
+ \dimexpr
+ \zposx{jlreq@rest@width.pos.\the\jlreq@zref@reference@count} sp - \@totalleftmargin -
+ \ifodd\jlreq@currentpage
+ \oddsidemargin
+ \else
+ \evensidemargin
+ \fi
+ \iftombow -1in \fi
+ - \pdfvariable horigin - \hoffset
+ \relax
}
\else
+ % トンボ出力時にはjlreq-trimmarksであることを仮定する.
+ % 新しいpLaTeXに対しては,jlreq-trimmarksは内部の1inを1trueinに書き換える
+ \@ifundefined{@tombowreset@@paper}{
+ \def\jlreq@tombow@adjust{\iftombow -1in \fi}
+ }{
+ \def\jlreq@tombow@adjust{\iftombow -1truein \fi}
+ }
\newcommand*{\jlreq@calc@current@linewidth@onecolumn}{%
\dimexpr
\jlreq@ifydir{%
@@ -436,7 +446,7 @@
- \topmargin - \headheight - \headsep - \voffset
- \zposy{jlreq@rest@width.pos.\the\jlreq@zref@reference@count} sp
}%
- \iftombow - 1in\fi
+ \jlreq@tombow@adjust
- \@totalleftmargin - 1in
\relax
}
@@ -1158,25 +1168,18 @@
%. ページレイアウト
% landscapeの場合縦横をひっくり返す
\if@landscape
- \jlreq@swap{\paperwidth}{\paperheight}
+ \jlreq@helper@swap@register{\paperwidth}{\paperheight}
\fi
% \pdfpagewidthとか設定
\ifx l\jlreq@engine
- \let\jlreq@pagewidth=\pagewidth
- \let\jlreq@pageheight=\pageheight
+ \setlength{\pagewidth}{\paperwidth}
+ \setlength{\pageheight}{\paperheight}
\else
- \let\jlreq@pagewidth=\pdfpagewidth
- \let\jlreq@pageheight=\pdfpageheight
-\fi
-\setlength{\jlreq@pagewidth}{\paperwidth}
-\setlength{\jlreq@pageheight}{\paperheight}
-\iftombow
- \addtolength{\jlreq@pagewidth}{2in}
- \addtolength{\jlreq@pageheight}{2in}
+ \setlength{\pdfpagewidth}{\paperwidth}
+ \setlength{\pdfpageheight}{\paperheight}
\fi
-
\ifx l\jlreq@engine
\def\jlreq@expand@speciallength#1{%
% zhやzwを\zhや\zwにする.
@@ -1203,6 +1206,11 @@
\jlreq@tempdimb=1\zw
\divide\jlreq@tempdima\jlreq@tempdimb
\multiply\jlreq@tempdima\jlreq@tempdimb
+ \ifdim\jlreq@tempdima>0pt
+ \ifnum 0\ifdim\jlreq@tempdima>25\zw 1\fi\ifdim\jlreq@tempdima<15\zw 1\fi>0
+ \jlreq@note{並列注の字詰め方向の長さ(行長)は,15字から20字くらいである.ケースによっては25字程度にする場合もある (4.2.7).}
+ \fi
+ \fi
\edef\jlreq@do{
\noexpand\setlength{\noexpand\marginparwidth}{\the\jlreq@tempdima}
\noexpand\setlength{\noexpand\marginparpush}{\the\dimexpr 0.5\zw\relax} % 同上:4.2.7.g
@@ -1215,11 +1223,6 @@
\setlength{\marginparsep}{0pt}
\fi
-\ifdim\marginparwidth>0pt
- \ifnum 0\ifdim\marginparwidth>25\zw 1\fi\ifdim\marginparwidth<15\zw 1\fi>0
- \jlreq@note{並列注の字詰め方向の長さ(行長)は,15字から20字くらいである.ケースによっては25字程度にする場合もある (4.2.7).}
- \fi
-\fi
% 縦書きの時は脚注に固定
% (TODO: 頭注)
\if@tate\@mparswitchfalse\fi
@@ -1345,13 +1348,13 @@
}
\def\jlreq@setsidemargin@by@fore@edge#1{
\jlreq@setsidemargin@by@gutter{#1}
- \@tempdima=\evensidemargin
- \evensidemargin=\oddsidemargin
- \oddsidemargin=\@tempdima
+ \jlreq@helper@swap@register{\oddsidemargin}{\evensidemargin}
\ifjlreq@determine@kihonhanmen@warning@first
\jlreq@note{基本版面の配置はのどの空き量を指定する (2.4.1.b).}
\fi
}
+\jlreq@aftercls@addtodeletecs{\jlreq@setsidemargin@by@gutter}
+\jlreq@aftercls@addtodeletecs{\jlreq@setsidemargin@by@fore@edge}
\ifx\jlreq@option@gutter\@empty
\ifx\jlreq@option@fore@edge\@empty
@@ -1377,36 +1380,41 @@
\else
\jlreq@setsidemargin@by@gutter{\jlreq@speciallength{\jlreq@option@gutter}}
\ifx\jlreq@option@fore@edge\@empty\else
- \ifjlreq@determine@kihonhanmen@warning@first\else
+ \ifjlreq@determine@kihonhanmen@warning@first
\ClassWarningNoLine{jlreq}{fore_edge is ignored}
\fi
\fi
\fi
-\addtolength{\oddsidemargin}{-1in}
-\addtolength{\evensidemargin}{-1in}
+\ifx l\jlreq@engine
+ \addtolength{\oddsidemargin}{-1in}
+ \addtolength{\evensidemargin}{-1in}
+\else
+ \addtolength{\oddsidemargin}{-1truein}
+ \addtolength{\evensidemargin}{-1truein}
+\fi
%.. 縦
% \topmarginに全体の頭からテキストの頭までの長さを入れる
% 天の値からtopmarginを設定する
\def\jlreq@settopmarginbyhead#1{
\if@tate
- \setlength{\topmargin}{\dimexpr #1 - \headsep - \headheight - 1in\relax}
+ \setlength{\topmargin}{\dimexpr #1 - \headsep - \headheight\relax}
\if@twocolumn
\addtolength{\topmargin}{\dimexpr\marginparwidth + \marginparsep\relax}
\fi
\jlreq@note{縦組の場合は地の空き量を指定する (2.4.1.b).}
\else
- \setlength{\topmargin}{\dimexpr #1 - \headsep - \headheight - 1in - \topskip + \Cht\relax}
+ \setlength{\topmargin}{\dimexpr #1 - \headsep - \headheight - \topskip + \Cht\relax}
\fi
}
\jlreq@aftercls@addtodeletecs{\jlreq@settopmarginbyhead}
% 地の値から
\def\jlreq@settopmarginbyfoot#1{
\if@tate
- \setlength{\topmargin}{\dimexpr\paperheight - \textwidth - \headsep - \headheight - 1in - #1 - \marginparsep - \marginparwidth\relax}
+ \setlength{\topmargin}{\dimexpr\paperheight - \textwidth - \headsep - \headheight - #1 - \marginparsep - \marginparwidth\relax}
\else
\jlreq@note{横組の場合は天の空き量を指定する (2.4.1.b).}
- \setlength{\topmargin}{\dimexpr\paperheight - \textheight + \topskip - 1\zh - \headsep - \headheight - 1in - #1\relax}
+ \setlength{\topmargin}{\dimexpr\paperheight - \textheight + \topskip - 1\zh - \headsep - \headheight - #1\relax}
\fi
}
\jlreq@aftercls@addtodeletecs{\jlreq@settopmarginbyfoot}
@@ -1442,7 +1450,11 @@
\fi
\fi
\fi
-
+\ifx l\jlreq@engine
+ \addtolength{\topmargin}{-1in}
+\else
+ \addtolength{\topmargin}{-1truein}
+\fi
%.. 下
\setlength{\footskip}{\dimexpr\headsep + \if@tate\marginparwidth + \marginparsep\else\topskip - \Cht\fi + \headheight\relax}
% \maxdepth + \topskip = フォントサイズ×1.5(だってさ)
@@ -1612,6 +1624,7 @@
% ラベルフォーマットでは#1=カウンタ名,見出し文字列フォーマットでは#1=見出し文字列,副題フォーマットでは#1=副題
% ラベルのみのフォーマットは目次に使われる.
\newcommand{\jlreq@BlockHeading@start}[5]{%
+ \if@noskipsec\leavevmode\fi
\edef\jlreq@BlockHeading@start@format{\unexpanded{#4}}% この二つは\parを含むかもしれないので引数渡しはしない(後の\@ifstarで詰まる)
\edef\jlreq@BlockHeading@start@totalformat{\unexpanded{#5}}%
\jlreq@BlockHeading@start@{#1}{#2}{#3}%
@@ -2224,7 +2237,7 @@
}
\def\jlreq@SetBlockHeadingSpaces@iii#1{%
\@for\@tempa:=#1\do{%
- \expandafter\jlreq@remove@spaceandbracket\expandafter{\@tempa}{\@tempa}%
+ \expandafter\jlreq@helper@trim\expandafter{\@tempa}{\@tempa}%
\expandafter\jlreq@iffirsttoken@ignorespaces\expandafter{\@tempa}{_}{%
\ifx\jlreq@lastdimen\@empty\else\eappto\jlreq@set{{\expandonce{\jlreq@lastdimen}}}\fi%
\def\jlreq@lastdimen{}%
@@ -2513,12 +2526,13 @@
%.. 窓見出し
\def\jlreq@CutinHeading@start#1#2#3#4#5#6#7{%
+ \if@noskipsec\leavevmode\fi
\par
- \ifnum\hangafter=1
+ \ifnum\hangafter=1 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{%
\jlreq@CutinHeading@start@{#2}{#3}{#4}{#5}{#6}{#7}%
- \else
+ }{%
\ClassError{jlreq}{Can not use \expandafter\string\csname#1\endcsname\space here}{\@ehc}%
- \fi
+ }%
}
% 1 = 書式指定,2 = インデント, 3 = 見出しと本文の間, 4 = これを越えたら二行以上,5 = これを越えたら三行以上,6 = テキスト
\def\jlreq@CutinHeading@start@#1#2#3#4#5#6{%
@@ -2825,12 +2839,12 @@
\ifx l\jlreq@engine
\def\jlreq@hook@prenote{%
\jlreq@lastnodechar=\lastnodechar\relax
- \ifnum\lastnodechar>-1\inhibitglue\fi
+ \ifnum\jlreq@lastnodechar>-1 \inhibitglue\fi
}
\else
% (u)platexの時は代入すると\inhibitglueが効かなくなる
\def\jlreq@hook@prenote{%
- \ifnum\lastnodechar>-1\inhibitglue\fi
+ \ifnum\lastnodechar>-1 \inhibitglue\fi
\jlreq@lastnodechar=\lastnodechar\relax
}
\fi
@@ -3160,7 +3174,7 @@
% \jlreq@tempcにセクション名たちを入れていく
\def\jlreq@tempc{}
\@for\jlreq@tempa:=#1\do{
- \expandafter\jlreq@remove@spaceandbracket\expandafter{\jlreq@tempa}{\jlreq@tempa}%
+ \expandafter\jlreq@helper@trim\expandafter{\jlreq@tempa}{\jlreq@tempa}%
\jlreq@switch{\jlreq@tempa}{
{headings}{\jlreq@tempatrue}
{paragraph}{
@@ -4694,7 +4708,7 @@
\def\jlreq@do{}%
\def\jlreq@keyvallist{}%
\@for\@tempa:=#1\do{%
- \expandafter\jlreq@remove@spaceandbracket\expandafter{\@tempa}{\@tempa}%
+ \expandafter\jlreq@helper@trim\expandafter{\@tempa}{\@tempa}%
\expandafter\jlreq@ifcontains\expandafter{\@tempa}{=}{%
\expandafter\appto\expandafter\jlreq@keyvallist\expandafter{\@tempa,}%
}{%
@@ -5108,13 +5122,24 @@
%. その他諸々
%.. 縦中横
-\DeclareRobustCommand*{\tatechuyoko}[1]{%
- \jlreq@ifydir{\ClassError{jlreq}{\string\tatechuyoko\space is not allowed in yoko mode}{\@ehc}}{}%
- \jlreq@lastnodechar=\lastnodechar
- \ifvmode\leavevmode\fi
+\edef\@tempa{%
+ \unexpanded{%
+ \jlreq@ifydir{\ClassError{jlreq}{\string\tatechuyoko\space is not allowed in yoko mode}{\@ehc}}{}%
+ \ifvmode\leavevmode\fi
+ }%
+ \ifx l\jlreq@engine\unexpanded{%
+ \jlreq@lastnodechar=\lastnodechar\relax
+ \ifnum\jlreq@lastnodechar>-1 \inhibitglue\fi
+ }\else\unexpanded{%
+ \ifnum\lastnodechar>-1 \inhibitglue\fi
+ \jlreq@lastnodechar=\lastnodechar\relax
+ }\fi
+}
+
+\expandafter\protected\expandafter\def\expandafter\tatechuyoko\expandafter#\expandafter1\expandafter{%
+ \@tempa
% 前のJFM glue
- \ifnum\jlreq@lastnodechar=-1\else
- \inhibitglue
+ \ifnum\jlreq@lastnodechar>-1
\jlreq@calc@jfmglue{\char\jlreq@lastnodechar}{阿}%
\jlreq@ifgluezero\jlreq@resultskip{}{\hskip\jlreq@resultskip}%
\fi