1

I want to use OTF version of STIXTwoMath-Regular.otf, to get the large delimiter such as (),[],{ },|,/,\vert,\Vert,\langle,\rangle,\lceil,\rceil, and so on, I need to modify what are all the delimiter, declared through \DeclareMathDelimiter{}{}{}{}{}{} in the fontmath.ltx

I redefined through \Udelcode ⟨char slot⟩ [=] ⟨fam.⟩ ⟨glyph slot⟩ command, i am getting the correct output for few delimiters only (),[],|

few of them are not rendered properly when using \big or \left, it is loading default LaTeX CMR fonts (CMEX10)

How to modify to get the proper font loading (OTF) for \left< . \right>, \langle,\rangle, \vert,\Vert,\lceil,\rceil,

MWE

\documentclass{book}
\usepackage{mathspec}
\setmainfont{STIXTwoMath-Regular.otf}
\setmathsfont(Latin){STIXTwoMath-Regular.otf}
\setmathsfont(Digits){STIXTwoMath-Regular.otf}
\setmathsfont(Greek){STIXTwoMath-Regular.otf}
\setmathsfont(Symbols){STIXTwoMath-Regular.otf}

\newfontface\StixMath{STIXTwoMath-Regular.otf}[Scale=1.0,NFSSFamily=stix]
\DeclareSymbolFont{Stixsym}{TU}{stix}{m}{n}

%%% for Bracket
\Udelcode`\[\symStixsym"005B
\Udelcode`\]\symStixsym"005D

%%% for paranthesis
\Udelcode`\(\symStixsym"0028
\Udelcode`\)\symStixsym"0029

