5

Continuing my odyssey with oldstyle numbers, I'd like to disable them also in the optional (second) argument of \cite{...}*{...} in amsrefs. Any hints how to do that? (I'm using XeLaTeX, but this is probably irrelevant here, since the problem is now not "how to get rid of oldstyle numbers", but "how to change the style of the second \cite's argument".)

Edit: here's an example:

\documentclass{article}

\usepackage{amsrefs}

\begin{document}

See \cite{somebook}*{p.~123}.
Also compare \citelist{\cite{somebook}\cite{anotherbook}*{p.987}}.

\begin{bibdiv}
  \begin{biblist}
    \bib{somebook}{book}{
      title={Title},
      author={Author},
      date={1999},
    }
    \bib{anotherbook}{book}{
      title={Another Title},
      author={Somebody Else},
      date={2001},
    }
  \end{biblist}
\end{bibdiv}

\end{document}

What I'd like to achieve is to change the style of "p. 123" (for instance, to boldface).

Edit 2: It seems that \citelist is a bonus challenge to this... (I modified the MWE above to show the problem.)

mbork
  • 13,385

1 Answers1

3

Examining amsrefs.sty, \citemid is used only once:

\def\citemid{,\penalty9999 \space}

\def\cite@cj#1#2{%
        \leavevmode
            \begingroup
                \cite@cb#1% write info to aux file
                \ar@SK@cite#1%
                \@citeleft
                \ar@hyperlink{#1}%
                \@ifnotempty{#2}{\citemid{#2}}%
                \citeright
            \endgroup
            \ignorespaces % ignore spaces inside \citelist
        \cite@endgroup
}

So it seems quite safe to redefine \citemid:

\def\citemid#1{,\penalty9999 \space{\bfseries#1}}

Note that the text p.~123 will be passed as #2, in this case.

egreg
  • 1,121,712
  • Thanks.

    The problem with oldstyle numbers is that I do want them in text, where there are lots of dates. I do not want them in maths (which is obvious, and where they are absent anyway), but also in references of all kinds (where they might look strange between braces). (Well, I like them there also, but the decision-makers don't.)

    – mbork May 03 '12 at 11:52
  • And AFAIR, \citemid is not really what I would like to patch here. The problem is that amsrefs is very hard to hack imho... – mbork May 03 '12 at 11:53
  • Thanks again. Works fine for \cite, but fails for \citelist... – mbork May 03 '12 at 12:14
  • The hack to \citemid seems to work. I've modified it. – egreg May 03 '12 at 12:24
  • Thanks a lot! You're right, this works (although I have a feeling that \citemid is not really for this kind of hacks). – mbork May 03 '12 at 12:31
  • @mbork Probably it isn't; but there seems not to be any specific formatting command for that part. – egreg May 03 '12 at 12:36
  • Yes, this seems to be a general problem with amsrefs... Is biber+biblatex better in this respect? – mbork May 03 '12 at 12:39
  • I'd recommend biblatex, sure. – egreg May 03 '12 at 12:46
  • I know, it's all the hotness now, but amsrefs has two important advantages: (i) one file with document and bibliography (this can be overcome of course with \write-ing) and (ii) one binary to compile ((pdf|xe|)latex) (which seems much more difficult to overcome, maybe by means of \write18?). And my question remains: is changing the style of citations (and "biblists") easier in biblatex? – mbork May 03 '12 at 12:49