2

I'm using a tikzset command to set a global style

\tikzset{FARROW/.tip={Latex[angle=40:2.5mm]},
   FARROW/.style={line width=3mm}
}

When I use it for an arrow, the arrow head style conforms to the style, but the line width stays the same

\begin{tikzpicture}
        \coordinate (o) at (0,0);
        \coordinate (e) at (0,3);
        \coordinate (ball) at (0,3.05);
        \coordinate (i1) at (2,0.5);
        \coordinate (i2) at (2,2.5);
        \filldraw (ball) circle (0.05cm);
        \draw[-FARROW] (o)node[right]{O}--(e) node[right] {$x$};
        \draw[-FARROW] (i1)--(i2) node[right] {$\VEC{i}$};
\end{tikzpicture}

Here's the output

Output showing arrow head is set, but line width not

  • Welcome to TeX.SX! It is better if you expand the code snippet sthat you have posted to a full minimal working example. It is much easier to help you if we can start with some compilable code that illustrates your problem. A MWE should start with a \documentclass command, include any necessary packages and be as small as possible to demonstrate your problem. At the moment we have to guess what packages etc you are using before we can compile your code (and I have no idea what \VEC is:) – Andrew Nov 1 '18 at 11:53
  • I'll remember that for future use, thanks. \VEC is a vector style \newcommand{\VEC}[1]{\bm{\mathrm{#1}}} – whitelined Nov 1 '18 at 12:30
3

Perhaps something like this:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\tikzset{
  FARROW/.style={line width=3mm, arrows={-Latex[angle=40:2.5mm]}}
}

\begin{document}

    \begin{tikzpicture}
        \coordinate (o) at (0,0);
        \coordinate (e) at (0,3);
        \coordinate (ball) at (0,3.05);
        \coordinate (i1) at (2,0.5);
        \coordinate (i2) at (2,2.5);
        \filldraw (ball) circle (0.05cm);
        \draw[FARROW] (o)node[right]{O}--(e) node[right] {$x$};
        \draw[FARROW] (i1)--(i2) node[right] {${i}$};
    \end{tikzpicture}

\end{document}

to produce:

enter image description here

I hope that these line widths are just for demonstration purposes and you don't really want to use these:)

  • This is excellent, thank you. Yes, the line weights were there to give me a big indication it was working. – whitelined Nov 1 '18 at 12:31

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.