From e4948270cfc867e7b7feb86af36ab6c97f133563 Mon Sep 17 00:00:00 2001
From: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Date: Tue, 10 Jun 2025 21:17:35 +0200
Subject: Maneage'd A&A (Astronomy and Astrophysics) journal style

Until this commit, the LaTeX style and settings of the core Maneage branch
were very generic and customizing for each separate journal required some
time to prepare the LaTeX style.

With this commit, a first attempt at customization of Maneage for the LaTeX
styles of the A&A journal. Note that EDP Science (the publisher of A&A) has
only claimed copyright in their style files, but hasn't actually specified
a license. Given that they have no objection to arXiv or Overleaf freely
distributing their style files, there is no problem is releasing these
files within this branch of Maneage also (only for people who want to use
their style to publish in their journal).
---
 tex/src/journal/linenoaa.sty | 144 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 144 insertions(+)
 create mode 100644 tex/src/journal/linenoaa.sty

(limited to 'tex/src/journal/linenoaa.sty')

diff --git a/tex/src/journal/linenoaa.sty b/tex/src/journal/linenoaa.sty
new file mode 100644
index 0000000..44a7f49
--- /dev/null
+++ b/tex/src/journal/linenoaa.sty
@@ -0,0 +1,144 @@
+\NeedsTeXFormat{LaTeX2e}[2003/12/01]
+\ProvidesPackage{linenoaa}[2023/03/12 v0.02]
+
+\providecommand{\addto}[2]{%
+  \ifx#1\@undefined
+    \def#1{#2}%
+  \else
+    \ifx#1\relax
+      \def#1{#2}%
+    \else
+      {\toks@\expandafter{#1#2}%
+        \xdef#1{\the\toks@}}%
+    \fi
+  \fi
+}
+
+\newif\ifGPL@lineno@desactivate
+\GPL@lineno@desactivatefalse
+
+\DeclareOption{desactivate}{
+	\providecommand{\@LN}{\@gobbletwo}
+	\providecommand{\@LN@col}{\@gobble}
+	\GPL@lineno@desactivatetrue	
+}
+\DeclareOption*{
+	\PassOptionsToPackage{\CurrentOption}{lineno}
+}
+\ProcessOptions\relax
+
+\ifGPL@lineno@desactivate
+	\endinput
+\fi
+
+\RequirePackage{lineno}[2005/11/02 v4.41]
+
+\addto\maketitle{\linenumbers\relax}
+
+\def\linenumberfont{\normalfont\scriptsize\sffamily}
+
+\modulolinenumbers[10]
+
+\@namedef{eqnarray*}{\def\@eqncr{\nonumber\@seqncr}\linenomath\eqnarray}
+\@namedef{endeqnarray*}{\nonumber\endeqnarray\endlinenomath}
+
+\@ifpackageloaded{amsmath}{%
+\renewenvironment{multline}{\linenomathNonumbers\start@multline\st@rredfalse}{%
+	\iftagsleft@ \@xp\lendmultline@ \else \@xp\rendmultline@ \fi
+	\endlinenomath\ignorespacesafterend}
+
+\renewenvironment{multline*}{\linenomath\start@multline\st@rredtrue}{\endmultline\endlinenomath}
+
+
+\renewenvironment{gather}{\linenomathNonumbers\start@gather\st@rredfalse}{%
+  \math@cr \black@\totwidth@ \egroup
+  $$\endlinenomath\ignorespacesafterend}
+
+\renewenvironment{gather*}{\linenomath\start@gather\st@rredtrue}{\endgather\endlinenomath}
+
+\renewenvironment{alignat}{\linenomathNonumbers\start@align\z@\st@rredfalse}{%
+\endalign\endlinenomath}
+
+\renewenvironment{alignat*}{\linenomath\start@align\z@\st@rredtrue}{\endalign\endlinenomath}
+
+\renewenvironment{xalignat}{\linenomathNonumbers\start@align\@ne\st@rredfalse}{%
+\endalign\endlinenomath}
+
+\renewenvironment{xalignat*}{\linenomath\start@align\@ne\st@rredtrue}{\endalign\endlinenomath}
+
+\renewenvironment{xxalignat}{\linenomath\start@align\tw@\st@rredtrue}{\endalign\endlinenomath}
+
+\renewenvironment{align}{\linenomathNonumbers\start@align\@ne\st@rredfalse\m@ne}{%
+  \math@cr \black@\totwidth@
+  \egroup
+  \ifingather@
+    \restorealignstate@
+    \egroup
+    \nonumber
+    \ifnum0=`{\fi\iffalse}\fi
+  \else
+    $$%
+  \fi
+  \endlinenomath
+  \ignorespacesafterend}
+  
+\renewenvironment{align*}{\linenomath\start@align\@ne\st@rredtrue\m@ne}{\endalign\endlinenomath}
+
+\renewenvironment{flalign}{\linenomathNonumbers\start@align\tw@\st@rredfalse\m@ne}{%
+\endalign\endlinenomath}
+
+\renewenvironment{flalign*}{\linenomath\start@align\tw@\st@rredtrue\m@ne}{\endalign\endlinenomath}
+
+\renewenvironment{equation}{%
+  \linenomathNonumbers\incr@eqnum
+  \mathdisplay@push
+  \st@rredfalse \global\@eqnswtrue
+  \mathdisplay{equation}%
+}{%
+  \endmathdisplay{equation}%
+  \mathdisplay@pop
+  \endlinenomath
+  \ignorespacesafterend}
+    
+\renewenvironment{equation*}{%
+  \linenomath\mathdisplay@push
+  \st@rredtrue \global\@eqnswfalse
+  \mathdisplay{equation*}%
+}{%
+  \endmathdisplay{equation*}%
+  \mathdisplay@pop
+  \endlinenomath
+  \ignorespacesafterend}}{%
+\def\equation{\linenomathNonumbers$$\refstepcounter{equation}}
+\def\endequation{\eqno \hbox{\@eqnnum}$$\endlinenomath\@ignoretrue}}
+
+\@ifpackagewith{amsmath}{fleqn}{%
+\renewenvironment{eqnarray}{%
+    \stepcounter{equation}%
+    \def\@currentlabel{\p@equation\theequation}%
+    \global\@eqnswtrue\m@th
+    \global\@eqcnt\z@
+    \tabskip\mathindent
+    \let\\=\@eqncr
+    \setlength\abovedisplayskip{\topsep}%
+    \ifvmode
+      \addtolength\abovedisplayskip{\partopsep}%
+    \fi
+    \addtolength\abovedisplayskip{\parskip}%
+    \setlength\belowdisplayskip{\abovedisplayskip}%
+    \setlength\belowdisplayshortskip{\abovedisplayskip}%
+    \setlength\abovedisplayshortskip{\abovedisplayskip}%
+    \linenomathNonumbers$$\everycr{}\halign to\linewidth% $$
+    \bgroup
+      \hskip\@centering
+      $\displaystyle\tabskip\z@skip{##}$\@eqnsel&%
+      \global\@eqcnt\@ne \hskip \tw@\arraycolsep \hfil${##}$\hfil&%
+      \global\@eqcnt\tw@ \hskip \tw@\arraycolsep
+        $\displaystyle{##}$\hfil \tabskip\@centering&%
+      \global\@eqcnt\thr@@
+        \hb@xt@\z@\bgroup\hss##\egroup\tabskip\z@skip\cr}%
+      {\@@eqncr
+    \egroup
+    \global\advance\c@equation\m@ne$$% $$
+    \endlinenomath
+    \@ignoretrue}}{}
-- 
cgit v1.2.1

