• Re: LaTeX problem

    From Athel Cornish-Bowden@21:1/5 to All on Sun Apr 6 20:04:12 2025
    On 2025-04-06 12:46:03 +0000, db said:

    I have a LaTeX file intended as a submission to an Elsevier
    journal, that compiles with a spurious error. A mini-example
    is at www.dieterbritz.dk/err.zip.

    404
    Not Found
    The resource requested could not be found on this server!

    It calls on the file
    elsarticle.cls, included. When I compile it with pdflatex,
    I get the apparent error

    ! Missing } inserted.
    <inserted text>
    }
    l.32 \end{frontmatter}

    ?

    but when I persist, it compiles correctly. So this is
    not an error. I can't submit the paper because the journal
    will reject it as having an error, so I must fix this.
    What is wrong here?


    --
    Athel -- French and British, living in Marseilles for 38 years; mainly
    in England until 1987.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marckus@21:1/5 to All on Sun Apr 6 21:12:24 2025
    Am 06.04.2025 um 14:46 schrieb db:
    I have a LaTeX file intended as a submission to an Elsevier
    journal, that compiles with a spurious error. A mini-example
    is at www.dieterbritz.dk/err.zip. It calls on the file
    elsarticle.cls, included. When I compile it with pdflatex,
    I get the apparent error

    ! Missing } inserted.
    <inserted text>
    }
    l.32 \end{frontmatter}

    ?

    but when I persist, it compiles correctly. So this is
    not an error. I can't submit the paper because the journal
    will reject it as having an error, so I must fix this.
    What is wrong here?

    Obviously a missing } was inserted. Check the file for an equal number
    of { and }.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich D i e z@21:1/5 to All on Mon Apr 7 09:30:26 2025
    db schrieb:

    I have a LaTeX file intended as a submission to an Elsevier
    journal, that compiles with a spurious error. A mini-example
    is at www.dieterbritz.dk/err.zip. It calls on the file
    elsarticle.cls, included. When I compile it with pdflatex,
    I get the apparent error

    ! Missing } inserted.
    <inserted text>
    }
    l.32 \end{frontmatter}

    ?

    but when I persist, it compiles correctly. So this is
    not an error. I can't submit the paper because the journal
    will reject it as having an error, so I must fix this.
    What is wrong here?

    mini.tex has:

    \abstract{...}


    But with elsarticle.cls abstract is to be used as an environment:

    \begin{abstract}...\end{abstract}


    According to elsarticle.cls the environment "abstract" is defined as:

    \newbox\absbox
    \let\@elsarticleabstitle\@empty %*%
    \def\abstracttitle#1{\gdef\@elsarticleabstitle{#1}} %*%
    \abstracttitle{Abstract} %*%
    \renewenvironment{abstract}{\global\setbox\absbox=\vbox\bgroup
    \hsize=\textwidth\def\baselinestretch{1}%
    \noindent\unskip\textbf{\@elsarticleabstitle} %*%
    \par\medskip\noindent\unskip\ignorespaces}
    {\egroup}

    When using the command \abstract directly, which underlies the
    encironment "abstract", instead of the environment, this gets you

    \global\setbox\absbox=\vbox\bgroup %%<- this \bgroup starts the
    %% content of the \vbox
    \hsize=\textwidth\def\baselinestretch{1}%
    \noindent\unskip\textbf{\@elsarticleabstitle} %*%
    \par\medskip\noindent\unskip\ignorespaces
    {...} %% <- This is a brace-balanced group
    %% An \egroup or closing brace ending the content of the \vbox is
    %% missing.

    , where the closing-brace or the \egroup-token denoting the end of the
    content of the \vbox is missing.

    Altenatively, instead of using "abstract" as an environment, you can do

    \abstract{...}\egroup

    or

    \abstract{...}}%

    , but those are not good practise.


    Ulrich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich D i e z@21:1/5 to All on Tue Apr 8 05:50:40 2025
    I wrote:

    db wrote:

    But now there is a new problem. The title appears on both
    pp. 1 and 2, the first without, the second with that Abstract.
    What do I do now?

    In mini.tex you have both \maketitle and \begin{frontmatter}...\end{frontmatter}
    while in elsarticle.cls the frontmatter-environment is defined as \newenvironment{frontmatter}{}{\maketitle}.

    Thus you have \maketitle twice and get two title pages.

    Probably commenting out \maketitle and keeping the
    frontmatter-environment does the trick.

    \documentclass[article,12pt,sort&compress]{elsarticle}
    % Use those packages that you need, by uncommenting. \usepackage[text={16cm,25cm},centering]{geometry} \usepackage{amsmath,amssymb,amsfonts}%
    \usepackage{amsthm}%
    \usepackage{mathrsfs}%
    \usepackage{xcolor}%
    \usepackage{color,soul}%
    \usepackage{textcomp}%
    \usepackage{manyfoot}%
    \usepackage{booktabs}%
    \usepackage{lineno}%
    \renewcommand{\baselinestretch}{1.5}
    \newcommand{\del}{\ensuremath{\partial}}

    \begin{document}
    \begin{frontmatter}
    \title{Test}
    \author{}
    %% The command "\end{frontmatter}" does \maketitle for you, thus
    %% turn "\maketitle" into a comment here as otherwise you get
    %% two pages with title:
    %\maketitle
    \journal{International journal of electrochemical science}
    \biboptions{comma,square}
    \begin{abstract}...\end{abstract}
    \begin{keyword}bla bla\end{keyword}
    \end{frontmatter}

    Some text

    \end{document}



    Ulrich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich D i e z@21:1/5 to All on Tue Apr 8 05:41:38 2025
    db wrote:

    But now there is a new problem. The title appears on both
    pp. 1 and 2, the first without, the second with that Abstract.
    What do I do now?

    In mini.tex you have both \maketitle and \begin{frontmatter}...\end{frontmatter}
    while in elsarticle.cls the frontmatter-environment is defined as \newenvironment{frontmatter}{}{\maketitle}.

    Thus you have \maketitle twice and get two title pages.

    Probably commenting out \maketitle and keeping the
    frontmatter-environment does the trick.

    Ulrich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)