Temas de Beamer y problemas de bidi

Temas de Beamer y problemas de bidi

Estoy intentando escribir una presentación en hebreo. Encontré una plantilla muy bonita que realmente funcionó desde la caja (que puedes encontraren este mismo enlace,fuenteysalida compilada del autor) pero hay dos problemas, donde mi salida compilada no está de acuerdo con lo anterior:

  1. La primera es que la lista se vacía hacia la izquierda (incluso si está alineada hacia la derecha), y esto no cambia incluso si la encierro en un flushrightentorno.

  2. El teorema (segundo cuadro) aparece con el título "Teorema" o su contraparte hebrea definida allí. Independientemente de cualquier modificación y eliminación de palabras.

    Sin embargo, si desactivo el tema ( Warsawy otros similares), entonces funciona perfectamente (también funciona con Hannovertemas similares). Pero no hay ningún recuadro que contenga el teorema como es habitual.

¿Existe una manera fácil de superar esto (excepto no preparar presentaciones en hebreo con Beamer)?

Si es relevante, estoy usando Arch Linux y texlive; pero el problema persiste en mi tableta Windows 8.1 con MiKTeX (más reciente).


Logré corregir el segundo problema usando el Rochestertema. Pero me gustaría entender cómo se puede resolver esto para otros temas como el Warsawtema.

La primera cuestión es algo más inflexible.

Respuesta1

LuaLaTeX+Babel+Beamer+Metropolis funcionan bastante bien para presentaciones en hebreo:presentación,fuente. Aunque no lo he probado en matemáticas.

Buena suerte :-)

Aquí hay una copia local de la fuente vinculada anteriormente:

%! TEX program = lualatex

%%%%%%%%%%
% BEAMER %
%%%%%%%%%%

\RequirePackage{luatex85}
\PassOptionsToPackage{luatex}{hyperref}

\documentclass[luatex]{beamer}

\usetheme{metropolis}

% Fix the title separator
\makeatletter
\setbeamertemplate{title separator}{
    \bgroup
    \bodydir TLT
    \begin{tikzpicture}
        \fill[fg] (0,0) rectangle (\textwidth, \metropolis@titleseparator@linewidth);
    \end{tikzpicture}%
    \egroup
    \par%
}
\makeatother

% Fix the progress bar and make it progress from right to left
\makeatletter
\setbeamertemplate{progress bar in section page}{
    \setlength{\metropolis@progressonsectionpage}{%
        \textwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
    }%
    \bgroup
    \bodydir TLT
    \begin{tikzpicture}
        \fill[bg] (0,0) rectangle (\textwidth, \metropolis@progressonsectionpage@linewidth);
        \fill[fg] (\textwidth,0) rectangle (\textwidth-\metropolis@progressonsectionpage, \metropolis@progressonsectionpage@linewidth);
    \end{tikzpicture}%
    \egroup
}
\makeatother

% A more logical title page, juxtaposing `institute` to `author`. This modification is not necessary for Hebrew support.
\makeatletter
\setbeamertemplate{title page}{
  \begin{minipage}[b][\paperheight]{\textwidth}
    \ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title graphic}\fi
    \vfill%
    \ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi
    \ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi
    \usebeamertemplate*{title separator}
    \ifx\beamer@shortauthor\@empty\else\usebeamertemplate*{author}\fi
    \ifx\insertinstitute\@empty\else\usebeamertemplate*{institute}\fi
    \ifx\insertdate\@empty\else\usebeamertemplate*{date}\fi
    \vfill
    \vspace*{1mm}
  \end{minipage}
}
\setbeamertemplate{author}{\vspace*{2em}\insertauthor\par\vspace*{0.25em}}
\setbeamertemplate{institute}{\insertinstitute\par}
\setbeamertemplate{date}{\vspace*{3mm}\insertdate\par}
\makeatother




%%%%%%%%%
% Babel %
%%%%%%%%%

\usepackage[nil,bidi=basic-r]{babel}
\babelprovide[import=he,main]{hebrew}
\babelprovide[import=en-GB]{english}
\babelprovide[import=cy]{welsh}

