36

This question already has an answer here:

I'm trying to use \mathscr in my documents, but it just doesn't show up. I'm using MacTeX, with pdfTeX and XeTeX version 3.1415926 and TeXShop version 3.26. As an MWE, I can use:

%!TEX TS-program = xelatex  
%!TEX encoding = UTF-8 Unicode  
\documentclass[a4paper]{report}  
\usepackage{mathrsfs}  
\begin{document}  
$\mathscr{abcdefghijklmnopqrstuvwxyz}$  
\end{document}  

the first two lines being TeXShop's way to be told to use XeLaTeX (though using pdfTeX changes nothing) and to save the document in UTF-8 Unicode encoding. How do I get the \mathscr to appear?

marked as duplicate by Henri Menke, LaRiFaRi, egreg fonts Mar 23 '15 at 10:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

23

You have to define a math font, e.g. XITS Math

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass[a4paper]{report}
\usepackage{unicode-math}
\setmathfont{XITS Math}
\setmathfont[version=setB,StylisticSet=1]{XITS Math}
\begin{document}
$\mathscr{abcdefghijklmnopqrstuvwxyz}$

$\mathscr{ABCDEFGHIJKLMNOPQRST}$

\mathversion{setB}%
$\mathscr{abcdefghijklmnopqrstuvwxyz}$

$\mathscr{ABCDEFGHIJKLMNOPQRST}$
\end{document}

enter image description here

  • Didn't work for me. Got error \setmathfont already defined!. Seem related to conflict with mathspec – lowndrul May 16 at 14:06
  • Works for me but as @karlkoeller says in another answer, lower case letters don't work with \mathscr ... at least for me this example just prints the upper case letters, and only the first set of caps at that. – JimLohse Jun 15 at 18:39
42

Talking about pdfLaTeX, the command \mathscr from the package mathrsfs only support capital letters...

MWE

%!TEX TS-program = pdflatex
%!TEX encoding = UTF-8 Unicode  
\documentclass[a4paper]{report}
\usepackage{mathrsfs}
\begin{document}
$\mathscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
\end{document}  

enter image description here

  • 2
    Note for users like me who stumble on this hoping it will work for lower-case letters as well: It won't :( – lowndrul May 16 at 14:00

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