9

I am entering my publications into the CV. Currently, I am using enumitem to define a new enumerate list as follows:

\makeatletter
\newlength{\bibhang}
\setlength{\bibhang}{1em}
\newlength{\bibsep}
 {\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}
\newlist{bibenum}{enumerate}{3}
\setlist[bibenum]{label=[\arabic*],resume,leftmargin={\bibhang+\widthof{[999]}},%
    itemindent=-\bibhang,
    itemsep=\bibsep,parsep=\z@,partopsep=0pt,
    topsep=0pt}
\let\oldendbibenum\endbibenum
\def\endbibenum{\oldendbibenum\vspace{-.6\baselineskip}}
\makeatother

And add the publications as follows:

\begin{bibenum}
\item \bibentry{pub1}
\item \bibentry{pub2}
\end{bibenum}

It works fine (an example shown below)

example

but gives the numbers in increasing order. Instead I want them in decreasing order. So, I tried using the etaremune package as follows

\makeatletter
\newlength{\bibhang}
\setlength{\bibhang}{1em}
\newlength{\bibsep}
 {\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}
\newlist{bibenumr}{etaremune}{3}
\setlist[bibenumr]{label=[\arabic*],resume,leftmargin={\bibhang+\widthof{[999]}},%
    itemindent=-\bibhang,
    itemsep=\bibsep,parsep=\z@,partopsep=0pt,
    topsep=0pt}
\let\oldendbibenumr\endbibenumr
\def\endbibenumr{\oldendbibenumr\vspace{-.6\baselineskip}}
\makeatother

But it gives an error of undefined control sequence...Package enumitem Error: Unknown list type 'etaremune'). Any ideas what is wrong? Is it possible to use etaremune with enumitem package?

