Skip to content

Instantly share code, notes, and snippets.

@h-kitagawa
Created September 2, 2017 21:11
Show Gist options
  • Save h-kitagawa/27fb063da4730164fd53042aae8f8b33 to your computer and use it in GitHub Desktop.
Save h-kitagawa/27fb063da4730164fd53042aae8f8b33 to your computer and use it in GitHub Desktop.
atbegshi.sty + 縦組クラス
\documentclass{tarticle}
\usepackage[word]{continue}% これは atbegshi 依存
\usepackage{etoolbox}
\makeatletter
\patchcmd{\AtBegShi@Output}%
{\let\AtBegShi@OrgProtect\protect}%
{\setbox\z@\hbox\bgroup\yoko\let\AtBegShi@OrgProtect\protect}%
{}{}
\patchcmd{\AtBegShi@Output}%
{\AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox}%
{\AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox\egroup}%
{}{}
\AtBeginShipout{\AtBeginShipoutAddToBox{ほーげほーげ,ふが「ぴよ」}}
\begin{document}
あいうえお、かきくけこ。「さーしす:せそ?」
\newpage
This is a pen. い
\end{document}
@aminophen
Copy link

だいたい ok らしかったのですが,pdfpages パッケージ使用時にはエラーが出ました。

\documentclass[dvipdfmx]{jarticle}
\usepackage{pdfpages}

\makeatletter
\usepackage{etoolbox}
\patchcmd{\AtBegShi@Output}%
{\let\AtBegShi@OrgProtect\protect}%
{\setbox\z@\hbox\bgroup\yoko\let\AtBegShi@OrgProtect\protect}%
{}{}
\patchcmd{\AtBegShi@Output}%
{\AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox}%
{\AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox\egroup}%
{}{}
\makeatother

\begin{document}
a
\end{document}
./pdfpages-atbegshi.tex:18: You can't use `\prevdepth' in restricted horizontal mode.
\nointerlineskip ->\prevdepth 
                              -\@m \p@ 
l.18 \end{document}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment