无法用多语种输入希伯来语

无法用多语种输入希伯来语

我的最终目标是用希伯来语制作beamer演示文稿。在尝试的过程中,我遇到了一个错误:

! Package etoolbox Error: Toggle 'Hebrew@RL' undefined.

被扔到线上

\setmainlanguage{Hebrew}

在下面的代码中:

\documentclass{article}

\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{bidi}

\setmainlanguage{Hebrew}

\begin{document}
שלום
\end{document}

那么我该如何创建希伯来语投影仪演示文稿呢?或者,我该如何创建希伯来语 LaTeX 输出?

谢谢

编辑:

根据 egreg 的评论,我编辑了我的代码(我可以用非 beamer 格式编译它):

\documentclass{beamer}

\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{bidi}

\setmainfont{David CLM}
\newfontfamily\hebrewfont{David CLM}

\begin{document}

\begin{frame}{שלום}
\end{frame}

\end{document}

现在我收到一个错误:

! Package polyglossia Error:  The current roman font does not contain the Hebrew script! Please define \hebrewfont with \newfontfamily.

See the polyglossia package documentation for explanation. Type  H <return>  for immediate help.  ...                                    

                                                   l.2 \select@language {hebrew}

但是 David CLM 是希伯来语字体。我该如何解决这个问题?

编辑:

根据艾伦的回答,我补充道

\setsansfont{David CLM}

现在我得到一个空白文档,并打印了一些警告:

** WARNING ** Tried to end an annotation without starting one!  
** WARNING ** Interpreting special command eann (pdf:) failed.  
** WARNING ** >> at page="1" position="(2.83482, 1.99252)" (in PDF)  
** WARNING ** >> xxx "pdf:eann"  
** WARNING ** Can't begin an annotation when one is pending.  
** WARNING ** Interpreting special command bann (pdf:) failed.  
** WARNING ** >> at page="1" position="(24.1549, 1.99252)" (in PDF)  
** WARNING ** >> xxx "pdf:bann<</Type/Annot/Subtype/Link/Border[0 0 0]/C[.5 .5 .5]..."  
** WARNING ** >> Reading special command stopped around >>   <</Type/Annot/Subtype/Link/Border[0 0 0]/C[.5 .5 .5]/A<</S/G...<<  
** WARNING ** Tried to end an annotation without starting one!  
** WARNING ** Interpreting special command eann (pdf:) failed.  
** WARNING ** >> at page="1" position="(115.413, 1.99252)" (in PDF)  
** WARNING ** >> xxx "pdf:eann"  
** WARNING ** Can't begin an annotation when one is pending.  
** WARNING ** Interpreting special command bann (pdf:) failed.  
** WARNING ** >> at page="1" position="(123.383, 1.99252)" (in PDF)  
** WARNING ** >> xxx "pdf:bann<</Type/Annot/Subtype/Link/Border[0 0 0]/C[.5 .55.5]..."  
** WARNING ** >> Reading special command stopped around >>  <</Type/Annot/Subtype/Link/Border[0 0 0]/C[.5 .5 .5]/A<</S/G...<<  

即使幻灯片是英文的,我也得到同样的结果

编辑: 我创建了一个新文件(将旧文件重命名为新文件),并进行了编译,结果相同。以下是文件:

 *File List*
  beamer.cls    2011/09/12 development version 3.12 A class for typesetting pre
sentations (rcs-revision 70f9d8411e54)
beamerbasercs.sty    2011/09/21 (rcs-revision 42a2c9debdc3)
beamerbasemodes.sty    2010/05/01 (rcs-revision efa082c6111d)
beamerbasedecode.sty    2010/05/01 (rcs-revision efa082c6111d)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
beamerbaseoptions.sty    2010/04/27 (rcs-revision 982469101dd6)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
geometry.sty    2010/09/12 v5.6 Page Geometry
  ifvtex.sty    2010/03/01 v1.5 Switches for detecting VTeX and its modes (HO)
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
  size11.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
 pgfcore.sty    2010/04/11 v2.10 (rcs-revision 1.7)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
   xetex.def    2009/11/22 v0.94 LaTeX color/graphics driver for XeTeX (RRM/JK)

  pgfsys.sty    2010/06/30 v2.10 (rcs-revision 1.37)
  pgfrcs.sty    2010/10/25 v2.10 (rcs-revision 1.24)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2008/07/18  (rcs-revision 1.7)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
 pgfcore.code.tex
 xxcolor.sty    2003/10/24 ver 0.1
