我花了很多时间根据自己的需要定制 biblatex 样式。就在我以为终于准备好的时候,我却发现 biblatex 似乎无法正常工作。
我需要使用 babel 才能正确连字。但 csquotes 中没有土耳其语。这会导致错误,我无法编译我的文档。我只能禁用 babel 才能编译它。以下是代码,
\documentclass[11pt,a4paper,oneside]{article}
\usepackage[turkish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper, top=2.5cm, right=2.5cm, bottom=2.5cm, left=4cm]{geometry}
\usepackage{setspace}
\usepackage[backend=biber, style=authoryear,date=year, firstinits=true, natbib=true]{biblatex}
\usepackage{csquotes}
错误日志如下:
错误:
./test.tex:46: Missing \endcsname inserted. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Extra \endcsname. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Missing \endcsname inserted. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Extra \endcsname. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Missing number, treated as zero. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Missing \endcsname inserted. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Extra \endcsname. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Missing \endcsname inserted. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Extra \endcsname. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Missing \endcsname inserted. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Extra \endcsname. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Missing \endcsname inserted. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Extra \endcsname. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Missing number, treated as zero. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Missing \endcsname inserted. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Extra \endcsname. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Missing \endcsname inserted. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Extra \endcsname. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Missing \endcsname inserted. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Extra \endcsname. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Missing \endcsname inserted. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Extra \endcsname. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Missing number, treated as zero. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Missing \endcsname inserted. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Extra \endcsname. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Missing \endcsname inserted. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Extra \endcsname. [...lmektedir \citep{frankel1981,diamond1984}.]
./test.tex:46: Missing \endcsname inserted. [...ya olduğu bilinmektedir \citep{albayrak} ]
./test.tex:46: Extra \endcsname. [...ya olduğu bilinmektedir \citep{albayrak} ]
./test.tex:46: Missing \endcsname inserted. [...ya olduğu bilinmektedir \citep{albayrak} ]
./test.tex:46: Extra \endcsname. [...ya olduğu bilinmektedir \citep{albayrak} ]
./test.tex:46: Missing number, treated as zero. [...ya olduğu bilinmektedir \citep{albayrak} ]
./test.tex:46: Missing \endcsname inserted. [...ya olduğu bilinmektedir \citep{albayrak} ]
./test.tex:46: Extra \endcsname. [...ya olduğu bilinmektedir \citep{albayrak} ]
./test.tex:46: Missing \endcsname inserted. [...ya olduğu bilinmektedir \citep{albayrak} ]
./test.tex:46: Extra \endcsname. [...ya olduğu bilinmektedir \citep{albayrak} ]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing number, treated as zero. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing number, treated as zero. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing number, treated as zero. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Use of \\blx@imc@bibstring doesn't match its definition. [\end]
./test.tex:64: Extra }, or forgotten \endgroup. [\end]
./test.tex:64: Argument of \@gobble has an extra }. [\end]
./test.tex:64: Paragraph ended before \@gobble was complete. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing number, treated as zero. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing number, treated as zero. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
./test.tex:64: Missing \endcsname inserted. [\end]
./test.tex:64: Extra \endcsname. [\end]
Warnings:
./test.tex: Package biblatex Warning: Conflicting options.
./test.tex: Package csquotes Warning: No style for language 'turkish'.
有什么方法可以解决这个问题吗?
这是一个 MWE。如果禁用 Babel,文档可以正常编译:
\documentclass[11pt,a4paper,oneside]{article}
\usepackage[turkish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper, top=2.5cm, right=2.5cm, bottom=2.5cm, left=4cm]{geometry}
\usepackage[backend=biber, style=authoryear, date=year, firstinits=true, natbib=true]{biblatex}
\usepackage{csquotes}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{Knu86,
author = {Knuth, Donald E.},
year = {1986},
title = {The \TeX book},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\section{mwe}
{
Lorem ipsum dolor sit amet, consectetur adipiscing elit \cite{Knu86}. Vivamus a fermentum tortor. Curabitur lacinia feugiat eros. Aenean sagittis pulvinar orci id sodales. Aenean vulputate leo elit, vitae euismod odio cursus sed. Integer nec risus semper, lobortis arcu nec, sodales urna. Sed convallis vitae justo nec vehicula. Maecenas eleifend, erat sit amet ultricies ultricies, mi nibh hendrerit arcu, in consequat leo dui vitae eros.
}
%KAYNAKÇA
\printbibliography
\end{document}
答案1
babel
土耳其语模块将其定义为=
一种简写,目的是在其前面留出一些空间以便在文本中使用。
由于没有理由=
在文本中使用,只需将其从简写列表中删除:
\usepackage[turkish,shorthands=:!]{babel}
如果你有babel
3.9 版本
\documentclass[11pt,a4paper,oneside]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[turkish,shorthands=:!]{babel}
\usepackage[
a4paper,
top=2.5cm,
right=2.5cm,
bottom=2.5cm,
left=4cm,
]{geometry}
\usepackage{csquotes}
\usepackage[
backend=biber,
style=authoryear,
date=year,
firstinits=true,
natbib=true,
]{biblatex}
另一种解决方法是,如果您仍有旧版本,babel
则在之后加载它biblatex
\documentclass[11pt,a4paper,oneside]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[
a4paper,
top=2.5cm,
right=2.5cm,
bottom=2.5cm,
left=4cm,
]{geometry}
\usepackage{csquotes}
\usepackage[
backend=biber,
style=authoryear,
date=year,
firstinits=true,
natbib=true,
]{biblatex}
\usepackage[turkish]{babel}