2

I am new to LaTex and I was told to ask only one question at a time, so please have patience with me. If you see similar postings, remember each has a different question.
In the appendix page footer, how do I make it number subsequent appendices as B, C, D etc.? Here is the functioning file:

\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}
3
  • 1
    Replace A with \thechapter. Aug 4 '18 at 12:57
  • Hello John, I do not understand you suggestion. When I replace A with \thechapter, LaTex returns several error messages labeled: "undefined control sequence"
    – Joe M.
    Aug 6 '18 at 15:31
  • Oops, no chapter in article class. Also, \section* does not increment \thesection. Will work on it. Aug 6 '18 at 15:50
1

If you want your appendices to show up in the table of contents, you need to use \section instead of \section*.

Also, I tried to use \counterwithin{page}{section}, but while most counters start at 0, page starts at 1, and I assume page A-0 is not desired.

BTW, using pdflscape instead of rotating or sidewaysfigure causes landscape pages to appear right side up (except for the footer and header).

\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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.