2

I recently switched to the Libertius font familiy (available from GitHub) for consistent text and math fonts. However, the automatic size calculation using \left and \right is not to my taste in all instances.

For example, in the following output, the square brackets seem too small, as they do not even reach at least up to the top and bottom edges of the content:

enter image description here

However, the norm seem way too big for the content.

As counterexample, see the following output without the Libertinus fonts set:

enter image description here

Can I get this with Libertinus?

Here's the MWE to produce above result (note that it only works if the Libertinus fonts are installed):

% !TeX program = lualatex
\documentclass{scrartcl}

\usepackage{mathtools}
\usepackage{amssymb}

\usepackage{unicode-math}
\usepackage{fontspec}
    \setmainfont{Libertinus Serif}
    \setsansfont{Libertinus Sans}
    \setmathfont{Libertinus Math}
%    \setmathfont[range={"02016}]{Latin Modern Math} % Replace \Vert

\usepackage[main=ngerman,english]{babel}

% macros for underscores of vectors
\newcommand{\ubar}[1]{\mkern 1.5mu\underline{\mkern-1.5mu#1\mkern-1.5mu}\mkern 1.5mu}
\newcommand{\uubar}[1]{\ubar{\ubar{#1}}}

% macros for bold symbols of vectors
\renewcommand{\vec}[1]{\symbf{#1}}
\newcommand{\vvec}[1]{\ubar{\symbfup{#1}}}
\newcommand{\vmat}[1]{\uubar{\symbfup{#1}}}
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}

\begin{document}

    \begin{align}
        x &= \frac{3}{\sigma^y_{\gamma}} \left[ \frac{(1-z)g(z)}{2E} \right] \\
        y &= \norm{\vvec{r}_{\vec{\sigma}}(\vvec{\sigma}_{n+1,j+1})} \\
        \vvec{b} &= \vmat{A}\vvec{x}
    \end{align}

\end{document}

Update: I tried to replace the \Vert character with the one from the XITS Math font which did fix the size of the norms. However, this messes up the double underlines from my \uubar macro making the spacing way too big (see updated example). I don't really know what \underline might have to do with that...

Update 2: The \Vert can be fixed most easily for my needs by replacing the glyph with the corresponding one from the Latin Modern Math font: \setmathfont[range={"02016}]{Latin Modern Math}

enter image description here

  • 1
    You can to patch the font like here tex.stackexchange.com/a/385117/2388. But imho a bug report at the libertinus site is the better idea, the \Vert size look rather unbalanced. – Ulrike Fischer Feb 2 '18 at 16:58
  • Judging from the amount of open issues on the repo I don't expect this to be addressed too soon. I'll file a report anyways, but considering the time constrains, I'd probably better look for a substitute font then. – Christoph90 Feb 2 '18 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.