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 '21 at 16:03
  • It is simply seeing the difference between $\vec{r}$ with and without "accents". Should I add an image? Aug 15 '21 at 17:19
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 '21 at 22:39

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.