Thursday, November 16, 2017

Soundtracks in AASTeX

It's great that \aastex\ lets us acknowledge facilities and funding sources.
But we all know that what really gets the science done is the music we listen to
while at our computers.  Why not start listing that music in our papers and give
future social anthropologists something fun to study?

I've defined \soundtrack and \music commands in \latex\ to enable this.

(Updated 20180102) In your latex file, add the following after the \documentclass command:

\usepackage[inline]{enumitem}

and put the following lines before the \begin{document} command:

\newcommand{\music}[3][.]{\item \href{#2}{#3}{#1}}
\newenvironment{soundtrack}
    {\vskip6pt{\large\it Soundtrack:} \begin{enumerate*}[label={}]
    }
    {\end{enumerate*}
    }

Use these commands by invoking the soundtrack environment and then listing \music{URL}{Artist} or \music[punctuation]{URL}{Artist} for as many artists as needed.  The default punctuation for the list of artists is a comma.  The last entry in the list (at least) should have different punctuation than the default comma.  For example, invoke:

\begin{soundtrack}
\music[!]{http://www.dragonforce.com/}{Dragonforce}
\music{http://www.shanekoyczan.com/}{Shane Koyczan}
\music[.]{http://www.vnvnation.com/}{VNV Nation}
\end{soundtrack}

to get the results seen in this PDF.

Future refinements such as fields for album, song, star rating, etc. are left for others to have fun with.

Rock on!
Pat Hall

1 comment: