Consider an environment which is intended to house a variety of content related to an author. Content may include name, affiliation, a paragraph which is a short biography, as well as, a series of select publications. Then consider a document which is intended to summarize a set of authors and accordingly, multiple instances of the `author environment'.
My initial attempt at solving the problem involved several files.
- A .cls file in which the author description environment is described.
- A .tex file which is the author summary, the environment is called here
- Some number of .tex files in which author attributes are defined
- Some number of .bib files in which author publications are defined
The .cls file appears as:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{authou}[2015/11/11 an author description]
\LoadClass[12pt]{article}
\RequirePackage[numbers]{natbib}
\RequirePackage{cite}
\bibliographystyle{plainnat}
% define an author description environment
\newenvironment{author_description}[2]{%
\input{#1}%
\begin{center}%
\textbf{Name}: \authorname\\%
\textbf{Affiliation}: \authoraffiliation\\%
\nocite{*}%
\bibliography{#2}%
\end{center}%
}%
{%
% environment end definition
\newpage%
}%
\AtBeginDocument{%
}%
\AtEndDocument{%
}%
The author summary document as:
\NeedsTeXFormat{LaTeX2e}
\documentclass{author}
\begin{document}
\begin{author_description}%
{author.tex}%
{author}%
\end{author_description}%
\begin{author_description}%
{anotherauthor.tex}%
{anotherauthor}%
\end{author_description}%
\end{document}
Author attributes are stored in a file with:
\newcommand\authorname{Author}
\newcommand\authoraffiliation{The author's most relevant affiliation}
And the standard .bib file looks like:
@ARTICLE{Author2015b,
author={Author},
journal={Journal},
title={The author's most recent work},
year={2015},
volume={40},
number={3},
pages={683-700},
keywords={reading, writing, arithmetic},
doi={},
ISSN={},
month={July},}
@ARTICLE{Author2015a,
author={Author},
journal={Journal},
title={The author's second most recent work},
year={2015},
volume={12},
number={1},
pages={56-74},
keywords={reading, writing, arithmetic},
doi={},
ISSN={},
month={May},}
Let me point out that the author attribute file and corresponding .bib files are both named with the author name, or author
and anotherauthor
in this case.
On compilation, there is an obvious error (see attachments). The .bib entries associated with the first instance of the author description environment appear in all subsequent instances.
When I first discovered this, I immediately turned my attention to multibib, however, upon looking into it a little deeper, it would appear that multibib does not lend itself to this problem.
So the question is: How do I define an environment which includes a bibliography (takes the .bib file name as an argument) and allow an indefinite number of bibliographies to be displayed within a single document?