-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我想将某些内容固定排版在偶数页的页面底部,但使用\ifodd\value{page}进行判断时在某些情形下会失效 #288
Comments
LaTeX 在执行到 \documentclass[fontset=windows,linespread=1.5625]{ctexart}
\usepackage[a4paper,twoside,top=35mm,bottom=35mm,left=28mm,right=26mm,showframe]{geometry}
\usepackage{zhlipsum}
\usepackage{needspace}
\newsavebox\makenotesbox
\newcommand{\makenotestext}
{\begin{tabular}[b]{l}
\hline
《史记·十二本纪·项羽本纪》 \\
\hline
\end{tabular}}
\newcommand{\makenotes}
{
\par
\sbox{\makenotesbox}{\parbox[b]{\textwidth}{\makenotestext}}
\needspace{%
\ifdim\dp\makenotesbox>\maxdepth
\dimexpr\ht\makenotesbox+\dp\makenotesbox-\maxdepth\relax
\else \ht\makenotesbox\fi}
\ifodd\value{page}
\ifdim\pagegoal=\maxdimen \hbox{}\thispagestyle{empty}\fi
\clearpage
\thispagestyle{empty}%
\hbox{}
\fi
% \null
% \vfill
\vspace*{\fill}
\noindent \usebox{\makenotesbox}\newpage
}
\begin{document}
\zihao{3}\fangsong
\zhlipsum[1-5][name=xiangyu]
\makenotes
\end{document} |
使用 这里需要「仅在 shipout/输出一页 时展开」,对应的就是 PS:texlive 2023 开始, |
在OP这种问题下,如果仅仅使用
|
谢谢 @Sophanatprime 前辈提供的解决方案。 |
检查
编译环境
操作系统
TeX 发行版
我的问题:
我希望将一些内容排版在偶数页的页面底部,使用了_\ifodd\value{page}_来判断当前页是否奇数页。如果是,则创建一个新页面来排版需要置底的内容。但是,实践时发现,有时会碰到排版无法达到预期目的的情况。
经过多次尝试,目前发现以下三种种情况会导致置底内容无法排版在偶数页:
出现以上任意一种情形时,置底内容将会直接在下一页排版(奇数页)。以下代码展示了第三种情形:
示例代码
请问各位老师、前辈,以上代码是哪里出错了吗?
The text was updated successfully, but these errors were encountered: