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'd like to add a certain marker after some bibliographic entries, e. g. superscript star *.

It should appear directly after the references number and should not be separated by a comma (as normal suffixes are).

Remark: I also need the normal suffixes for giving page numbers, so how could I achieve that without changing the standard behavior of \cite[prefix][suffix]{citekey}?

example:

\documentclass{scrbook}

\begin{filecontents*}{mybib7.bib}

@MISC{Caesar,
  author = {Caesar, Gaius J.},
  title = {title},
  year = {45BC},
}

@MISC{Cicero,
  author = {Cicero, Marcus T.},
  title = {title},
  year = {44BC},
}

\end{filecontents*}

\newcommand{\WW}{\textsuperscript{*}}

\usepackage[natbib=true, style=numeric-comp, backend=bibtex8, defernumbers, useprefix, maxnames=99, maxcitenames=3]{biblatex}  % f¸r bessere Literaturverzeichnisse
\renewcommand{\bibfont}{\normalfont\small}
\renewcommand\multicitedelim{\addsemicolon\space}


\usepackage{csquotes} 

\bibliography{mybib7}

\begin{document}

\cites[][\WW{}]{Caesar}[][p.~13]{Cicero}

I wish it would look like that: [1\WW{}; 2, p.~13]

\nocite{*}
\printbibliography

\end{document}

screenshot

share|improve this question
2  
By "some entries" do you mean the same ones consistently throughout the whole document? –  Audrey Feb 26 '12 at 17:13
1  
@Audrey: no, it will not always be the same cite keys, so there might be a citation of \cite{Caesar} with and another citation of \cite{Caesar} without the star in the same document. –  Martin Feb 26 '12 at 19:17
add comment

2 Answers

Here's one way to do it:

  • Define a new boolean citewithstar (which defaults to false).

  • Change the definition of the cite bibmacro so that a superscript star is added after the label number if citewithstar is true.

  • Define a macro \starnext that will set citewithstar to true for the next citation key.

  • Add \starnext in the prenote optional argument of the respectice citation command.

So far, there's one drawback: Adding \starnext in the prenote optional argument of the first/only citation key will produce an unwanted additional space. In this case, add \starnext before the citation command (see my example).

Note: You don't have to use "p.~13" in postnote optional arguments -- biblatex will assume that "13" is a page number and apply the correct formatting.

\documentclass{article}

\usepackage{biblatex}

\renewcommand*{\multicitedelim}{\addsemicolon\space}

\newbool{citewithstar}

\renewbibmacro*{cite}{%
  \printtext[bibhyperref]{%
    \printfield{prefixnumber}%
    \printfield{labelnumber}%
    \ifbool{citewithstar}{\textsuperscript{*}}{}% ADDED
    \ifbool{bbx:subentry}
      {\printfield{entrysetcount}}
      {}}}

\newcommand*{\starnext}{%
  \AtNextCitekey{\booltrue{citewithstar}}%
}

\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@MISC{Caesar,
  author = {Caesar, Gaius J.},
  title = {title},
  year = {45BC},
}
@MISC{Cicero,
  author = {Cicero, Marcus T.},
  title = {title},
  year = {44BC},
}
\end{filecontents*}

\addbibresource{\jobname.bib}

\begin{document}

\starnext\cites{Caesar}[13]{Cicero}

\cites{Caesar}[\starnext][13]{Cicero}

\printbibliography

\end{document}

enter image description here

If you'd like to specify the symbol in the label number suffix, a control sequence can take the place of citewithstar.

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=numeric-comp,sorting=none]{biblatex}
\usepackage[colorlinks]{hyperref}

\renewcommand*{\multicitedelim}{\addsemicolon\space}

\DeclareFieldFormat{labelnumber}{\mkbiblabelsuffix{#1}}

\newrobustcmd*{\mkbibsuffix}[1]{%
  \csgdef{cbx:suffix}{#1}}

\newrobustcmd*{\mkbiblabelsuffix}[1]{%
  \ifcsundef{cbx:suffix}
    {#1}
    {#1\mkbibsuperscript{\csuse{cbx:suffix}}%
     \global\csundef{cbx:suffix}}}

\addbibresource{biblatex-examples.bib}
\begin{document}
\mkbibsuffix{\dag}\cite[10--15]{companion}
\mkbibsuffix{*}\cites[10--15]{companion}[e.g.\mkbibsuffix{**}][]{ctan}{markey}{knuth:ct}
\mkbibsuffix{\ddag}\cites{companion}{ctan,markey,knuth:ct}
\printbibliography
\end{document}

enter image description here

share|improve this answer
1  
+1 Instead of a boolean flag, you could use a control sequence representing the suffix. This would make the solution more general without compromising its simplicity. (I wouldn't mind making edits to show you what I mean.) –  Audrey Feb 26 '12 at 21:47
    
@Audrey Feel free to edit! –  lockstep Feb 26 '12 at 21:52
    
Done. Please change/omit what I've added however you like. –  Audrey Feb 26 '12 at 22:13
add comment

The label number suffix can be specified in the postnote argument, but we need some way of distinguishing it from the actual postnote.

Here we wrap the suffix in parentheses and put it before any postnote. Other delimiters could be used, just not square and curly brackets - they either interfere with the arguments of the citation command or get processed out of the postnote field.

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=numeric-comp,sorting=none]{biblatex}
\usepackage[colorlinks]{hyperref}

\renewcommand*{\multicitedelim}{\addsemicolon\space}

\renewbibmacro*{postnote}{%
  \iffieldundef{postnote}{}{\printfield{postnote}}}

\DeclareFieldFormat{postnote}{\mkpostnote#1\relax}

\makeatletter

\newrobustcmd*{\mkpostnote}{%
  \@ifnextchar(%)
    {\mkpostnote@i}
    {\mkpostnote@i()}}

\def\mkpostnote@i(#1){%
  \ifblank{#1}{}{\mkbibsuperscript{#1}}%
  \@ifnextchar\relax{}{\mkpostnote@ii}}

\def\mkpostnote@ii#1\relax{%
  \postnotedelim%
  \mkpageprefix[pagination]{#1}}

\makeatother

\addbibresource{biblatex-examples.bib}
\begin{document}
\subsection*{Without label number suffix}
\cite[See][]{companion}
\cite[See][10]{companion}
\cite[See][10--15]{companion}
\cite[See][10--15 and the last section]{companion}
\cites[10--15]{companion}[e.g.][]{ctan}[10--15]{markey}[10]{knuth:ct}
\cite[See][]{companion,ctan,markey,knuth:ct}
\subsection*{With label number suffix}
\cite[See][(\dag)]{companion}
\cite[See][(\dag)10]{companion}
\cite[See][(\dag)10--15]{companion}
\cite[See][(\dag) 10--15 and the last section]{companion}
\cites[(*)10--15]{companion}[e.g.][(**)]{ctan}[10--15]{markey}[10]{knuth:ct}
\cites(See)()[(\ddag)]{companion}{ctan,markey,knuth:ct}
\printbibliography
\end{document}

enter image description here

For reference here's an excerpt of the same document without any changes to the postnote format.

enter image description here

share|improve this answer
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.