Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numbering publications #1

Closed
btskinner opened this issue Aug 17, 2021 · 0 comments
Closed

Numbering publications #1

btskinner opened this issue Aug 17, 2021 · 0 comments
Assignees

Comments

@btskinner
Copy link
Owner

Question

Someone emailed to ask whether it was possible to number publications. Here's a solution that I think will work.

h/t

Changes in cv.tex to number bibliography entries (but still APA style and reverse chronological order)

First, change the options in \usepackage{biblatex} from:

\usepackage[style=apa,
backend=biber,
sortcites=true,
sorting=ydmdnt,
language=american]{biblatex} 

to

\usepackage[style=apa,
citestyle=numeric,    % <-- add this option so numbers are used
defernumbers=true,    % <-- add this option so numbers reset with each section
backend=biber,
sortcites=true,
sorting=ydmdnt,
language=american]{biblatex}

Second, change the \defbibenvironment{mybib} from:

% no letter for same year entries
\defbibenvironment{mybib}
{\list
  {}
  {\setlength{\leftmargin}{\bibhang}%
    \setlength{\itemindent}{-\leftmargin}%
    \setlength{\itemsep}{\bibitemsep}%
    \setlength{\parsep}{\bibparsep}}}
{\endlist}
{\clearfield{extradate}\item}

to

% no letter for same year entries
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
\defbibenvironment{mybib}
  {\list
     {\printtext[labelnumberwidth]{%
      \printfield{labelprefix}%
      \printfield{labelnumber}}}
     {\setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\clearfield{extradate}\item}

Results

Original

Screen Shot 2021-08-17 at 2 02 02 PM

### Numbered

Screen Shot 2021-08-17 at 2 00 25 PM

Changes in numbered branch

Alternately, you can git checkout numbered branch, which includes these changes.

@btskinner btskinner self-assigned this Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant