我有 30 多年前的 .bib 文件,所以仍然使用 Bibtex 和“传统”重音字母命令(例如,\'{e}
等等)。我试过 Biber 等,发现 (a) 从现有内容到所需内容需要大量工作,并且 (b) 有点令人困惑。
我有少量书名(准确地说是两本),这些书名在罗马字母书目条目中都有希腊文标题。为这些书创建 bibtex 条目的最简单方法是什么?
提前谢谢了。
答案1
这取决于您如何处理文档中的希腊语,并在评论中提到。但是,假设使用LGR
希腊语字体编码的“经典”设置并使用 pdfLaTeX 进行编译,您可以在参考书目中使用它,就像在文档本身中一样。在下面的 MWE 中,\textgreek
定义了一个宏来自动选择 LGR 编码并将其限制为宏的参数。
\documentclass{article}
\begin{filecontents}{\jobname.bib}
@book{greekbk,
title = {\textgreek{Βίος και Πολιτεία του Αλέξη Ζορμπά}},
author = {\textgreek{Νίκος Καζαντζάκης}},
year = {1946}
}
@book{englishbk,
title = {The Tragedy of Hamlet, Prince of Denmark},
author = {William Shakespeare},
year = {1601}
}
\end{filecontents}
\usepackage[LGR,T1]{fontenc}
\newcommand{\textgreek}[1]{\begingroup\fontencoding{LGR}\selectfont#1\endgroup}
\begin{document}
This is a document that cites publications in two alphabets: \cite{greekbk,englishbk}
\bibliographystyle{plain}
\bibliography{\jobname}
\end{document}
答案2
在 biblatex/biber 方面进行扩展:
biblatex 可以读取 bibtex 输出,因此迁移到 biblatex 非常简单。默认样式为数字。
平均能量损失
% arara: pdflatex
% arara: bibtex
% arara: pdflatex
\documentclass{article}
\begin{filecontents*}[overwrite]{\jobname.bib}
@book{greekbk,
title = {\textgreek{Βίος και Πολιτεία του Αλέξη Ζορμπά}},
author = {\textgreek{Νίκος Καζαντζάκης}},
year = {1946},
}
@book{englishbk,
title = {The Tragedy of Hamlet, Prince of Denmark},
author = {William Shakespeare},
year = {1601},
}
@book{rus,
title = {Грек Зорба},
author = {Никос Казандзакис},
year = {2003},
}
\end{filecontents*}
\usepackage[LGR,T1]{fontenc}
\newcommand{\textgreek}[1]{\begingroup\fontencoding{LGR}\selectfont#1\endgroup}
\usepackage[backend=bibtex]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
This is a document that cites publications in two alphabets: \cite{greekbk,englishbk}.%, rus, esp, zh}.
Compile with pdflatex.
\printbibliography[title={References (biblatex/bibtex + legacy fonts)}]
\end{document}
排序引用选项;biber 是默认后端:
平均能量损失
% arara: pdflatex
% arara: biber
% arara: pdflatex
\begin{filecontents*}[overwrite]{\jobname.bib}
@book{greekbk,
title = {\textgreek{Βίος και Πολιτεία του Αλέξη Ζορμπά}},
author = {\textgreek{Νίκος} \textgreek{Καζαντζάκης}},
year = {1946},
}
@book{englishbk,
title = {The Tragedy of Hamlet, Prince of Denmark},
author = {William Shakespeare},
year = {1601},
}
@book{rus,
title = {Грек Зорба},
author = {Никос Казандзакис},
year = {2003},
}
\end{filecontents*}
\documentclass{article}
\usepackage[LGR,T1]{fontenc}
\newcommand{\textgreek}[1]{\begingroup\fontencoding{LGR}\selectfont#1\endgroup}
\usepackage[sortcites=true]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
This is a document that cites publications in two alphabets: \cite{greekbk,englishbk}%, rus, esp, zh}.
Compile with pdflatex.
\printbibliography[title={References (biblatex/biber + legacy fonts)}]
\end{document}
交换为 truetype Unicode 字体;以及作者年份样式:
平均能量损失
% arara: lualatex
% arara: biber
% arara: lualatex
\begin{filecontents*}[overwrite]{\jobname.bib}
@book{greekbk,
title = {Βίος και Πολιτεία του Αλέξη Ζορμπά},
author = {Νίκος Καζαντζάκης},
year = {1946},
}
@book{englishbk,
title = {The Tragedy of Hamlet, Prince of Denmark},
author = {William Shakespeare},
year = {1601},
}
@book{rus,
title = {Грек Зорба},
author = {Никос Казандзакис},
year = {2003},
}
@book{esp,
title = {Zorba, el griego},
author = {Nikos Kazantzakis},
translator = {Jaime Berenguer Amenós},
year = {1972},
}
@book{zh,
title = {{\fchinese 希臘左巴}},
author = {{\fchinese 卡山札基}},
year = {1946},
}
\end{filecontents*}
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Noto Serif}%has Greek and Latin
\newfontfamily\fchinese{Noto Serif CJK SC}
\usepackage[style=authoryear,
%%backend=bibtex,
]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
This is a document that cites publications in two alphabets: \cite{greekbk,englishbk,rus,esp,zh}.
Compile with lualatex.
\printbibliography[title={References (biblatex/biber + ttf/otf fonts)}]
\end{document}
让 polyglossia 处理字体(中文是手写的):
平均能量损失
% arara: lualatex
% arara: biber
% arara: lualatex
\begin{filecontents*}[overwrite]{\jobname.bib}
@book{greekbk,
title = {Βίος και Πολιτεία του Αλέξη Ζορμπά},
author = {Νίκος Καζαντζάκης},
year = {1946},
langid={greek},
}
@book{englishbk,
title = {The Tragedy of Hamlet, Prince of Denmark},
author = {William Shakespeare},
year = {1601},
}
@book{rus,
title = {Грек Зорба},
author = {Никос Казандзакис},
year = {2003},
langid={russian},
}
@book{esp,
title = {Zorba, el griego},
author = {Nikos Kazantzakis},
translator = {Jaime Berenguer Amenós},
year = {1972},
langid={spanish},
}
@book{zh,
title = {{\fchinese 希臘左巴}},
author = {{\fchinese 卡山札基}},
year = {1946},
}
\end{filecontents*}
\documentclass{article}
\usepackage{polyglossia}
\usepackage{csquotes}
\setmainfont{Noto Serif}%has Greek and Latin
\setmainlanguage{english}
\setotherlanguage{spanish}
\setotherlanguage{greek}
\setotherlanguage{russian}
\newfontfamily\spanishfont{DejaVu Serif}
\newfontfamily\greekfont{Liberation Serif}
\newfontfamily\russianfont{EB Garamond}
\newfontfamily\fchinese{Noto Serif CJK SC}
\usepackage[style=authoryear,
language=auto,
autolang=other,]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
This is a document that cites publications in two alphabets: \cite{greekbk,englishbk,rus,esp,zh}.
Compile with lualatex.
\printbibliography[title={References (biblatex/biber + polyglossia)}]
\end{document}
只是为了强调它们是不同的字体/脚本环境:
平均能量损失
% arara: lualatex
% arara: biber
% arara: lualatex
\begin{filecontents*}[overwrite]{\jobname.bib}
@book{greekbk,
title = {Βίος και Πολιτεία του Αλέξη Ζορμπά},
author = {Νίκος Καζαντζάκης},
year = {1946},
langid={greek},
langidopts={variant=mono},
}
@book{englishbk,
title = {The Tragedy of Hamlet, Prince of Denmark},
author = {William Shakespeare},
year = {1601},
}
@book{rus,
title = {Грек Зорба},
author = {Никос Казандзакис},
year = {2003},
langid={russian},
}
@book{esp,
title = {Zorba, el griego},
author = {Nikos Kazantzakis},
translator = {Jaime Berenguer Amenós},
year = {1972},
langid={spanish},
}
@book{zh,
title = {{\fchinese 希臘左巴}},
author = {{\fchinese 卡山札基}},
year = {1946},
}
\end{filecontents*}
\documentclass{article}
\usepackage{xcolor}
\usepackage{polyglossia}
\usepackage{csquotes}
\setmainlanguage{english}
\newfontfamily{\spanishfont}[Color=red]{DejaVu Serif}
\newfontfamily{\greekfont}[Script=Greek,Colour=blue]{Liberation Serif}
\newfontfamily\russianfont[Script=Cyrillic,Colour=brown]{EB Garamond}
\setotherlanguage{spanish}
\setotherlanguage{greek}
\setotherlanguage{russian}
\newfontfamily\fchinese{Noto Serif CJK SC}[Scale=1.5]
\usepackage[style=authoryear,
language=auto,
autolang=other,]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
This is a document that cites publications in two alphabets: \cite{greekbk,englishbk,rus,esp,zh}.
Compile with lualatex.
\printbibliography[title={References (biblatex/biber + polyglossia)}]
\end{document}
字体和谐;回到数字:
平均能量损失
% arara: lualatex
% arara: biber
% arara: lualatex
\begin{filecontents*}[overwrite]{\jobname.bib}
@book{greekbk,
title = {Βίος και Πολιτεία του Αλέξη Ζορμπά},
author = {Νίκος Καζαντζάκης},
year = {1946},
langid={greek},
}
@book{englishbk,
title = {The Tragedy of Hamlet, Prince of Denmark},
author = {William Shakespeare},
year = {1601},
}
@book{rus,
title = {Грек Зорба},
author = {Никос Казандзакис},
year = {2003},
langid={russian},
}
@book{esp,
title = {Zorba, el griego},
author = {Nikos Kazantzakis},
translator = {Jaime Berenguer Amenós},
year = {1972},
langid={spanish},
}
@book{zh,
title = {{\fchinese 希臘左巴}},
author = {{\fchinese 卡山札基}},
year = {1946},
}
\end{filecontents*}
\documentclass{article}
\usepackage{polyglossia}
\usepackage{csquotes}
\setmainfont{Noto Serif}%has Greek and Latin
\setmainlanguage{english}
\setotherlanguage{spanish}
\setotherlanguage{greek}
\setotherlanguage{russian}
\newfontfamily\spanishfont{Noto Serif}
\newfontfamily\greekfont[Script=Greek]{Noto Serif}
\newfontfamily\russianfont[Script=Cyrillic]{Noto Serif}
\newfontfamily\fchinese{Noto Serif CJK SC}
\usepackage[sortcites=true,
language=auto,
autolang=other,]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
This is a document that cites publications in two alphabets: \cite{greekbk,englishbk,rus,esp,zh}.
Compile with lualatex.
\printbibliography[title={References (biblatex/biber + polyglossia)}]
\end{document}
使用 babel 作为字体(中文是手工输入的):
平均能量损失
% arara: lualatex
% arara: biber
% arara: lualatex
\begin{filecontents*}[overwrite]{\jobname.bib}
@book{greekbk,
title = {Βίος και Πολιτεία του Αλέξη Ζορμπά},
author = {Νίκος Καζαντζάκης},
year = {1946},
langid={greek},
}
@book{englishbk,
title = {The Tragedy of Hamlet, Prince of Denmark},
author = {William Shakespeare},
year = {1601},
}
@book{rus,
title = {Грек Зорба},
author = {Никос Казандзакис},
year = {2003},
langid={russian},
}
@book{esp,
title = {Zorba, el griego},
author = {Nikos Kazantzakis},
translator = {Jaime Berenguer Amenós},
year = {1972},
langid={spanish},
}
@book{zh,
title = {{\fchinese 希臘左巴}},
author = {{\fchinese 卡山札基}},
year = {1946},
}
\end{filecontents*}
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Noto Serif}%has Greek and Latin
\usepackage[spanish,greek,russian,english]{babel}
\usepackage{csquotes}
\babelfont[spanish]{rm}{Noto Serif}
\babelfont[greek]{rm}{Noto Serif}
\babelfont[russian]{rm}{Noto Serif}
\newfontfamily\fchinese{Noto Serif CJK SC}
\usepackage[sortcites=true,
language=auto,
autolang=other,]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
This is a document that cites publications in two alphabets: \cite{greekbk,englishbk,rus,esp,zh}.
Compile with lualatex.
\printbibliography[title={References (biblatex/biber + babel)}]
\end{document}
babel 也能处理中文:
平均能量损失
% arara: lualatex
% arara: biber
% arara: lualatex
\begin{filecontents*}[overwrite]{\jobname.bib}
@book{greekbk,
title = {Βίος και Πολιτεία του Αλέξη Ζορμπά},
author = {Νίκος Καζαντζάκης},
year = {1946},
langid={greek},
}
@book{englishbk,
title = {The Tragedy of Hamlet, Prince of Denmark},
author = {William Shakespeare},
year = {1601},
}
@book{rus,
title = {Грек Зорба},
author = {Никос Казандзакис},
year = {2003},
langid={russian},
}
@book{esp,
title = {Zorba, el griego},
author = {Nikos Kazantzakis},
translator = {Jaime Berenguer Amenós},
year = {1972},
langid={spanish},
}
@book{zh,
title = {希臘左巴},
author = {卡山札基},
year = {1946},
langid={chinese},
}
\end{filecontents*}
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Noto Serif}%has Greek and Latin
\usepackage[spanish,greek,russian,english]{babel}
\usepackage{csquotes}
\babelfont[spanish]{rm}{Noto Serif}
\babelfont[greek]{rm}{Noto Serif}
\babelfont[russian]{rm}{Noto Serif}
\babelprovide{chinese}
\babelfont[chinese]{rm}{Noto Serif CJK SC}
%\newfontfamily\fchinese{Noto Serif CJK SC}
\usepackage[sortcites=true,
language=auto,
autolang=other,]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
This is a document that cites publications in two alphabets: \cite{greekbk,englishbk,rus,esp,zh}.
Compile with lualatex.
\printbibliography[title={References (biblatex/biber + babel)}]
\end{document}