我需要写“שלום!”但“ם”和“!”之间不能有空格。
该文件主要为英文,其中只有少数希伯来语单词。
我尝试过的一个最小示例:
\documentclass[12pt]{report}
\usepackage[sfdefault]{FiraSans}
\usepackage{polyglossia}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Noto Sans Hebrew}
\setmainlanguage{english}
\setotherlanguage{hebrew}
\begin{document}
\noindent
!\texthebrew{שלום} \\
!hello \\
\end{document}
有谁知道如何解决这一问题?
目前看起来是这样的:
感叹号和最接近的字母之间似乎有一个额外的空格。
编辑:包括缺少的 usepackage
编辑2:
添加后的输出\listfiles
为:
*File List*
report.cls 2020/04/10 v1.4m Standard LaTeX document class
size12.clo 2020/04/10 v1.4m Standard LaTeX file (size option)
FiraSans.sty 2019/10/10 (Bob Tennent and autoinst) Style file for Fira Sans
fonts.
ifxetex.sty 2019/10/25 v0.7 ifxetex legacy package. Use iftex instead.
iftex.sty 2020/03/06 v1.0d TeX engine tests
ifluatex.sty 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.
xkeyval.sty 2014/12/03 v2.7a package option processing (HA)
xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
textcomp.sty 2020/02/02 v2.0n Standard LaTeX package
fontspec.sty 2020/02/21 v2.7i Font selection for XeLaTeX and LuaLaTeX
xparse.sty 2020-10-05 L3 Experimental document command parser
expl3.sty 2020-10-05 L3 programming layer (loader)
l3backend-xetex.def 2020-09-24 L3 backend support: XeTeX
xparse-generic.tex
fontspec-xetex.sty 2020/02/21 v2.7i Font selection for XeLaTeX and LuaLaTeX
fontenc.sty
fontspec.cfg
polyglossia.sty 2020/10/15 v1.50a Modern multilingual typesetting with XeLaT
eX and LuaLaTeX
etoolbox.sty 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
makecmds.sty 2009/09/03 v1.0a extra command making commands
l3keys2e.sty 2020-10-05 LaTeX2e option processing using LaTeX3 keys
filehook.sty 2020/09/29 v0.8a Hooks for input files
filehook-2020.sty 2020/09/29 v0.8a Hooks for input files
gloss-latex.ldf polyglossia: module for default language
gloss-english.ldf polyglossia: module for english
gloss-hebrew.ldf polyglossia: module for hebrew
bidi.sty 2020/05/17 v36.3 Bidirectional typesetting in plain TeX and LaT
eX
biditools.sty 2020/05/13 v2 Programming tools for bidi package
zref-abspage.sty 2020-07-03 v2.32 Module abspage for zref (HO)
zref-base.sty 2020-07-03 v2.32 Module base for zref (HO)
ltxcmds.sty 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
infwarerr.sty 2019/12/03 v1.5 Providing info/warning/error messages (HO)
kvsetkeys.sty 2019/12/15 v1.18 Key value parser (HO)
kvdefinekeys.sty 2019-12-19 v1.6 Define keys (HO)
pdftexcmds.sty 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO)
etexcmds.sty 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
auxhook.sty 2019-12-17 v1.6 Hooks for auxiliary files (HO)
atbegshi.sty 2020/08/17 v1.0a Emulation of the original atbegshi package
with kernel methods
latex-xetex-bidi.def 2019/03/03 v1.3.7 bidi adaptations for `latex.ltx' for
XeTeX engine
footnote-xetex-bidi.def 2017/08/09 v1.1 bidi footnote macros for XeTeX engin
e
report-xetex-bidi.def 2017/06/09 v0.8 bidi adaptations for standard report c
lass for XeTeX engine
loadingorder-xetex-bidi.def 2017/12/29 v0.97 making sure that bidi is the la
st package loaded
hebrewcal.sty 2019/12/03 v2.7 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)
ts1cmr.fd 2019/12/16 v2.5j Standard LaTeX font definitions
***********
编辑3:输出pdf中使用的字体:
答案1
sf
从 中删除\hebrewfontsf
。
\documentclass[12pt]{report}
\usepackage{polyglossia}
\newfontfamily\hebrewfont[Script=Hebrew]{Noto Sans Hebrew}
\setmainlanguage{english}
\setotherlanguage{hebrew}
\begin{document}
\noindent
!\texthebrew{שלום} \\
!hello \\
\end{document}
编辑:
使用\usepackage[sfdefault]{FiraSans}
,我无法重现该错误。
\documentclass[12pt]{report}
\usepackage[sfdefault]{FiraSans}
\usepackage{polyglossia}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Noto Sans Hebrew}
\setmainlanguage{english}
\setotherlanguage{hebrew}
\begin{document}
\noindent
!\texthebrew{שלום} \\
!hello \\
\end{document}
编辑2:输出\listfiles
*File List*
report.cls 2021/10/04 v1.4n Standard LaTeX document class
size12.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
FiraSans.sty 2019/10/10 (Bob Tennent and autoinst) Style file for Fira Sans
fonts.
ifxetex.sty 2019/10/25 v0.7 ifxetex legacy package. Use iftex instead.
iftex.sty 2020/03/06 v1.0d TeX engine tests
ifluatex.sty 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.
xkeyval.sty 2020/11/20 v2.8 package option processing (HA)
xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
textcomp.sty 2020/02/02 v2.0n Standard LaTeX package
fontspec.sty 2020/02/21 v2.7i Font selection for XeLaTeX and LuaLaTeX
xparse.sty 2021-11-12 L3 Experimental document command parser
expl3.sty 2021-11-22 L3 programming layer (loader)
l3backend-xetex.def 2021-12-14 L3 backend support: XeTeX
fontspec-xetex.sty 2020/02/21 v2.7i Font selection for XeLaTeX and LuaLaTeX
fontenc.sty
fontspec.cfg
polyglossia.sty 2021/04/12 v1.53 Modern multilingual typesetting with XeLaTe
X and LuaLaTeX
etoolbox.sty 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
makecmds.sty 2009/09/03 v1.0a extra command making commands
l3keys2e.sty 2021-11-12 LaTeX2e option processing using LaTeX3 keys
gloss-latex.ldf polyglossia: module for default language
gloss-english.ldf polyglossia: module for english
gloss-hebrew.ldf polyglossia: module for hebrew
bidi.sty 2020/05/17 v36.3 Bidirectional typesetting in plain TeX and LaT
eX
biditools.sty 2020/05/13 v2 Programming tools for bidi package
zref-abspage.sty 2020-07-03 v2.32 Module abspage for zref (HO)
zref-base.sty 2020-07-03 v2.32 Module base for zref (HO)
ltxcmds.sty 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
infwarerr.sty 2019/12/03 v1.5 Providing info/warning/error messages (HO)
kvsetkeys.sty 2019/12/15 v1.18 Key value parser (HO)
kvdefinekeys.sty 2019-12-19 v1.6 Define keys (HO)
pdftexcmds.sty 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO)
etexcmds.sty 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
auxhook.sty 2019-12-17 v1.6 Hooks for auxiliary files (HO)
atbegshi.sty 2021/01/10 v1.0c Emulation of the original atbegshi
package with kernel methods
latex-xetex-bidi.def 2019/03/03 v1.3.7 bidi adaptations for `latex.ltx' for
XeTeX engine
footnote-xetex-bidi.def 2017/08/09 v1.1 bidi footnote macros for XeTeX engin
e
report-xetex-bidi.def 2017/06/09 v0.8 bidi adaptations for standard report c
lass for XeTeX engine
loadingorder-xetex-bidi.def 2017/12/29 v0.97 making sure that bidi is the la
st package loaded
hebrewcal.sty 2019/12/03 v2.7 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)
ts1cmr.fd 2019/12/16 v2.5j Standard LaTeX font definitions
***********
编辑3:字体截图