Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using apalike-letters bibliography style and when citing multiple sources a comma is used to separate them:

image

How can I modify this to use semicolon instead of comma? I've changed every comma to semicolon in the class file but it didn't help :/

Any ideas? Please note that I don't want to use natbib because I have very large document and natbib generates some strange errors while compiling…

You can find the whole project (with the style file in it) at http://piec.info/apalike-letters_test.zip [76 KB].

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

It's really quite easy; well, almost. Just remove

\usepackage{breakcites}

and substitute that line with

\makeatletter
\def\@citex[#1]#2{%
  \let\@citea\@empty
  \@cite{\@for\@citeb:=#2\do
    {\@citea\def\@citea{;\penalty\@m\ }%
     \edef\@citeb{\expandafter\@firstofone\@citeb}%
     \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
     \@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}%
       \G@refundefinedtrue
       \@latex@warning
         {Citation `\@citeb' on page \thepage \space undefined}}%
       {\csname b@\@citeb\endcsname}}}{#1}}
\makeatother

It's just the same definition make by breakcites, but with a semicolon instead of a comma.

If this mysterious code scares you, use

\usepackage{breakcites}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@citex}{,}{;}{}{}
\makeatother

that does the same.

share|improve this answer
    
You're a genius! Works as a charm. I didn't realize that it was caused by the breakcites package (which I use to properly hyphenate and break cites). Thanks! –  bpiec Jun 24 '12 at 16:54
    
@bpiec Without breakcites it would have been the same; the package modifies the \@citex command in the LaTeX kernel, which has a comma in the corresponding place. But the \patchcmd trick would work the same. :) –  egreg Jun 24 '12 at 17:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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