0

I want to use the \lBrace/\rBrace symbols from stix without changing all other math symbols in my document. A helpful snippet is provided here, which I have successfully used in the past with, I think, xelatex. However, I am now using the kao template. Kao uses the unicode-math package, which breaks the trick to import from stix:

\documentclass{article}
\usepackage{unicode-math}

\makeatletter
\@ifpackageloaded{stix}{%
}{%
  \DeclareFontEncoding{LS2}{}{\noaccents@}
  \DeclareFontSubstitution{LS2}{stix}{m}{n}
  \DeclareSymbolFont{stix@largesymbols}{LS2}{stixex}{m}{n}
  \SetSymbolFont{stix@largesymbols}{bold}{LS2}{stixex}{b}{n}
  \DeclareMathDelimiter{\lBrace}{\mathopen} {stix@largesymbols}{"E8}%
                                            {stix@largesymbols}{"0E}
  \DeclareMathDelimiter{\rBrace}{\mathclose}{stix@largesymbols}{"E9}%
                                            {stix@largesymbols}{"0F}
}
\makeatother

\begin{document}
$\lBrace A, B, C\rBrace$
\end{document}

Output after latexmk -lualatex test:

A, B, C without curly braces

If remove the unicode-math import, and compile with latexmk -pdf test, I get the following:

enter image description here

This is what I would like to achieve in lualatex combined with unicode-math. Any ideas? Lualatex version is 1.10.0. My tex distribution is "TeX Live 2019/Debian" (on Linux Mint 20.03. Yes, I need to upgrade but can't find the time...).

I have tried using stix2 (Stix Two?) but that has the same effect (= symbols missing in the final pdf). I guess I could also try to remove the dependency on unicode-math, but I'm assuming this dependency is there for a reason... I'd also be happy with a solution that doesn't involve stix; I just need those two symbols as delimiters, but I don't care much for how they look. If there's another package that provides these symbols I'd happily use it instead, but I've not been able to find it...

1
  • 2
    don't use the stix package or 8-bit LS1 and LS2 encoding, just load the stix mat font and use unicode-math range option to specify which characters should use that. Commented May 22, 2025 at 11:55

2 Answers 2

1

It seem lBrace and rBrace are already defined. By using a different name you get the output you're looking for.

\documentclass{article}

\usepackage{unicode-math}

\makeatletter
\@ifpackageloaded{stix}{%
}{%
  \DeclareFontEncoding{LS2}{}{\noaccents@}
  \DeclareFontSubstitution{LS2}{stix}{m}{n}
  \DeclareSymbolFont{stix@largesymbols}{LS2}{stixex}{m}{n}
  \SetSymbolFont{stix@largesymbols}{bold}{LS2}{stixex}{b}{n}
  \DeclareMathDelimiter{\mylBrace}{\mathopen} {stix@largesymbols}{"E8}{stix@largesymbols}{"0E}
  \DeclareMathDelimiter{\myrBrace}{\mathclose}{stix@largesymbols}{"E9}{stix@largesymbols}{"0F}
}

\makeatother

\begin{document}

$\mylBrace A, B, C\myrBrace$

\end{document}
1
  • Nice catch! It looks like pdflatex and xelatex/lualatex have different behaviour w.r.t. reusing names as arguments to \DeclareMathDelimiter, weird. Commented May 22, 2025 at 12:20
1

Based on @david-carlisle's comment, the following also works:

\documentclass{article}

\usepackage{unicode-math}

\AtBeginDocument{
  \setmathfont{STIX}[range={\lBrace, \rBrace}]
}

\begin{document}
$\lBrace A, B, C\rBrace$
\end{document}

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.