TransWikia.com

How can I make my SI (Supplementary Information) with numbers (currently: using the appendix package)?

TeX - LaTeX Asked on July 16, 2021

I want to have my "appendix" to be a supplementary information – but instead of just renaming it renewcommand{appendixname}{Supplementary Information} I also want it to be numbered:

Supplementary Information 1 (section)

Supplementary Information 2 (section)

Supplementary Information 2.1 (subsection)

Supplementary Information 2.2 (subsection)

I thought this numbering where easy, just: renewcommand{thesection}{arabic{section}} but as you can see, this did not do the trick.

I am very limited, because I need to use this weird format/documentclass, see below:

[![documentclass[preprint,12pt,authoryear]{elsarticle}

usepackage{amssymb}
usepackage{booktabs}
usepackage{subcaption}
usepackage{graphicx}

usepackage{tocbibind} %for appendix/SI numbering
usepackage[toc,page]{appendix} %for appendix/SI numbering

usepackage{setspace}

usepackage{afterpage}

usepackage{rotating}
usepackage{booktabs}
usepackage{hyperref}
usepackage{tabularx}
usepackage{threeparttable}
usepackage{amssymb}
usepackage{amsmath}
usepackage{tabu}
usepackage{siunitx}


defCOMP#1{begin{tabular}{c}#1end{tabular}}

usepackage{bm}
usepackage{mathtools}
newcommand{myMatrix}[1]{bm{mathit{#1}}}

doublespacing

journal{x}

begin{document}

begin{frontmatter}

title{A title}
author{Me}

begin{keyword}
A keyword
end{keyword}

end{frontmatter}




section{Introduction label{sec:intro}}

Please find some text here. Find more of my ideas in~ref{sec:si1}.


section{Conclusion label{sec:concl}}
Main text is over.
renewcommand{appendixname}{Supplementary Information}

renewcommand{thesection}{arabic{section}}


appendix

%section*{Supplementary Information}
renewcommand{thefigure}{SI~arabic{figure}}
setcounter{figure}{0}
renewcommand{thetable}{SI~arabic{table}}
setcounter{table}{0}

section{The first thing in SI
 label{sec:si1}}
word
section{The second thing in SI}
another word
subsection{The first sub-thing in SI}
bla bla
subsection{The second sub-thing in SI}
bla bla 2


end{document}][1]][1]
 

this is the current outcome in picture

One Answer

You have to make the numbering change after, not before, the appendix command. Below is a modified version of your MWE where I have changed all your [ and ] to the regular [ and ] so that it will compile using pdflatex.

% appsiprob.tex  SE 575134

documentclass[preprint,12pt,authoryear]{elsarticle}

usepackage{amssymb}
usepackage{booktabs}
usepackage{subcaption}
usepackage{graphicx}

usepackage{tocbibind} %for appendix/SI numbering
usepackage[toc,page]{appendix} %for appendix/SI numbering

usepackage{setspace}

usepackage{afterpage}

usepackage{rotating}
usepackage{booktabs}
usepackage{hyperref}
usepackage{tabularx}
usepackage{threeparttable}
usepackage{amssymb}
usepackage{amsmath}
usepackage{tabu}
usepackage{siunitx}


defCOMP#1{begin{tabular}{c}#1end{tabular}}

usepackage{bm}
usepackage{mathtools}
newcommand{myMatrix}[1]{bm{mathit{#1}}}

doublespacing

journal{x}

begin{document}

begin{frontmatter}

title{A title}
author{Me}

begin{keyword}
A keyword
end{keyword}

%tableofcontents
end{frontmatter}

section{Introduction label{sec:intro}}

Please find some text here. Find more of my ideas in~ref{sec:si1}.

section{Conclusion label{sec:concl}}
Main text is over.
renewcommand{appendixname}{Supplementary Information}

%renewcommand{thesection}{arabic{section}}   %%%% not here
appendix
renewcommand{thesection}{Supplementary Information arabic{section}}    %%%% but here

%section*{Supplementary Information}
renewcommand{thefigure}{SI~arabic{figure}}
setcounter{figure}{0}
renewcommand{thetable}{SI~arabic{table}}
setcounter{table}{0}

section{The first thing in SI
 label{sec:si1}}
word
section{The second thing in SI}
another word
subsection{The first sub-thing in SI}
bla bla
subsection{The second sub-thing in SI}
bla bla 2

end{document}][1]][1]

I didn't change the weird stuff after your end{document} as that would be ignored by pdflatex.

enter image description here

Correct answer by Peter Wilson on July 16, 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