Skip to content

Commit

Permalink
Merge pull request #1738 from munepi/support_tdir_includefullpagegrap…
Browse files Browse the repository at this point in the history
…hics

review-jlreq: \includefullpagegraphicsを縦書きモードに対応
  • Loading branch information
kmuto authored Sep 7, 2021
2 parents d8d3963 + f3b69be commit 6219a30
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
23 changes: 22 additions & 1 deletion templates/latex/review-jlreq/review-jlreq.cls
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
\RequirePackage{fix-cm}%%\RequirePackage{fix-cm,exscale}
\IfFileExists{latexrelease.sty}{}{\RequirePackage{fixltx2e}}

%% amsmath: override \@ifstar with \new@ifnextchar in amsgen.sty
\let\ltx@ifstar\@ifstar%%as \@ifstar of LaTeX kernel

%% graphicx: added nosetpagesize
\IfFileExists{platexrelease.sty}{%% is bundled in TL16 or higher release version
\PassOptionsToPackage{nosetpagesize}{graphicx}%%for TL16 or higher version
Expand Down Expand Up @@ -226,12 +229,29 @@
\edef\grnchry@gutter{\evensidemargin}
\newcommand*\includefullpagegraphics{%
\clearpage
\@ifstar
\ltx@ifstar
{\@includefullpagegraphics}%
{\thispagestyle{empty}\@includefullpagegraphics}
}

\newcommand*\@includefullpagegraphics[2][]{%
\if@tate
\vbox to \textheight{%
\ifodd\c@page
\vskip-\dimexpr\evensidemargin - \topskip + 1in\relax
\else
\vskip-\dimexpr\oddsidemargin - \topskip + 1in\relax
\fi
\vbox to \paperwidth{\vss
\hbox to \textwidth{%
\hskip-\grnchry@head\relax
\hbox to \paperheight{\hss
\rotatebox{90}{\includegraphics[#1]{#2}}%
\hss}%
\hss}%
\vss}%
\vss}%
\else
\vbox to \textheight{%
\vskip-\grnchry@head
\vbox to \paperheight{\vss
Expand All @@ -247,6 +267,7 @@
\hss}%
\vss}%
\vss}%
\fi
\clearpage
}

Expand Down
28 changes: 26 additions & 2 deletions templates/latex/review-jsbook/review-jsbook.cls
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
\RequirePackage{fix-cm}%%\RequirePackage{fix-cm,exscale}
\IfFileExists{latexrelease.sty}{}{\RequirePackage{fixltx2e}}

%% amsmath: override \@ifstar with \new@ifnextchar in amsgen.sty
\let\ltx@ifstar\@ifstar%%as \@ifstar of LaTeX kernel

%% graphicx: added nosetpagesize
\IfFileExists{platexrelease.sty}{%% is bundled in TL16 or higher release version
\PassOptionsToPackage{nosetpagesize}{graphicx}%%for TL16 or higher version
Expand Down Expand Up @@ -152,7 +155,7 @@
\xdef#1{\ifx\recls@hiddenfolio\@empty tombo,\fi#1}}

%% \recls@set@hiddenfolio{<preset>}
%% <preset>: default, marusho-ink (丸正インキ), nikko-pc (日光企画),
%% <preset>: default, marusho-ink (丸正インキ), nikko-pc (日光企画),
%% shippo (ねこのしっぽ)
\def\recls@set@hiddenfolio#1{\ifx#1\@empty\else
\@ifundefined{@makehiddenfolio@#1}{%
Expand Down Expand Up @@ -287,6 +290,9 @@
% \typeout{!!! magscale: \jsc@magscale}
% \typeout{!!! mag: \the\mag}%%=> 1000 -> OK

%% compatibility for jlreq.cls
\let\if@tate\iftdir

%% override papersize with custom papersize
\ifx\recls@paperwidth\@empty\else\ifx\recls@paperheight\@empty\else
\setlength{\paperwidth}{\recls@paperwidth}
Expand Down Expand Up @@ -401,12 +407,29 @@
\let\grnchry@gutter\recls@gutter
\newcommand*\includefullpagegraphics{%
\clearpage
\@ifstar
\ltx@ifstar
{\@includefullpagegraphics}%
{\thispagestyle{empty}\@includefullpagegraphics}
}

\newcommand*\@includefullpagegraphics[2][]{%
\if@tate
\vbox to \textheight{%
\ifodd\c@page
\vskip-\dimexpr\evensidemargin - \topskip + 1in\relax
\else
\vskip-\dimexpr\oddsidemargin - \topskip + 1in\relax
\fi
\vbox to \paperwidth{\vss
\hbox to \textwidth{%
\hskip-\grnchry@head\relax
\hbox to \paperheight{\hss
\rotatebox{90}{\includegraphics[#1]{#2}}%
\hss}%
\hss}%
\vss}%
\vss}%
\else
\vbox to \textheight{%
\vskip-\grnchry@head
\vbox to \paperheight{\vss
Expand All @@ -422,6 +445,7 @@
\hss}%
\vss}%
\vss}%
\fi
\clearpage
}

Expand Down

0 comments on commit 6219a30

Please sign in to comment.