% For some reason Babel’s `\babelfont` doesn’t work
\setsansfont[Script=Hebrew]{Open Sans Hebrew}
\setmonofont{Fira Mono}
\renewcommand{\H}[1]{\foreignlanguage{hebrew}{\fontspec[Script=Hebrew]{Open Sans Hebrew}#1}}
\newcommand{\nikud}[1]{$\mbox{\H{#1}}$}
\newcommand{\E}[1]{\foreignlanguage{english}{\fontspec{Open Sans}#1}}
\newcommand{\C}[1]{\foreignlanguage{welsh}{\fontspec{Open Sans}#1}}
\newcommand{\LR}[1]{{‏\textdir TLT #1}}



%%%%%%%%
% MISC %
%%%%%%%%

\usepackage{metalogo, fancyvrb}

\newcommand{\smallurl}[1]{{\footnotesize\url{#1}}}



%%%%%%%%%%%%
% DOCUMENT %
%%%%%%%%%%%%

\begin{document}
\title{מצגות \E{Beamer} בעברית הן בגדר האפשר}
\subtitle{החלום שכולנו חיכינו לו מתגשם סוף כל סוף}
\author{יודה רונן\quad\foreignlanguage{english}{\smallurl{<https://me.digitalwords.net/>}}}
\institute{האגודה הבינלאומית ל\TeX נולוגיה עברית}
\date{אוגוסט 2018}
\frame{\titlepage}


\begin{frame}{שלום עולם!}
    מה יש לנו כאן?

    \begin{itemize}
        \item פתרון מודרני שלם (אך לא מושלם) ליצירת מצגות עבריות ב־\E{Beamer}.
        \item משתמש במחלקות וחבילות הרגילות, ולא דורש תחזוק של פוֹרְקִים עם התאמה לעברית. למעשה, פחות או יותר הכל עובד מהקופסה חוץ מכמה תיקונים קטנים שנדרשים.
        \item המנוע הוא \LuaLaTeX, על הכיווניות אחראית החבילה \E{Babel}, והעיצוב הוא של הערכה \E{Metropolis} האלגנטית, הברורה והנקיה.
    \end{itemize}
\end{frame}


\begin{frame}{על כתפי ענקים}
    ככל הידוע לי, היו לפחות שלושה פתרונות קודמים:
    \begin{itemize}
        \item של \href{https://web.archive.org/web/20111206041733/http://www.technion.ac.il/~ronen/latex/beamer_hebrew.html}{רונן אברבנאל}%
            \footnote{כתובת: \smallurl{https://web.archive.org/web/20111206041733/http://www.technion.ac.il/~ronen/latex/beamer_hebrew.html}}
        \item של \href{https://web.archive.org/web/20150327024158/http://technion.ac.il/~gai/beamer/index.html}{גיא שקד}%
            \footnote{כתובת: \smallurl{https://web.archive.org/web/20150327024158/http://technion.ac.il/~gai/beamer/index.html}}
        \item של \href{https://tug.org/pipermail/xetex/2009-July/013721.html}{ופא ח׳ליקי}%
            \footnote{כתובת: \smallurl{https://tug.org/pipermail/xetex/2009-July/013721.html}}
    \end{itemize}

    כמו שאפשר לראות, שני הראשונים כבר לא נמצאים יותר ברשת באופן עצמאי אלא רק בארכיון האינטרנט.
    הפתרון של רונן לא מתקמפל היטב בגרסאות חדשות;
    של גיא ושל ופא מבוססים על מחלקה לא סטנדרטית.
\end{frame}


\begin{frame}{האקים א׳: קווים מפרידים}
    בגדול הכל עובד ישר מהקופסה. עם זאת, יש כמה דברים קטנים שצריך לשנות, כמו שאפשר לראות בקוד המקור של הקובץ הזה.

    שניים מהם קשורים לקווים המפרידים בשקופיות מיוחדות:

    \begin{itemize}
        \item תיקון של הקו המפריד בכותרת.
        \item תיקון של הקו המפריד בסעיפים והחלפת הכיוון שלו כך שיהיה הגיוני (התקדמות מימין לשמאל).
    \end{itemize}
\end{frame}


\begin{frame}{האקים ב׳: ענייני פונטים}
    ושניים קשורים לפונטים:

    \begin{itemize}
        \item משום מה מנגנון בחירת הפונטים של \E{Babel} לא עובד טוב, אז צריך לעקוף אותו ולהשתמש ב־\E{fontspec} ישירות.
        \item ניקוד מוצג נכון רק אם אין מלל לועזי לפניו בפסקה%
            \footnote{אני משער שהפונט העברי חוזר ללא המאפיין \E{\texttt{Script=Hebrew}}, ההכרחי לניקוד.}.
            כדי לעקוף את הבעיה אפשר לשים את המילה המנוקדת בסביבה מבודדת%
            \footnote{לדוגמה, בתוך \E{\texttt{\textbackslash mbox}} בתוך מתמטיקה; לא אלגנטי אבל עובד. אפשר, כמובן, ליצור פקודה יפה שעושה את זה.}.

            \begin{itemize}
                \item ככה זה נראה נכון: \E{abc} \nikud{נִקּוּד}\\
                \item וככה לא נכון: \E{abc} נִקּוּד
            \end{itemize}
    \end{itemize}
\end{frame}


\begin{frame}{האקים ג׳: טבלאות}
    לא בדיוק האק, אלא משהו לשים לב אליו: סדר העמודות בטבלאות הוא משמאל לימין ולא מימין לשמאל.

    \vfill

    \begin{columns}[t]
        \column{0.50\textwidth}
        קלט:\\
        \begin{otherlanguage}{english}
            \bgroup\tt
            \textbackslash begin\{tabular\}\{r|r|r\}\\
            \quad\foreignlanguage{hebrew}{\fontspec{Pragmata Pro}{שמאל}} \&\\
            \quad\foreignlanguage{hebrew}{\fontspec{Pragmata Pro}{אמצע}} \&\\
            \quad\foreignlanguage{hebrew}{\fontspec{Pragmata Pro}{ימין}}\\
            \textbackslash end\{tabular\}
            \egroup
        \end{otherlanguage}

        \column{0.40\textwidth}
        פלט:\\
        \begin{tabular}{r|r|r}
            שמאל &
            אמצע &
            ימין
        \end{tabular}
    \end{columns}
\end{frame}


\begin{frame}{מה לא עובד?}
    הבעיה היחידה שנתקלתי בה ולא מצאתי פתרון עבורה היא בביבליוגרפיה עם \E{Bib\LaTeX}. רוב הרשומות ב־\E{\texttt{\textbackslash printbibliography}} מסתדרות מעולה, ושומרות על כיווניות בלי בעיה. לעומת זאת, רשומות של תרגומים שמשתמשות בשדה \E{\texttt{related}} ובשדה \E{\texttt{relatedtype}} עם הערך \E{\texttt{translationof}} מתחרבשות בחלק שמציג את הספר המקורי: כל האותיות מופיעות בסדר הפוך. אם מצאתם פתרון לבעיה, אשמח לשמוע מתחרבשים בחלק שמציג את המקור: כל האותיות מופיעות בסדר הפוך. אם מצאתם פתרון לבעיה, אשמח לשמוע :-) (פרטי יצירת קשר יש בעמוד השער).

    דוגמה לבעיה אפשר לראות בתרגום הוולשי של הארי פוטר במצגת הזאת:\\
    \smallurl{https://ac.digitalwords.net/\#nonacademic-2018-08-23}\\
    קובץ ה־\E{Bib\LaTeX} זמין כאן:
    \smallurl{https://gitlab.com/rwmpelstilzchen/bibliography.bib}
\end{frame}


\begin{frame}{מה צריך עוד לעשות?}
    כאמור, אני נתקלתי רק בבעיה אחת שלא הצלחתי לפתור. יכול להיות שאנשים עם צרכים אחרים משלי יתקלו בבעיות אחרות. אם נתקלת בבעיה כללית, אל תהסס/י לפנות אלי: אם מצאת פתרון, אשמח לשמוע אותו; אם לא מצאת פתרון, אשמח לנסות לעזור.
\end{frame}


\begin{frame}{דוגמה למצגת מורכבת}
    הצורך ביצירת מצגת עברית עלה אצלי עבור הרצאה שהכנתי לכנס מיתופיה 2018 („הארי פוטר וכינויי הגוף השני”), הרצאה שהיא גלגול של הרצאה שהצגתי בכנסים אקדמיים (בלשניים וקלטולוגיים) לקהל הפוטריסטי. לא יכולתי להסתמך על מצגת באנגלית בגלל שלא כולם בקהל קוראים באנגלית באופן שוטף, כך שהייתי צריך לתרגם את המצגת הקיימת שהיתה לי לעברית. \E{PowerPoint} של מיקרוסופט או \E{Impress} של ליברה־אופיס הן לא אופציות: אני מעדיף למות תריסר מיתות משונות לפני שאגע בדברים האלה. מתוך הצורך הגיעה נבירה ב־\url{tex.stackexchange.com} ויצירת הפתרון הזה.

    למה אני מספר את זה? כי אם אתם רוצים לראות מצגת די מורכבת שעובדת יפה עם עברית ושקוד המקור שלה זמין, גשו אל:\\
    \smallurl{https://ac.digitalwords.net/\#nonacademic-2018-08-23}
\end{frame}



\part{ככה נראית שקופית של חלק}
\frame{\partpage}

\section{וככה סעיף לקראת הסוף}

\begin{frame}{הערת־אגב: פונטים למצגות}
    במצגת הזאת משמש הפונט \href{https://en.wikipedia.org/wiki/Open_Sans}{\E{Open Sans}} של סטיב מטסון עם \href{https://yaronimus.wordpress.com/2014/01/19/\%D7\%90\%D7\%95\%D7\%A4\%D7\%9F-\%D7\%A1\%D7\%90\%D7\%A0\%D7\%A1-\%D7\%92\%D7\%95\%D7\%A4\%D7\%9F-\%D7\%A8\%D7\%A9\%D7\%AA-\%D7\%97\%D7\%99\%D7\%A0\%D7\%9E\%D7\%99-\%D7\%91\%D7\%A2\%D7\%99\%D7\%A6\%D7\%95\%D7\%91\%D7\%95-\%D7\%A9\%D7\%9C-\%D7\%99\%D7\%90/}{ההרחבה העברית} שעיצב ינק יונטף („הפונט של הארץ”).
    לדעתי זה פונט מעולה למצגות, בדומה ל־\E{Fira Sans} (הפונט הדיפולטיבי של \E{Metropolis}); $\mbox{אָלֶף}$ (\E{Alef}), עם כל חיבתי אליו, לא מתאים למצגות.
\end{frame}
\end{document}

Respuesta2

Esta es sólo una explicación para el segundo problema.

Parece que Beamer sólo incluye traducciones para unos pocos idiomas. Para teoremas, etc., esto parece limitarse al brasileño, croata, inglés, francés, alemán, griego, noruego, polaco, serbio y español. Una nota en beamerbasemisc.sty dice esto sobre el manejo de meses:

Esto no es óptimo; para una localización completa se debe utilizar babel.

De hecho, he usado Beamer en un idioma no compatible y supongo que esto no es infrecuente. Sin embargo, muchos casos no demostrarán el problema ya que no requerirán texto definido por el proyector como parte del contenido de las diapositivas.

Sospecho que en este caso, necesitarías contribuir con traducciones al hebreo para que esto funcione correctamente. Sin embargo, es posible que puedas redefinir lo extraño para que determinadas presentaciones funcionen correctamente para tu propio uso, sin necesidad de realizar una traducción completa. Sin embargo, como siempre ocurre con beamer, probablemente tengas que rastrear lo que está sucediendo en al menos media docena de archivos solo para solucionar el problema. beamerbasetranslator.sty, translator.styetc.

El mapeo lingüístico está presente en translator-language-mappings.tex:

\DeclareOption{hebrew}         {\trans@use@and@alias{hebrew}    {Hebrew}}

translator.styintroduce esto. Sin embargo, lo que sucede después es que el beamervalor predeterminado es inglés cuando no puede encontrar un diccionario para hebreo (porque beamerno tiene uno). Presumiblemente, esto es un problema para la mayoría de los idiomas definidos, ya que la mayoría de ellos carecen de beamerdiccionarios de traducción específicos.

Lo que podrías intentar es copiar el diccionario relevante translator-theorem-dictionary-English.dicty translator-theorem-dictionary-Hebrew.dictluego editarlo, cambiando los nombres que realmente necesitas usar. Haga la copia en el directorio correspondiente TEXMFHOMEpara que no se sobrescriba con las actualizaciones. Esto evitará errores debido a que algo no está ahí, beamerya que no eliminará ninguna traducción. Pero le permitirá simplemente agregar traducciones de los términos que realmente utilice. Si hace más que esto, debería considerar enviar su diccionario o diccionarios en sentido ascendente para que el hebreo funcione de inmediato.

información relacionada