There seem to be a clash between two things I usually do but had never done simultaneously: using the T1 font encoding and using \overrightarrow
for vectors.
Indeed, I find the \vec
arrow's fixed size ugly. For example like this:
So what I usually do is \renewcommand{\vec}[1]{\overrightarrow{#1}}
which outputs nice long arrows (at least in OT1 encoding).
Although, I have to use the T1 encoding for my current document but it seems to mess with the arrows. For example here, the arrow is too long on the left:
I could provide my whole preamble if the font encoding is not the problem but it's quite long.
So the question is: how to have both a correct encoding (my document is in French) and nice arrows over my vectors?
EDIT: adding an example (after @DavidCarlisle's request)
I found what caused the font change: the newtxmath
package. I had used it to be able to use \not
with anything I want. After examination, I happen to prefer the original \vec
command applied on single characters with the newtxmath
font.
Here is the example anyway:
% Set up the document's format to A4 and the font's size to 12pt.
\documentclass[a4paper,12pt]{report}
% Set up the input's encoding to UTF-8, the document's font and language to T1 (adapted to french) and french (the grammar linter uses this parameter).
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
% Allows to define \notfoo or \nfoo (not recommended) in order for \not\foo to work as wished.
\usepackage{newtxmath}
% Redefines \vec such that the arrow covers the whole name of the vector.
\renewcommand{\vec}[1]{\overrightarrow{#1}}
\begin{document}
\(\vec{v}\)
\end{document}
\vec
is intended to be used on just one symbol. In your example, it should be set only on thep
,\nu
oru
, respectively, excluding indices and such.T1
as in\usepackage[T1]{fontenc}
has no effect at all on math mode so it is hard to guess what the question is refering to