0

I needed to write '‫שלום!‬' but without a space between the 'ם' and the '!'.

The document is mainly in english with just a few Hebrew words in it.

A minimal example of what I tried:

\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}

Does anyone know how to fix this?

It currently looks like:

enter image description here

With what looks like an extra space between the exclamation mark and the nearest letter.

Edit: include missing usepackage

Edit2:

The output after adding \listfiles is:

 *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
 ***********

Edit 3: font used in output pdf:

enter image description here

1
  • I guess you should update your TeX system.
    – egreg
    Jan 17 at 22:50

1 Answer 1

0

Remove the sf from \hebrewfontsf.

\documentclass[12pt]{report}
\usepackage{polyglossia}
\newfontfamily\hebrewfont[Script=Hebrew]{Noto Sans Hebrew}
\setmainlanguage{english}
\setotherlanguage{hebrew}
\begin{document}
    \noindent
    !\texthebrew{שלום} \\
    !hello \\
\end{document}

output

Edit:

With \usepackage[sfdefault]{FiraSans}, I cannot reproduce the error.

\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}

second try

Edit 2: Output of \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
 ***********

Edit 3: Screenshots of fonts

fonts

21
  • Couldn't make it work by removing the 'sf'. The shape (or rather width of the lines) of the letters changed but the space still remains. Or is this just for me?
    – J...S
    Jan 17 at 16:09
  • Are you using the exact MWE? Because your initial MWE wasn't even compilable for me and the font in !hello is not the default font.
    – marv
    Jan 17 at 16:11
  • Sorry i had missed a \usepackage[sfdefault]{FiraSans}. Could that be responsible for the difference? Sorry again for having a non-working MCVE. I have edited the question.
    – J...S
    Jan 17 at 16:13
  • See my edit. There must be something else wrong in your example.
    – marv
    Jan 17 at 16:19
  • Strange.. That's exactly how my code looks like. I suppose the distribution doesn't make any difference, but I'm using texlive,
    – J...S
    Jan 17 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.