4

I have a book that uses footnotes and several bibliographies, and includes books, articles and the like. Ordinarily, the citation style author-year and along the lines of "Author (Year), Title, Publisher." I use a code fragment to adapt the standard biblatex style so that I get parenthesis around the year for all literature types (see MWE). However, I have one literature type (misc2) that I created to cover court rulings (as misc one is used for legal documents that otherwise don't fit in the biblatex types). These are, unlike the rest, supposed to look like this: "EuG v. 15.6.2000, Rs. T-298/07, T-312/97, Slg. 2000, II-2325 -- Alzetta" (Court v. Date, Title).

I want to adapt only the type misc 2 to show the year field in "v. YEAR" instead of "(YEAR)". How can I adapt my code for that purpose?

MWE:

\documentclass[graybox,envcountchap,sectrefs]{svmono}
\usepackage[autocite=footnote, language=german, style=authoryear-ibid, sorting=nyt, backend=biber]{biblatex}
\usepackage[bottom]{footmisc}
\bibliography{lit.bib}
\makeindex
%command for generally putting parenthesis around year/date
\renewbibmacro*{cite:labelyear+extrayear}{%
\iffieldundef{labelyear}
  {}
  {\ifentrytype{misc}
    {
        \printtext[bibhyperref]{%
        %\printtext[parens]{%
        %\printfield{labelyear}%
        %\printfield{extrayear}}
        }}  
    {
        \printtext[bibhyperref]{%
        \printtext[parens]{%
        \printfield{labelyear}%
        \printfield{extrayear}}
        }}
   }
   }
\begin{document}

Test Document Group 1 (book)\autocite[2]{draftnotice}.


"Misc" is used for other legal documents, "Misc 2" is distinct and used for court rulings:


Test Document Group 2 (Misc2)\footnote{\fullcite{eugh29807}.} 


What Test Document Group 2 is supposed to be like\footnote{EuG v. 15.6.2000, Rs. T-298/07, T-312/97, Slg. 2000, II-2325 -- Alzetta}

\end{document}

My lit.bib

@book{draftnotice,
    Author = {{Karl Marx}},
    Howpublished = {Capital},
    Year = {1867}}

@misc2{eugh29807,
    Author = {{EuG}},
    Howpublished = {Rs. T-298/07, T-312/97, Slg. 2000, II-2325 -- Alzetta},
    Year = {15.6.2000}}

And a picture to show what i mean:

enter image description here

  • 1
    Please note that with biblatex the proper way to give a date with month and day is the date field: date = {2000-06-15} instead of year = {15.6.2000}. (You may need some modifications to show the full date in the correct format then.) – moewe Jun 20 '16 at 5:26
2
+50

You can use \DeclareFieldFormat for this, which allows formatting on a per-entry type. (I've changed your documentclass to article, since I don't have your class).

Note: This is a temporary answer, which although it works has some problems as noted in the comments. I will update with a better solution.

\documentclass[]{article}
\begin{filecontents}{\jobname.bib}
@book{draftnotice,
    Author = {{Karl Marx}},
    Howpublished = {Capital},
    Year = {1867}}

@misc2{eugh29807,
    Author = {{EuG}},
    Howpublished = {Rs. T-298/07, T-312/97, Slg. 2000, II-2325 -- Alzetta},
    Year = {15.6.2000}}
\end{filecontents}
\usepackage[autocite=footnote, language=german, style=authoryear-ibid, sorting=nyt, backend=biber]{biblatex}
\usepackage[bottom]{footmisc}
\bibliography{\jobname.bib}

%command for generally putting parenthesis around year/date
\renewbibmacro*{cite:labelyear+extrayear}{%
\iffieldundef{labelyear}
  {}
  {\printtext[bibhyperref]{%
   \printtext[parens]{%
   \printfield{labelyear}%
   \printfield{extrayear}}%
   }}%
   }

\DeclareFieldFormat[misc2]{parens}{v. #1\addcomma}
\begin{document}

Test Document Group 1 (book)\autocite[2]{draftnotice}.


"Misc" is used for other legal documents, "Misc 2" is distinct and used for court rulings:


Test Document Group 2 (Misc2)\footnote{\fullcite{eugh29807}.} 


What Test Document Group 2 is supposed to be like\footnote{EuG v. 15.6.2000, Rs. T-298/07, T-312/97, Slg. 2000, II-2325 -- Alzetta}

\end{document}

output of footnotes

  • marvellous! seems to work. – kuuhkuuh Jun 18 '16 at 20:39
  • 1
    The "risk" with this is that if the parens format is used anywhere else for @misc2 one will still get the "v. " prefix, this could be undesirable. Introducing brackets in cite:labelyear+extrayear can cause double brackets in \textcite context. (You might also want to make sure that the redefinition of cite:labelyear+extrayear does not introduce spurious spaces.) – moewe Jun 19 '16 at 6:55
  • 1
    @moewe Yes, I'm aware of that problem. I've fixed the spaces problem, but also adding the comma in the field format is problematic too. Can you suggest a better way of solving this? (I can update my answer or feel free to add a new answer yourself.) – Alan Munn Jun 19 '16 at 18:19
  • 1
    I didn't think of the \addcomma in the field format, but I agree that is also a bit unfortunate. I think the new format is sufficiently dissimilar that I would branch the entire cite macro with \ifentrytype. If I had to deal with legal citations I would probably create a new entry type for that and would be prepared to accept that the cite macro would look different for that special type. – moewe Jun 20 '16 at 5:39
  • 1
    I'll add an updated answer in a few days. – Alan Munn Jun 20 '16 at 22:07

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.