3

I'd like amsrefs to print (in the bibliography, not with the actual citations, e.g. in the margin) the label used in the \bib and \cite commands (i.e., the first argument to \bib). I tried this:

\documentclass{article}

\usepackage{amsrefs}
\usepackage{lipsum}

\let\origbib=\bib
\def\bib#1#2#3{\llap{#1\qquad}\origbib{#1}{#2}{#3}}

\begin{document}

This: \cite{a} and that: \cite{b} are important papers.

\vspace{6\baselineskip}\lipsum[1-4] % to get a page break between papers in the bibliography

\begin{biblist}
  \bib{a}{article}{
    author={Someone},
    title={A title},
  }
  \bib{b}{article}{
    author={Another one},
    title={Another title},
  }
\end{biblist}

\end{document}

but it doesn't work very well (\llap is issued in vertical mode, and adding \leavevmode before causes some errors I don't have enough motivation to investigate due to the deadline... :-/). Adding \vspace{-\baselineskip} after the \llap helps a bit, but still the label for the first entry on a page gets printed on the previous page. I can live with this, but I'm also wondering whether there's a better (also, more elegant) solution.

  • I expect you can use showlabels, but it needs a MWE – David Carlisle Jun 26 '14 at 20:29
  • You probably should explain more clearly what you mean as it's not really clear. A MWE would help and save people from wasting their time. – Andrew Jun 26 '14 at 20:30
  • I know, I know, people!!! One comment is enough! It's 22:30 here, I have a deadline, and I forgot about a MWE... ;-) – mbork Jun 26 '14 at 20:33
  • @DavidCarlisle: showlabels seems to know nothing about amsrefs. – mbork Jun 26 '14 at 20:33
  • @mbork have faith – David Carlisle Jun 26 '14 at 20:36
5

works for me?

enter image description here

\documentclass{article}

\usepackage{amsrefs}
\usepackage{lipsum}
\usepackage{showkeys}

\begin{document}

This: \cite{a} and that: \cite{b} are important papers.

\vspace{6\baselineskip}\lipsum[1-4] % to get a page break between papers in the bibliography

\begin{biblist}
  \bib{a}{article}{
    author={Someone},
    title={A title},
  }
  \bib{b}{article}{
    author={Another one},
    title={Another title},
  }
\end{biblist}

\end{document}
  • well yes, the labels do print in the margin next to the bib items, but unless it's just my old eyes, they are also (almost) overprinting the references where cited. (they'll go away in the final copy, but ...) – barbara beeton Jul 1 '14 at 11:38
  • @barbarabeeton almost is good:-) (the main idea is not to affect the typesetting of the existing text so by design they are somewhat squeezed in) – David Carlisle Jul 1 '14 at 11:45
  • Well, my fault - I mixed the names of showlabels and showkeys... Thanks! – mbork Aug 19 '14 at 17:09
1

The way to use showlabels for this case is something like

\usepackage{showlabels}
\showlabels{bib}

The result isn't exactly as you describe, but does indicate the \bib label with a {a} in the margin. The showlabels package tries quite hard to avoid spacing changes, so if a spacing change does appear in this case, that may be a showlabels bug.

  • Indeed, there were some spacing changes. Thanks anyway! – mbork Aug 19 '14 at 17:09
  • Ooops: then can you illustrate here a minimal example which illustrates the spacing change? I should be able to fix that. Add it here, or there's an issues list at bitbucket (oops, I see I'm a little behind – this might prompt me to do a catch-up) – Norman Gray Aug 19 '14 at 18:14
  • I'll try, though that might be tough - my example is a not-so-small document with a custom class... – mbork Aug 19 '14 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.