Cita hebrea correctamente alineada a la derecha al final de una oración en una nueva línea

Cita hebrea correctamente alineada a la derecha al final de una oración en una nueva línea

Tengo un problema menor con las citas en hebreo en un documento que estoy tipografiando. Tengo citas de la Biblia en el formato "Capítulo de libro: versículo: texto hebreo". Cuando el texto hebreo continúa en la siguiente línea, está alineado a la izquierda, mientras que yo quiero que esté alineado a la derecha.

Usar \flushrightno es una opción, ya que la referencia de la Biblia aún debe estar alineada a la izquierda. Usar \hfillno es una opción porque no sé dónde ocurre el salto de línea.

Consulte el MWE a continuación. El resultado debe ser como el primer ejemplo, pero con la segunda línea alineada a la derecha o, de manera equivalente, como el segundo ejemplo, pero con la primera línea justificada.

Cuando un párrafo tiene solo una línea, debe estar alineado a la izquierda.

ingrese la descripción de la imagen aquí

\documentclass{article}

\usepackage[margin=4cm]{geometry}
\usepackage{showframe}

\usepackage{polyglossia} 
\setdefaultlanguage{english}
\setotherlanguage{hebrew}
\newfontfamily\englishfont[Mapping=tex-text]{Latin Modern Roman}
\newfontfamily\hebrewfont[Scale=MatchLowercase]{Ezra SIL}
\DeclareTextFontCommand{\ez}{\hebrewfont}

\parindent0pt

\begin{document}

Nehemia 4:8b--c: \RL{\ez{אל־תיראו מפניהם את־אדני הגדול והנורא זכרו והלחמו על־אחיכם בניכם ובנתיכם נשיכם ובתיכם}}

\flushright{Nehemia 4:8b--c: \RL{\ez{אל־תיראו מפניהם את־אדני הגדול והנורא זכרו והלחמו על־אחיכם בניכם ובנתיכם נשיכם ובתיכם}}}

\end{document}

(Compile con XeLaTeX. Requiere elEzra SIL fuentes).

Respuesta1

Prueba esto:

\documentclass{article}
\usepackage{parskip}
\usepackage{polyglossia} 
\setdefaultlanguage{english}
\setotherlanguage{hebrew}
\newfontfamily\hebrewfont[Scale=MatchLowercase,Script=Hebrew]{SBL BibLit}
\pagestyle{empty}
\newenvironment{RTLpar}{%
  \par\ignorespaces
  \leftskip=0pt plus .5fil%
  \rightskip=0pt plus -.5fil%
  \parfillskip=0pt plus .5fil%
}{\par}
\newbox\linebox
\newcount\linecount
\def\countparlines{%
  \setbox\linebox\lastbox
  \ifvoid\linebox
  \else
    \global\advance\linecount 1%
    \unskip\unpenalty
    {\countparlines}%
  \fi}
\def\rtlpar#1{%
  \vskip-\baselineskip % This is a hack, but I don't know the proper solution
  \global\linecount=0%
  \vbox{#1\par\countparlines}%
  \ifnum\linecount>1
    \begingroup
    \leftskip=0pt plus .5fil%
    \rightskip=0pt plus -.5fil%
    \parfillskip=0pt plus .5fil%
    #1\par
    \endgroup
  \else
    #1\par
  \fi}
\begin{document}
\begin{RTLpar}
  Nehemiah 4:8b--c: \texthebrew{אל־תיראו מפניהם את־אדני הגדול והנורא זכרו
  והלחמו על־אחיכם בניכם ובנתיכם נשיכם ובתיכם}
\end{RTLpar}
\rtlpar{Nehemiah 4:8b--c: \texthebrew{אל־תיראו מפניהם את־אדני הגדול והנורא זכרו
והלחמו על־אחיכם בניכם ובנתיכם נשיכם ובתיכם}}
\rtlpar{Nehemiah 4:8a: \texthebrew{וארא ואקום ואמר אל־החרים ואל־הסגנים ואל
יתר העם}}
\begin{quote}
  \begin{hebrew}
    אל־תיראו מפניהם את־אדני הגדול והנורא זכרו והלחמו על־אחיכם בניכם ובנתיכם
    נשיכם ובתיכם (\textenglish{Nehemiah 4:8b--c})
  \end{hebrew}
\end{quote}
\end{document}

ingrese la descripción de la imagen aquí

información relacionada