Text FormattingCode Redefinition for Vector Arrow

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Code Redefinition for Vector Arrow

Post by ghostanime2001 »

In the esvect package, I modified the vertical shift of the vector arrow in the "implementation" section of the package. I want to redefine the command \vv with the changed vertical shifts. I used \renewcommand but there is an error. Please take a look at my code. Thanks!

Code: Select all

\documentclass{article}
\usepackage[b]{esvect}  
\makeatletter
\def\vectfill@{\traitfill@\relbaredd\relbareda\fldr}
%\end{macrocode}
 %Construction of the arrow:
 % \begin{macrocode}
 \def\traitfill@#1#2#3#4{%
 $\m@th\mkern2mu\relax#4#1\mkern0mu%on met \relbaredd au d\’ebut
 \cleaders\hbox{$#4\mkern0mu#2\mkern0mu$}\hfill%remplit avec relbareda
 \mkern0mu#3$%
 }

% the above code has changed values of 0.2mu

\makeatletter
    \def\overvect@#1#2#3{\vbox{\ialign{##\crcr%
     \noalign{\kern-0.5pt\nointerlineskip}#1#2\crcr%
     \noalign{\kern0.5pt\nointerlineskip}$\m@th\hfil#2#3\hfil$\crcr}}}

% the above code has changed values of +-0.5pt
\begin{document}
$\vv{i}\vv{a}$
\end{document}
Last edited by ghostanime2001 on Fri Jun 14, 2013 7:12 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Code Redefinition for Vector Arrow

Post by cgnieder »

I'm not sure what you want us to do here. As far as I can see this is the code from the package but with changed length values. You can leave the first definition as it is exactly the same as in the package and you should undo the catcode change from \makeatletter after the redefinitions with \makeatother:

Code: Select all

\documentclass{article}
\usepackage[b]{esvect}
\makeatletter
\def\traitfill@#1#2#3#4{%
  $\m@th\mkern2mu\relax#4#1\mkern0mu%on met \relbaredd au d\’ebut
  \cleaders\hbox{$#4\mkern0mu#2\mkern0mu$}\hfill%remplit avec relbareda
  \mkern0mu#3$%
}

% the above code has changed values of -1.5mu => 0mu

\def\overvect@#1#2#3{\vbox{\ialign{##\crcr%
  \noalign{\kern-0.5pt\nointerlineskip}#1#2\crcr%
  \noalign{\kern0.5pt\nointerlineskip}$\m@th\hfil#2#3\hfil$\crcr}}}

% the above code has changed values of -.7pt => -.5pt and -.3pt => .5pt
\makeatother
\begin{document}

$\vv{i}\vv{a}$

\end{document}
Regards
site moderator & package author
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Code Redefinition for Vector Arrow

Post by ghostanime2001 »

Last edited by ghostanime2001 on Mon Jun 17, 2013 6:10 pm, edited 8 times in total.
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Code Redefinition for Vector Arrow

Post by ghostanime2001 »

I have made a similar post here if it helps.
Last edited by ghostanime2001 on Fri Jun 14, 2013 7:10 pm, edited 2 times in total.
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: Code Redefinition for Vector Arrow

Post by ghostanime2001 »

any ideas?
Post Reply