2

How can I correctly redefine the command for the times-symbol in the libertinust1math font to make the symbol larger?

I've tried the following, but I do not know if that's the correct way.

\documentclass[a4paper,12pt]{article}
\usepackage[sansmath]{libertinust1math}

%\usepackage{scalerel}
%%\newcommand\Times{\scaleobj{2.5}{\times}}

\let\Oldtimes\times
\renewcommand{\times}{\mathop{\mathchoice
  {\vcenter{\hbox{\LARGE$\Oldtimes$}}}
  {\vcenter{\hbox{\large$\Oldtimes$}}}
  {\vcenter{\hbox{\footnotesize$\Oldtimes$}}}
  {\vcenter{\hbox{\scriptsize$\Oldtimes$}}}
}\displaylimits}

\begin{document}

\begin{equation*}
\vec{a}\times\vec{b}=
  \begin{pmatrix}
    1 \\
    2 \\
    3
  \end{pmatrix}
  \times
  \begin{pmatrix}
    4 \\
    5 \\
    6
  \end{pmatrix}
\end{equation*}
\end{document}

enter image description here

  • 1
    I don't know if it is a good idea to redefine a standard command like that. For instance, $x^\times$ won't work after the redefinition but it does before. Why don't you just give the macro a new name? – marmot Jun 20 '18 at 3:37
  • @marmot thanks for your hint. I just do not know if this is the correct way. But I thought if I redefine the old command, I can more easily use my source code with a different font. Because the times symbol seems to me to be so small only in the writing libertinust1math. – user139826 Jun 20 '18 at 4:55
  • It looks like a general problem of scale of letters relative to other math symbols. Perhaps writing to the package author is the best option. – Andrew Swann Jun 20 '18 at 6:30
  • This looks rather bad. The spacing is wrong, the lines of the times symbol to thick and it is also too high. – Ulrike Fischer Jun 20 '18 at 7:19
3

For strange reasons, the \times symbol is raised from the baseline, so “vcentering” it will not lead to pleasant results. On the other hand, instead of fixed sizes, it is better to scale the symbol, so it will work independently on the current font size.

\documentclass[a4paper,12pt]{article}
\usepackage[sansmath]{libertinust1math}
\usepackage{graphicx}

\mathchardef\originaltimes\times
\renewcommand{\times}{%
  \mathbin{%
    \mathpalette\makebigger{{2.2}{\originaltimes}}% fix the factor to suit
  }%
}
\makeatletter
\newcommand{\makebigger}[2]{\make@bigger#1#2}
\newcommand\make@bigger[3]{%
  \vcenter{\hbox{%
    \scalebox{#2}{%
      \raisebox{-.2\height}[.8\height][0pt]{$\m@th#1#3$}% lower to the baseline
    }%
  }}%
}
\makeatother

\begin{document}

\begin{equation*}
\vec{a}\times\vec{b}=
  \begin{pmatrix}
    1 \\
    2 \\
    3
  \end{pmatrix}
  \times
  \begin{pmatrix}
    4 \\
    5 \\
    6
  \end{pmatrix}
\end{equation*}
\end{document}

I chose a 2.2 scaling factor just by way of example. Try with other values until you're satisfied.

enter image description here

Your Answer

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