Skip to content

Commit

Permalink
Add test sample for new era (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-tk committed Feb 9, 2019
1 parent 8db546b commit b5b1d5b
Showing 1 changed file with 100 additions and 0 deletions.
100 changes: 100 additions & 0 deletions japanese-otf-uptex/test/uplatex/era.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
% -*- coding: utf-8 -*-

%%%%%%%%
% ①,②,③,④ のどれかを実行すればよい。
% ① platex, 新元号なし
% $ platex era.tex
% ② uplatex, 新元号なし
% $ uplatex era.tex
% ③ platex, 新元号あり
% $ platex "\def\era{true}\input" era.tex
% ④ uplatex, 新元号あり
% $ uplatex "\def\era{true}\input" era.tex
%%%%%%

\newif\ifuptexmode\uptexmodefalse
\ifnum\jis"2121="3000 \uptexmodetrue\fi

\makeatletter

\def\@opt@{multi}
\def\@default{default}

\ifx\option\@undefined
\def\option{default}
\fi
\ifx\option\@default
\else
\edef\@opt@{\option,\@opt@}
\fi

\ifx\class\@undefined
\ifuptexmode
\def\engine{upLaTeX}
\else
\def\engine{pLaTeX}
\fi
\fi

\newif\ifnewera\newerafalse
\ifx\era\@undefined
\edef\era{なし}
\else
\neweratrue
\edef\era{あり}
\fi
\typeout{## 新元号:\era ##}

\documentclass[a4paper,draft,autodetect-engine]{jsarticle}

\usepackage{plext}
\usepackage[\@opt@]{otf}

\makeatother
\edef\bs{$\backslash$\kern0em}

\begin{document}
\parindent0pt

エンジン:\texttt{\engine}\\
オプション:\texttt{\option}\\
新元号:\era

\vskip1zh

\bs{}ajLig: \ajLig{明治}\ajLig{大正}\ajLig{昭和}\ajLig{平成}\ifnewera\ajLig{新元号}\fi

\bs{}UTF: \UTF{337E}\UTF{337D}\UTF{337C}\UTF{337B}\ifnewera\UTF{32FF}\fi

\bs{}CID: \CID{7621}\CID{7622}\CID{7623}\CID{8323}\ifnewera\CID{23058}\fi

\ifuptexmode

UTF-8: ㍾㍽㍼㍻\ifnewera\fi

\bs{}kchar: \kchar"337E\kchar"337D\kchar"337C\kchar"337B\ifnewera\kchar"32FF\fi

\fi

\vskip1zh

\parbox<t>{25.0zw}{

\bs{}ajLig: \ajLig{明治}\ajLig{大正}\ajLig{昭和}\ajLig{平成}\ifnewera\ajLig{新元号}\fi

\bs{}UTF: \UTF{337E}\UTF{337D}\UTF{337C}\UTF{337B}\ifnewera\UTF{32FF}\fi

\bs{}CID: \CID{12041}\CID{12042}\CID{12043}\CID{12044}\ifnewera\CID{23059}\fi

\ifuptexmode

UTF-8: ㍾㍽㍼㍻\ifnewera\fi

\bs{}kchar: \kchar"337E\kchar"337D\kchar"337C\kchar"337B\ifnewera\kchar"32FF\fi

\fi

}

\end{document}

0 comments on commit b5b1d5b

Please sign in to comment.