%%% for |
\Udelcode`\|\symStixsym"007C

\Udelcode`\<\symStixsym"3C
\Udelcode`\>\symStixsym"3E

\xdef\sqrt{\Uradical\symStixsym"221A}

\begin{document}

%%%%%%%%%%%%%%%% ( )

$(01234567890)$

$\big( \Big( \bigg( \Bigg(  abcdefghijklmnopqrstuvwxyz \big) \Big) \bigg) \Bigg)$


$\displaystyle \left( \frac{1}{2} \right)$\medskip

==========================\medskip

%%%%%%%%%%%%%%%% [ ]


$[01234567890]$

$\big[ \Big[ \bigg[ \Bigg[  abcdefghijklmnopqrstuvwxyz \big] \Big] \bigg] \Bigg]$


$\displaystyle \left[ \frac{1}{2} \right]$\medskip


==========================\medskip
%%%%%%%%%%%%%%%% | |


$|01234567890|$

$\big| \Big| \bigg| \Bigg|  abcdefghijklmnopqrstuvwxyz \big| \Big| \bigg| \Bigg|$


$\displaystyle \left| \frac{1}{2} \right|$


==========================\medskip


$<01234567890>$



$\big< \Big< \bigg< \Bigg<  abcdefghijklmnopqrstuvwxyz \big> \Big> \bigg> \Bigg>$

$\displaystyle \left< \frac{1}{2} \right>$

=========

$\{01234567890\}$

$\big\{01234567890\big\}$

$\big\{01234567890\big\}$


$\big\{ \Big\{ \bigg\{ \Bigg\{  abcdefghijklmnopqrstuvwxyz \big\} \Big\} \bigg\} \Bigg\}$

$\displaystyle \left\{ \frac{1}{2} \right\}$

=========

$\sqrt{2}$

$\displaystyle\sqrt{\frac{1}{2\frac{1}{2}}}$


===================

$\displaystyle\big\vert \Big\vert \bigg\vert \Bigg\vert  abcdefghijklmnopqrstuvwxyz \big\vert \Big\vert \bigg\vert \Bigg\vert$

$\displaystyle\big\Vert \Big\Vert \bigg\Vert \Bigg\Vert  abcdefghijklmnopqrstuvwxyz \big\Vert \Big\Vert \bigg\Vert \Bigg\Vert$

$\displaystyle\big\langle \Big\langle \bigg\langle \Bigg\langle  abcdefghijklmnopqrstuvwxyz \big\rangle \Big\rangle \bigg\rangle \Bigg\rangle$

$\displaystyle\big\lceil \Big\lceil \bigg\lceil \Bigg\lceil  abcdefghijklmnopqrstuvwxyz \big\rceil \Big\rceil \bigg\rceil \Bigg\rceil$

\end{document} 
3
  • 1
    Why not using unicode-math?
    – egreg
    Dec 4, 2021 at 14:51
  • 1
    as egreg says \usepackage{unicode-math}\setmathfont{Stix Two Math} will do exactly what you want. Dec 4, 2021 at 15:53
  • note if you use \bigg[ you lose the mathopen spacing, better to use \biggl[ and \biggr] Dec 4, 2021 at 15:55

1 Answer 1

1

You also need to set mathcodes.

\documentclass[twocolumn]{article}
\usepackage{mathspec}
\setmainfont{STIX Two Text}
\setmathsfont(Latin){STIXTwoMath-Regular.otf}
\setmathsfont(Digits){STIXTwoMath-Regular.otf}
\setmathsfont(Greek){STIXTwoMath-Regular.otf}
\setmathsfont(Symbols){STIXTwoMath-Regular.otf}

\newfontface\StixMath{STIXTwoMath-Regular.otf}[Scale=1.0,NFSSFamily=stix]
\DeclareSymbolFont{Stixsym}{TU}{stix}{m}{n}

%%% for bracket
\Umathcode`\[ = "4 \symStixsym "005B
\Umathcode`\] = "5 \symStixsym "005D
\Udelcode`\[ = \symStixsym "005B
\Udelcode`\] = \symStixsym "005D

%%% for parenthesis
\Umathcode`\( = "4 \symStixsym "0028
\Umathcode`\) = "5 \symStixsym "0029
\Udelcode`\( = \symStixsym"0028
\Udelcode`\) = \symStixsym"0029

%%% for |
\Umathcode`\| = "0 \symStixsym "007C
\Udelcode`\| = \symStixsym"007C
\def\vert{\Udelimiter "0 \symStixsym "007C }
\def\Vert{\Udelimiter "0 \symStixsym "2016 }

%%% for angle brackets
\def\langle{\Udelimiter "4 \symStixsym "27E8 }
\def\rangle{\Udelimiter "5 \symStixsym "27E9 }
\Udelcode`\<\symStixsym"27E8
\Udelcode`\>\symStixsym"27E9

%%% for braces
\def\lbrace{\Udelimiter "4 \symStixsym "007B }
\def\rbrace{\Udelimiter "5 \symStixsym "007D }

%%% floor
\def\lfloor{\Udelimiter "4 \symStixsym "230A }
\def\rfloor{\Udelimiter "4 \symStixsym "230B }

%% ceiling
\def\lceil{\Udelimiter "4 \symStixsym "2308 }
\def\rceil{\Udelimiter "4 \symStixsym "2309 }

\xdef\sqrt{\Uradical\symStixsym"221A }

\begin{document}

\subsection*{Parentheses}

$(01234567890)$

$\big( \Big( \bigg( \Bigg(  abcdefghijklmnopqrstuvwxyz \big) \Big) \bigg) \Bigg)$

$\displaystyle \left( \frac{1}{2} \right)$

\subsection*{Brackets}

$[01234567890]$

$\big[ \Big[ \bigg[ \Bigg[  abcdefghijklmnopqrstuvwxyz \big] \Big] \bigg] \Bigg]$

$\displaystyle \left[ \frac{1}{2} \right]$

\subsection*{Bars}

$|01234567890|$

$\big| \Big| \bigg| \Bigg|  abcdefghijklmnopqrstuvwxyz \big| \Big| \bigg| \Bigg|$

$\displaystyle \left| \frac{1}{2} \right|$

\subsection*{Angle brackets}

$\langle 01234567890\rangle$

$\big< \Big< \bigg< \Bigg<  abcdefghijklmnopqrstuvwxyz \big> \Big> \bigg> \Bigg>$

$\displaystyle \left< \frac{1}{2} \right>$

\subsection*{Braces}

$\{01234567890\}$

$\big\{ \Big\{ \bigg\{ \Bigg\{  abcdefghijklmnopqrstuvwxyz \big\} \Big\} \bigg\} \Bigg\}$

$\displaystyle \left\{ \frac{1}{2} \right\}$

\subsection*{Radical}

$\sqrt{2}$

$\displaystyle\sqrt{\frac{1}{2\frac{1}{2}}}$


\subsection*{Misc}

$\displaystyle\big\vert \Big\vert \bigg\vert \Bigg\vert  abcdefghijklmnopqrstuvwxyz \big\vert \Big\vert \bigg\vert \Bigg\vert$

$\displaystyle\big\Vert \Big\Vert \bigg\Vert \Bigg\Vert  abcdefghijklmnopqrstuvwxyz \big\Vert \Big\Vert \bigg\Vert \Bigg\Vert$

$\displaystyle\big\langle \Big\langle \bigg\langle \Bigg\langle  abcdefghijklmnopqrstuvwxyz \big\rangle \Big\rangle \bigg\rangle \Bigg\rangle$

$\displaystyle\big\lceil \Big\lceil \bigg\lceil \Bigg\lceil  abcdefghijklmnopqrstuvwxyz \big\rceil \Big\rceil \bigg\rceil \Bigg\rceil$

$\displaystyle\big\lfloor \Big\lfloor \bigg\lfloor \Bigg\lfloor  abcdefghijklmnopqrstuvwxyz \big\rfloor \Big\rfloor \bigg\rfloor \Bigg\rfloor$

\end{document} 

After this, pdffonts shows

name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
VNNHAY+STIXTwoText-Bold-Identity-H   CID Type 0C       Identity-H       yes yes yes      4  0
BELAGZ+STIXTwoMath-Regular-Identity-H CID Type 0C       Identity-H       yes yes yes      6  0
NQCIYR+STIXTwoText-Identity-H        CID Type 0C       Identity-H       yes yes yes      8  0

so no Computer Modern glyph is used.

5
  • thanks for your answer, it is very helpful to me
    – RCV
    Dec 7, 2021 at 6:01
  • the solution is working only on xelatex, it is not working in LuaLaTeX
    – RCV
    Jan 13, 2022 at 7:36
  • @pdy_tam mathspec does not work with LuaLaTeX to begin with.
    – egreg
    Jan 13, 2022 at 8:09
  • i used unicode-math.sty, my file main text is minion font, delimiters to be print from STIXTwoMath-Regular.otf, so i tried this solution, but not working
    – RCV
    Jan 13, 2022 at 9:01
  • @pdy_tam This answer is specific for mathspec.
    – egreg
    Jan 13, 2022 at 10:48

You must log in to answer this question.

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