在横向环境中,页数显示在页面的左侧。此时我想强制 LaTeX 将所有页码打印在底部。以下代码是我想要的 LaTeX 的 MWE。请帮我解决这个问题。
\documentclass[a4paper,11pt]{article}
\usepackage{pdflscape}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{landscape}
\begin{figure}
\centering
\begin{subfigure}[t]{0.7\textwidth}
\includegraphics[width=\linewidth]{Figure4a.pdf}
\caption{Positive decision variables}\label{Fig4a}
\end{subfigure}
~
\begin{subfigure}[t]{0.7\textwidth}
\includegraphics[width=\linewidth]{Figure4b.pdf}
\caption{Binary decision variables}\label{Fig4b}
\end{subfigure}\\[1ex]
\caption{XXX}
\label{Fig1}
\end{figure}
\end{landscape}
\end{document}
答案1
您是否尝试过使用基于 typearea 的方法,如如何将某些页面更改为横向/纵向模式?
代替
\documentclass{article} \usepackage[paper=portrait,pagesize]{typearea}
你也可以使用
\documentclass[paper=portrait,pagesize]{scrartcl}
答案2
我修改了代码如下,现在可以正常工作。请注意,以下代码的当前布局如下图所示:
\documentclass[a4paper,11pt]{article}
\usepackage{pdflscape}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{everypage}
\newlength{\hfoot}
\newlength{\vfoot}
\AddEverypageHook{\ifdim\textwidth=\linewidth\relax
\else\setlength{\hfoot}{-\topmargin}%
\addtolength{\hfoot}{-\headheight}%
\addtolength{\hfoot}{-\headsep}%
\addtolength{\hfoot}{-.5\linewidth}%
\ifodd\value{page}\setlength{\vfoot}{\oddsidemargin}%
\else\setlength{\vfoot}{\evensidemargin}\fi%
\addtolength{\vfoot}{\textheight}%
\addtolength{\vfoot}{\footskip}%
\raisebox{\hfoot}[0pt][0pt]{\rlap{\hspace{\vfoot}\rotatebox[origin=cB]{90}{\thepage}}}\fi}
\begin{document}
\pagebreak{}
\begin{landscape}
\pagestyle{empty}
\begin{figure}
\centering
\begin{subfigure}[t]{0.7\textwidth}
\includegraphics[width=\linewidth]{Figure4a.pdf}
\caption{Positive decision variables}\label{Fig4a}
\end{subfigure}
~
\begin{subfigure}[t]{0.7\textwidth}
\includegraphics[width=\linewidth]{Figure4b.pdf}
\caption{Binary decision variables}\label{Fig4b}
\end{subfigure}\\[1ex]
\caption{XXX}
\label{Fig1}
\end{figure}
\end{landscape}
\pagestyle{empty}
\end{document}