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 customize verbose biblatex citations to exclude URLs (and DOIs) while keeping them in the bibliography. Is there a simple way to accomplish this?

While I'm at it, I'd like to get rid of the "In: " that the verbose styles use (in both the bibliography and citations), and put the URLs and DOIs on separate lines in the bibliography.

share|improve this question
1  
Just want to mention that your add-on questions have already been addressed. lockstep gives a really nice intro to customizing styles here. –  Audrey Mar 4 '12 at 23:33

1 Answer 1

up vote 7 down vote accepted

I answer in order to all your questions

  1. Every field in biblatex can be modified by the command DeclareFieldFormat. To change settins only at cite commands you can use the command \AtEveryCite.

    \AtEveryCite{%
      \DeclareFieldFormat{url}{}%
      \DeclareFieldFormat{urldate}{}%
      \DeclareFieldFormat{doi}{}%
     }
    

    Instead you can also use AtEveryBibitem.

  2. The word "in" can be removed by redefining the macro in: as follow:

     \renewbibmacro*{in:}{} 
    
  3. Extra line breaks can be done by expanding the relevant field formats.

     \DeclareFieldFormat{url}{\newline\mkbibacro{URL}\addcolon\space\url{#1}}
     \DeclareFieldFormat{doi}{\newline%
       \mkbibacro{DOI}\addcolon\space
       \ifhyperref
         {\href{http://dx.doi.org/#1}{\nolinkurl{#1}}}
         {\nolinkurl{#1}}}
    

Every definition can be found in the file biblatex.def

Here the complete code:

\documentclass[]{article}
\usepackage{filecontents}
\begin{filecontents}{References.bib}
@article{Sarukkai:2005,
author = {Sarukkai, S},
title = {Revisiting the 'unreasonable effectiveness' of mathematics},
journal = {Current science},
year = {2005},
url = {http://www.ias.ac.in/currsci/feb102005/415.pdf},
}
\end{filecontents}
\usepackage[style=verbose]{biblatex}
\addbibresource{References.bib}
\AtEveryCite{%
 \DeclareFieldFormat{url}{}%
 \DeclareFieldFormat{urldate}{}%
 \DeclareFieldFormat{doi}{}%
}
\DeclareFieldFormat{url}{\newline\mkbibacro{URL}\addcolon\space\url{#1}}
\DeclareFieldFormat{doi}{\newline%
  \mkbibacro{DOI}\addcolon\space
  \ifhyperref
    {\href{http://dx.doi.org/#1}{\nolinkurl{#1}}}
    {\nolinkurl{#1}}}

\renewbibmacro*{in:}{} 

\begin{document}
This, \fullcite{Sarukkai:2005} includes the URL for the citation, which I don't want; thought I do want it in the bibliography.


\printbibliography
\end{document}

enter image description here

share|improve this answer
    
Brilliant. This works perfectly, with one glitch. I'm using this code inside of a \newcommand{mycommand} definition with arguments, so the #1 is being substituted with the first argument to mycommand, is there a way to avoid that? –  raxacoricofallapatorius Mar 4 '12 at 18:43
3  
@raxacoricofallapatorius: Use ##1 for this argument –  Marco Daniel Mar 4 '12 at 18:55

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.