%% file: example.tex = LaTeX + BibTex example for article-like report 
%% init: sometime 1993 for my practical "Stellar Spectra A"
%% last: Nov  3 2021  Rob Rutten  Deil
%% site: https://robrutten.nl/rrweb/rjr-edu/manuals/student-report/

%% First read ``latex-bibtex-simple-manual'' at
%% https://robrutten.nl/Report_recipe.html

%% Then run this file to see what it does:
%%    latex example     bibtex example     latex example     latex example
%% inspect with xdvi example &, or pdflatex into example.pdf for inspection.

%% Take out my content to make a template for your report.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{aa}    %% Astronomy & Astrophysics style class aa.cls v8.2

%% load latex packages
\usepackage{graphicx,url,twoopt,natbib}
\usepackage[varg]{txfonts}           %% old-fashioned A&A font choice
\usepackage{hyperref}                %% for pdflatex
%%\usepackage[breaklinks]{hyperref}  %% for latex+dvips, not for pdflatex
%%\usepackage{breakurl}              %% for latex+dvips, not for pdflatex

%% define link colors
\hypersetup{
  colorlinks=true,   %% links colored instead of frames
  urlcolor=blue,     %% external hyperlinks
  linkcolor=blue     %% internal latex links (eg Fig)
}

\bibpunct{(}{)}{;}{a}{}{,}    %% natbib cite format used by A&A and ApJ
\pagestyle{plain}             %% undo the fancy A&A pagestyle 
\let\footnotesize\tiny        %% keep this to 1 page (aa.cls sets \small)

