2

I need to change the appearance of sections/subsections in an article in the appendix so that the numbering is preserved, but that the display is not the usual

1 Ghosts are real

1.1 Ghosts are criminals

but rather

Section 1 Ghosts are real

Article 1.1 Ghosts are criminals

I don't mind manually numbering if that's easier (I'm not an expert with LaTeX, so whatever is easier is preferable), but of course if I can do this with automatic numbering, it's less room for error which is a big pro.

It's a tough thing to google so your input is appreciated!

Mark
  • 21

2 Answers2

2

You can change the appearance of \section and \subsection after \appendix.

\documentclass{article}

\usepackage{titlesec}

\begin{document}

\section{Ghosts are real}

\subsection{Ghosts are criminal}

\appendix
\titleformat{\section}
 {\Large\bfseries}
 {Section \thesection}
 {1em}
 {}
\titleformat{\subsection}
 {\large\bfseries}
 {Article \thesubsection}
 {1em}
 {}
\renewcommand{\thesection}{\arabic{section}}

\section{Ghosts are real}

\subsection{Ghosts are criminal}

\end{document}

enter image description here

Without packages:

\documentclass{article}

\makeatletter
\renewcommand{\@seccntformat}[1]{%
  \ifcsname format#1\endcsname\csname format#1\endcsname\fi
  \csname the#1\endcsname\quad
}
\makeatother

\begin{document}

\section{Ghosts are real}

\subsection{Ghosts are criminal}

\appendix
\newcommand{\formatsection}{Section }
\newcommand{\formatsubsection}{Article }
\renewcommand{\thesection}{\arabic{section}}

\section{Ghosts are real}

\subsection{Ghosts are criminal}

\end{document}
egreg
  • 1,121,712
1

As you didn't provide any MWE, I assumed that you are using standard class files, and the MWE is

\documentclass{book}

\usepackage[explicit]{titlesec}

\begin{document}
\makeatletter
\titleformat{\section}[display]{\normalfont\huge\bfseries}{Section \thesection}{20pt}{\huge}
\titleformat{\subsection}[display]{\normalfont\large\bfseries}{Article \thesubsection}{20pt}{\large}
\makeatother

\section{Ghosts are real}

\subsection{Ghosts are criminals}

\end{document}
MadyYuvi
  • 13,693
  • Thanks a lot for this advice and excuses for the lack of MWE! you're correct, it's standard class files as you suggest. The trouble is, that this is in the Appendix, so it appears as "Article 1.1 E.1". Is there any way around this? – Mark Jan 24 '20 at 13:47