
\documentclass{article}[12pt]
\usepackage{setspace}
\usepackage{lastpage}
\usepackage{rotating}
\usepackage{etoolbox}
\usepackage{lscape}
\usepackage{pdflscape}
%\usepackage{textcomp}
\usepackage[titletoc]{appendix}
\usepackage{longtable}
\usepackage{easytable}
\usepackage{array}
\usepackage{multirow}
\usepackage{amssymb}
\usepackage{fancyhdr}
%\usepackage{helvetica} % uses helvetica postscript font (download helvetica.sty)
\usepackage[includeheadfoot]{geometry}
\geometry{a4paper,hmargin={2cm,2cm},vmargin={2cm,2cm}}
\usepackage{caption}
\captionsetup{skip=0pt}
\usepackage[table]{xcolor}
\usepackage{booktabs,arydshln}
\usepackage{lipsum}
\newcommand\VRule[1][\arrayrulewidth]{\vrule width #1}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\fancypagestyle{mydoc}{%
\fancyhf{}
\fancyhead{}
\fancyfoot{}
\fancyfoot[C]{
\scriptsize
Page \thepage\ of \pageref{LastPage}
}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\fancypagestyle{lscape}{%
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyhf{}
\fancyhead{}
\fancyfoot{}
\fancyfoot[C]{
\scriptsize
Page \thepage\ of \pageref{LastPage}
}
\fancyfoot[L]{
\footnotesize
Created: 14 August 2002 \\
Modified: 20 December 2012 \\
}
}
\begin{document}
\onehalfspacing
\title{
\vspace{48pt}
\textbf{Application \\ \vspace{48pt}
}
\vspace{96pt}
\large{Modality: \\}
\vspace{18pt}
\large{Submodality: \\}
\vspace{48pt}
}
\author{Name \\
\vspace{36pt}}
\maketitle
\thispagestyle{empty}
\newpage
\thispagestyle{mydoc}
\tableofcontents
\newpage
\clearpage
\pagestyle{mydoc}
\section{Section Title 1}
\lipsum[1-10]
\section{Section Title 2}
\lipsum[11-20]
\section{Appendices: Index and Supporting Evidence}
\begin{appendices}
\newgeometry{a4paper,hmargin={2cm,2cm},vmargin={-0.5cm,0cm},landscape,includeheadfoot}
\paperwidth=\pdfpageheight
\paperheight=\pdfpagewidth
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
\fancyhfoffset[R]{8.75cm}
\textheight=17.5cm
\makeatletter
\setlength{\@fptop}{0cm}
\makeatother
\pagestyle{lscape}
\setcounter{section}{1}
\addcontentsline{toc}{section}{\protect\numberline{\thesection}{Index}}
\begin{table}[h!]
\normalsize
\begin{center}
\begin{tabular}{!{\VRule[1pt]} m{2cm} | m{4.7cm} | m{3cm} | m{4.6cm} | m{2.5cm} | m{6.2cm} !{\VRule[1pt]} @{}m{0pt}@{} }
\specialrule{1pt}{0pt}{0pt}
\multicolumn{6}{ !{\VRule[1pt]} c !{\VRule[1pt]} }{\cellcolor{gray!25} \textbf{\Large TEST TEXT}} & \\ [6pt]
\specialrule{1pt}{0pt}{1pt} \specialrule{1pt}{1pt}{0pt}
\cellcolor{gray!25}\parbox{2cm}{\centering \textbf{TEXT:}} & &
\cellcolor{gray!25}\parbox{3cm}{\centering \textbf{TEXT:\\(if applicable)}} & &
\cellcolor{gray!25}\parbox{2.5cm}{\centering \textbf{TEXT \\ MORE:}} & & \\[22pt]
\specialrule{1pt}{0pt}{0pt}
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{!{\VRule[2pt]} m{251mm} !{\VRule[2pt]} @{}m{0pt}@{} }
\specialrule{2pt}{0pt}{0pt}
\vspace{2pt}
\parbox{251mm}{\centering{\LARGE{}\textbf{APPENDIX 1}}\\
\large{}\textbf{Long text \\ Long text \\ Long text. \\ \vspace{2pt}}} & \\
\specialrule{2pt}{0pt}{0pt}
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{!{\VRule[1pt]} l L{22.2cm} !{\VRule[1pt]} @{}m{0pt}@{} }
\specialrule{1pt}{0pt}{0pt}
\parbox[l]{2.6cm}{\large{}\textbf{TEXT: \\ ~} }& \large{}\parbox[l]{20.5cm}{Test TEXT.} & \\[16pt]
\specialrule{1pt}{0pt}{0pt}
\end{tabular}
\begin{tabular}{!{\VRule[1pt]} C{2cm} !{\VRule[1pt]} L{11.8cm} !{\VRule[1pt]} L{10.5cm} !{\VRule[1pt]} @{}m{0pt}@{} }
\specialrule{1pt}{0pt}{0pt}
\multicolumn{3}{ !{\VRule[1pt]} c !{\VRule[1pt]} }{\cellcolor{gray!25} \textbf{\LARGE 1 - TEXT}} & \\ [20pt]
\specialrule{1pt}{0pt}{0pt}
\cellcolor{gray!25} ~ & \cellcolor{gray!25} \centering \large \textbf{sample}
& \parbox{10.3cm}{\cellcolor{gray!25} \centering \large \textbf{sample more} } & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx1 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx2 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx3 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx4 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
\multicolumn{3}{ !{\VRule[1pt]} c !{\VRule[1pt]} }{\cellcolor{gray!25} \tiny{}} & \\
\specialrule{1pt}{0pt}{0pt}
\end{tabular}
\end{center}
\end{table}
\newpage
\clearpage
\makeatletter
\setlength{\@fptop}{0pt}
\makeatother
\begin{table}[th!]
\begin{center}
\begin{tabular}{!{\VRule[1pt]} l L{22.2cm} !{\VRule[1pt]} @{}m{0pt}@{} }
\specialrule{1pt}{0pt}{0pt}
\parbox[l]{2.6cm}{\large{}\textbf{TEXT: \\ ~} }& \large{}\parbox[l]{20.5cm}{Long text.} & \\[16pt]
\specialrule{1pt}{0pt}{0pt}
\end{tabular}
\begin{tabular}{!{\VRule[1pt]} C{2cm} !{\VRule[1pt]} L{11.8cm} !{\VRule[1pt]} L{10.5cm} !{\VRule[1pt]} @{}m{0pt}@{} }
\specialrule{1pt}{0pt}{0pt}
\multicolumn{3}{ !{\VRule[1pt]} c !{\VRule[1pt]} }{\cellcolor{gray!25} \textbf{\LARGE 1 - TEXT}} & \\ [20pt]
\specialrule{1pt}{0pt}{0pt}
\cellcolor{gray!25} ~ & \cellcolor{gray!25} \centering \large \textbf{sample}
& \parbox{10.3cm}{\cellcolor{gray!25} \centering \large \textbf{sample more} } & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx1 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx2 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx3 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx4 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
\multicolumn{3}{ !{\VRule[1pt]} c !{\VRule[1pt]} }{\cellcolor{gray!25} \tiny{}} & \\
\specialrule{1pt}{0pt}{0pt}
\end{tabular}
\end{center}
\end{table}
\newpage
\clearpage
\newgeometry{a4paper,hmargin={2.5cm,2.5cm},vmargin={1.5cm,2cm},includeheadfoot}
\paperwidth=\pdfpageheight
\paperheight=\pdfpagewidth
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
\fancyhfoffset[R]{0pt}
\section{Supporting Evidence}
\pagestyle{mydoc}
\subsection{Appendix 2}
\lipsum[1-5]
\clearpage
\subsection{Appendix 3}
\lipsum[1-5]
\end{appendices}
\end{document}
решение1
\newgeometry
не поддерживает такие опции, как a4paper
и landscape
(в журнале есть предупреждения об этом). Поэтому сначала \newgeometry
настройте портретную страницу, что сделало \textheight
much слишком высоким (и \textwidth
much слишком маленьким, что привело к overfull hbox
предупреждениям). Вы исправили это, установив его вручную, но это не учитывается для страницы, на которой он установлен. То есть ваш нижний колонтитул всегда был там, но намного ниже физической страницы.
Поэтому я придумал новую команду \newgeometryswitchlc
, которая переключает из портретной ориентации в альбомную или наоборот. Поскольку эта команда (как и оригинал) восстанавливает настройки из преамбулы, ее нельзя использовать для обратного переключения. Это делается с помощью обычного \newgeometry
, но вам придется вручную установить \pdfpageheight
и \pdfpagewidth
после этого, чтобы получить правильные размеры в просмотрщике PDF.
Кстати: я закомментировал некоторые пакеты, которые здесь не нужны (и которые у меня не установлены).
\documentclass{article}[12pt]
\usepackage{setspace}
\usepackage{lastpage}
\usepackage{rotating}
\usepackage{etoolbox}
\usepackage{lscape}
\usepackage{pdflscape}
%\usepackage{textcomp}
%\usepackage[titletoc]{appendix}
%\usepackage{longtable}
%\usepackage{easytable}
\usepackage{array}
%\usepackage{multirow}
\usepackage{amssymb}
\usepackage{fancyhdr}
%\usepackage{helvetica} % uses helvetica postscript font (download helvetica.sty)
\usepackage[includeheadfoot]{geometry}
\geometry{a4paper,hmargin={2cm,2cm},vmargin={2cm,2cm}}
\usepackage{caption}
\captionsetup{skip=0pt}
\usepackage[table]{xcolor}
\usepackage{booktabs,arydshln}
\usepackage{lipsum}
\newcommand\VRule[1][\arrayrulewidth]{\vrule width #1}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\fancypagestyle{mydoc}{%
\fancyhf{}
\fancyhead{}
\fancyfoot{}
\fancyfoot[C]{
\scriptsize
Page \thepage\ of \pageref{LastPage}
}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\fancypagestyle{lscape}{%
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyhf{}
\fancyhead{}
\fancyfoot{}
\fancyfoot[C]{
\scriptsize
Page \thepage\ of \pageref{LastPage}
}
\fancyfoot[L]{
\footnotesize
Created: 14 August 2002 \\
Modified: 20 December 2012 \\
}
}
\makeatletter
% like \newgeometry, but also switches between landscape and portait
\newcommand{\newgeometryswitchlc}[1]{%
\clearpage
\Gm@restore@org
\Gm@initnewgm
\Gm@newgmtrue
\setkeys{Gm}{#1}%
\Gm@newgmfalse
% switch between landscape and portait
\Gm@swap@papersizetrue
\Gm@process
% set the correct dimension for the PDF viewer
% must be done manually when switching back with \newgeometry
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
\ifnum\mag=\@m\else\Gm@magtooffset\fi
\Gm@changelayout
\Gm@showparams{newgeometry}}%
\makeatother
\begin{document}
\onehalfspacing
\title{
\vspace{48pt}
\textbf{Application \\ \vspace{48pt}
}
\vspace{96pt}
\large{Modality: \\}
\vspace{18pt}
\large{Submodality: \\}
\vspace{48pt}
}
\author{Name \\
\vspace{36pt}}
\maketitle
\thispagestyle{empty}
\newpage
\thispagestyle{mydoc}
\tableofcontents
\newpage
\clearpage
\pagestyle{mydoc}
\section{Section Title 1}
\lipsum[1-10]
\section{Section Title 2}
\lipsum[11-20]
\section{Appendices: Index and Supporting Evidence}
%\begin{appendices}
\appendix
% changed vmargin
\newgeometryswitchlc{hmargin={2cm,2cm},vmargin={0cm,1cm},includeheadfoot}
%\paperwidth=\pdfpageheight no longer necessary
%\paperheight=\pdfpagewidth
%\pdfpageheight=\paperheight done in \newgeometrylandscape
%\pdfpagewidth=\paperwidth
\fancyhfoffset[R]{8.75cm}
%\textheight=17.5cm to high, but
\makeatletter
\setlength{\@fptop}{0cm}
\makeatother
\pagestyle{lscape}
\setcounter{section}{1}
\addcontentsline{toc}{section}{\protect\numberline{\thesection}{Index}}
\begin{table}[h!]
\normalsize
\begin{center}
\begin{tabular}{!{\VRule[1pt]} m{2cm} | m{4.7cm} | m{3cm} | m{4.6cm} | m{2.5cm} | m{6.2cm} !{\VRule[1pt]} @{}m{0pt}@{} }
\specialrule{1pt}{0pt}{0pt}
\multicolumn{6}{ !{\VRule[1pt]} c !{\VRule[1pt]} }{\cellcolor{gray!25} \textbf{\Large TEST TEXT}} & \\ [6pt]
\specialrule{1pt}{0pt}{1pt} \specialrule{1pt}{1pt}{0pt}
\cellcolor{gray!25}\parbox{2cm}{\centering \textbf{TEXT:}} & &
\cellcolor{gray!25}\parbox{3cm}{\centering \textbf{TEXT:\\(if applicable)}} & &
\cellcolor{gray!25}\parbox{2.5cm}{\centering \textbf{TEXT \\ MORE:}} & & \\[22pt]
\specialrule{1pt}{0pt}{0pt}
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{!{\VRule[2pt]} m{251mm} !{\VRule[2pt]} @{}m{0pt}@{} }
\specialrule{2pt}{0pt}{0pt}
\vspace{2pt}
\parbox{251mm}{\centering{\LARGE{}\textbf{APPENDIX 1}}\\
\large{}\textbf{Long text \\ Long text \\ Long text. \\ \vspace{2pt}}} & \\
\specialrule{2pt}{0pt}{0pt}
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{!{\VRule[1pt]} l L{22.2cm} !{\VRule[1pt]} @{}m{0pt}@{} }
\specialrule{1pt}{0pt}{0pt}
\parbox[l]{2.6cm}{\large{}\textbf{TEXT: \\ ~} }& \large{}\parbox[l]{20.5cm}{Test TEXT.} & \\[16pt]
\specialrule{1pt}{0pt}{0pt}
\end{tabular}
\begin{tabular}{!{\VRule[1pt]} C{2cm} !{\VRule[1pt]} L{11.8cm} !{\VRule[1pt]} L{10.5cm} !{\VRule[1pt]} @{}m{0pt}@{} }
\specialrule{1pt}{0pt}{0pt}
\multicolumn{3}{ !{\VRule[1pt]} c !{\VRule[1pt]} }{\cellcolor{gray!25} \textbf{\LARGE 1 - TEXT}} & \\ [20pt]
\specialrule{1pt}{0pt}{0pt}
\cellcolor{gray!25} ~ & \cellcolor{gray!25} \centering \large \textbf{sample}
& \parbox{10.3cm}{\cellcolor{gray!25} \centering \large \textbf{sample more} } & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx1 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx2 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx3 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx4 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
\multicolumn{3}{ !{\VRule[1pt]} c !{\VRule[1pt]} }{\cellcolor{gray!25} \tiny{}} & \\
\specialrule{1pt}{0pt}{0pt}
\end{tabular}
\end{center}
\end{table}
\newpage
\clearpage
\makeatletter
\setlength{\@fptop}{0pt}
\makeatother
\begin{table}[th!]
\begin{center}
\begin{tabular}{!{\VRule[1pt]} l L{22.2cm} !{\VRule[1pt]} @{}m{0pt}@{} }
\specialrule{1pt}{0pt}{0pt}
\parbox[l]{2.6cm}{\large{}\textbf{TEXT: \\ ~} }& \large{}\parbox[l]{20.5cm}{Long text.} & \\[16pt]
\specialrule{1pt}{0pt}{0pt}
\end{tabular}
\begin{tabular}{!{\VRule[1pt]} C{2cm} !{\VRule[1pt]} L{11.8cm} !{\VRule[1pt]} L{10.5cm} !{\VRule[1pt]} @{}m{0pt}@{} }
\specialrule{1pt}{0pt}{0pt}
\multicolumn{3}{ !{\VRule[1pt]} c !{\VRule[1pt]} }{\cellcolor{gray!25} \textbf{\LARGE 1 - TEXT}} & \\ [20pt]
\specialrule{1pt}{0pt}{0pt}
\cellcolor{gray!25} ~ & \cellcolor{gray!25} \centering \large \textbf{sample}
& \parbox{10.3cm}{\cellcolor{gray!25} \centering \large \textbf{sample more} } & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx1 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx2 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx3 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
Tx4 & more & & \\ [16pt]
\specialrule{1pt}{0pt}{0pt}
\multicolumn{3}{ !{\VRule[1pt]} c !{\VRule[1pt]} }{\cellcolor{gray!25} \tiny{}} & \\
\specialrule{1pt}{0pt}{0pt}
\end{tabular}
\end{center}
\end{table}
\newpage
\clearpage
\newgeometry{hmargin={2.5cm,2.5cm},vmargin={1.5cm,2cm},includeheadfoot}
%\paperwidth=\pdfpageheight no longer necessary
%\paperheight=\pdfpagewidth
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
\fancyhfoffset[R]{0pt}
\section{Supporting Evidence}
\pagestyle{mydoc}
\subsection{Appendix 2}
\lipsum[1-5]
\clearpage
\subsection{Appendix 3}
\lipsum[1-5]
%\end{appendices}
\end{document}