5

Updated with MWE:

I am making a template for keeping track of articles for a project and for this I want to have costumized \cite-s to use in text and as section titles. I have made a crude solution:

\documentclass[a4paper,13ptmathspec]{scrartcl}
\usepackage{filecontents}
\usepackage{biblatex}


\begin{filecontents}{ref.bib}
@article{szabo2006,
  title = {Phase transition in the collective migration of tissue cells: Experiment and model},
  author = {Szab\'o, B. and Sz\"oll\"osi, G. J. and G\"onci, B. and Jur\'anyi, Zs. and Selmeczi, D. and Vicsek, Tam\'as},
  journal = {Phys. Rev. E},
  volume = {74},
  issue = {6},
  pages = {061908},
  numpages = {5},
  year = {2006},
  month = {Dec},
  publisher = {American Physical Society},
  doi = {10.1103/PhysRevE.74.061908},
  url = {http://link.aps.org/doi/10.1103/PhysRevE.74.061908}
}
\end{filecontents}
\addbibresource{ref.bib}
\begin{document}
\section{First section}
I want to be able to modifiy the citing style separatly here (\citeauthor{szabo2006} \citeyear{szabo2006}\cite{szabo2006}).
\section{\citeauthor{szabo2006}:\citetitle{szabo2006}\cite{szabo2006}}
and in the section title. I also don't want the quotes in the section title.

\printbibliography
\end{document}

enter image description here

My problem is, that I could make these multiple cite-s into one command with newcommand, but for example I would like to remove the quotes around the title, when I put it in the section title. It seems to me that \DeclareCiteCommand would be the way to go, but I was unable to make it work. How could this be accomplished?

  • 3
    A minimal working example (MWE) is needed. – egreg May 11 '14 at 21:52
  • What does the question have to do with chapter titles? – cfr May 12 '14 at 1:36
  • 2
    MWE, and perhaps some visual indication of how it should appear. The MWE will answer what bibstyle/citestyle you have in mind, and the manually-constructed visual example will help make sure the answer is along the lines you envision. (E.g., probably not everyone has the same idea as to what 'normal reference numbering' means....) – jon May 12 '14 at 2:35
  • This is mildly related (it shows how implementing such a command might work). If you use a class that passes the argument to \chapter or \section on to \MakeUppercase and friends, you might also like to read A \cite{} as name for a chapter header. If you can come up with a MWE, we might be able to eventually answer your question satisfyingly. – moewe May 12 '14 at 5:04
  • Sorry, I was not carefull enough with the question, shame on me. I tried to clarify it and added an mwe, I hope it is alright now. – fbence May 13 '14 at 13:31
5

\DeclareCiteCommand is not so fearsome. The first and last arguments are usually just \usebibmacro{prenote} and \usebibmacro{postnote}. The third argument usually \multicitedelim. Finally the second argument prints your citation:

  • \printnames{labelname} gives you the authors
  • \printfield{labeltitle} the title
  • \printfield{year} the year

you can then add appropriate punctuation via \addcolon, \addspace etc. and biblatexs bracketing macros. Here are a couple of variations:

Sample output

\documentclass[a4paper,13ptmathspec]{scrartcl}
\usepackage{filecontents}
\usepackage[style=numeric]{biblatex}

\DeclareCiteCommand{\citesect}{\usebibmacro{prenote}}%
{\printnames{labelname}\addcolon\addspace\printfield{labeltitle}%
\addspace\mkbibparens{\printfield{year}}}%
{\multicitedelim}{\usebibmacro{postnote}}

\DeclareCiteCommand{\citesectno}{\usebibmacro{prenote}}%
{\printnames{labelname}\addcolon\addspace\printfield{labeltitle}%
\addspace\mkbibparens{\printfield{year}}\addspace\mkbibbrackets{\usebibmacro{cite}}}%
{\multicitedelim}{\usebibmacro{postnote}}

\begin{filecontents}{ref.bib}
@article{szabo2006,
  title = {Phase transition in the collective migration of tissue cells: Experiment and model},
  author = {Szab\'o, B. and Sz\"oll\"osi, G. J. and G\"onci, B. and Jur\'anyi, Zs. and Selmeczi, D. and Vicsek, Tam\'as},
  journal = {Phys. Rev. E},
  volume = {74},
  issue = {6},
  pages = {061908},
  numpages = {5},
  year = {2006},
  month = {Dec},
  publisher = {American Physical Society},
  doi = {10.1103/PhysRevE.74.061908},
  url = {http://link.aps.org/doi/10.1103/PhysRevE.74.061908}
}
\end{filecontents}
\addbibresource{ref.bib}
\begin{document}
\section{First section}
I want to be able to modifiy the citing style separately here
(\citeauthor{szabo2006} \citeyear{szabo2006} \cite{szabo2006}).

\section{\citesect{szabo2006}}
A citation in the section title without quotes.

\section{\citesectno{szabo2006}}
A citation in the section title without quotes and with the citation number.

\printbibliography
\end{document}

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.