EDIT: As pointed out by egreg, I cannot use etaremune with enumitem. Does anyone know any other way to do it? Basically a reverse numbered list with flexibility of defining the way it looks (like square brackets, indentations, separations etc.

Following is a minimum working example. I started from a template I found online and tried to remove all the unnecessary commands. Any help?

\documentclass[11pt]{article}

% This is a helpful package that puts math inside length specifications
\usepackage{calc}

% Layout: Puts the section titles on left side of page
\reversemarginpar

%% Use these lines for letter-sized paper
\usepackage[paper=letterpaper,
            marginparwidth=1.2in,     % Length of section titles
            marginparsep=.05in,       % Space between titles and text
            margin=1in,               % 1 inch margins
            includemp]{geometry}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% DEFINE THE "bibenum" list using enumitem package
%%% Need to modify this such that "bibenum" gives reverse numbering instead
\usepackage[shortlabels]{enumitem}

\makeatletter
\newlength{\bibhang}
\setlength{\bibhang}{1em}
\newlength{\bibsep}
 {\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}
\newlist{bibenum}{enumerate}{3}
\setlist[bibenum]{label=[\arabic*],resume,leftmargin={\bibhang+\widthof{[999]}},%
        itemindent=-\bibhang,
        itemsep=\bibsep,parsep=\z@,partopsep=0pt,
        topsep=0pt}
\let\oldendbibenum\endbibenum
\def\endbibenum{\oldendbibenum\vspace{-.6\baselineskip}}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{hyperref}

%%% SECTION HEADINGS
\renewcommand{\section}[1]{\pagebreak[3]%
    \vspace{1.3\baselineskip}%
    \phantomsection\addcontentsline{toc}{section}{#1}%
    \noindent\llap{\smash{\parbox[t]{\marginparwidth}{\hyphenpenalty=10000\raggedright #1}}}%
    \vspace{-\baselineskip}\par}

\begin{document}

\section{\textbf{Journal Publications}}

\begin{bibenum}
    \item pub1
    \item pub2
    \item pres1
    \item pres2
\end{bibenum}

\end{document}
Ankush
  • 401
  • There is really no difference between the two usages, even though you mention that you're using etaremune in the second. What "undefined control sequence" error are you receiving exactly? – Werner Jan 10 '14 at 15:54
  • In the second one, I use etaremune instead of enumerate while defining the \newlist{bibenum} -- so as to get reverse numbering.

    I am getting the following error: ./CVheader.tex:127: Undefined control sequence. ... itemize, description,\messageBreak enumerate, itemize, desc... l.127 \newlist{bibenumr}{eta./CVheader.tex:127: Package enumitem Error: Unknown list type `etaremune').

    – Ankush Jan 10 '14 at 16:12
  • 1
    @Ankush Basically you can't do this way: etaremune is not a list defined in enumitem, but rather an environment built over the standard enumerate. – egreg Jan 10 '14 at 17:04
  • @egreg: Any other way around it? I want to keep the same style of list as in bibenum but reverse the numbering. – Ankush Jan 10 '14 at 17:21
  • Can you add an example of how you would use the environments? – egreg Jan 10 '14 at 18:08
  • Sure, I added an example in the question above. – Ankush Jan 10 '14 at 18:32
  • @egreg Any ideas? I need this to be solved. – Ankush Jan 14 '14 at 23:48
  • You can add keys also to etaremune and possibly emulate what enumerate does. Can you add some material to play with? – egreg Jan 14 '14 at 23:56
  • @egreg I am not sure what you mean by keys? I added a minimum working example for playing with. – Ankush Jan 15 '14 at 17:45

1 Answers1

11

etaremune is customizable similarly to enumitem. Here's an emulation.

\documentclass[11pt]{article}

% This is a helpful package that puts math inside length specifications
\usepackage{calc}

% Layout: Puts the section titles on left side of page
\reversemarginpar

%% Use these lines for letter-sized paper
\usepackage[paper=letterpaper,
            marginparwidth=1.2in,     % Length of section titles
            marginparsep=.05in,       % Space between titles and text
            margin=1in,               % 1 inch margins
            includemp]{geometry}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% DEFINE THE "bibenum" list using enumitem package
%%% Need to modify this such that "bibenum" gives reverse numbering instead
\usepackage[shortlabels]{enumitem}
\usepackage{etaremune}

\makeatletter
\newlength{\bibhang}
\setlength{\bibhang}{1em}
\newlength{\bibsep}
 {\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}
\newlist{bibenum}{enumerate}{3}
\setlist[bibenum]{label=[\arabic*],resume,leftmargin={\bibhang+\widthof{[999]}},%
        itemindent=-\bibhang,
        itemsep=\bibsep,parsep=0pt,partopsep=0pt,
        topsep=0pt}
%\let\oldendbibenum\endbibenum
%\def\endbibenum{\oldendbibenum\vspace{-.6\baselineskip}}

\newenvironment{bibenum*}
  {\renewcommand\labelenumi{[\theenumi]}%
   \etaremune[
     topsep=0pt,
     itemsep=\bibsep,
     parsep=0pt,partopsep=0pt,
     itemindent=-\bibhang,
     leftmargin={\bibhang+\widthof{[999]}}]}
  {\endetaremune}

\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{hyperref}

%%% SECTION HEADINGS
\renewcommand{\section}[1]{\pagebreak[3]%
    \vspace{1.3\baselineskip}%
    \phantomsection\addcontentsline{toc}{section}{#1}%
    \noindent\llap{\smash{\parbox[t]{\marginparwidth}{\hyphenpenalty=10000\raggedright #1}}}%
    \vspace{-\baselineskip}\par}

\begin{document}

\section{\textbf{Journal Publications}}

\begin{bibenum}
    \item pub1
    \item pub2
    \item pres1
    \item pres2
\end{bibenum}

\section{\textbf{Reverse order}}

\begin{bibenum*}
    \item pub1
    \item pub2
    \item pres1
    \item pres2
\end{bibenum*}

\end{document}

enter image description here

egreg
  • 1,121,712