
\font\sevenbf=cmbx7

% Fonts  for 8pt
\font\eightrm=cmr8
\font\eightbf=cmbx8
\font\eightit=cmti8
\font\eightsl=cmsl8
\font\eightmus=cmmi8
\font\eighttt=cmtt8
\font\eightsf=cmss8
% Fonts  for 12pt
\font\twelverm=cmr12
\font\twelvebf=cmbx12
\font\twelveit=cmti12
\font\twelvesl=cmsl12
\font\twelvemus=cmmi12
\font\twelvett=cmtt12
\font\twelvesf=cmss12

\font\bigbf=cmbx12 scaled \magstep3
\font\eightsc=cmcsc10 at 8pt
\font\tensc=cmcsc10
\font\tensf=cmss10
\font\twelvesc=cmcsc10 at 12pt

% Japanese fonts
\input luatexja-core.sty
\def\minfnt{psft:Ryumin-Light:jfm=ujis }
\def\gothfnt{psft:GothicBBB-Medium:jfm=ujis }
\jfont\eightmc=\minfnt at 10.5\jQ
\jfont\eightjtt={psft:GothicBBB-Medium:jfm=mono} at 10.5\jQ
\jfont\eightgt=\gothfnt at 10.5\jQ
\let\tenmc=\tenmin
\jfont\tenjtt={psft:GothicBBB-Medium:jfm=mono} at 13.5\jQ
\let\tengt=\tengt
\jfont\twelvemc=\minfnt at 16\jQ
\jfont\twelvegt=\gothfnt at 16\jQ
\jfont\biggt=\gothfnt at 28\jQ

% Size 
\def\large{\def\rm{\textfont0=\twelverm\twelverm\fam0}\def\bf{\twelvebf\gt}%
  \let\it=\twelveit  \let\sl=\twelvesl \let\mus=\twelvemus 
  \let\sc=\twelvesc  \let\tt=\twelvett \let\sf=\twelvesf
  \let\mc=\twelvemc \let\gt=\twelvegt
  \baselineskip=18pt\rm\mc
  \ltjsetparameter{xkanjiskip={0.25\zw plus 0.10\zw minus 0.10\zw}}}

\def\big{\bigbf\biggt\ltjsetparameter{xkanjiskip={0.25\zw plus 0.10\zw minus 0.10\zw}}}

\def\normalsize{\def\rm{\textfont0=\tenrm\tenrm\fam0\let\sx=\sevenrm}%
  \def\bf{\tenbf\gt\let\sx=\sevenbf}%
  \let\it=\tenit \let\sl=\tensl \let\mus=\tenmus 
  \let\sc=\tensc \def\tt{\tentt\tenjtt}\let\sf=\tensf %
  \let\mc=\tenmc \let\gt=\tengt
  \baselineskip=15pt\rm\mc
  \ltjsetparameter{xkanjiskip=0.25\zw plus 1pt minus 1pt}}
\def\small{\def\rm{\textfont0=\eightrm\eightrm\fam0}\def\bf{\eightbf\gt}%
  \let\it=\eightit \let\sl=\eightsl \let\mus=\eightmus 
  \let\sc=\eightsc \def\tt{\eighttt\eightjtt}\let\sf=\eightsf %
  \let\mc=\eightmc \let\gt=\eightgt%
  \rm\mc\ltjsetparameter{xkanjiskip={0.25\zw plus 1pt minus 1pt},
  yjabaselineshift=-0.76pt, yalbaselineshift=-0.76pt}
}



% layout
\normalsize\parindent=1\zw\parskip=0pt
\pdfpagewidth=210mm\pdfpageheight=297mm
\hsize=43\zw\hoffset=\dimexpr(\pdfpagewidth-\hsize)/2-1in\relax
\vsize=246mm

% heading
\outer\def\beginsection#1\par{\vskip0pt plus.1\vsize\penalty-250%
  \vskip0pt plus-.1\vsize\bigskip\vskip\parskip%
  \message{#1}\leftline{\large\bf#1\hskip0.5\zw\hrulefill}\nobreak\smallskip}
\outer\def\beginparagraph#1\par{\vskip0pt plus.1\vsize\penalty-100%
  \vskip0pt plus-.1\vsize\medskip\vskip\parskip%
  \message{#1}\leftline{\bf\char"25A0 #1}\nobreak}

% verbatim
% borrowed from manmac.tex
\chardef\other=12
\newbox\vspbox
\setbox\vspbox=\hbox{\tt\char32}
{\catcode`\ =\active\catcode`\_=\active%\catcode`\%=\active
\gdef\ttverbatim{\begingroup\ltjsetparameter{xkanjiskip=0pt}
\catcode`\ =\active\let =~\catcode`\%=\other
\catcode`\\=\other\catcode`\{=\other\catcode`\}=\other
\catcode`\$=\other\catcode`\&=\other\catcode`\#=\other\catcode`\~=\other
\catcode`\_=\active\catcode`\^=\other\catcode"FFFFF=12%" <- needed
\let_=\_%
\obeyspaces\obeylines\tt}}

\abovedisplayskip=\medskipamount
\abovedisplayshortskip=\medskipamount
\belowdisplayskip=\medskipamount
\belowdisplayshortskip=\medskipamount
%
\outer\def\begintt{$$\let\par=\endgraf\baselineskip=12pt
\ttverbatim\parskip=0pt\catcode`\|=0 \rightskip-5pc\ttfinish}
{\catcode`\|=0 |catcode`|\=\other% | is temporary escape character
|obeylines% end of line is active
|gdef|ttfinish#1^^M#2\endtt{#1|parindent3|zw|noindent|vbox{#2}|hss|endgroup$$}}

\catcode`\|=\active
{\obeylines \gdef|{\ttverbatim \spaceskip.5em\let^^M=\  \let|=\endgroup}}

{\catcode`\_=\active \global\catcode`\<=\active
\gdef<{\begingroup\catcode`\_=\active\let_=\_\it\@arg}
\gdef\@arg#1>{$\langle$#1\/$\rangle$\endgroup}
}

\def\lvert{\delimiter"426A30C }
\def\rvert{\delimiter"526A30C }

% itemize
\newcount\enumi\enumi=0
\def\item{\par\medskip\leftskip=2\zw\noindent\hskip-1\zw\hbox to 1\zw{\hss$\bullet$\hss}}
\def\itemitem{\par\leftskip=4\zw\noindent\hskip-1\zw\hbox to 1\zw{\hss$-$\hss}}
\def\itemT{\par\leftskip=6\zw\noindent\hskip-1\zw\hbox to 1\zw{\hss$\bullet$\hss}}
\def\enum{\par\medskip\advance\enumi1\leftskip=2\zw\noindent\hskip-1\zw\hbox to 1\zw{\hss\the\enumi.\kern0.5\zw}}
\def\enditem{\medskip\par\enumi=0\leftskip=0pt\parskip=0pt\noindent}

\ltjsetparameter{jaxspmode={`★,0}}

\endinput
