![对于宽长的桌子,我该如何将桌子的页面旋转为横向,同时页码仍然位于页面底部?](https://linux22.com/image/473887/%E5%AF%B9%E4%BA%8E%E5%AE%BD%E9%95%BF%E7%9A%84%E6%A1%8C%E5%AD%90%EF%BC%8C%E6%88%91%E8%AF%A5%E5%A6%82%E4%BD%95%E5%B0%86%E6%A1%8C%E5%AD%90%E7%9A%84%E9%A1%B5%E9%9D%A2%E6%97%8B%E8%BD%AC%E4%B8%BA%E6%A8%AA%E5%90%91%EF%BC%8C%E5%90%8C%E6%97%B6%E9%A1%B5%E7%A0%81%E4%BB%8D%E7%84%B6%E4%BD%8D%E4%BA%8E%E9%A1%B5%E9%9D%A2%E5%BA%95%E9%83%A8%EF%BC%9F.png)
我有一个与几年前提出的问题类似的问题:单个横向页面,底部有页码?
不幸的是,由于 everypage.sty 包不再存在,该问题中显示的解决方案似乎不再起作用(请参阅那么 everypage 包替换是什么?和https://ctan.org/tex-archive/macros/latex/contrib/everypage)?
我有一个很宽(至少 12 列)且很长(超过 200 行)的长表,它占用了多页。我想以横向显示它,而不是纵向显示。
我尝试实施用户 John Kormylo 在上述 Stack 问题中建议的解决方案,但 Latex 抛出了错误“未找到文件‘everypage.sty’”,如果该包已以某种方式被替换,则这是有道理的。
\usepackage{pdflscape}
\usepackage{longtable}
\usepackage{everypage}
%%%%the below stuff is to attempt to keep page numbers on the bottom of the page even in landscape mode.
%%%%It came from here, and all credit goes to user John Kormylo:
%%%%https://tex.stackexchange.com/questions/278113/single-landscape-page-with-page-number-at-the-bottom
\newcommand{\Lpagenumber}{\ifdim\textwidth=\linewidth\else\bgroup
\dimendef\margin=0 %use \margin instead of \dimen0
\ifodd\value{page}\margin=\oddsidemargin
\else\margin=\evensidemargin
\fi
\raisebox{\dimexpr -\topmargin-\headheight-\headsep-0.5\linewidth}[0pt][0pt]{%
\rlap{\hspace{\dimexpr \margin+\textheight+\footskip}%
\llap{\rotatebox{90}{\thepage}}}}%
\egroup\fi}
\AddEverypageHook{\Lpagenumber}%%%%%%%%%%%%
\begin{document}
\begin{landscape}
\begin{longtable}{|c|c|c|c|c|c|c|c|c|c|c|c|}
%headers and stuff go here, not relevant to my issue
\hline
StarID&$q_{EM,red}$&$q_{EM,blue}$&$q_{LAD,red}$&$q_{LAD,blue}$&StarType&$
EM_{Time}$&$LAD_{Time}$&BPred&BPblue&Cred&Cblue\\
\hline
10.4285&1&1&1&0&cepheid&52.079&10.998&Incorr&Incorr&Incorr&Corr \\
\hline
10.4396&1&1&1&1&cepheid&50.38&13.313&Incorr&Incorr&Incorr&Incorr \\
\hline
%%%lots more lines in an identical style
\end{longtable}
\end{landscape}
\end{document}
几点说明:
-我的文档类是我所在大学专门创建的论文(但基于书籍类),我认为我不能分享它,所以我不确定上面要使用什么文档类
-我的大学不允许我在四边留出 1 英寸的边距
-我并不局限于使用 pdflscape 软件包,我只是欣赏读者在屏幕上阅读文档时如何清晰地看到旋转的页面
答案1
我不确定 pgflscape 会对 产生什么影响\put
。
\documentclass{book}
\usepackage{pdflscape}
\usepackage{longtable}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx}% for \rotetebox
\newcommand{\Lpagenumber}{\ifdim\textwidth=\linewidth\else\bgroup
\dimendef\margin=0 %use \margin instead of \dimen0
\ifodd\value{page}\margin=\oddsidemargin
\else\margin=\evensidemargin
\fi
\put (\dimexpr 1in+\margin+\textheight+\footskip\relax,
\dimexpr -1in-\topmargin-\headheight-\headsep-\linewidth\relax)
{\rotatebox[origin=lb]{90}{\makebox[\linewidth]{\thepage}}}%
\egroup\fi}
\AddToHook{shipout/background}{\Lpagenumber}
\begin{document}
\begin{landscape}
\pagestyle{empty}%
\begin{longtable}{|c|c|c|c|c|c|c|c|c|c|c|c|}
%headers and stuff go here, not relevant to my issue
\hline
StarID&$q_{EM,red}$&$q_{EM,blue}$&$q_{LAD,red}$&$q_{LAD,blue}$&StarType&$
EM_{Time}$&$LAD_{Time}$&BPred&BPblue&Cred&Cblue\\
\hline
10.4285&1&1&1&0&cepheid&52.079&10.998&Incorr&Incorr&Incorr&Corr \\
\hline
10.4396&1&1&1&1&cepheid&50.38&13.313&Incorr&Incorr&Incorr&Incorr \\
\hline
%%%lots more lines in an identical style
\end{longtable}
\end{landscape}
\end{document}