使用 Natbib、Polyglossia、BibTeX 和 XeLaTeX 更改書目標題

使用 Natbib、Polyglossia、BibTeX 和 XeLaTeX 更改書目標題

我正在用希伯來語編寫文檔,但我的參考文獻完全是英語。由於 RTL 語言中的文字對齊問題,參考書目包含在英文區塊中:

\addcontentsline{toc}{chapter}{ביבליוגרפיה} %Ideally this will be removed when a solution is found
\begin{english}
\bibliographystyle{apalike}
\bibliography{./bibliography}
\end{english}

即便如此,由於文件是希伯來語,因此參考書目標題需要右對齊並手動設定為希伯來語。如果我刪除該\begin{english}塊,參考書目標題的格式正確,適合希伯來語(我認為這是多語言的工作),但參考文獻本身嚴重混亂 - 特別是標點符號完全被破壞。

我想解決方案要么是渲染沒有標題的參考書目並手動添加它,要么覆蓋 Polyglossia 所做的任何更改參考書目目標題的操作。我也沒有找到方法。

微量元素:

% Compiled with XeLaTeX
\documentclass[12pt]{report}

\usepackage[sort]{natbib}
\usepackage{polyglossia}
\usepackage{bidi}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\addto\captionsenglish{
  \renewcommand{\bibname}{ביבליוגרפיה} % Swap bibliography title to Hebrew
}
\begin{document}
\setRL
לורם איפסום דולור סיט אמת

% Bibliography:
\clearpage %This replaces the page break at the start of the bibliography
\addcontentsline{toc}{chapter}{ביבליוגרפיה} 
\begin{english} % Insert the bibliography in English
    \bibliographystyle{apalike}
    \bibliography{./bibliography}
\end{english}
\end{document}

答案1

是的,肯定有一種更簡單的方法來更改參考書目標題natbib。您可以使用以下程式碼來執行此操作:

\renewcommand{\bibsection}{\section*{Whatever You Prefer}}

請注意,此處的使用section*可確保參考書目部分不會編號,正如之前在評論中所建議的那樣克里斯托夫90

答案2

從技術意義上來說,這是一個答案,但它是不可接受的,因為肯定有一個更優雅的解決方案。這充其量只是期望效果的一個例子。

\documentclass[12pt]{report}

\usepackage[sort]{natbib}
\usepackage{polyglossia}
\usepackage{bidi}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\addto\captionsenglish{
  \renewcommand{\bibname}{} % Empty bibliography title
}
\begin{document}
\setRL
לורם איפסום דולור סיט אמת

% Bibliography:
\clearpage %This replaces the page break at the start of the bibliography
\begingroup
    \let\clearpage\relax % Omit the page break at the start of the bibliography
    \addcontentsline{toc}{chapter}{ביבליוגרפיה} % Because starred chapters don't add to the TOC
    \chapter*{ביבליוגרפיה} % Manually add the title without numbering
    \vspace{-86pt} % Empty chapters add lots of vspace which is normally useful. Manually remove it
    \begin{english} % Insert the bibliography in English
        \bibliographystyle{apalike}
        \bibliography{./bibliography}
    \end{english}
\endgroup
\end{document}

相關內容