2

To elaborate on this example, I have this code:

\documentclass[ngerman]{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{filecontents}
\begin{filecontents}{bibliographie.bib}
@newspaper{SZ.23.06.2014,
 author = {Gammelin, Cerstin and Hulverscheidt, Claus},
 year = {2014},
 title = {Sozialisten nennen Preis für Juncker},
 pages = {1},
 pagination = {page},
 journal = {Süddeutsche Zeitung},
 month = {23.06.}
}
\end{filecontents}

\usepackage[style=authoryear-luh-ipw,datelabel=terse]{biblatex}
\DeclareBibliographyAlias{newspaper}{article}
\addbibresource{bibliographie.bib}

\renewbibmacro*{cite:labelyear+extrayear}{%
  \iffieldundef{labelyear}
    {}
    {%
     \ifentrytype{newspaper}%
         {%
          \printtext[bibhyperref]{\printfield{month}\printfield{year}}%
         }%
        {%
         \printtext[bibhyperref]{\printfield{labelyear}\printfield{extrayear}}%
        }%
   }%
}

\begin{document}

\parencite{SZ.23.06.2014}

\printbibliography

\end{document}

which gives me the following output (note the additional space within the parentheses):

enter image description here

What I want to do is to cite newspaper articles by the newspaper (not the actual author), something like this:

(Süddeutsche Zeitung 23.06.2014, S. 11)

Literatur

Süddeutsche Zeitung (23.06.2014) = Gammelin, Cerstin und Claus Hulverscheidt : Sozialisten nennen Preis für Junker. In: Süddeutsche Zeitung 23.06.2014, S. 11.

I did have a look at the Biblatex documentation, but I'm kind of confused with Biblatex's macro structure. Can anyone please help me?

  • You can get rid of the evil space by using the correct way to enter dates in biblatex: either just date = {2014-06-23}, no year, month or day field; or year = {2014}, month = {6}, day={23} (obviously the former is somewhat shorter and - I think - more readable). If you need another date format than the one you get if you use the date field, have a look at the date option and its friends (pp. 51 sq. in the biblatex manual): you probably want date=short. – moewe Jun 23 '14 at 14:54
  • Thanks, I had actually found the suggestion of misusing the month format somewhere. Could you give me a hint about the second part of my question? – user3447650 Jun 23 '14 at 17:21
3

You have only adjusted the format of citations and not of the printed date in the bibliography. Also you are misusing the month format, the day should be put in a separate day field. Here is an example including an article entry to show that we are only changing the format of news paper entries.

Update to address your citing format for these entries I have add code to modify the standard cite macro from authoryear-icomp.cbx to first test wether the type of the entry is newspaper and the to apply appropriate formatting.

Sample output

\documentclass[ngerman]{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{filecontents}
\begin{filecontents}{bibliographie.bib}
@newspaper{SZ.23.06.2014,
 author = {Gammelin, Cerstin and Hulverscheidt, Claus},
 year = 2014,
 title = {Sozialisten nennen Preis für Juncker},
 pages = {1},
 pagination = {page},
 journal = {Süddeutsche Zeitung},
 month = 6,
 day=23
}
@Article{test-art,
  author =   {Author, A. N.},
  title =    {Title},
  journal =  {J. Jour.},
  year =     2014,
  volume =   4,
  number =   2,
  pages =    {1--20},
  month =    6,
  day =      20
}
\end{filecontents}

\usepackage[style=authoryear-luh-ipw,datelabel=terse]{biblatex}
\DeclareBibliographyAlias{newspaper}{article}
\addbibresource{bibliographie.bib}

\renewbibmacro*{cite:labelyear+extrayear}{%
  \iffieldundef{labelyear}
    {}
    {%
     \ifentrytype{newspaper}%
         {%
         \printtext[bibhyperref]{\mkdatezeros{\thefield{day}}\adddot
         \mkdatezeros{\thefield{month}}\adddot\printfield{year}}%
         }%
        {%
         \printtext[bibhyperref]{\printfield{labelyear}\printfield{extrayear}}%
        }%
   }%
}

\DeclareFieldFormat[newspaper]{date}{\mkdatezeros{\thefield{day}}\adddot
         \mkdatezeros{\thefield{month}}\adddot\printfield{year}}

\makeatletter
\renewbibmacro*{cite}{% Modified from authoryear-icomp.cbx
  \ifentrytype{newspaper}{\printtext{\printfield{journaltitle}\addspace\usebibmacro{cite:labelyear+extrayear}\addcomma\addspace \printfield{pages}}%
  }
  {\iffieldundef{shorthand}
    {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
       {\usebibmacro{cite:ibid}}
       {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
          {\usebibmacro{cite:label}%
           \setunit{\addspace}%
           \usebibmacro{cite:labelyear+extrayear}%
           \usebibmacro{cite:reinit}}
          {\iffieldequals{namehash}{\cbx@lasthash}
             {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
                          \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
                {\setunit{\addcomma}%
                 \usebibmacro{cite:extrayear}}
                {\setunit{\compcitedelim}%
                 \usebibmacro{cite:labelyear+extrayear}%
                 \savefield{labelyear}{\cbx@lastyear}}}
             {\printnames{labelname}%
              \setunit{\nameyeardelim}%
              \usebibmacro{cite:labelyear+extrayear}%
              \savefield{namehash}{\cbx@lasthash}%
              \savefield{labelyear}{\cbx@lastyear}}}}}
    {\usebibmacro{cite:shorthand}%
     \usebibmacro{cite:reinit}}}%
  \setunit{\multicitedelim}}
\makeatother

\begin{document}

\parencite{SZ.23.06.2014} and \parencite{test-art}

\printbibliography

\end{document}
  • Thanks, Andrew (unfortunately, I cannot vote you up yet). Like I have noted above, I had found the suggestion of misusing the month format somewhere. Could you give me a hint about the second part of my question? – user3447650 Jun 23 '14 at 17:23

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.