I am trying to redefine \v command (wedge above character) to do what \vec does in mathmode and preserve \v in a command called, say \hac. This code works perfect
\documentclass{article}
\let\hac\v%
\renewcommand{\v}[1]{\ensuremath{\vec{#1}}}%
\begin{document}
line 1: š č ř
line 2: \hac{s} \hac{c} \hac{r} \v{s} \v{c} \v{r}
\end{document}
(line 1 does not print ''š č ř'' as it does not recognize the characters). However, when I add
\usepackage[cp1250]{inputenc}%
into the preamble, the first line prints ''s c r'' with a \vec over them. I do not understand where this behaviour is coming from and how to fix it. (Line 2 is always correct, first ''s c r'' is with a wedge and the second is with a \vec). Can anyone please explain?
Alternative way to achieve what I am trying to achieve is to find out syntax of the \v command. I did this using \showcmd in show2e package, finding ''> \v=macro: ->\OT1-cmd \v \OT1\v . \v '', but do not understand the syntax.
Thank you, J
š
is defined in cp1250 encoding to be\v s
so if you redefine\v
you redefineš
.;-)