我是 LaTex 新手,我被告知一次只能问一个问题,所以请耐心等待。如果您看到类似的帖子,请记住每个帖子都有不同的问题。
在附录页脚中,我如何让其将后续附录编号为 B、C、D 等?这是功能文件:
\documentclass[pdftex]{article}
\title{ENVE Template}
%PACKAGES
\usepackage{helvet}
\usepackage{blindtext}
\usepackage{parskip}
\usepackage{longtable}
\setlength\LTleft{0pt}
\setlength\LTright{0pt}
\usepackage{color,soul}
\usepackage{colortbl}
\usepackage{framed}
\usepackage[table[usenames,dvipsnames,svgnames]{xcolor}
\usepackage{fancyhdr}
\usepackage{tabularx}
\usepackage{xpatch}
\usepackage[utf8]{inputenc}
\usepackage{sectsty}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage{pdflscape}
%COMMANDS
\newcommand{\version}{4.0} %%%%%%UPDATE VERSION NUMBER HERE
\renewcommand{\familydefault}{\sfdefault}
\renewcommand*{\contentsname}{Table of Contents}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\DeclareRobustCommand{\hlgreen}[1]{{\sethlcolor{enve-green}\hl{#1}}}
\DeclareRobustCommand{\hlgray}[1]{{\sethlcolor{gray}\hl{#1}}}
\newcommand\textbox[1]{%
\parbox{0.33/textwidth}{#1}%
}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
%
\definecolor{enve-green}{RGB}{123,135,56}
\definecolor{gray}{RGB}{83,86,90}
\setlength{\parindent}{0cm}
\sectionfont{\color{enve-green}}
%MARGINS
\usepackage[top=1in, bottom=1.5in, left=1in, right=1in]{geometry}
\setlength{\headheight}{40pt}
%HEADER & FOOTER
\renewcommand\tabularxcolumn[1]{m{#1}}% for vertical centering text in X column
\newcolumntype{Y}{>{\flushright\arraybackslash}X}
\newcolumntype{Z}{>{\centering\arraybackslash}c}
\newcolumntype{W}{>{\flushleft\arraybackslash}X} % my attempt to align tabularx environment
\fancypagestyle{firstpagestyle}{%HEADER/FOOTER FOR COVER PAGE ONLY
\chead{\small JOE'S TEST FILE}
\cfoot{\small JOE'S TEST FILE}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\pagestyle{fancy} %HEADER/FOOTER FOR REST OF DOC
\renewcommand{\headrulewidth}{0pt}
\fancyhead{}
\chead{
\renewcommand{\arraystretch}{1.5}
\begin{tabular}[c]{|c|c|c|}
\hline
{\cellcolor{gray}\small\color{white}\textbf{JOES'S TEST FILE}} & {\small\textbf{JOE'S TEST FILE}} & {\cellcolor{enve-green}\small\color{white}\textbf{SHORT TITLE}} \\
\hline
\end{tabular}}
%%% TO BE REPLACED BY IMAGE OF LOGO
\fancyfoot[C]{\small JOE'S TEST FILE
\\ \thepage}
\fancypagestyle{plain}
%LEFTBAR SPECIFICATIONS
\renewenvironment{leftbar}[2][\hsize]
{
\def\FrameCommand
{
{\color{enve-green}\vrule width 3pt}
\hspace{0pt}
}
\MakeFramed{\hsize#1\advance\hsize-\width\FrameRestore}
}
{\endMakeFramed}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VERSION HISTORY
\pagenumbering{roman}
\setcounter{page}{1}
\center\section*{Version History}\label{history}
\centering
\begin{tabular}{|l|l|l|}
\hline
\multicolumn{1}{|c|}{\cellcolor{enve-green}\color{white}\textbf{Date}} &
\multicolumn{1}{c|}{\cellcolor{enve-green}\color{white}\textbf{Version}} &
\multicolumn{1}{c|}{\cellcolor{enve-green}\color{white}\textbf {Affected Sections}} \\ \hline
M/D/YYYY & 1.0 & All Sections \\ \hline
\end{tabular}
\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TABLE OF CONTENTS
\begingroup
\makeatletter
\let\ps@fancy\ps@empty
\tableofcontents\label{toc}
\listoffigures
\listoftables
\clearpage
\endgroup
\pagestyle{fancy} %HEADER/FOOTER FOR REST OF DOC
\renewcommand{\headrulewidth}{0pt}
\chead{
\renewcommand{\arraystretch}{1.5}
\begin{tabular}[c]{|c|c|c|}
\hline
{\cellcolor{gray}\small\color{white}\textbf{TEST FILE}} & {\small\textbf{JOE'S TEST FILE}} & {\cellcolor{enve-green}\small\color{white}\textbf{SHORT TITLE}} \\
\hline
\end{tabular}}
\clearpage
\appendix
\setcounter{page}{1}
\renewcommand{\thepage}{A-\arabic{page}}
\section*{Appendix}\label{appendix}
\clearpage
\begin{landscape}
\begin{sidewaysfigure}
\appendix
\setcounter{page}{1}
\renewcommand{\thepage}{B-\arabic{page}}
\section*{This Should be In Portrait}
\subsection{First Subsection}
Test text
\end{sidewaysfigure}
\end{landscape}
\end{document}
答案1
如果您希望附录显示在目录中,则需要使用\section
而不是\section*
。
另外,我尝试使用\counterwithin{page}{section}
,但大多数计数器从 0 开始,而页面从 1 开始,而我认为页面A-0
不是所需的。
顺便说一句,使用 pdflscape反而旋转或侧向显示会导致横向页面正面朝上(页脚和页眉除外)。
\documentclass[pdftex]{article}
\title{ENVE Template}
%PACKAGES
\usepackage{helvet}
\usepackage{blindtext}
\usepackage{parskip}
\usepackage{longtable}
\setlength\LTleft{0pt}
\setlength\LTright{0pt}
\usepackage{color,soul}
\usepackage{colortbl}
\usepackage{framed}
\usepackage[table[usenames,dvipsnames,svgnames]{xcolor}
\usepackage{fancyhdr}
\usepackage{tabularx}
\usepackage{xpatch}
\usepackage[utf8]{inputenc}
\usepackage{sectsty}
\usepackage{graphicx}
\usepackage{pdflscape}
%COMMANDS
\newcommand{\version}{4.0} %%%%%%UPDATE VERSION NUMBER HERE
\renewcommand{\familydefault}{\sfdefault}
\renewcommand*{\contentsname}{Table of Contents}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\DeclareRobustCommand{\hlgreen}[1]{{\sethlcolor{enve-green}\hl{#1}}}
\DeclareRobustCommand{\hlgray}[1]{{\sethlcolor{gray}\hl{#1}}}
\newcommand\textbox[1]{%
\parbox{0.33/textwidth}{#1}%
}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
%
\definecolor{enve-green}{RGB}{123,135,56}
\definecolor{gray}{RGB}{83,86,90}
\setlength{\parindent}{0cm}
\sectionfont{\color{enve-green}}
%MARGINS
\usepackage[top=1in, bottom=1.5in, left=1in, right=1in]{geometry}
\setlength{\headheight}{40pt}
%HEADER & FOOTER
\renewcommand\tabularxcolumn[1]{m{#1}}% for vertical centering text in X column
\newcolumntype{Y}{>{\flushright\arraybackslash}X}
\newcolumntype{Z}{>{\centering\arraybackslash}c}
\newcolumntype{W}{>{\flushleft\arraybackslash}X} % my attempt to align tabularx environment
\fancypagestyle{firstpagestyle}{%HEADER/FOOTER FOR COVER PAGE ONLY
\chead{\small JOE'S TEST FILE}
\cfoot{\small JOE'S TEST FILE}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\pagestyle{fancy} %HEADER/FOOTER FOR REST OF DOC
\renewcommand{\headrulewidth}{0pt}
\fancyhead{}
\chead{
\renewcommand{\arraystretch}{1.5}
\begin{tabular}[c]{|c|c|c|}
\hline
{\cellcolor{gray}\small\color{white}\textbf{JOES'S TEST FILE}} & {\small\textbf{JOE'S TEST FILE}} & {\cellcolor{enve-green}\small\color{white}\textbf{SHORT TITLE}} \\
\hline
\end{tabular}}
%%% TO BE REPLACED BY IMAGE OF LOGO
\fancyfoot[C]{\small JOE'S TEST FILE
\\ \thepage}
\fancypagestyle{plain}
%LEFTBAR SPECIFICATIONS
\renewenvironment{leftbar}[2][\hsize]
{
\def\FrameCommand
{
{\color{enve-green}\vrule width 3pt}
\hspace{0pt}
}
\MakeFramed{\hsize#1\advance\hsize-\width\FrameRestore}
}
{\endMakeFramed}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VERSION HISTORY
\pagenumbering{roman}
\setcounter{page}{1}
\center\section*{Version History}\label{history}
\centering
\begin{tabular}{|l|l|l|}
\hline
\multicolumn{1}{|c|}{\cellcolor{enve-green}\color{white}\textbf{Date}} &
\multicolumn{1}{c|}{\cellcolor{enve-green}\color{white}\textbf{Version}} &
\multicolumn{1}{c|}{\cellcolor{enve-green}\color{white}\textbf {Affected Sections}} \\ \hline
M/D/YYYY & 1.0 & All Sections \\ \hline
\end{tabular}
\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TABLE OF CONTENTS
\begingroup
\makeatletter
\let\ps@fancy\ps@empty
\tableofcontents\label{toc}
\listoffigures
\listoftables
\clearpage
\endgroup
\pagestyle{fancy} %HEADER/FOOTER FOR REST OF DOC
\renewcommand{\headrulewidth}{0pt}
\chead{
\renewcommand{\arraystretch}{1.5}
\begin{tabular}[c]{|c|c|c|}
\hline
{\cellcolor{gray}\small\color{white}\textbf{TEST FILE}} & {\small\textbf{JOE'S TEST FILE}} & {\cellcolor{enve-green}\small\color{white}\textbf{SHORT TITLE}} \\
\hline
\end{tabular}}
\clearpage
\appendix
\renewcommand{\thepage}{\thesection-\arabic{page}}
\section{Appendix}\label{appendix}
\setcounter{page}{1}
%\clearpage% redundant
\begin{landscape}
\section{This Should be In Portrait}
\setcounter{page}{1}
\subsection{First Subsection}
Test text
\end{landscape}
\end{document}