5

I am working on a document that has an appendix. I would like it to have the heading: "Appendix A. Tasks for Progressive Formulation"

This is the code I am using

 \appendix

 \newpage

 \section{Tasks for Progressive Formulation}

The result I get is missing the space between the word Appendix and the letter A. It shows like this:

AppendixA. Tasks for Progressive Formulation

How can I force a white space between Appendix and the letter?

Edit: more code

\documentclass{elsarticle}

\usepackage[english]{babel} 
\usepackage{booktabs} 
\usepackage[autostyle, english = american]{csquotes} 
\usepackage{float} 
\restylefloat{figure} 
\usepackage[margin=3cm]{geometry} 
\usepackage{graphicx} 
\usepackage{lineno} 
\usepackage{multirow} 
\usepackage{natbib} 
\usepackage{tabulary} 


\begin{document}

\appendix
\newpage
\section{Tasks for Progressive Formulation}
\end{document}
6

It's a wrong choice by elsarticle.cls that has

\def\appendixname{Appendix }

with a space, whereas babel correctly does

\renewcommand{\appendixname}{Appendix}

with no space. You can reinstate the behavior expected by elsarticle doing

\addto\captionsenglish{\renewcommand{\appendixname}{Appendix }}

Here's a minimal example (the other packages you load have nothing to do with the issue) But, really, elsarticle should do di \documentclass{elsarticle}

\usepackage[english]{babel}
\addto\captionsenglish{\renewcommand{\appendixname}{Appendix }}

\begin{document}

\appendix
\section{Tasks for Progressive Formulation}
\end{document}

But, really, elsarticle should do differently: the code from line 748 to line 758 in elsarticle.cls should be

\renewcommand\appendix{\par
  \setcounter{section}{0}%
  \setcounter{subsection}{0}%
  \setcounter{equation}{0}
  \gdef\thefigure{\@Alph\c@section.\arabic{figure}}%
  \gdef\thetable{\@Alph\c@section.\arabic{table}}%
  \gdef\thesection{\appendixname\space\@Alph\c@section}%
  \@addtoreset{equation}{section}%
  \gdef\theequation{\@Alph\c@section.\arabic{equation}}%
}

without a redefinition of \appendixname and adding the space in the redefinition of \thesection. A fixed tag should be just a tag, with no “formatting instructions” that belong elsewhere.

2

Please try the following MWE (I reduced your code a little bit to make it minimal):

\documentclass{elsarticle}

\usepackage[english]{babel} 
\usepackage[margin=3cm]{geometry} 

\usepackage{blindtext}  % dummy text


\begin{document}
\blindtext % dummy text
\appendix
\renewcommand*{\thesection}{\appendixname~\Alph{section}}
\section{Tasks for Progressive Formulation}
\blindtext
\subsection{Test}
\blindtext
\end{document}

The point for you is the line \renewcommand*{\thesection}{\appendixname~\Alph{section}}. here I redefine the error in your used document class. \appendixname gives "Appendix" and \Alph{section} contains the numbering (A) and the heading. \thesection is the macro that writes the wrong line and is redefined with \renewcommand.

Result:

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.