Bibliography with Turkish Babel missing author name

babelbiblatexbibliographiesturkish

I am trying to prepare my bibliography, but when I try to add some references it comes without authors of references.

Here is my main.text:

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{geometry}

\geometry{top=30mm,right=30mm,left=30mm,bottom=30mm}

\usepackage{setspace}
\usepackage{anyfontsize}
\usepackage{multicol}
\usepackage{ragged2e}
\usepackage{amsmath}
\usepackage{mathptmx}
\usepackage[english,turkish]{babel}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage[style=authoryear]{biblatex}
\addbibresource{biblio.bib}

\begin{document}
\shorthandoff{=!}
%\input{Chapters/Titlepage}
%\input{Chapters/Titlepage2}
%\input{Chapters/Abstract}
\input{Chapters/Micromechanics of Lamina}
\input{Chapters/MacroMechanics of Lamina}
\input{Chapters/Macromechanical Analysis of Laminates}

\printbibliography

\end{document}

This is my bibliography, it is just for a demo right now.

@article{knuth:1984,
title={Literate Programming},
author={Donald, Knuth},
journal={The Computer Journal},
volume={27},
number={2},
pages={97--111},
year={1984},
publisher={Oxford University Press}
}

And this is the result I get:

enter image description here

Best Answer

The problem here are babel-turkish's shorthand settings. babel-turkish makes = active, which brakes many key-value packages. Since biblatex uses key-value syntax for names, those error and will not show.

In the example the problematic shorthands for != are disabled after \begin{document}, but that is slightly too late for biblatex, as it reads the .bbl file (which contains all the bibliographic data, amongst them names) at \begin{document}.

With the new hook management system we can fine-tune the placement of \shorthandoff within \begin{document}.

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[english,turkish]{babel}
\usepackage[T1]{fontenc}
\usepackage[style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}

\AtBeginDocument[biblatex/shorthands]{%
  \shorthandoff{=!}%
}

\DeclareHookRule{begindocument}{biblatex/shorthands}{before}{biblatex}

\begin{document}
Lorem \autocite{sigfridsson}

\printbibliography
\end{document}

Lorem (Sigfridsson ve Ryde 1998)

Another way to resolve this problem would be to use the shorthands option to explicitly enable those shorthands that we want. Turkish sets :, = and !. If we disable != we're left with :, so we say shorthands=:. If you don't even want an active colon, go with shorthands=off.

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[english, turkish, shorthands=:]{babel}
\usepackage[T1]{fontenc}
\usepackage[style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{sigfridsson}

\printbibliography
\end{document}
Related Question