hyperref.sty    2011/11/21 v6.82l Hypertext links for LaTeX
hobsub-hyperref.sty    2011/04/23 v1.4 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty    2011/04/23 v1.4 Bundle oberdiek, subset generic (HO)
  hobsub.sty    2011/04/23 v1.4 Subsetting bundle oberdiek (HO)
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/message (HO)
 ltxcmds.sty    2011/04/18 v1.20 LaTeX kernel commands for general use (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
 intcalc.sty    2007/09/27 v1.1 Expandable integer calculations (HO)
etexcmds.sty    2011/02/16 v1.5 Prefix for e-TeX command names (HO)
kvsetkeys.sty    2011/04/07 v1.13 Key value parser (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Defining keys (HO)
pdftexcmds.sty    2011/04/22 v0.16 Utilities of pdfTeX for LuaTeX (HO)
pdfescape.sty    2011/04/04 v1.12 Provides string conversions (HO)
bigintcalc.sty    2011/01/30 v1.2 Expandable big integer calculations (HO)
  bitset.sty    2011/01/30 v1.1 Data type bit set (HO)
uniquecounter.sty    2011/01/30 v1.2 Provides unlimited unique counter (HO)
letltxmacro.sty    2010/09/02 v1.4 Let assignment for LaTeX macros (HO)
 hopatch.sty    2011/01/30 v1.0 Wrapper for package hooks (HO)
xcolor-patch.sty    2011/01/30 xcolor patch
atveryend.sty    2011/04/23 v1.7 Hooks at very end of document (HO)
atbegshi.sty    2011/01/30 v1.15 At begin shipout hook (HO)
refcount.sty    2010/12/01 v3.2 Data extraction from references (HO)
 hycolor.sty    2011/01/30 v1.7 Color options of hyperref/bookmark (HO)
kvoptions.sty    2010/12/23 v3.10 Keyval support for LaTeX options (HO)
  pd1enc.def    2011/11/21 v6.82l Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg    2008/07/11 v1.2 hyperref configuration for XeLaTeX
     url.sty    2006/04/12  ver 3.3  Verb mode for urls, etc.
  hxetex.def    2011/11/21 v6.82l Hyperref driver for XeTeX
   puenc.def    2011/11/21 v6.82l Hyperref: PDF Unicode definition (HO)
stringenc.sty    2010/03/01 v1.8 Converts strings between encodings (HO)
rerunfilecheck.sty    2011/04/15 v1.7 Rerun checks for auxiliary files (HO)
se-ascii-print.def    2010/03/01 v1.8 stringenc: Printable ASCII characters
beamerbaserequires.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerbasecompatibility.sty    2010/07/12  (rcs-revision 6648c3177e4e)
beamerbasefont.sty    2010/10/26  (rcs-revision f39336aafb3c)
 amssymb.sty    2009/06/22 v3.00
amsfonts.sty    2009/06/22 v3.00 Basic AMSFonts support
beamerbasetranslator.sty    2010/06/11  (rcs-revision 85fd1cc7fc42)
translator.sty    2010/06/12 ver 1.10
translator-language-mappings.tex
beamerbasemisc.sty    2010/06/06  (rcs-revision bff0a9294b45)
beamerbasetwoscreens.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerbaseoverlay.sty    2011/09/12  (rcs-revision 70f9d8411e54)
beamerbasetitle.sty    2010/09/21  (rcs-revision f0446ed0b6ae)
beamerbasesection.sty    2010/08/29  (rcs-revision e07e85b4cd4a)
beamerbaseframe.sty    2011/09/12  (rcs-revision 70f9d8411e54)
beamerbaseverbatim.sty    2011/09/12  (rcs-revision 70f9d8411e54)
beamerbaseframesize.sty    2011/09/12  (rcs-revision 70f9d8411e54)
beamerbaseframecomponents.sty    2011/09/12  (rcs-revision 70f9d8411e54)
beamerbasecolor.sty    2010/06/06  (rcs-revision d1a9b48be06d)
beamerbasenotes.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerbasetoc.sty    2010/06/11  (rcs-revision 242ecaa6783b)
beamerbasetemplates.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerbaseauxtemplates.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerbaseboxes.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerbaselocalstructure.sty    2010/09/19  (rcs-revision 9224c5f3ce70)
enumerate.sty    1999/03/05 v3.00 enumerate extensions (DPC)
beamerbasenavigation.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerbasetheorems.sty    2010/06/06  (rcs-revision 7e7cc5e53e9d)
 amsmath.sty    2000/07/18 v2.13 AMS math features
 amstext.sty    2000/06/29 v2.01
  amsgen.sty    1999/11/30 v2.0
  amsbsy.sty    1999/11/29 v1.2d
  amsopn.sty    1999/12/14 v2.01 operator names
  amsthm.sty    2009/07/02 v2.20.1
beamerbasethemes.sty    2010/05/01  (rcs-revision efa082c6111d)
beamerthemedefault.sty    2010/06/17  (rcs-revision d02a7cf4d8ae)
beamerfontthemedefault.sty    2010/06/17  (rcs-revision d02a7cf4d8ae)
beamercolorthemedefault.sty    2010/06/17  (rcs-revision d02a7cf4d8ae)
beamerinnerthemedefault.sty    2010/06/17  (rcs-revision d02a7cf4d8ae)
beamerouterthemedefault.sty    2010/06/17  (rcs-revision d02a7cf4d8ae)
fontspec.sty    2011/09/18 v2.2a Advanced font selection for XeLaTeX/LuaLaTeX
   expl3.sty    2011/11/19 v2966 L3 Experimental code bundle wrapper
 l3names.sty    2011/11/11 v2944 L3 Experimental namespace for primitives
l3bootstrap.sty    2011/09/10 v2798 L3 Experimental bootstrap code
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
    calc.sty    2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
l3basics.sty    2011/10/15 v2915 L3 Experimental basic definitions
 l3expan.sty    2011/10/09 v2896 L3 Experimental argument expansion
    l3tl.sty    2011/10/22 v2929 L3 Experimental token lists
   l3seq.sty    2011/10/09 v2896 L3 Experimental sequences and stacks
   l3int.sty    2011/10/22 v2928 L3 Experimental integers
 l3quark.sty    2011/10/09 v2896 L3 Experimental quarks
   l3prg.sty    2011/10/15 v2915 L3 Experimental control structures
 l3clist.sty    2011/10/09 v2896 L3 Experimental comma separated lists
 l3token.sty    2011/10/22 v2931 L3 Experimental token manipulation
  l3prop.sty    2011/09/17 v2839 L3 Experimental property lists
   l3msg.sty    2011/10/09 v2896 L3 Experimental messages
    l3io.sty    2011/10/09 v2896 L3 Experimental input-output operations
  l3file.sty    2011/10/09 v2896 L3 Experimental file operations
  l3skip.sty    2011/11/14 v2959 L3 Experimental dimensions and skips
  l3keys.sty    2011/09/10 v2800 L3 Experimental key-value interfaces
    l3fp.sty    2011/09/26 v2857 L3 Experimental floating-point operations
   l3box.sty    2011/11/15 v2960 L3 Experimental boxes
l3coffins.sty    2011/11/15 v2963 L3 Experimental coffin code layer
 l3color.sty    2011/09/07 v2776 L3 Experimental colour support
l3luatex.sty    2011/09/10 v2798 L3 Experimental LuaTeX-specific functions
  xparse.sty    2011/11/19 v2966 L3 Experimental document command parser
fontspec-patches.sty    2011/09/18 v2.2a Advanced font selection for XeLaTeX/Lu
aLaTeX
fixltx2e.sty    2006/09/13 v1.1m fixes to LaTeX
fontspec-xetex.sty    2011/09/18 v2.2a Advanced font selection for XeLaTeX/LuaL
aTeX
 fontenc.sty
  eu1enc.def    2010/05/27 v0.1h Experimental Unicode font encodings
  eu1lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern
xunicode.sty    2011/09/09 v0.981 provides access to latin accents and many oth
er characters in Unicode lower plane
 eu1lmss.fd    2009/10/30 v1.6 Font defs for Latin Modern
fontspec.cfg
polyglossia.sty    2011/10/12 v1.2.0cc Babel replacement for XeLaTeX
etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX
makecmds.sty    2009/09/03 v1.0a extra command making commands
 xkeyval.sty    2008/08/13 v2.6a package option processing (HA)
 xkeyval.tex    2008/08/13 v2.6a key=value parser (HA)
    bidi.sty    2012/01/01 v11.150 Bidirectional typesetting in plain TeX and L
aTeX
   iftex.sty    2010/07/25 v0.2 Provides if(tex) conditional for PDFTeX, XeTeX,
 and LuaTeX
biditools.sty    2012/01/01 v0.1 Programming tools for bidi package
xetex-bidi.def    2012/01/01 v1.0.1 bidi adaptations for XeTeX engine
footnote-xetex-bidi.def    2010/07/25 v0.5 bidi footnote macros for XeTeX engin
e
amsmath-xetex-bidi.def    2010/07/25 v0.2 bidi adaptations for amsmath package 
for XeTeX engine
amsthm-xetex-bidi.def    2010/07/25 v0.1 bidi adaptations for amsthm package fo
r XeTeX engine
color-xetex-bidi.def    2010/07/25 v0.1 bidi adaptations for color package for 
XeTeX engine
xcolor-xetex-bidi.def    2010/07/25 v0.1 bidi adaptations for xcolor package fo
r XeTeX engine
graphicx-xetex-bidi.def    2012/01/01 v0.4 bidi adaptations for graphicx packag
e for XeTeX engine
hyperref-xetex-bidi.def    2012/01/01 v0.5 bidi adaptations for hyperref packag
e for XeTeX engine
loadingorder-bidi.def    2012/01/01 v0.8a making sure that bidi is the last pac
kage loaded
gloss-hebrew.ldf    polyglossia: module for hebrew
hebrewcal.sty    2008/07/01 v2.4 Hebrew calendar for polyglossia (adapted from 
hebcal.sty in Babel)
cal-util.def
babel-hebrewalph.def    2010/03/02 Babel definitions for Hebrew numerals
 Adapted from hebrew.ldf (2005/03/30 v2.3h)
   t3cmr.fd    2001/12/31 TIPA font definitions
 nameref.sty    2010/04/30 v2.40 Cross-referencing by name of section
gettitlestring.sty    2010/12/03 v1.4 Cleanup title references (HO)
translator-basic-dictionary-English.dict    
translator-bibliography-dictionary-English.dict    
translator-environment-dictionary-English.dict    
translator-months-dictionary-English.dict    
translator-numbers-dictionary-English.dict    
translator-theorem-dictionary-English.dict    
 ***********

睡觉了,明天再来。

答案1

对你的问题的简单回答是,你不能使用beamerwith (当你设置从右到左的语言,如希伯来语或阿拉伯语时,bidi它会被加载。)polyglossia

Beamer XeTeX 从右到左进行一些讨论。

另外,Beamer 默认使用无衬线字体,但设置fontspec\setmainfont罗马字体。更改

\setmainfont{David CLM}

\setsansfont{David CLM}

将允许beamer使用希伯来字体,但如果没有 RTL 支持,这实际上没什么用。

bidi包提供了一个bidipresentation类,但是它非常简单,并且不提供任何功能beamer

不幸的是,这似乎是目前的情况。但bidibeamer都是复杂的软件包,因此让它们一起工作可能并不是一件容易的事。

答案2

LuaLaTeX+Babel+Beamer+Metropolis 非常适合制作希伯来语演示文稿:邮政推介会来源

我希望这对你有用:-)

答案3

您正在使用多语种,但您必须声明:

 \setmainlanguage{hebrew}

有可能:

\setotherlanguage{english}

如果您要将整个文档设置为希伯来语,则无需调用 bidi 包。

答案4

这是我在网上找到的 Ronen Abarbanel 的一些东西(请看一下这里)。Ronen 还展示了输出 PDF 文件,看起来对齐方式正确。不幸的是,尝试使用最近的 TeXlive 输入文件不会产生相同的输出,主要区别在于希伯来语分项文本向左对齐而不是向右对齐。

我附上了一个稍微短一点的版本。请注意,它使用了bidi、 和fontspec(在 PDF 文件中产生一些警告)。但是,如果您尝试添加polyglossia、 和\semainlanguage{hebrew},它将失败。

\documentclass[xetex]{beamer}
\usepackage{fontspec,bidi}
\setmainfont{Times New Roman}
\setsansfont{Times New Roman}

\useoutertheme[right]{}

\newenvironment{hframe}[0]{\begin{frame}\setRL}{\end{frame}}
\newcommand{\hframetitle}[1]{\frametitle{\hfill\RL{#1}}}
\newcommand{\hframesubtitle}[1]{\framesubtitle{\hfill\RL{#1}}}
\newcommand{\hsection}[1]{\section{\RL{#1}}}
\newcommand{\hsubsection}[1]{\subsection{\RL{#1}}}
\newcommand{\hsubsubsection}[1]{\subsubsection{\RL{#1}}}
\newtheorem{hclaim}[theorem]{\RL{טענה}}

\title{\RL{מצגת דוגמא בעברית שנוצרה באמצעות beamer}}
\author{\RL{רונן אברבנאל}}
\date{\today}

\begin{document}

\begin{frame}
    \titlepage  
\end{frame}

\hsection{הקדמה}
\hsubsection{מבט על beamer}

\begin{hframe}
  \hframetitle{תכונות של המחלקה בימר}
  \begin{itemize}
  \item<1->  מחלקת LaTeX רגילה.
  \item<2-> מעברים קצת בעייתיים.
  \item<3-> לא דרושה תוכנה חיצונית.      
  \end{itemize}
\end{hframe}

\begin{hframe}
\begin{hclaim}[עברית ב-Beamer]
העברית ב-\LaTeX-Beamer סבירה למדי.
\end{hclaim}
ואפשר גם לכתוב טקסט מחוץ לבלוק.
\end{hframe}

\end{document}

另外,看看Vafa Khalighi 的方法。

相关内容