JP-Ellis / tikz-feynman

Feynman Diagrams with TikZ
http://www.jpellis.me/projects/tikz-feynman
Other
148 stars 20 forks source link

Setting vertex style for every vertex #8

Closed apuignav closed 8 years ago

apuignav commented 8 years ago

Hi!

Sorry again for more issues, I just started using the package (amazing, by the way) and I'm finding some problems.

The issue is I cannot use every vertex/.style because I get the error

! Package pgfkeys Error: I do not know the key '/tikz/dot' and I am going to ig nore it. Perhaps you misspelled it.

I think I followed the manual, but maybe I misunderstood. If that's the case, I'll be happy to submit a pull request to make the wording clearer.

MWE follows:

\documentclass[a4paper]{scrartcl}
\usepackage[T1]{fontenc}   

\usepackage{tikz}
\usepackage{tikz-feynman}

\tikzfeynmanset{every vertex/.style={dot}}

\title{MWE}
\author{Albert Puig}
\date{}

\begin{document}

\begin{tikzpicture}
\begin{feynman}
    \vertex (b1) {$i$};
    \vertex [right=of b1] (b2);
    \vertex [right=of b2] (b3) {$o$};

    \diagram* {
        (b1) -- [fermion] (b2) -- [fermion] (b3),
    };
\end{feynman}
\end{tikzpicture}

\end{document}

Thanks a lot!

JP-Ellis commented 8 years ago

Hi! Thanks for using this package, I'm glad you're finding it useful :)

Are you using v1.0.0-rc1.1? If so, then this is a bug I just recently fixed in e5ba50b2735d3cd5d61732a38e2660aebd5ee610.

Could you let me know if using the latest code on the master branch fixes it for you? You can either git clone it, or download a snapshot of the master branch here.

apuignav commented 8 years ago

Works perfectly with the head! It's a pity the dot is too big it doesn't look too good, but problem solved.

Thanks!

JP-Ellis commented 8 years ago

I'm glad the master branch solved all your problems :)

As for the size of the dot, it does look quite big when I compile your example. I'll consider a few other cases and I might make it a bit smaller. I don't use dots all that often in my diagrams, so the couple of tests cases, such as

screenshot from 2016-01-18 21-50-54

don't look all that bad in my opinion, but I guess they could be a little smaller.

If you want, you can also create your own dot style:

\tikzfeynmanset{
  my dot/.style={
    /tikzfeynman/dot,
    /tikz/minimum size=3pt,
  },
  every vertex/.style={my dot},
}

Hope that helps :)

samox73 commented 2 years ago

This is still an issue for me. The following code

\documentclass{standalone}
\usepackage[T1]{fontenc}

\usepackage{tikz}
\usepackage{tikz-feynman}

\tikzfeynmanset{every vertex/.style={dot}}
\tikzstyle{phonon} = [dashed, half left]

\begin{document}

\begin{tikzpicture}
\begin{feynman}
    \vertex (b1) {};
    \vertex [right=of b1] (b2) {};
    \vertex [right=of b2] (b3) {};
    \vertex [right=of b3] (b4) {};

    \diagram* {
      (b1) -- [fermion] (b2) -- [fermion] (b3) -- [fermion] (b4),
      (b2) -- [phonon] (b3);
    };
\end{feynman}
\end{tikzpicture}

\end{document}

results in 2022-06-16T14:10:27,893373418+02:00 for me. Using tikz-feynman 2016/02/05 v1.1.0

samox73 commented 2 years ago

Okay I just found https://github.com/JP-Ellis/tikz-feynman/issues/20#issuecomment-181143783, but please consider updating the CTAN doc. This has driven me mad for the last hour.