TransWikia.com

Appendix header on top of a table and numbering

TeX - LaTeX Asked on November 18, 2021

I am trying to create an appendix to my document. I have two issues. First, the appendix should be labelled as follows:
"Appendix A", followed by "Appendix B", etc. No extra naming. I tried to use appendix and chapters, but that always numbered the appendixes. For example "Appendix A" is shown as "1 Appendix A" instead. Is it possible to have only "Appendix", followed by a letter, in scrreprt? Using section* does not work as then it will not be listed in the TOC.

I am also trying to put the start of the appendix on top of a table. I found some code recommended in another post but I cannot get it to work. Any help appreciated.

documentclass{scrreprt}
usepackage{caption}
usepackage{babel}
usepackage{booktabs,rotating}  
usepackage{geometry}

begin{document}
    
    tableofcontents
    
    chapter{Intro}
    
    Some text...
    
    chapter{Main}
    
    chapter{Conclusion}
    
    section*{Appendix A}
    
    section*{Appendix B}
    
    renewcommand{thetable}{Alph{section}arabic{table}}
    renewcommand{thesubsection}{Alph{subsection}}
    setcounter{table}{0}
    setcounter{section}{1}
    
    begingroup
    newgeometry{bottom=0.1cm, top=0.1cm}
    vfill
    begin{table}
    
    begin{sideways}    
    begin{minipage}{textheight} % here
        caption{A simple table}
        begin{tabular}{p{5cm}p{5cm}p{5cm}p{5cm}}
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
            10000000000 & 10000000000 & 10000000000 & 10000000000 \
        end{tabular}
        end{minipage} % and here
    end{sideways}
    end{table}
    vfill
    restoregeometry
    endgroup

end{document}

One Answer

You can borrow the main idea from how to change the section title and its arrangement and use this in your preamble:

usepackage{titlesec}
titleformat{section}{normalfontLargebfseries}{Appendix~thesubsection}{1em}{}

You might also like to switch between listing your section{} as Appendix ... on the TOC or including it manually using

addcontentsline{toc}{section}{Unnumbered Appendix}
section*{Unnumbered Appendix}

Important! Labeling sections in a new way works only if

renewcommand{thetable}{Alph{section}arabic{table}}
renewcommand{thesubsection}{Alph{section}}
setcounter{table}{0}
setcounter{section}{1}

is inserted before use of section.

In order to replace Table 1 with Appendix B you need to change both tablename and thetable like this:

renewcommand{thetable}{Alph{section}arabic{table}}
%renewcommand{thetable}{Alph{section}} %if you need a chapter index only
renewcommand{tablename}{Appendix}

Answered by Simonas Mamaitis on November 18, 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