5

How can I get the \sslash symbol with XeLaTeX ? With unicode-math there is no output ...

Thanks.

\documentclass[a4paper,11pt]{article}

\usepackage[tuenc]{fontspec}
    \setmainfont[Ligatures=TeX]{CMU Serif} %needed for me to get small-bold caps
    \setsansfont{CMU Sans Serif}
    \setmonofont{CMU Typewriter Text}
\usepackage[a4paper]{geometry}
\usepackage[french]{babel}

\usepackage{unicode-math} %works without this

\begin{document}

$a \sslash b$

\end{document}
2
  • 1
    Don't you need a package that supports \sslash, such as \usepackage{stmaryrd}? Dec 1, 2016 at 11:16
  • Thank you for your answer, but I don't like to load a full package for only one poor symbol. Solution given after are better for me.
    – Oli
    Dec 1, 2016 at 19:37

2 Answers 2

2

Latin Modern Math hasn't the glyph, unfortunately, but you can always borrow missing glyphs from other math fonts:

\documentclass[a4paper,11pt]{article}

\usepackage[a4paper]{geometry}

\usepackage{fontspec}
\usepackage[french]{babel}
\usepackage{unicode-math} %works without this

\setmainfont[Ligatures=TeX]{CMU Serif} %needed for me to get small-bold caps
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}
\setmathfont{Latin Modern Math}
\setmathfont[range=\sslash]{Asana Math}

\begin{document}

$a \sslash b$

\end{document}

enter image description here

On the other hand, the symbol will be quite different from a simple slash, so redefining it in terms of the standard slash may be better. You have to delay the redefinition after unicode-math has done its work, though.

\documentclass[a4paper,11pt]{article}

\usepackage[a4paper]{geometry}

\usepackage{fontspec}
\usepackage[french]{babel}
\usepackage{unicode-math} %works without this

\setmainfont[Ligatures=TeX]{CMU Serif} %needed for me to get small-bold caps
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}
%\setmathfont{Latin Modern Math} % not needed in this case

\AtBeginDocument{%
  \renewcommand\sslash{\mathbin{/\mkern-5.5mu/}}%
}

\begin{document}

$a \sslash b$

\end{document}

enter image description here

3
  • Thank you for your solution with \setmathfont[range=\sslash]{Asana Math}, I didn't know this very usefull solution that can be used in other cases !
    – Oli
    Dec 1, 2016 at 19:39
  • Wich fonts is the best to complete missing symbols in Latin Modern ?
    – Oli
    Dec 1, 2016 at 19:47
  • @Oli None has the rounded ends, I'm afraid.
    – egreg
    Dec 1, 2016 at 20:33
3

You need to specify a unicode math font family that features a \sslash symbol. The default math font family -- Latin Modern Math -- does not. In the example below, I suggest you load either the XITS Math or the Asana Math font family.

enter image description here

\documentclass[a4paper,11pt]{article}

\usepackage[tuenc]{fontspec}
\setmainfont{CMU Serif} %needed for me to get small-bold caps
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}
\usepackage[a4paper]{geometry}
\usepackage[french]{babel}

\usepackage{unicode-math} 
% choose a math font family that features '\sslash'
\setmathfont{XITS Math}[Scale=MatchLowercase] % or, load "Asana Math"

\begin{document}
$a \sslash b$
\end{document}

Addendum: If neither Asana Math nor XITS Math are deemed suitable for your document, you could define the \sslash operator yourself, by placing the following instruction in the preamble:

\providecommand\sslash{\mathbin{/\mkern-5.5mu/}}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .