1

I am trying to achieve citations and a bibliography, that look like this:

There’s a sentence, where a book of SCOTT (1991) is quoted. Then some text with STRATTON et al. 1981 in it.

Bibliography

SCOTT 1991: David A. Scott, Metallography and microstructure of ancient and historic metals, Los Angeles, 1991.

STRATTON et al. 1981: Carol Stratton und Miriam McNair Scott, The Art of Sukhothai. Thailand’s Golden Age, Oxford, New York, Melbourne, 1981.

With lockstep's solution of the original question "Adding an [AuthorYear] block at the beginning of bibliography entries" I got pretty close, but the uppercase letters and "et al." are not going well together. This is what I got so far:

\begin{filecontents}{Test.bib}
@book{Scott1991,
address = {Los Angeles},
author = {Scott, David A.},
publisher = {Archetype Books},
title = {{Metallography and microstructure of ancient and historic metals}},
year = {1991}
}

@book{Stratton1981,
address = {Oxford, New York, Melbourne},
author = {Stratton, Carol and {McNair Scott}, Miriam},
publisher = {Oxford University Press},
title = {{The Art of Sukhothai. Thailand's Golden Age}},
year = {1981}
}

\end{filecontents}

\documentclass[ngerman]{scrreprt}
\usepackage[ngerman]{babel} 
\usepackage[utf8]{inputenc}

    \usepackage[%
    citestyle=authoryear-comp,%
    bibstyle=authortitle-comp,%
    backend=bibtex]{biblatex}%  
    \ExecuteBibliographyOptions{%
        maxcitenames=1,%
        language=ngerman,%  
        punctfont=true,%
        autopunct=false,%
        sorting=nyt}

% -- Publisher, Location, Date
        \renewbibmacro*{publisher+location+date}{%
        \printlist{location}%
        \setunit*{\addcomma\space}%
        \usebibmacro{date}%
        \newunit}

% -- Author-Year-Block at the beginning

    \newcounter{mymaxcitenames}
    \AtBeginDocument{%
    \setcounter{mymaxcitenames}{\value{maxnames}}%
    }

    \renewbibmacro*{begentry}{%
        \printtext[]{%          
            \begingroup
                \defcounter{maxnames}{\value{mymaxcitenames}}%
                \printnames{labelname}%
                \setunit{\nameyeardelim}%
   \usebibmacro{cite:labelyear+extrayear}%
            \endgroup
            }%
        \addcolon\addspace
    }
% -- Sorting, dots etc.

    \DeclareNameAlias{sortname}{given-family}
%   \DeclareNameFormat{labelname}{\MakeUppercase{#1}}   % <--- Produces labels in Uppercase but also kills "et al."

    \DeclareFieldFormat*{title}{#1\isdot}
    \DeclareFieldFormat{parens}{#1} 
    \DeclareFieldFormat{booktitle}{#1\isdot}

    \DefineBibliographyStrings{ngerman}{andothers = {et\addabbrvspace al\adddot}}

    \renewcommand{\newunitpunct}{\addcomma\space}
    \setlength{\bibitemsep}{\baselineskip}
    \setlength{\bibhang}{0pt}


\bibliography{Test.bib}     

\begin{document}
There's a sentence, where a book of \textcite{Scott1991} is quoted. Then some text with \cite{Stratton1981} in it.

\printbibliography

\end{document}

I'd love to be enlightened by you, magically producing uppercase names and lowercase "et al.". :)

^1 borrowed from here

  • Note that you are missing some %s in your code at the end of lines, this can potentially introduce unwanted space. There should be no need to redefine \newblockpunct if you already have \renewcommand{\newunitpunct}{\addcomma\space}. And you should probably use andothers = {et\addabbrvspace al\adddot} to not mess up the punctuation tracker. With biblatex >= 3.3 \DeclareNameAlias{sortname}{first-last} would be \DeclareNameAlias{sortname}{given-family}. \DeclareFieldFormat{parens}{#1} looks a bit suspicious to me, too. – moewe Apr 10 '16 at 14:45
  • \DeclareFieldFormat[article, book, inbook, incollection, inproceedings, patent, thesis, unpublished, misc]{title}{#1\isdot} can easily be replaced by \DeclareFieldFormat*{title}{#1\isdot} to reset the title format for all types. – moewe Apr 10 '16 at 14:46
  • I tried that last part before posting the question but it did not produce the same result. I could not figure out why. – fortunecookies Apr 10 '16 at 14:51
  • It does the same in your MWE, I would be interested to see an example of how it doesn't work. It should really. – moewe Apr 10 '16 at 14:53
  • I'll eliminate it from the example. But my original document is huge and I do not yet know how to reproduce that in a smaller scale. There are a few other oddities like that but I thought I should not cutter the question... – fortunecookies Apr 10 '16 at 15:04
  • That is good thinking (we prefer one question at a time). But if you can find the time to isolate the issue a bit, do not hesitate to ask a new question. – moewe Apr 10 '16 at 15:06
  • I found out that I need both redefinitions, \newblockpunct and \newunitpunct. Otherwise I either get dots between the parts of the entries or a new line for each part. Where Do I need to put the %? These always are a mystery to me.... – fortunecookies Apr 10 '16 at 15:29
  • That could be because of your block=nbpar, just drop it. For % placement read this and linked questions (especially this one), you basically want it at all line ends except after a command without braces. So after \foo it is not necessary, but after \foo{ or \foo{bar} you would need a %. Cf. also the modified version of my answer. – moewe Apr 10 '16 at 15:33

1 Answers1

2

Just add \renewcommand*{\mkbibnamefamily}{\textsc} to the \renewbibmacro*{begentry} bit and to \AtEveryCite

\AtEveryCite{\renewcommand*{\mkbibnamefamily}{\textsc}}
\renewbibmacro*{begentry}{%
  \printtext{%
    \begingroup
      \renewcommand*{\mkbibnamefamily}{\textsc}%
      \defcounter{maxnames}{\value{mymaxcitenames}}%
      \printnames{labelname}%
      \setunit{\nameyeardelim}%
      \usebibmacro{cite:labelyear+extrayear}%
    \endgroup
  }%
  \addcolon\addspace
}

In pre-3.3 biblatex that would be \mkbibnamelast instead.


Or you can go about this the other way and make \textsc the default and change the font only after the bibliography label.

\renewcommand*{\mkbibnamefamily}{\textsc}
\renewbibmacro*{begentry}{%
  \printtext{%
    \begingroup
      \defcounter{maxnames}{\value{mymaxcitenames}}%
      \printnames{labelname}%
      \setunit{\nameyeardelim}%
      \usebibmacro{cite:labelyear+extrayear}%
    \endgroup
  }%
  \addcolon\addspace
  \renewcommand*{\mkbibnamefamily}[1]{##1}%
}
moewe
  • 175,683
  • wow, that was fast! This is producing small caps, but I need the real uppercase letters. I should affect both, the citation and the bibliography. I will update the question to point that out, too. – fortunecookies Apr 10 '16 at 14:49
  • 1
    @fortunecookies Well, just replace \textsc by \MakeUppercase if you must. Can you specify where exactly you need the CAPS? When you say bibliography do you mean in the labels and in the actual entry? – moewe Apr 10 '16 at 14:52
  • My university just wants them to look like that. Personally I'd also prefer small caps. With bibliography I meant it to look like my example on top: Uppercase labels and normal names in the actual entry. – fortunecookies Apr 10 '16 at 15:10
  • @fortunecookies OK, check out the edited answer (but replace \textsc with \MakeUppercase). – moewe Apr 10 '16 at 15:11
  • I chose the first option and it works great. just one last tweak: there should be an empty line between the entries of the bibliography: I guess my lack of % produced it accidentally but how do I get it on purpose? – fortunecookies Apr 10 '16 at 15:44
  • 1
    @fortunecookies Modify \bibitemsep, maybe \setlength{\bibitemsep}{2\itemsep}, \setlength{\bibitemsep}{\parsep} or \setlength{\bibitemsep}{\baselineskip} are what you are after. – moewe Apr 10 '16 at 15:46
  • the baselineskip fitted nicely. Is it ok to kill the hanging indentation with \setlength{\bibhang}{0pt}? – fortunecookies Apr 10 '16 at 16:00
  • @fortunecookies If you (or your university) insist on having no hanging indent. I suppose you can get away with it if the \bibitemsep is large enough, otherwise it will look a bit meh. – moewe Apr 10 '16 at 16:05
  • I definitely see what you mean, but I am bound by their citation guidelines. Thanks a lot for helping me out so patiently! – fortunecookies Apr 10 '16 at 16:39
  • @moeve There is a tiny problem remaining... when I use ´\fullcite´ or ´\footfullcite´ to display the full bibliographic information of a book, then both names (in the label and in the actual entry) are in uppercase letters. How do I only change the labeling part? – fortunecookies Apr 12 '16 at 12:38
  • @fortunecookies Can you try the alternative solution? – moewe Apr 12 '16 at 12:41
  • @moeve The \fullcite-problem appears only when using the first solution. The second one looks good. :) – fortunecookies Apr 12 '16 at 13:04