2

When I am citing an entry with a shorthand with biblatex-chicago, the year gets printed along with the shorthand label. Is there a way to make Bibtex to just print the shorthand without the year, i.e. the way authoryear does?


\documentclass{article}
\usepackage[
    authordate,
    backend=biber,
    safeinputenc,
    natbib,
]{biblatex-chicago}

\begin{filecontents*}{\jobname.bib}
@book{paul2007,
    author      = {Hermann Paul},
    title       = {{Mittelhochdeutsche Grammatik}},
    shorthand   = {MhdG},
    edition     = {25. Aufl., neu bearbeitet von Thomas Klein, Hans-Jochim Solms und Klaus-Peter Wegera. Mit einer Syntax von Ingeborg Schröbler, neubearbeitet und erweitert von Heinz-Peter Prell},
    series      = {Sammlung kurzer Grammatiken germanischer Dialekte A. Hauptreihe},
    number      = {2},
    publisher   = {Niemeyer},
    location    = {Tübingen},
    year        = {2007},
    pagination  = {section},
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
\citet{paul2007}
\printbibliography
\end{document}

This results in the following:

Bibliography with wrongly formatted text citation

What I want the in-text citation to look like is just 'MhdG' without the '2007'. If there are any pages indicated, those should stay in the normal way, of course.

3

This is a matter of deleting a few lines from the relevant bibmacros. We need to modify two bibmacros, textcite:authshort for \textcite/\citet and cite:shorthand for all other cite commands.

\documentclass{article}
\usepackage[
    authordate,
    backend=biber,
    safeinputenc,
    natbib,
]{biblatex-chicago}

\makeatletter
\renewbibmacro*{cite:shorthand}{%
  \printtext[bibhyperref]{\printfield{shorthand}}%
  \usebibmacro{cite:reinit}}

\renewbibmacro*{textcite:authshort}{%
  \iffieldequals{fullhash}{\cbx@lasthash}%
  {\iffieldundef{postnote}%
    {\iffieldequals{fullhash}{\cbx@lastyear}%
      {\setunit{\multicitedelim}%
        \global\undef\cbx@lastyear}%
      {\iffieldequalstr{entrysubtype}{classical}%
        {\setunit{\multicitedelim}}%
        {\setunit{\compcitedelim}}}}%
    {\setunit{\multicitedelim}}%
    \iffieldequalstr{entrysubtype}{classical}%
    {\usebibmacro{cite:label}}%
    {\usebibmacro{cmscitesortdate}}}%
  {\iffieldundef{shorthand}%
    {\ifthenelse{\ifnameundef{labelname}\OR
        \ifentrytype{inreference}\OR
        \ifentrytype{reference}\OR
        \ifentrytype{mvreference}}%
      {\iffieldequalstr{entrysubtype}{classical}%
        {\setunit{%
            \global\booltrue{cbx:parens}%
            \cms@testspace\bibopenparen}%
          \ifnumequal{\value{citecount}}{1}%
          {\usebibmacro{prenote}}%
          {}%
          \usebibmacro{cite:label}}%
        {\usebibmacro{cite:label}%
          \ifboolexpr{%
            togl {cms@gencite}%
            and
            (
            test {\iffinalcitedelim}%
            or
            togl {cms@genallnames}%
            )
          }%
          {\thegen}%
          {}%
          \setunit{%
            \global\booltrue{cbx:parens}%
            \cms@testspace\bibopenparen}%
          \ifnumequal{\value{citecount}}{1}%
          {\usebibmacro{prenote}}%
          {}%
          \usebibmacro{cmscitesortdate}}}%
      {\printnames{labelname}%
        \ifboolexpr{%
          togl {cms@gencite}%
          and
          (
          test {\iffinalcitedelim}%
          or
          togl {cms@genallnames}%
          )
        }%
        {\thegen}%
        {}%
        \setunit{%
          \global\booltrue{cbx:parens}%
          \cms@testspace\bibopenparen}%
        \ifnumequal{\value{citecount}}{1}%
        {\usebibmacro{prenote}}%
        {}%
        \iffieldequalstr{entrysubtype}{classical}%
        {\usebibmacro{cite:label}}%
        {\usebibmacro{cmscitesortdate}}%
        \savefield{fullhash}{\cbx@lasthash}}}%
    {\printfield{shorthand}%
      \ifboolexpr{%
        togl {cms@gencite}%
        and
        (
        test {\iffinalcitedelim}%
        or
        togl {cms@genallnames}%
        )
      }%
      {\thegen}%
      {}%
      \setunit{%
        \global\booltrue{cbx:parens}%
        \cms@testspace\bibopenparen}%
      \ifnumequal{\value{citecount}}{1}%
      {\usebibmacro{prenote}}%
      {}%
      \iffieldequalstr{entrysubtype}{classical}%
      {\usebibmacro{cite:label}}%
      {}%
      \savefield{fullhash}{\cbx@lasthash}}%
    \stepcounter{textcitecount}}% Added ???
  \setunit{%
    \ifbool{cbx:parens}%
    {\bibcloseparen\global\boolfalse{cbx:parens}}%
    {}%
    \textcitedelim}}% Not \multicitedelim ???
\makeatother

\begin{filecontents*}{\jobname.bib}
@book{paul2007,
    author      = {Hermann Paul},
    title       = {{Mittelhochdeutsche Grammatik}},
    shorthand   = {MhdG},
    edition     = {25. Aufl., neu bearbeitet von Thomas Klein, Hans-Jochim Solms und Klaus-Peter Wegera. Mit einer Syntax von Ingeborg Schröbler, neubearbeitet und erweitert von Heinz-Peter Prell},
    series      = {Sammlung kurzer Grammatiken germanischer Dialekte A. Hauptreihe},
    number      = {2},
    publisher   = {Niemeyer},
    location    = {Tübingen},
    year        = {2007},
    pagination  = {section},
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
\cite{paul2007}

\citep{paul2007}

\citet{paul2007}

\citet[5]{paul2007}
\printbibliography
\end{document}

MhdG (MhdG) MhdG MhdG, § 5


The following code might help you to get the postnote in parentheses for \citet.

\makeatletter
\renewbibmacro*{textcite:postnote}{%
  \iffieldundef{postnote}%
  {}%
  {\savefield{fullhash}{\cbx@lastyear}%
    \setunit{\ifbool{cbx:parens}{\postnotewrapper}{\addspace\global\booltrue{cbx:parens}\bibopenparen}}%delim}%
    \printfield{postnote}}%
  \ifthenelse{\value{multicitecount}=\value{multicitetotal}}%
  {\setunit{}%
    \printtext{%
      \ifbool{cbx:parens}%
      {\bibcloseparen\global\boolfalse{cbx:parens}}%
      {}}}%
  {\setunit{%
      \ifbool{cbx:parens}%
      {\bibcloseparen\global\boolfalse{cbx:parens}}%
      {}%
      \textcitedelim}}}% Not \multicitedelim ???
\makeatother
  • Thanks, however it makes etoolbox throw an error: "Error: Invalid boolean expression." Maybe there's a bracket missing/too many somewhere? (Or maybe i should update Ubuntu 16.04 to get a more current TexLive?) – Jipí Aug 15 '18 at 6:41
  • @Jipí The exact MWE worked for me on a fully updated MikTeX with biblatex 3.11, Biber 2.11 and biblatex-chicago 1.0rc5. The TeX live that comes with Ubuntu 16.04 is outdated by today's standard, so I can't guarantee that this solution will work with your ancient version. Unfortunately, biblatex-chicago is a very complex style and I can't obtain the old version that you are using easily. You don't need to update your Ubuntu, it would be enough to install the vanilla TeX live (tex.stackexchange.com/q/1092/35864) if you are up for that. – moewe Aug 15 '18 at 7:09
  • @Jipí I see we had that conversation before in tex.stackexchange.com/q/416228/35864. biblatex 3.3 trails behind current development eight versions and almost two and a half years. With actively developed projects such as biblatex and biblatex-chicago there comes a point at which you can't really expect complicated lower-level and internal stuff like this to work smoothly any more. – moewe Aug 15 '18 at 7:57
  • I updated by manually installing TeXLive 2018, and now it works as it should. Is there a way to get MhdG (§ 5) from \citet[5]{paul2007} in addition to the above solution? – Jipí Sep 11 '18 at 19:27
  • @Jipí I added an attempt. If that does not help or has bugs, I suggest you open a new question with an MWE and more details (test cases and expected output). – moewe Sep 11 '18 at 20:27

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.