templates/latex/review-jlreq/review-base.sty in review-3.0.0.preview2 vs templates/latex/review-jlreq/review-base.sty in review-3.0.0.preview3
- old
+ new
@@ -1,23 +1,165 @@
% jlreq用基本設定
-\RequirePackage{needspace}
-\RequirePackage{alltt}
-\RequirePackage{float}
-\RequirePackage{upquote}
-\RequirePackage{bm}
+\newcommand*\PDFDocumentInformation[1]{%
+ \AtBeginShipoutFirst{\special{pdf:docinfo <<#1>>}}}
+\@onlypreamble\PDFDocumentInformation
-\IfFileExists{jumoline.sty}{
-\RequirePackage{jumoline}
+\PDFDocumentInformation{
+ /Title (\review@booktitlename)
+ /Author (\review@autnames)
+ % /Subject ()
+ % /Keywords (,,)
+ /Creator (Re:VIEW \review@reviewversion, with LaTeX)
}
\RequirePackage{pxrubrica}
\@ifpackagelater{pxrubrica}{2017/04/20}{% true
\rubysetup{J}}{% false
\rubysetup{g}}
\long\def\review@ifempty#1{\expandafter\ifx\expandafter\relax\detokenize{#1}\relax\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+% コードリスト装飾のデフォルト
+\newenvironment{reviewemlist}{%
+ \begin{tcolorbox}[skin=enhanced jigsaw,breakable,colback=black!10,colframe=black!10,boxrule=0mm,arc=0mm]\begin{alltt}}%
+ {\end{alltt}\end{tcolorbox}}
+
+\newenvironment{reviewlist}{%
+ \begin{tcolorbox}[skin=enhanced jigsaw,breakable,colback=white,colframe=black,boxrule=0.15mm,arc=0mm]\begin{alltt}}%
+ {\end{alltt}\end{tcolorbox}}
+
+\newenvironment{reviewsource}{%
+ \begin{tcolorbox}[skin=enhanced jigsaw,breakable,colback=white,colframe=black,boxrule=0.15mm,arc=0mm]\begin{alltt}}%
+ {\end{alltt}\end{tcolorbox}}
+
+\newenvironment{reviewcmd}{%
+ \begin{tcolorbox}[skin=enhanced jigsaw,breakable,colback=black!99,colframe=black!99,boxrule=0mm,arc=0mm]\begin{alltt}\begingroup\color{white}\ignorespaces}%
+ {\endgroup\end{alltt}\end{tcolorbox}}
+
+% 図
+\newenvironment{reviewimage}{%
+ \begin{figure}\begin{center}}{\end{center}\end{figure}}
+
+\newenvironment{reviewdummyimage}{%
+ \begin{figure}
+ \begin{center}\begin{alltt}}{%
+ \end{alltt}\end{center}
+ \end{figure}}
+
+\newcommand{\reviewindepimagecaption[2]}{\@makecaption{}{#2}}
+
+% 表
+\newenvironment{reviewtablesetup}{%
+}{}
+
+\newcommand{\reviewth}[1]{\cellcolor{black!70}\textcolor{white}{\bfseries #1}}
+\newcommand\reviewtablecaption[1]{\caption{#1}\vskip\abovecaptionskip}% アキをより広げる
+% \reviewtablecaption* を定義する(suffixパッケージ効果)
+%\WithSuffix\newcommand\reviewtablecaption*[1]{\@makecaption{}{#1}\vskip\abovecaptionskip}% アキをより広げる
+\newenvironment{reviewtable}[1]{%
+\begin{reviewtablesetup}\begin{tabular}{#1}}%
+{\end{tabular}\end{reviewtablesetup}}
+
+\newcommand*\reviewimgtablecaption[1]{\caption{#1}}
+
+% コラム
+\newenvironment{reviewcolumn}[1][COLUMN]{%
+ \begin{tcolorbox}[skin=enhanced jigsaw,breakable,boxrule=0.2mm,arc=2mm,colback=white,colframe=black!100!white,title={\sffamily\bfseries #1}]\par}
+ {\end{tcolorbox}}
+
+\newcommand{\reviewbackslash}[0]{\textbackslash{}}
+
+\renewcommand{\@makecaption}[2]{{% %本当はl,c,rを[]で指定したい
+ \reset@font\small
+ \vskip\abovecaptionskip
+ \jlreq@ifempty{#1}{%
+ \sbox\@tempboxa{{\jlreq@@makecaption@font #2}}}{%
+ \sbox\@tempboxa{{\jlreq@@makecaption@label@font #1}\review@intn@captionprefix{\jlreq@@makecaption@font #2}}}
+ \ifdim \wd\@tempboxa >\hsize
+ \jlreq@ifempty{#1}{%
+ {\jlreq@@makecaption@font #2}}{%
+ {\jlreq@@makecaption@label@font #1}\review@intn@captionprefix{\jlreq@@makecaption@font #2}}\relax\par
+ \else
+ \global\@minipagefalse
+ \hbox to\hsize{\box\@tempboxa\hfil}% キャプションLeft
+% \hbox to\hsize{\hfil\box\@tempboxa\hfil}% キャプションCenter
+% \hbox to\hsize{\hfil\box\@tempboxa}% キャプションRight
+ \fi
+ \vskip\belowcaptionskip}}
+
+\newcommand{\review@commoncaption}[2]{\@makecaption{#1}{#2}}
+\newcommand{\reviewlistcaption}[1]{\review@commoncaption{}{#1}}
+\newcommand{\reviewemlistcaption}[1]{\review@commoncaption{}{#1}}
+\newcommand{\reviewsourcecaption}[1]{\review@commoncaption{}{#1}}
+\newcommand{\reviewcmdcaption}[1]{\review@commoncaption{}{#1}}
+\newenvironment{reviewlistblock}{\list{}{\topsep.5\baselineskip \leftmargin\z@ \itemindent\z@}\item\relax}{\endlist}% 上下アキ0.5
+
+\newcommand{\reviewimageref}[2]{\review@intn@image #1}
+\newcommand{\reviewtableref}[2]{\review@intn@table #1}
+\newcommand{\reviewlistref}[1]{\review@intn@list #1}
+\newcommand{\reviewbibref}[2]{#1}
+\newcommand{\reviewcolumnref}[2]{\review@intn@columnname #1}
+\newcommand{\reviewsecref}[2]{#1}
+
+\renewcommand{\contentsname}{\review@toctitle}
+
+% 囲み記事
+\newenvironment{reviewnote}[1][]{%
+ \begin{tcolorbox}[skin=enhanced jigsaw,breakable,empty,coltitle=black,title={\sffamily\bfseries NOTE #1},borderline horizontal={0.5mm}{0pt}{black!50}, left=1mm, right=1mm, left skip=6mm]}
+ {\end{tcolorbox}}
+
+\newenvironment{reviewmemo}[1][]{%
+ \begin{tcolorbox}[skin=enhanced jigsaw,breakable,empty,coltitle=black,title={\sffamily\bfseries MEMO #1},borderline horizontal={0.5mm}{0pt}{black!50}, left=1mm, right=1mm, left skip=6mm]}
+ {\end{tcolorbox}}
+
+\newenvironment{reviewtip}[1][]{%
+ \begin{tcolorbox}[skin=enhanced jigsaw,breakable,empty,coltitle=black,title={\sffamily\bfseries Tips #1},borderline horizontal={0.5mm}{0pt}{black!50}, left=1mm, right=1mm, left skip=6mm]}
+ {\end{tcolorbox}}
+
+\newenvironment{reviewinfo}[1][]{%
+ \begin{tcolorbox}[skin=enhanced jigsaw,breakable,empty,coltitle=black,title={\sffamily\bfseries INFORMATION #1},borderline horizontal={0.5mm}{0pt}{black!50}, left=1mm, right=1mm, left skip=6mm]}
+ {\end{tcolorbox}}
+
+\newenvironment{reviewwarning}[1][]{%
+ \begin{tcolorbox}[skin=enhanced jigsaw,breakable,empty,coltitle=black,title={\sffamily\bfseries WARNING! #1},borderline horizontal={0.5mm}{0pt}{black!50}, left=1mm, right=1mm, left skip=6mm]}
+ {\end{tcolorbox}}
+
+\newenvironment{reviewimportant}[1][]{%
+ \begin{tcolorbox}[skin=enhanced jigsaw,breakable,empty,coltitle=black,title={\sffamily\bfseries IMPORTANT! #1},borderline horizontal={0.5mm}{0pt}{black!50}, left=1mm, right=1mm, left skip=6mm]}
+ {\end{tcolorbox}}
+
+\newenvironment{reviewcaution}[1][]{%
+ \begin{tcolorbox}[skin=enhanced jigsaw,breakable,empty,coltitle=black,title={\sffamily\bfseries CAUTION! #1},borderline horizontal={0.5mm}{0pt}{black!50}, left=1mm, right=1mm, left skip=6mm]}
+ {\end{tcolorbox}}
+
+\newenvironment{reviewnotice}[1][]{%
+ \begin{tcolorbox}[skin=enhanced jigsaw,breakable,empty,coltitle=black,title={\sffamily\bfseries NOTICE #1},borderline horizontal={0.5mm}{0pt}{black!50}, left=1mm, right=1mm, left skip=6mm]}
+ {\end{tcolorbox}}
+
+% 書体
+\newcommand{\reviewkw}[1]{\textbf{\textgt{#1}}}
+\newcommand{\reviewami}[1]{#1}% FIXME
+\newcommand{\reviewballoon}[1]{←{#1}}
+\newcommand{\reviewem}[1]{\textbf{#1}}
+\newcommand{\reviewstrong}[1]{\textbf{#1}}
+\newcommand{\reviewunderline}[1]{\underline{#1}}% ulemかjumolineで上書き。デフォルトはulemにしている
+\newcommand{\reviewit}[1]{\textit{#1}}
+\newcommand{\reviewbold}[1]{\textbf{#1}}
+\newcommand{\reviewcode}[1]{\texttt{#1}}
+\newcommand{\reviewtt}[1]{\texttt{#1}}
+\newcommand{\reviewtti}[1]{\texttt{\textit{#1}}}
+\newcommand{\reviewttb}[1]{\texttt{\textbf{#1}}}
+
+%% @<del> is ignored in LaTeX with default style
+\newcommand{\reviewstrike}[1]{#1}
+
+%%%% for ulem.sty:
+\renewcommand{\reviewstrike}[1]{\sout{#1}}
+%%
+%%%% for jumoline.sty:
+%%\renewcommand{\reviewstrike}[1]{\Middleline{#1}}
+
\newcommand{\reviewtitlefont}[0]{\usefont{T1}{phv}{b}{n}\gtfamily}
\newcommand{\reviewmainfont}[0]{}
\newcommand{\reviewcolophon}[0]{\clearpage}
\newcommand{\reviewappendix}[0]{\appendix}
@@ -49,10 +191,15 @@
\fi
\ifdefined\appendixname
\renewcommand{\appendixname}{\reviewappendixname}
\fi
+% hooks
+\def\reviewbegindocumenthook{}
+
+\def\reviewenddocumenthook{}
+
\def\reviewfrontmatterhook{%
\renewcommand{\chaptermark}[1]{{}}
\frontmatter
}
@@ -69,24 +216,21 @@
\def\reviewbackmatterhook{%
\backmatter
}
% cover
-\ifdefined\review@cover
- \def\reviewcoverpagecont{\review@coverfile}
-\fi
+\if@reclscover
\ifdefined\review@coverimage
\def\reviewcoverpagecont{%
- \thispagestyle{empty}
- \null\vfill
- \centerline{\vbox to 0pt{\vss\hbox to 0pt{\hss
- \expandafter\includegraphics\expandafter[\review@coverimageoption]{\review@coverimage}% includefullpagegraphicsを導入すべき?
- \hss}\vss}}
- \vfill\null
- \clearpage
+ \expandafter\includefullpagegraphics\expandafter[\review@coverimageoption]{\review@coverimage}
+ \cleardoublepage
}
\fi
+\ifdefined\review@coverfile
+ \def\reviewcoverpagecont{\review@coverfile}
+\fi
+\fi
% titlepage
\ifdefined\review@titlepage
\ifthenelse{\isundefined{\review@titlefile}}{%
\def\reviewtitlepagecont{%
@@ -106,12 +250,12 @@
{\Large\review@subtitlename\par}%
\fi
\vskip 15em%
{\huge
\lineskip .75em
- \begin{tabular}[t]{c}%
- \review@titlepageauthors
+ \begin{tabular}[t]{p{\textwidth}}%
+ \centering\review@titlepageauthors
\end{tabular}\par}%
\vfill
{\large\review@date \review@intn@edition%
\ifx\review@jlreq@driver\review@jlreq@driver@luatex
\hspace{2\zw}%
@@ -153,18 +297,17 @@
\ifthenelse{\isundefined{\review@colophonfile}}{%
\def\reviewcolophonpagecont{%
\reviewcolophon
\thispagestyle{empty}
\vspace*{\fill}
-\typeout{\review@booktitlename}
{\noindent\reviewtitlefont\Large\review@booktitlename}\\
\ifdefined\review@subtitlename
{\noindent\reviewtitlefont\large\review@subtitlename} \\
\fi
\rule[8pt]{\textwidth}{1pt} \\
{\noindent\review@pubhistories}
-\begin{tabular}{ll}
+\begin{tabular}{p{3em}p{\dimexpr\textwidth-6em}}
\review@colophonnames
\end{tabular}
\\
\rule[0pt]{\textwidth}{1pt} \\
\ifdefined\review@rights