%% Add commands to add a note or link to a reference
\makeatletter
\newcommand{\bibnote}[2]{\global\@namedef{#1note}{#2}}
\newcommand{\biblink}[2]{\global\@namedef{#1link}{#2}}
\makeatother

%% Commands to make citations ADS clickers and to add such also to refs.
%% The twoopt definition permits parameters as in natbib (which I never use).
%% The stonyslink solves a stop problem when using latex instead of pdflatex.
%% May 20 2019: switch to "new" ADS (classic in EDP/A&A readme still work)
\makeatletter
  \protected\def\stonyslink{%
     \def\hyper@linkstart##1##2{}\let\hyper@linkend\@empty}
  \newcommandtwoopt{\citeads}[3][][]{%
   \href{http://ui.adsabs.harvard.edu/abs/#3/abstract}%
        {\stonyslink \citealp[#1][#2]{#3}}%   %% Rutten, 2000
   \biblink{#3}{\href{http://ui.adsabs.harvard.edu/abs/#3/abstract}{ADS}}}
 \newcommandtwoopt{\citepads}[3][][]{%
   \href{http://ui.adsabs.harvard.edu/abs/#3/abstract}%
        {\stonyslink \citep[#1][#2]{#3}}%     %% (Rutten 2000)
   \biblink{#3}{\href{http://ui.adsabs.harvard.edu/abs/#3/abstract}{ADS}}}
 \newcommandtwoopt{\citetads}[3][][]{%
   \href{http://ui.adsabs.harvard.edu/abs/#3/abstract}%
        {\stonyslink \citet[#1][#2]{#3}}%     %% Rutten (2000)
  \biblink{#3}{\href{http://ui.adsabs.harvard.edu/abs/#3/abstract}{ADS}}}
 \newcommandtwoopt{\citeyearads}[3][][]{%
   \href{http://ui.adsabs.harvard.edu/abs/#3/abstract}%
        {\stonyslink \citeyear[#1][#2]{#3}}%  %% 2000
   \biblink{#3}{\href{http://ui.adsabs.harvard.edu/abs/#3/abstract}{ADS}}}
\makeatother

%% ADS specific page opener = {bibcode}{pdf page number}{link text}
%% (ADS has promised that the "classic" link below keeps working; it has
%%  wider application than "new" ADS commands, e.g. by directly 
%%  opening the arXiv pdf for "silly" publishers without pdf opener on ADS)
\def\linkadspage#1#2#3{\href{http://adsabs.harvard.edu/cgi-bin/nph-data_query?bibcode=#1\&link_type=ARTICLE\&db_key=AST\#page=#2}{#3}}

%% Spectral species
\def\HI{\ion{H}{I}}            %% A&A; for aastex use \def\HI{\ion{H}{1}} 
\def\MgI{\ion{Mg}{I}}          %% A&A; for aastex use \def\MgI{\ion{Mg}{1}} 
\def\MgII{\ion{Mg}{II}}        %% A&A; for aastex use \def\MgII{\ion{Mg}{2}} 

%% Hyphenation
\hyphenation{Schrij-ver}       %% Dutch ij is a single character


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}  

%% Simple header (replacing A&A commands which produce the A&A banner)

\twocolumn[{%
\vspace*{4ex}
\begin{center}
  {\Large \bf RYDBERG EMISSION LINES IN THE SOLAR SPECTRUM}\\[4ex] 
  {\large \bf R. J. Rutten$^{1, 2}$, M. Carlsson$^2$
              and N. G. Shchukina$^3$}\\[4ex]
  \begin{minipage}[t]{16cm} \small        
        $^1$ Lingezicht Astrophysics,
             NL--4158~CA Deil, The Netherlands\\
        $^2$ Institute of Theoretical Astrophysics,
             P.O.~Box 1029, Blindern, N--0315 Oslo, Norway\\
        $^3$ Main Astronomical Observatory, 
             252127 Kiev, Ukraine\\

  {\bf Abstract.~}  This is a latex and bibtex example for astronomy students,
  accompanying the manual at
  \href{https://robrutten.nl/Report_recipe.html}
       {\url{https://robrutten.nl/Report_recipe.html}}.
    %% This URL needs package breakurl for proper breaking when using dvips
    Sloppy authors use "....." instead of ``.....'', 
    do not add space-making backslashes after et al., $\backslash$AA, etc., 
    do not use tildes for non-breakable spaces before units and after 
    initials, do not end italics with $\backslash${/}, 
    do not set units in roman font, do not set the e of electron 
    in $m_{\rm e}$ or the eff in $T_{\rm eff}$ in roman,
    do not use bibtex, do not use a spell checker, do not use
    $\backslash$url for weblinks, do not link citations to NASA's ADS.
    Probably they do nothing well -- unlike us.
   \vspace*{2ex}
  \end{minipage}
\end{center}
}] 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}     \label{sec:introduction}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The existence of two emission features in the solar spectrum near
12~$\mu$m was announced by
%% Note tilde, mandatory to avoid line break between number and unit
\citetads{1981ApJ...247L..97M}%% Murcray+others MgI features,
%% Add a brief comment as identifier for yourself and co-authors.
%% Using ADS bibcodes is mandatory for my clickable cites but is also useful
%% to avoid confusing co-authors with your own inventions
\footnote{Depending on your pdf-viewer settings, clicking a name-year
  citation may open the corresponding ADS abstract page in your browser.},
but only when they were informed by L.~Testerman and J.~Brault that
%% Note tildes to avoid line breaks
they had noticed them too.
Before that, \citetads{1980STIN...8031298G} %% Goldman+others IR atlas
had white-pasted them out of their spectrum atlas in the mistaken
belief that all solar and telluric lines should be in absorption.
We explained these emission features many years ago
(\citeads{1992A&A...253..567C}, % Carlsson+Rutten+Shchukina MgI
henceforth Pub~I; see also \citeads{1994IAUS..154..309R}).

%% Add (Pub I) to the reference
\bibnote{1992A&A...253..567C}{(Pub~I)}
%% Don't use ``Paper~I'' since journals appear electronically only

%% Define \PubI as an ADS clicker
\def\PubI{\href{http://adsabs.harvard.edu/abs/1992A&A...253..567C}{Pub~I}}

%% Note: citations are properly broken by the breaklinks hyperref option
%% when using dvips, but then do not link in the Adobe pdf reader.
%% Citation breaks are handled correctly by pdflatex.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Model computations}    \label{sec:computations}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsection{Background}
%%%%%%%%%%%%%%%%%%%%%%%%%
In the solar photosphere NLTE departure diffusion occurs in the upper
reaches of the \MgI\ term structure (see
\linkadspage{1992A&A...253..567C}{7}{Figs.~3 and 4}\footnote{%
  Links to cited figures or equations may open the pertinent page 
  via ADS (but macOS Preview may shunt to the start page).}
of \PubI).
It is akin to optically-thin collisional-radiative recombination along
Rydberg levels in tenuous plasmas as sketched in
%% The \, below is a thinner space than a tilde; can also be good for units 
Fig.\,\ref{fig:waterfalls}\footnote{%
  Multi-panel figure production: prepare separate figures, each with
  full axis annotation, and paste them together using the latex commands
  in my
  \href{https://robrutten.nl/rrweb/rjr-edu/manuals/student-report/cutmultipanel.tex}{{\tt cutmultipanel.tex}}.
  These remove superfluous axis annotation between adjacent panels and
  rescale them to the same size; they also maintain image resolution for
  zoom-in per pdf viewer.
  This way you can define the multi-panel assembly layout (e.g.,
  column-wide vertical stacking or page-wide horizontal) while writing,
  including re-ordering figures from coauthors.
}.
The righthand cartoon in \linkadspage{2019arXiv190804624R}{4}{Fig.~2
here}\footnote{Link to a figure page in the arXiv pdf for a Springer
  publication not directly accessible at ADS.} 
shows the \HI\ Rydberg ladder more formally.

%% {fig:waterfalls}
%===========================================================================
\begin{figure}[hbtp]
  \centering
  \includegraphics[width=\columnwidth]{waterfalls}  %% no file extension
  \caption[]{\label{fig:waterfalls} %
  Collisional-radiative recombination along \MgI\ Rydberg states
  visualized by Mats Carlsson for drop-pool kayakers.
  {\em Left:\/} the largest recombination flow from the magnesium
%% Always end italics strings with \/
  population reservoir in the \MgII\ ground state is into the highest
  \MgI\ level ($n\!=\!9$ in the present model).
%% The ! signs above reduce the spacing around the =    
  {\em Right:\/} along the $\Delta n\!=\!1$ downward ladder the flow
  is initially dominated by collisional transitions but radiative
  transitions take over lower down.
  The recombination flow is driven by photon losses in strong \MgI\
  lines and is balanced by radiative ionization in ultraviolet \MgI\
  edges.
  Similar Rydberg flows occur in other elements, but the \MgI\ Rydberg
  levels contain the largest photospheric populations, exceeding even
  the \HI\ ones.
  From \citetads{1994IAUS..154..309R}. % Rutten+Carlsson Tucson review
  }
\end{figure}
% ===========================================================================
%% Have "floats" such as figures between blank lines to make them float


%% In this file every sentence starts on a new line for better
%% readability, easier change, better synchronization in
%% shared-access systems such as svn, easier use of (mg)diff.
%% This is automatically formatted by emacs in the setup I use,
%% specified in my ~/.emacs shown in "Recipes for linux/unix"
%% on my website.


\subsection{Method}
%%%%%%%%%%%%%%%%%%%%
We solved the statistical equilibrium and radiative transfer equations
for all relevant levels and frequencies in \MgI\ and \MgII\ for
various models of the solar atmosphere, including the standard one
formulated in the monumental articles by Vernazza et al.\
(\citeyearads{1973ApJ...184..605V}, % VALI
\citeyearads{1976ApJS...30....1V}, % VALII
\citeyearads{1981ApJS...45..635V}). % VALIII
%% Example same-authors multiple citation list


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Conclusion} \label{sec:conclusion}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Our computation explained the formation of the enigmatic
\MgI\,12\,$\mu$m emission features.
They arise through population depletion by line photon losses and
population replenishment from the ionic reservoir through highly
excited levels.
A Rydberg-channel replenishment flow is realized by
collisionally-dominated population diffusion via ladder-wise departure
divergence (see Fig.~\ref{fig:waterfalls} in
Sect.~\ref{sec:computations}).  
%% Note the tilde.  Fig. \ref would generate too much end-of-sentence space
%% and a line break between Fig. and the number is undesirable

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{acknowledgements} 
  We are indebted to NASA's \href{http://ui.adsabs.harvard.edu}{ADS}
  for its magnificent literature and bibliography serving which
  was severely missed by us -- fortunately unknowingly -- 
  in pre-internet 1992.
%% us -- fortunately is A&A style; ApJ wants us---unfortunately.
\end{acknowledgements}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% references
\bibliographystyle{aa-note} %% aa.bst but adding links and notes to references
%%\raggedright              %% for latex+dvips, not for pdflatex
\bibliography{example}      %% example.bib = bibtex entries copied from ADS

\end{document}
