5

When I try to use the libertine package with lualatex:

\documentclass{article}
\usepackage{libertine}
\begin{document}
  \(\mathbf{\tilde{n}}\)
\end{document}

I'm seeing problems making a letter with a tilde above it bold:

enter image description here

It looks ok without the libertine package or without being bold. Is this a known issue with lualatex or something I can fix?

[update]: Here's longer list of n's and ñ's. The hope would be that the boldness of the n matches regular text bold. And that the tildes all end up in a reasonable place. I'm not sure what to expect for differences between mathbf/symbf but for various attempts they look different:

\documentclass{article}

%\usepackage{libertine}
% Supports symbf
\usepackage{libertinus}

\begin{document}
  
  \textbf{n}
  \textbf{ñ} % U+00F1
  \textbf{ñ} % U+006E U+0303
  \(\mathbf{ñ}\) % U+00F1
  \(\mathbf{ñ}\) % U+006E U+0303
  \(\mathbf{\tilde{n}} \)
  \(\symbf{ñ}\) % U+00F1
  \(\symbf{ñ}\) % U+006E U+0303
  \(\symbf{\tilde{n}}\)

\end{document}

With libertinus this outputs:

enter image description here

12
  • 1
    @Marijn interesting. So ñ (U+00F1) works. but ñ (U+006E U+0303) does not. Commented May 18 at 15:14
  • 1
    @Sebastiano libertinus gives a different wrong result.
    – cfr
    Commented May 18 at 15:21
  • 1
    @Sebastiano Do you get a correct result? Because I tried with both libertinus and libertinus-otf and the accent is always misplaced.
    – cfr
    Commented May 18 at 15:24
  • 1
    @cfr Yes you're right. But to the minimal working examples of egreg work always :-)
    – Sebastiano
    Commented May 18 at 15:25
  • 2
    @Sebastiano I'm pretty sure TeX has an \if@user@egreg ... somewhere ....
    – cfr
    Commented May 18 at 15:27

2 Answers 2

5

Don't use libertine. The font is long unsupported.

Use libertinus instead, and \symbf instead of \mathbf.

\documentclass{article}
\usepackage{libertinus}

\begin{document}

\(\tilde{\symbf{n}}+a+b\)

\(\symbf{\tilde{n}}+a+b\)

\end{document}

In my opinion the first syntax is correct.

enter image description here

10
  • Could you explain why/when \symbf versus \mathbf?
    – cfr
    Commented May 18 at 15:25
  • I'm also curious. Meanwhile, the \symbf bold n is every so slightly less bold than \textbf{n} or \mathbf{n}. Commented May 18 at 15:29
  • @AlecJacobson \usepackage[semibold]{libertinus}
    – egreg
    Commented May 18 at 15:32
  • @cfr do a copy & paste to see the difference between \symbf + \mathbf: the first copy the n as U+1D427 (mathematical bold small n) and so as mathematical symbol, while the second copies it simply as U+006E (latin small n). Commented May 19 at 5:33
  • @UlrikeFischer Do you mean from the PDF? Because they both copy-paste as n. Or what am I meant to paste them into? They actually look different in the PDF, but they paste identically. Paste: nn or do I have to compile with something other than LuaTeX to see a difference? I also tried pasting into my editor and onto the commandline: echo 'nn' | sed 's/n/x/g' -> xx where the echo is pasted from the PDF and the sed expression is entered normally.
    – cfr
    Commented May 19 at 6:12
5

If you must continue to use the libertine package, I suggest you write either \tilde{\mathbf{n}} or \textbf{\~{n}} in math mode.

I have a hunch that \tilde{\mathbf{n}} is what you want.

enter image description here

% !TEX TS-program = lualatex
\documentclass{article}
\usepackage{libertine} % or: '\usepackage{libertinus}'
\begin{document}

$\mathbf{\tilde{n}}$ 
$\tilde{\mathbf{n}}$ 
$\textbf{\~{n}}$

\end{document}

You must log in to answer this question.

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