X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Fltjspf.cls;h=ce12a2f76f88c9a10e9f99d83e14cb2c424ed3e9;hb=0b91eabbaa3ec3f81de6bf9d7a1a2ee4ef363118;hp=319fbad202fb40b752e0de0dd4826c456a070014;hpb=094cc0e836b9e264fc79744b28efb644d0fc6f73;p=luatex-ja%2Fluatexja.git diff --git a/src/ltjspf.cls b/src/ltjspf.cls index 319fbad..ce12a2f 100644 --- a/src/ltjspf.cls +++ b/src/ltjspf.cls @@ -38,7 +38,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjspf} - [2016/08/03 ltjsclasses ] + [2018/03/22 ltjsclasses ] \def\jsc@clsname{ltjspf} \RequirePackage{luatexja} \newif\if@restonecol @@ -98,7 +98,6 @@ \newif\if@slide \@slidefalse \def\jsc@magscale{1} -\DeclareOption{slide}{\@slidetrue\def\jsc@magscale{3.583}\@landscapetrue\@titlepagetrue} \DeclareOption{8pt} {\def\jsc@magscale{0.833}}% 1.2^(-1) \DeclareOption{9pt} {\def\jsc@magscale{0.913}}% 1.2^(-0.5} \DeclareOption{10pt}{\def\jsc@magscale{1}} @@ -118,26 +117,15 @@ \DeclareOption{10.5ptj}{\def\jsc@magscale{1.139}} \DeclareOption{11ptj}{\def\jsc@magscale{1.194}} \DeclareOption{12ptj}{\def\jsc@magscale{1.302}} -\newif\if@ltjs@mag@xreal -\@ltjs@mag@xrealtrue -\DeclareOption{nomag*}{\@ltjs@mag@xrealtrue} -\DeclareOption{nomag}{\@ltjs@mag@xrealfalse} -\DeclareOption{noxreal}{% - \ClassWarningNoLine{\jsc@clsname}{% - The class option `noxreal' is obsolete. \MessageBreak - Please use the `nomag' option instead}% - \@ltjs@mag@xrealfalse} -\DeclareOption{real}{% - \ClassWarningNoLine{\jsc@clsname}{% - The class option `real' is obsolete. \MessageBreak - Please use the `nomag' option instead}% - \@ltjs@mag@xrealfalse} +\newif\ifjsc@mag@xreal +\jsc@mag@xrealtrue +\DeclareOption{nomag*}{\jsc@mag@xrealtrue} +\DeclareOption{nomag}{\jsc@mag@xrealfalse} \DeclareOption{usemag}{% \ClassWarningNoLine{\jsc@clsname}{% This \jsc@clsname\space cls does not support `usemag'\MessageBreak option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% - \@ltjs@mag@xrealtrue} - + \jsc@mag@xrealtrue} \hour\time \divide\hour by 60\relax \@tempcnta\hour \multiply\@tempcnta 60\relax \minute\time \advance\minute-\@tempcnta @@ -217,7 +205,9 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \DeclareOption{winjis}{% \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `winjis' option}} \DeclareOption{uplatex}{% - \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `uplatex' option}} + \ClassErrorNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `uplatex' option}} +\DeclareOption{autodetect-engine}{% + \ClassWarningNoLine{\jsc@clsname}{The \jsc@clsname\space class does not support `autodetect-engine' option}} \DeclareOption{mingoth}{\mingothtrue} \DeclareOption{ptexjis}{\ptexjistrue} \DeclareOption{jis}{\jisfonttrue} @@ -249,9 +239,10 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \ifdim\jsc@mpt=1.0954\p@ \renewcommand{\@ptsize}{1}\else \ifdim\jsc@mpt=1.2\p@ \renewcommand{\@ptsize}{2}\else \renewcommand{\@ptsize}{-20}\fi\fi -\if@ltjs@mag@xreal\RequirePackage{type1cm} +\ifjsc@mag@xreal \ifdim\jsc@mpt=\p@\else \expandafter\let\csname OT1/cmr/m/n/10\endcsname\relax + \expandafter\let\csname TU/lmr/m/n/10\endcsname\relax \expandafter\let\csname OMX/cmex/m/n/10\endcsname\relax \newluafunction\ltjs@@magnify@font@calc \begingroup\catcode`\%=12\relax @@ -259,11 +250,11 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% local getdimen, mpt=tex.getdimen, tex.getdimen('jsc@mpt')/65536 local t = lua.get_functions_table() t[\the\ltjs@@magnify@font@calc] = function() - tex.sprint(math.floor(0.5+mpt*getdimen('dimen@'))) + tex.sprint(-2,math.floor(0.5+mpt*getdimen('dimen@'))) end function luatexja.ltjs_unmagnify_fsize(a) local s = luatexja.print_scaled(math.floor(0.5+a/mpt*65536)) - tex.sprint( (s:match('%.0$')) and s:sub(1,-3) or s ) + tex.sprint(-2, (s:match('%.0$')) and s:sub(1,-3) or s ) end } \endgroup @@ -271,7 +262,7 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \def\@tempa{#1}\def\@tempb{#2}% \ifx\@tempb\@empty \edef\@tempb{ scaled\directlua{% - tex.sprint(math.floor(0.5+\jsc@magscale*1000)) + tex.sprint(-2,math.floor(0.5+\jsc@magscale*1000)) }}% \else \dimen@\@tempb\relax @@ -289,36 +280,48 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \expandafter\endgroup\@tempa } \fi\fi -\newlength{\stockwidth} -\newlength{\stockheight} -\setlength{\stockwidth}{\paperwidth} -\setlength{\stockheight}{\paperheight} +\def\jsc@smallskip{\vspace\jsc@smallskipamount} +\newskip\jsc@smallskipamount +\jsc@smallskipamount=3\jsc@mpt plus 1\jsc@mpt minus 1\jsc@mpt \iftombow + \newlength{\stockwidth} + \newlength{\stockheight} + \setlength{\stockwidth}{\paperwidth} + \setlength{\stockheight}{\paperheight} \advance \stockwidth 2in \advance \stockheight 2in -\fi -\ifdefined\pdfpagewidth - \setlength{\pdfpagewidth}{\stockwidth} - \setlength{\pdfpageheight}{\stockheight} + \ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\stockwidth} + \setlength{\pdfpageheight}{\stockheight} + \else + \setlength{\pagewidth}{\stockwidth} + \setlength{\pageheight}{\stockheight} + \fi \else - \setlength{\pagewidth}{\stockwidth} - \setlength{\pageheight}{\stockheight} + \ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\paperwidth} + \setlength{\pdfpageheight}{\paperheight} + \else + \setlength{\pagewidth}{\paperwidth} + \setlength{\pageheight}{\paperheight} + \fi \fi + \def\Cjascale{0.903375} \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax \ifmingoth - \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.903375] \ltj@stdmcfont:jfm=min}{} - \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.903375] \ltj@stdgtfont:jfm=min}{} + \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [\Cjascale] \ltj@stdmcfont:jfm=min}{} + \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [\Cjascale] \ltj@stdgtfont:jfm=min}{} \else \ifptexjis - \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.903375] \ltj@stdmcfont:jfm=jis}{} - \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.903375] \ltj@stdgtfont:jfm=jis}{} + \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [\Cjascale] \ltj@stdmcfont:jfm=jis}{} + \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [\Cjascale] \ltj@stdgtfont:jfm=jis}{} \else - \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.903375] \ltj@stdmcfont:jfm=ujis}{} - \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.903375] \ltj@stdgtfont:jfm=ujis}{} + \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [\Cjascale] \ltj@stdmcfont:jfm=ujis}{} + \DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [\Cjascale] \ltj@stdgtfont:jfm=ujis}{} \fi \fi -\DeclareFontShape{JT3}{mc}{m}{n}{<-> s * [0.903375] \ltj@stdmcfont:jfm=ujisv}{} -\DeclareFontShape{JT3}{gt}{m}{n}{<-> s * [0.903375] \ltj@stdgtfont:jfm=ujisv}{} +\DeclareFontShape{JT3}{mc}{m}{n}{<-> s * [\Cjascale] \ltj@stdmcfont:jfm=ujisv}{} +\DeclareFontShape{JT3}{gt}{m}{n}{<-> s * [\Cjascale] \ltj@stdgtfont:jfm=ujisv}{} \DeclareFontShape{JY3}{mc}{bx}{n}{<->ssub*gt/m/n}{} \DeclareFontShape{JY3}{gt}{bx}{n}{<->ssub*gt/m/n}{} \DeclareFontShape{JY3}{mc}{m}{it}{<->ssub*mc/m/n}{} @@ -401,12 +404,13 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \belowdisplayshortskip \belowdisplayskip \let\@listi\@listI} \mcfamily\selectfont\normalsize -\setbox0\hbox{\char"3000}% 全角スペース +\setbox0\hbox{漢} \setlength\Cht{\ht0} \setlength\Cdp{\dp0} \setlength\Cwd{\wd0} \setlength\Cvs{\baselineskip} \setlength\Chs{\wd0} +\setbox0=\box\voidb@x \newcommand{\small}{% \ltj@@ifnarrowbaselines {\jsc@setfontsize\small\@ixpt{11}}% @@ -461,11 +465,11 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \@lowpenalty 51 \@medpenalty 151 \@highpenalty 301 -\setlength\topskip{10\jsc@mpt} +\setlength\topskip{1.38\zh}%% from 10\jsc@mpt (2016-08-17) \if@slide \setlength\headheight{0\jsc@mpt} \else - \setlength\headheight{2\topskip} + \setlength\headheight{20\jsc@mpt}%% from 2\topskip (2016-08-17); from \topskip (2003-06-26) \fi \setlength\footskip{9\jsc@mmm} \setlength\headsep{9\jsc@mmm} @@ -480,8 +484,8 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \addtolength{\textheight}{0.1\jsc@mpt} \setlength{\mathindent}{10\jsc@mmm} \def\flushbottom{% - \def\@textbottom{\vskip \z@ \@plus.1\jsc@mpt}% - \let\@texttop\relax} + \def\@textbottom{\vskip \z@ \@plus.1\jsc@mpt}% + \let\@texttop\relax} \setlength\marginparsep{\columnsep} \setlength\marginparpush{\baselineskip} \setlength{\oddsidemargin}{\paperwidth} @@ -507,7 +511,7 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \if@slide \addtolength\topmargin{-\headheight} \else - \addtolength\topmargin{-\topskip} + \addtolength\topmargin{-10\jsc@mpt}%% from -\topskip (2016-10-08); from -\headheight (2003-06-26) \fi \addtolength\topmargin{-\headsep} \addtolength\topmargin{-\footskip} @@ -714,7 +718,7 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \begingroup \@svsechd \endgroup \unskip \@tempskipa #1\relax - \hskip -\@tempskipa\@inhibitglue + \hskip -\@tempskipa\ltjfakeparbegin \else \clubpenalty \@clubpenalty \everypar{}% @@ -727,7 +731,7 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \if@slide {\vskip\if@twocolumn-5\jsc@mpt\else-6\jsc@mpt\fi \maybeblue\hrule height0\jsc@mpt depth1\jsc@mpt - \vskip\if@twocolumn 4\jsc@mpt\else 7\jsc@mpt\fi\relax} + \vskip\if@twocolumn 4\jsc@mpt\else 7\jsc@mpt\fi\relax}% \fi \par % 2000-12-18 \ignorespaces} @@ -961,7 +965,7 @@ option, since LuaTeX does not support \string\mag\MessageBreak in pdf output}% \@restonecolfalse\newpage \fi \thispagestyle{empty}% - \setcounter{page}\@ne + \ifodd\c@page\setcounter{page}\@ne\else\setcounter{page}\z@\fi }% {\if@restonecol\twocolumn \else \newpage \fi \if@twoside\else @@ -1219,10 +1223,6 @@ class has defined the old font commands like\MessageBreak \def\footnote{\inhibitglue\footnotes@ve} \let\footnotemarks@ve=\footnotemark \def\footnotemark{\inhibitglue\footnotemarks@ve} -\renewcommand\@makefnmark{% - \unless\ifnum\ltjgetparameter{direction}=3 - \hbox{}\hbox{\@textsuperscript{\normalfont\@thefnmark}}\hbox{}% - \else\hbox{\yoko \@textsuperscript{\normalfont\@thefnmark}}\fi} \def\thefootnote{\ifnum\c@footnote>\z@\leavevmode\lower.5ex\hbox{*}\@arabic\c@footnote\fi} \renewcommand{\footnoterule}{% \kern-3\jsc@mpt @@ -1241,18 +1241,18 @@ class has defined the old font commands like\MessageBreak \color@begingroup \@makefntext{% \rule\z@\footnotesep\ignorespaces}% - \futurelet\next\fo@t} -\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t - \else \let\next\f@t\fi \next} -\def\f@@t{\bgroup\aftergroup\@foot\let\next} -\def\f@t#1{#1\@foot} -\def\@foot{\@finalstrut\strutbox\color@endgroup\egroup} + \futurelet\jsc@next\jsc@fo@t} +\def\jsc@fo@t{\ifcat\bgroup\noexpand\jsc@next \let\jsc@next\jsc@f@@t + \else \let\jsc@next\jsc@f@t\fi \jsc@next} +\def\jsc@f@@t{\bgroup\aftergroup\jsc@@foot\let\jsc@next} +\def\jsc@f@t#1{#1\jsc@@foot} +\def\jsc@@foot{\@finalstrut\strutbox\color@endgroup\egroup} \newcommand\@makefntext[1]{% \advance\leftskip 3\zw \parindent 1\zw \noindent \llap{\@makefnmark\hskip0.3\zw}#1} -\protected\def\@inhibitglue{\directlua{luatexja.jfmglue.create_beginpar_node()}} +\let\@inhibitglue=\ltjfakeparbegin \def\@item[#1]{% \if@noparitem \@donoparitem @@ -1295,7 +1295,7 @@ class has defined the old font commands like\MessageBreak \else \clubpenalty \@clubpenalty \everypar{}% - \fi\@inhibitglue}% + \fi\ltjfakeparbegin}% \if@noitemarg \@noitemargfalse \if@nmbrlist @@ -1497,6 +1497,8 @@ class has defined the old font commands like\MessageBreak \hyphenation{ado-be post-script ghost-script phe-nom-e-no-log-i-cal man-u-script} \pagestyle{headings} \pagenumbering{arabic} +\fnfixbottomtrue % 2017-02-19 +\IfFileExists{stfloats.sty}{\RequirePackage{stfloats}\fnbelowfloat}{} \if@twocolumn \twocolumn \sloppy @@ -1510,7 +1512,7 @@ class has defined the old font commands like\MessageBreak \renewcommand\familydefault{\sfdefault} \raggedright \ltj@setpar@global - \ltjsetxkanjiskip{0.1em}\relax + \ltjsetxkanjiskip0.1em\relax \fi \endinput %%