TransWikia.com

Appendix Section Title without A in Front but Appendix Subsection Titles with A in Front

TeX - LaTeX Asked on June 14, 2021

I would like to have the appendix section title without an A in front but subsection title starting with an A (e.g. A1, A2, …) and also appendix table or figure titles starting with an A. Here is the code I am using. With this code I get an A in front of the Appendix section but if I use section*{Appendix} I don’t get A in front of the subsections.

begin{document}

documentclass[12pt,letter,notitlepage]{article}
DeclareCaptionLabelFormat{AppendixTables}{Table A.#2} 

appendix

section{Appendix}

captionsetup{labelformat=AppendixTables}
setcounter{table}{0}

subsection{Subsection 1}
subsection{Subsection 2}

end{document}

2 Answers

It would have helped if your MWE compiled without errors.

However, try this:

% appendixprob.tex  SE 579384

documentclass[12pt,notitlepage]{article}
%DeclareCaptionLabelFormat{AppendixTables}{Table A.#2} %% causes an error
usepackage{appendix} %% could be useful but not necessary

begin{document}

section{A section}

appendix
%begin{appendices}
renewcommand{thesection}{arabic{section}}
renewcommand{thesection}{hspace{0.5em}} % no number but align with section titles
renewcommand{thesubsection}{Alph{section}.arabic{subsection}}
section{Appendix}

%captionsetup{labelformat=AppendixTables} %% causes an error
setcounter{table}{0}

subsection{Subsection 1}
subsection{Subsection 2}
%end{appendices}

end{document}

It does what you want regarding the numbering of section{Appendix} but I have no idea if the positioning is what you want. It is up to you to deal with the numbering of floats.

enter image description here

Answered by Peter Wilson on June 14, 2021

Add manually the appendix.

documentclass[12pt,letterpaper]{article}

counterwithin{table}{section}

newcommand{singleappendix}[1]{%
  appendix
  section*{#1}
  addcontentsline{toc}{section}{#1}
  stepcounter{section}
}

begin{document}

tableofcontents

section{Introduction}

begin{table}[htp]
caption{This is a table caption}
end{table}

singleappendix{Appendix}

subsection{Subsection 1}
subsection{Subsection 2}

begin{table}[htp]
caption{This is a table caption}
end{table}

end{document}

enter image description here

Answered by egreg on June 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP