JP-Ellis / tikz-feynman

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

inline/baseline in feynman environment #79

Open jionnyMagiah opened 1 year ago

jionnyMagiah commented 1 year ago

I have an issue related to this https://github.com/JP-Ellis/tikz-feynman/issues/32. I have this LaTex code

\begin{align}
    \labeq{lqed}
    \mathcal{L}_{Q E D}&=-\frac{1}{4} F_{\mu \nu} F^{\mu \nu}-\bar{\psi}\left(\gamma^{\mu} \partial_{\mu}+m\right) \psi+i e A_{\mu} \bar{\psi} \gamma^{\mu} \psi \\
    &=\ 
    \begin{tikzpicture}[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]
        \begin{feynman}[inline=(a)]
            \diagram[horizontal=a to b]{
            a--[boson]b};
        \end{feynman}
    \end{tikzpicture} \ +\ 
    \begin{tikzpicture}[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]
        \begin{feynman}[inline=(a)]
            \diagram[horizontal=a to b]{
            a--[fermion]b};
        \end{feynman}
    \end{tikzpicture} \ +\ 
    \begin{tikzpicture}[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]
        \begin{feynman}[inline=(a)]
            \diagram[horizontal=a to b]{
                a -- [fermion] b -- [fermion] c,
                b -- [boson] d,
                c--[opacity=0]d
                };
        \end{feynman}
    \end{tikzpicture} \nonumber
\end{align}

the graphs are correctly lined up, but in the "baseline" size rather then the "inline" size, which causes an overflow (the black vertical line is the margin). Schermata del 2022-12-27 10-26-25 I tried using inline after the tikzpicture environment, but it won't compile.