6

I'm making slides using beamer with Fira as the main font, and I want to use Fira Math to match it. However, I've found that Fira Math does not seem to have scalable forward slash delimiters, which I would like to use. Here's a MWE; it doesn't use beamer because the problem can be illustrated just by using Fira Math.

\documentclass{article}

\usepackage{unicode-math}
\setmathfont{Fira Math}

\begin{document}
    $\left/\begin{tabular}{l}a\\b\end{tabular}\right/$
\end{document}

This produces the following:

enter image description here

If I comment out the \setmathfont{Fira Math} line, I get what I want for the slashes, but of course it doesn't use the Fira Math font otherwise (not shown here):

enter image description here

Is there a way I can tell unicode-math to "borrow" these forward slash delimiters from another font that includes them, while using Fira Math for everything else? I know it's possible to do something like \setmathfont{...}[range={...}], where range= specifies which characters to pull from a particular font, but I'm not sure what to put for the scalable forward slash delimiters. I tried \setmathfont{Latin Modern Math}[range={\left/,\right/}], but that gives me a Missing number error.

2 Answers 2

1

I'd go with a different font than Latin Modern Math and use a “simpler” syntax that doesn't require guessing.

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

\setmathfont{Fira Math}

\newfontface{\bigslashes}{TeX Gyre DejaVu Math}[NFSSFamily=bigslashes]
\DeclareSymbolFont{bigslashes}{TU}{bigslashes}{m}{n}
\DeclareMathDelimiter{/}{\mathord}{operators}{`/}{bigslashes}{`/}

\begin{document}

$/a/ + \left/\begin{matrix} a\\b\\c\\d \end{matrix}\right/$

\end{document}

enter image description here

The big slashes aren't cut in the same way as in Fira Math, but…

1
  • yes we really ought to add latex/nfss wrappers around \U... declarations so you can do a combination of the two Commented Oct 2, 2023 at 11:29
4

range needs a bit of help for delimiters

enter image description here

\documentclass{article}

\usepackage{unicode-math}
\setmathfont{Fira Math}

\setmathfont[range={`/}]{Latin Modern Math}
\let\lmfam\allocationnumber % fam allocated above for latin modern

\begin{document}
\Udelcode `/= \lmfam `/
   $/a/  + \left/\begin{tabular}{l}a\\b\\c\\d\end{tabular}\right/$
\end{document}
3
  • Thanks! I'm running into trouble figuring out how to check the math fam for a different font though (I want to try out some other possibilities for the replacement font). When I run your example with \showlists uncommented, I get a weird error message and no PDF output: C:\Users\[snip]\test.tex:11: OK. [\showlists]. Any idea on what to do with this error message? It's unfortunately not very informative as to what's going wrong.
    – Jigsaw
    Commented Oct 2, 2023 at 0:25
  • no that is not an error, the showlists interaction looks like an error as tex stops and shows the current state, but there should be a better way, I did ping Will in chat last night to see if he had an idea, I'll probably add something later. but look in the log and you will see the 4 shown Commented Oct 2, 2023 at 7:14
  • @Jigsaw try now, I updated so 4 is found automatically Commented Oct 2, 2023 at 7:59

You must log in to answer this question.

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