3

In earlier versions (verified with v9.1) of the Astronomy & Astrophysics template, it was possible to remove the line numbers by

\documentclass[desactivate]{aa}.

However, in the current version (9.3) this does not compile. How do I fix this.

A current version of the template with a some content can be found on overleaf.

A MWE is here:

\documentclass{aa}  
\usepackage{lipsum}
\begin{document}
   \title{Astronomy \& Astrophysics \LaTeX\ template}
   \author{M. Example\inst{1}}
   \institute{nowhere}
   \abstract{no context}{aimless}{stupid method}{without results}{or conclusions}
   \maketitle
   \lipsum[1]
\end{document}

Note that line numbers are only printed if \maketitle is present.

5
  • 1
    Please add a short, but compilable test file which allows us to reproduce the problem. It should include a class, the necessary packages and a document environment. Commented 2 days ago
  • With \documentclass{aa} \begin{document} test \end{document} I do not get any line numbers. Which numbers do you want to remove? Commented 2 days ago
  • @samcarter-is-at-topanswers-xyz The current version only prints line numbers every 10 lines, so you need to write 10 lines of text to see them. Commented 2 days ago
  • Even with a whole document, I don't get line numbers: \documentclass{aa} \usepackage{duckuments} \begin{document} \duckument \end{document} Commented 2 days ago
  • @samcarter-is-at-topanswers-xyz line numbers are only printed if \maketitle is present, see MWE included above. Commented 2 days ago

3 Answers 3

3

The desactivate option is passed to linenoaa and causes \endinput so that lineno isn't loaded.

However, the class later calls a few commands from lineno.

By the way, the example file loads subcaption, forgetting that caption isn't compatible with the aa class:

Package caption Warning: Unknown document class (or package),
(caption)                standard defaults will be used.
See the caption package documentation for explanation.

Using subcaption will change the captions from

Wanted caption

to

Not wanted caption

There's a hilarious Cephe{\"{\i}}d in the example file that could (and should) be either Cephe\"id or Cepheïd.

But this isn't your problem. Likely, the people at A&A will massage the submitted file to remove the line numbers in the final version. What can you do?

Simple:

\providecommand{\columnwiselinenumbersfalse}{}
\providecommand{\runningpagewiselinenumbers}{}
\providecommand{\linenumbers}{}

\documentclass[desactivate]{aa}
4

You could use \nolinenumbers to switch off line numbering:

\documentclass{aa}  
\usepackage{lipsum}
\begin{document}
   \title{Astronomy \& Astrophysics \LaTeX\ template}
   \author{M. Example\inst{1}}
   \institute{nowhere}
   \abstract{no context}{aimless}{stupid method}{without results}{or conclusions}
   \maketitle
   \nolinenumbers
   \lipsum[1]
\end{document}

enter image description here

1

The current version of the A&A template removed handling of desactivate and creating replacing the necessary commands with the proper gobble. While you could go through the *.sty in detail and recreate them, it is easier and more stable to leave the processing of line numbers in place and just suppress their printing:

\documentclass{aa}
% other packages...

\AtBeginDocument{%
  \makeatletter
  \let\origMakeLineNumber\makeLineNumber
  \let\origLineNumber\LineNumber
  \let\origThelinenumber\thelinenumber
  \renewcommand\makeLineNumber{\relax}%
  \renewcommand\LineNumber{}%
  \renewcommand\thelinenumber{}%
  \makeatother
} 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.