2

I would like to remove the year label, if it is undefined. What I get:

EC No 197/38 2012 (n.d.)

But it should be:

EC No 197/38 2012

In the bibliography I get this, but it is correct for me:

EC No 197/38 2012: Waste electrical and electronic equipment (WEEE), 4 July 2012, Commission Regulation.

\documentclass{book}
\usepackage[style=authoryear-icomp]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{biblio.bib}
@Misc{EC4July2012,
  Title                    = {Waste electrical and electronic equipment ({WEEE}), 4 July 2012},
  Author                   = {{EC No 197/38 2012}},
  Type                     = {Commission Regulation},
}
\end{filecontents}

\addbibresource{biblio.bib}

\nocite{*}

\begin{document}
Something \autocite{EC4July2012}.
\printbibliography

\end{document}
8
  • The proper way would be to have the date (in your 4 July 2012) case in the year field in the bibtex entry. – Guido May 21 '14 at 11:35
  • @Guido The problem is that it is a European Comission Regulation. And in the short form citation should be "EC No 197/38 2012". The form and style of laws are difficult to make correct in this case. – Xeo May 21 '14 at 11:41
  • 1
    If you have more of these rules/regulations/laws that need special handling, it might be a good idea to create a new entry type for those (a starting point might be List of People analog to Bibliography and How can I create entirely new data types with BibLaTeX/Biber?), if you can provide a prototype of what your citations contain and how they should look like in citations and bibliographies, we might be able to help you here. – moewe May 22 '14 at 5:17
  • Of course you can also just redefine a cite command to always omit dates for @miscs: \renewbibmacro*{cite:labelyear+extrayear}{% \ifentrytype{misc} {} {\iffieldundef{labelyear} {} {\printtext[bibhyperref]{% \printfield{labelyear}% \printfield{extrayear}}}}} (modulo line breaks and comment characters, if you want that, I can write up an answer). – moewe May 22 '14 at 5:21
  • @moewe It is working with your redefinition, but now i have space before parenthesis in all cites. Author x and Author y ( 2014 ) or (Author y et. al. 2002 )? – Xeo May 23 '14 at 19:44
2

Handling of laws, regulations etc. that are supposed to be cited in a very particular way isn't all that easy. If you have several of such documents you might want to consider creating dedicated entrytypes for easy customisation (see How can I create entirely new data types with BibLaTeX/Biber? on how to do that, and How to implement a jurisdiction biblatex entry type? & How to cite a section of a Constitution for a more thought through and an ad-hoc solution; as well as What is the proper way to cite a legal document? for a general discussion).

In your case, there is the obvious ad-hoc solution of suppressing years for @miscs:

\renewbibmacro*{cite:labelyear+extrayear}{%
  \ifentrytype{misc}
    {}
    {\iffieldundef{labelyear}
      {}
      {\printtext[bibhyperref]{%
         \printfield{labelyear}
         \printfield{extrayear}}}}}
0

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.