13

I have a large table which gives a literature overview and contains only citations in its cells.

I'm using biblatex with a numeric format, so sources are normally cited as

  • [33],
  • [35-37, 49]
  • [123, S. 54f] etc.

The parentheses need a lot of space (the table has many columns), so I'd like to remove them (only) in this table:
Is there a \cite command which only gives the numeric key (and the pages) without parenthesis like

  • 33
  • 35-37, 49
  • 123, S. 54f

Note: I need this modification without [] only in this one table, not in the rest of the document!

3 Answers 3

8

EDIT: Changed the answer according to the comment, that Martin is using numeric-comp

You can create a new cite command which based on the code of numeric-comp.cbx

The default setting is:

\DeclareCiteCommand{\cite}[\mkbibbrackets]
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}%
   \usebibmacro{postnote}}

So you create:

\DeclareCiteCommand{\tabcite}%[\mkbibbrackets]
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}%
   \usebibmacro{postnote}}

and now use \tabcite{<key>}

Here is a minimal example:

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{test,
author={Vorname Name},
title ={The Title},
year={2011}
}
\end{filecontents*}
\documentclass[a4paper]{article}
\usepackage[style=numeric]{biblatex}
\bibliography{\jobname}
\DeclareCiteCommand{\tabcite}%[\mkbibbrackets]
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}%
   \usebibmacro{postnote}}

\begin{document}
\cite{test}\qquad\tabcite{test}

\printbibliography
\end{document}

I use biblatex v1.6.

enter image description here

6
  • 2
    thank you! Where do I have to put the \DeclareCite command? I put in in my preamble and got an error message "Bibliography macro 'cite' undefined" Aug 17, 2011 at 16:55
  • 1
    @Martin: The preamble is correct. I will add a minimal example. Aug 17, 2011 at 17:39
  • 1
    Thank you for the minimal example! (It works for me, but:) I'm using the style numeric-comp and then I get the above error message. Would that also work with your installation? (I still have biblatex 1.4, must see how I can upgrade to 1.6, if that should be the reason for my problem) Aug 18, 2011 at 5:42
  • @Martin: I edited my post. Why do you use biblatex v1.4? You can update the package with your package manager as usual. Aug 18, 2011 at 6:44
  • My package manager TeX Live Utiliy (MacOS X) refuses to update any packages as I still have TeXLive 2010 on my machine. It seems that I'll have to install TeXLive 2011, which I will do asap. Thanks for the change of your MWE. Aug 18, 2011 at 8:23
8

I'd simply redefine \mkbibbrackets to do nothing inside the group created by the table.

\documentclass{article}

\usepackage{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

\begin{table}
\renewcommand{\mkbibbrackets}[1]{#1}
\centering
\begin{tabular}{c}
\autocite[99]{A01}
\end{tabular}
\caption{A table}
\end{table}

Some text \autocite[99]{A01}.

\printbibliography

\end{document}
4

Put this before the table:

\DeclareCiteCommand{\cite}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

and then after the table, put back the normal numeric style definition:

\DeclareCiteCommand{\cite}[\mkbibbrackets]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .