如何将 csquotes foreignquotes 与 RTL 语言结合使用?

如何将 csquotes foreignquotes 与 RTL 语言结合使用?

我无法让csquotes外文引文与 RTL 语言(我的情况是希伯来语)完美兼容。是我做错了什么,还是某个地方有错误?

\documentclass{article}
\usepackage{fontspec}
\usepackage{libertine}
\usepackage{polyglossia}
\usepackage{csquotes}
\setmainlanguage{english}
\setotherlanguage{hebrew}
\pagestyle{empty}
\begin{document}
\subsection*{foreigntextquote}
\subsubsection*{What I get:}
Genesis begins \foreigntextquote{hebrew}[Gen 1:1][.]{בְּרֵאשִׁית בָּרָא אֱלֹהִים אֵת הַשָּׁמַיִם
וְאֵת הָאָרֶץ}.
\subsubsection*{What I want:}
Genesis begins \textquote[Gen 1:1][.]{\texthebrew{בְּרֵאשִׁית בָּרָא אֱלֹהִים אֵת הַשָּׁמַיִם
וְאֵת הָאָרֶץ}}.
\subsection*{foreigndisplayquote}
\subsubsection*{What I get:}
\begin{foreigndisplayquote}{hebrew}[Gen 1:1]
בְּרֵאשִׁית בָּרָא אֱלֹהִים אֵת הַשָּׁמַיִם וְאֵת הָאָרֶץ.
\end{foreigndisplayquote}
\subsubsection*{What I want:}
\begin{quote}
  \begin{hebrew}
    בְּרֵאשִׁית בָּרָא אֱלֹהִים אֵת הַשָּׁמַיִם וְאֵת הָאָרֶץ. \textenglish{(Gen 1:1)}
  \end{hebrew}
\end{quote}
\end{document}

在此处输入图片描述

答案1

我猜csquote在此期间已经更新了(使用 csquotes.sty 2021-02-22 v5.2l)。我使用了字体Linux Libertine O

“更新”(带引号)

(1)我修正了“我想要的”(在代码中标记)中的一个放错位置的点和一个多余的空格,以使结果看起来相同。

(2)希伯来语目前不支持,csquotes所以我添加了 \DeclareQuoteStyle{hebrew}使用来自的定义https://en.wikipedia.org/wiki/Hebrew_punctuation

(3)可以使用的第二个可选参数来控制空格foreigndisplayquote\begin{foreigndisplayquote}{⟨ lang⟩ }[⟨ cite⟩ ][⟨ punct⟩ ]

现在输出看上去不错。

Z Z

\documentclass{article}
\usepackage{fontspec}

\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{hebrew}

\newfontfamily\hebrewfont[Script=Hebrew]{Linux Libertine O}
\newfontfamily\englishfont[Ligatures=NoCommon]{Linux Libertine O}   

\usepackage[autostyle=true]{csquotes}   

\DeclareQuoteStyle{hebrew}% from https://en.wikipedia.org/wiki/Hebrew_punctuation
{\textquotedblright}
{\textquotedblright}
[0.05em]
{\textquoteright}
{\textquoteright}

\pagestyle{empty}

\begin{document}    

\subsection*{foreigntextquote}
\subsubsection*{What I get:}
Genesis begins \foreigntextquote{hebrew}[Gen 1:1][.]{בְּרֵאשִׁית בָּרָא אֱלֹהִים אֵת הַשָּׁמַיִם
    וְאֵת הָאָרֶץ}.
\subsubsection*{What I want:} %corrected [] instead of [.] <<<<<
Genesis begins \textquote[Gen 1:1][]{\texthebrew{בְּרֵאשִׁית בָּרָא אֱלֹהִים אֵת הַשָּׁמַיִם
        וְאֵת הָאָרֶץ.}}. 
\subsection*{foreigndisplayquote}
\subsubsection*{What I get:}
\begin{foreigndisplayquote}{hebrew}[Gen 1:1][\,] %using the optional argument to insert a space
    בְּרֵאשִׁית בָּרָא אֱלֹהִים אֵת הַשָּׁמַיִם וְאֵת הָאָרֶץ.  
\end{foreigndisplayquote}
\subsubsection*{What I want:}% corrected extra space removed before the dot <<<<<
\begin{quote}
    \begin{hebrew}
        בְּרֵאשִׁית בָּרָא אֱלֹהִים אֵת הַשָּׁמַיִם וְאֵת הָאָרֶץ.\textenglish{(Gen 1:1)\,}
    \end{hebrew}
\end{quote}

\end{document}

相关内容