0

I had redefined the \vec command to remove kerning, and have noticed how after loading "accents" the kerning is back to normal (it is as if my redefinition of \vec was being ignored).

\documentclass{article}
\usepackage[utf8]{inputenc}

% Accents
\usepackage{accents}

% Change kerning for vectors
\let\originalvec\vec
\renewcommand\vec[1]{\originalvec{\kern0pt #1}}

\begin{document}
$\vec{r}$
\end{document}

Any idea on what could be happening? Thanks!

2
  • 2
    show a complete example, not only a snippet. That makes it much easier to test your issue. Aug 15, 2021 at 16:03
  • It is simply seeing the difference between $\vec{r}$ with and without "accents". Should I add an image? Aug 15, 2021 at 17:19

1 Answer 1

1

Your \originalvec is the version used by accents, which disregards the \kern0pt instruction.

\documentclass{article}

\NewCommandCopy{\originalvec}{\vec} % better than \let
\usepackage{accents}

% Change kerning for vectors
\renewcommand\vec[1]{\originalvec{\kern0pt #1}}

\begin{document}

$\vec{r}$

$\originalvec{r}$

\end{document}

I'm not sure you really want it, anyway.

enter image description here

1
  • That does it, thanks a lot! Aug 15, 2021 at 22:39

You must log in to answer this question.

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