4
\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,positioning}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{decorations.pathmorphing}
\tikzstyle arrowstyle=[scale=1]
\tikzstyle directed=[postaction={decorate,decoration={markings,
    mark=at position .5 with {\arrow[arrowstyle]{stealth}}}}]
\tikzstyle reverse directed=[postaction={decorate,decoration={markings,
    mark=at position .5 with {\arrowreversed[arrowstyle]{stealth};}}}]    

\tikzset{
        gluon/.style={decorate, draw=black,very thick, 
        decoration={coil,amplitude=4pt, segment length=5pt}} 
        }   
\makeatletter

% gluon decoration (based on the original coil decoration)

\pgfdeclaredecoration{gluon}{coil}
{
  \state{coil}[switch if less than=%
    0.5\pgfdecorationsegmentlength+%>
    \pgfdecorationsegmentaspect\pgfdecorationsegmentamplitude+%
    \pgfdecorationsegmentaspect\pgfdecorationsegmentamplitude to last,
               width=+\pgfdecorationsegmentlength]
  {
    \pgfpathcurveto
    {\pgfpoint@oncoil{0    }{ 0.555}{1}}
    {\pgfpoint@oncoil{0.445}{ 1    }{2}}
    {\pgfpoint@oncoil{1    }{ 1    }{3}}
    \pgfpathcurveto
    {\pgfpoint@oncoil{1.555}{ 1    }{4}}
    {\pgfpoint@oncoil{2    }{ 0.555}{5}}
    {\pgfpoint@oncoil{2    }{ 0    }{6}}
    \pgfpathcurveto
    {\pgfpoint@oncoil{2    }{-0.555}{7}}
    {\pgfpoint@oncoil{1.555}{-1    }{8}}
    {\pgfpoint@oncoil{1    }{-1    }{9}}
    \pgfpathcurveto
    {\pgfpoint@oncoil{0.445}{-1    }{10}}
    {\pgfpoint@oncoil{0    }{-0.555}{11}}
    {\pgfpoint@oncoil{0    }{ 0    }{12}}
  }
  \state{last}[next state=final]
  {
    \pgfpathcurveto
    {\pgfpoint@oncoil{0    }{ 0.555}{1}}
    {\pgfpoint@oncoil{0.445}{ 1    }{2}}
    {\pgfpoint@oncoil{1    }{ 1    }{3}}
    \pgfpathcurveto
    {\pgfpoint@oncoil{1.555}{ 1    }{4}}
    {\pgfpoint@oncoil{2    }{ 0.555}{5}}
    {\pgfpoint@oncoil{2    }{ 0    }{6}}
  }
  \state{final}{}
}

\def\pgfpoint@oncoil#1#2#3{%
  \pgf@x=#1\pgfdecorationsegmentamplitude%
  \pgf@x=\pgfdecorationsegmentaspect\pgf@x%
  \pgf@y=#2\pgfdecorationsegmentamplitude%
  \pgf@xa=0.083333333333\pgfdecorationsegmentlength%
  \advance\pgf@x by#3\pgf@xa%
}

\makeatother



\begin{document}
\begin{tikzpicture}[scale=1.5][line width=10pt]
%\draw[step=.25cm] (-2.5,-2.5) grid (2.5,2.5);
\coordinate (Origin) at (0,0);
%\fill[black] (Origin) circle (2pt);
\draw [directed] (-1.25,.5) coordinate (a_3) -- node[left] {q} (-1.25, -.5) coordinate (a_2);
\draw [reverse directed] (-1.25, -.5) coordinate (a_2) -- (-.75,0) coordinate (a_1);
\draw [reverse directed] (-.75,0) coordinate (a_1) -- (-1.25,.5) coordinate (a_3);
\draw [dashed] (-.75,0) coordinate (a_1) -- node[above] {$h_{2}(h_{1})$} (1,0) coordinate (a_5);
\draw [dashed] (1,0) coordinate (a_5) -- node[above] {$\phi_1$} (1.75,.75) coordinate (a_6);
\draw [dashed] (1,0) coordinate (a_5) -- node[below] {$\phi_1$}(1.75,-.75) coordinate (a_7);
\draw [directed] (1.75,.75) coordinate(a_6) -- (1.75,1.25) coordinate  [label = above:{$\tau^-$}] (a_8);
\draw [reverse directed] (1.75,.75) coordinate (a_6) -- (2.25,.75) coordinate [label = right:{$\tau^+$}]  (a_9);
\draw [reverse directed] (1.75,-.75) coordinate(a_10) -- (1.75,-1.25) coordinate  [label = below:{$\tau^+$}] (a_11);
\draw [directed] (1.75,-.75) coordinate(a_10) -- (2.25,-.75) coordinate  [label = right:{$\tau^-$}] (a_11);
 \node (a_12) at (-1.15,.4) {};
  \node (a_13) at (-2.2,1.4) {g};
  \path (a_12) edge[decorate,decoration={gluon, amplitude=4pt, segment length=5.25pt}] (a_13);
 \node (a_14) at (-1.15,-.4) {};
  \node (a_15) at (-2.2,-1.4) {g};
  \path (a_14) edge[decorate,decoration={gluon, amplitude=4pt, segment length=5.25pt}] (a_15);
\end{tikzpicture}
\end{document}

I have the above Feynman diagram code. I would like to make all the lines thicker. I tried to specify the line width globally by using:

\begin{tikzpicture}[scale=1.5][line width=10pt]

but due to some reason there is no effect. Can someone point out what I'm doing wrong? Thanks in advance.

1
  • Included the coils? – skpblack Aug 25 '14 at 3:48
7

Your error is precisely to use two blocks of options [...][...] for tikzpicture; this tikzpicture only recognizes the options of the first [...] and omites the second.

You must put the options separated by commas. [scale=1.5,line width=10pt] instead of [scale=1.5][line width=10pt]. (10pt seems too, i used 2pt).

If you want a global definition for all pictures, you should to put in the preamble (or before of all pictures) something like

\tikzset{every picture/.style={line width=2pt}}
2
  • good to know that. – user3922546 Aug 25 '14 at 18:48
  • @user3922546: Please accept this answer then if it helps you. This will conclude this question. – Martin Scharrer Nov 24 '17 at 12:12

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.