1

The following section, appendix and references

\section{Conclusion}
something

\appendix
\section{Appendix: My Title}
my appendix


\bibliographystyle{plain}
\bibliography{bibs}

have a layout like this

enter image description here

I guess the Appendix format is not correct. Moreover, I want to put a table in the appendix. It should be

Appendix A
Table 4. Shows the detailed information about results.

\begin{table} [b]
\centering  
\caption{Details}
\label{sys-spec}
\begin{tabular}{ |p{1.4cm}|p{6.2cm}| }
    \hline
       A  &   B
    \hline
       C  &   D
    \hline
\end{tabular}
\end{table}
  • 1
    as always, please post full minimal examples that others can copy and test as is, not sniplets like this where we have to add stuff to even compile the sniplets. I don't even know what you mean by »I guess the Appendix format is not correct.« – daleif Aug 14 at 15:57
1

Here is a way based on the answer of redefining the section here:

\documentclass[margins=0.5cm]{article}
\usepackage{filecontents}
\begin{filecontents*}{bibs.bib}
@article{test,
  title={An article},
  year=2019,
  author={Me Only},
  journal={A journal}
}

@article{testB,
  title={An other article},
  year=2018,
  author={Me Again},
  journal={Another journal}
}
\end{filecontents*}
\makeatletter
\newcounter{mysection}
\renewcommand\themysection{\Alph{mysection}}
\let\oldsection\section

\def\appendix{%
\let\thesection\themysection
\def\section{%
\@ifstar{\@Starred}{\@nonStarred}%
}
\def\@Starred{%
\@ifnextchar[%
{\GenericWarning{}{Warning: A starred section can not have parameters. I am going to ignore them!}\@StarredWith}%
{\@StarredWithout}%
}     
\def\@StarredWith[##1]##2{%
\oldsection*[##1]{##2}%
}
\def\@StarredWithout##1{
\oldsection*{##1}%
}
\def\@nonStarred{%
\@ifnextchar[%
{\@nonStarredWith}%
{\@nonStarredWithout}%
}
\def\@nonStarredWith[##1]##2{%
\refstepcounter{mysection}%
\oldsection*[Appendix\space\themysection: ##1]{Appendix\space\themysection:\protect\\##2}%
\addcontentsline{toc}{section}{Appendix\space\themysection: ##1}
}
\def\@nonStarredWithout##1{%
\refstepcounter{mysection}
\oldsection*{Appendix\space\themysection:\protect\\##1}%
\addcontentsline{toc}{section}{Appendix\space\themysection: ##1}
}
}
\makeatother

\author{Someone}
\title{Some title}

\begin{document}

%\maketitle

\tableofcontents


\section{Conclusion}

something

\appendix

\section{My Title}
my Appendix \thesection{}, starts the appendix\ldots

\section*{A starred section}
with some content

\section{Another section}
my Appendix \thesection{} is about\ldots 

\subsection{A subsection}

with some text

\nocite{*}
\bibliographystyle{plain}
\bibliography{bibs}
\end{document}

Output:

enter image description here

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.