LaTeX:拆分和聚集环境
LaTeX: Split and gathered environment
我想在多行上拆分一个在聚集环境中包含 tikzpicture 的方程式。我曾尝试使用对齐和拆分环境,但都没有用...
这是一个工作示例,其中等式位于一条直线上:
\documentclass[12pt]{article}
\usepackage{amssymb}
% !TEX program = lualatex
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{tikz}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\begin{equation}
2\Im\left(F(q^2)\right) =
\begin{gathered}
\scalebox{0.7}{
\begin{tikzpicture}
\begin{feynman}
\vertex (i1) {\(s\)};
\vertex [right=of i1] (a);
\vertex [right=of a] (b);
\vertex [right=of b] (i2);
\diagram* {
i1 -- a --[half left] b -- i2,
b --[half left, double] a,
};
%% Find the midpoint which is halfway between a and b
\coordinate (midpoint) at ($(a)!0.5!(b)$);
%% Draw a line starting 2 units above the midpoint, and
%% ending 2 units below the midpoints
\draw [dashed] ($(midpoint) + (0, 0.8)$) -- ($(midpoint) + (0,-0.8)$);
\end{feynman}
\end{tikzpicture}
}
\end{gathered}
= \int\frac{\,d^d k}{i\pi^{d/2}} \left[2\pi i\: \theta(k^0)\delta(k^2-m^2)\right]\left[2\pi i\: \theta(q^0-k^0)\delta((q-k)^2)\right]%
\end{equation}
\end{document}
这是我想做的事情
\documentclass[12pt]{article}
\usepackage{amssymb}
% !TEX program = lualatex
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{tikz}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\begin{equation}
\begin{split}
2\Im\left(F(q^2)\right) &=
\begin{gathered}
\scalebox{0.7}{
\begin{tikzpicture}
\begin{feynman}
\vertex (i1) {\(s\)};
\vertex [right=of i1] (a);
\vertex [right=of a] (b);
\vertex [right=of b] (i2);
\diagram* {
i1 -- a --[half left] b -- i2,
b --[half left, double] a,
};
%% Find the midpoint which is halfway between a and b
\coordinate (midpoint) at ($(a)!0.5!(b)$);
%% Draw a line starting 2 units above the midpoint, and
%% ending 2 units below the midpoints
\draw [dashed] ($(midpoint) + (0, 0.8)$) -- ($(midpoint) + (0,-0.8)$);
\end{feynman}
\end{tikzpicture}
}
\end{gathered}\
&= \int\frac{\,d^d k}{i\pi^{d/2}} \left[2\pi i\: \theta(k^0)\delta(k^2-m^2)\right]\left[2\pi i\: \theta(q^0-k^0)\delta((q-k)^2)\right]%
\end{split}
\end{equation}
\end{document}
后者returns在split环境下聚集导致的错误
你们知道解决我的问题的方法吗?
我不清楚你想要的结果到底应该是什么样子,但我认为这应该大致是你想要的:
\documentclass[12pt]{article}
\usepackage{amssymb}
% !TEX program = lualatex
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{tikz}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\begin{align}
2\Im\left(F(q^2)\right) &=
\parbox{0.5\linewidth}{%
\scalebox{0.7}{
\begin{tikzpicture}
\begin{feynman}
\vertex (i1) {\(s\)};
\vertex [right=of i1] (a);
\vertex [right=of a] (b);
\vertex [right=of b] (i2);
\diagram* {
i1 -- a --[half left] b -- i2,
b --[half left, double] a,
};
%% Find the midpoint which is halfway between a and b
\coordinate (midpoint) at ($(a)!0.5!(b)$);
%% Draw a line starting 2 units above the midpoint, and
%% ending 2 units below the midpoints
\draw [dashed] ($(midpoint) + (0, 0.8)$) -- ($(midpoint) + (0,-0.8)$);
\end{feynman}
\end{tikzpicture}
}
} \
&= \int\frac{\,d^d k}{i\pi^{d/2}} \left[2\pi i\: \theta(k^0)\delta(k^2-m^2)\right]\left[2\pi i\: \theta(q^0-k^0)\delta((q-k)^2)\right] \notag
\end{align}
\end{document}
结果如下:
我想在多行上拆分一个在聚集环境中包含 tikzpicture 的方程式。我曾尝试使用对齐和拆分环境,但都没有用...
这是一个工作示例,其中等式位于一条直线上:
\documentclass[12pt]{article}
\usepackage{amssymb}
% !TEX program = lualatex
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{tikz}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\begin{equation}
2\Im\left(F(q^2)\right) =
\begin{gathered}
\scalebox{0.7}{
\begin{tikzpicture}
\begin{feynman}
\vertex (i1) {\(s\)};
\vertex [right=of i1] (a);
\vertex [right=of a] (b);
\vertex [right=of b] (i2);
\diagram* {
i1 -- a --[half left] b -- i2,
b --[half left, double] a,
};
%% Find the midpoint which is halfway between a and b
\coordinate (midpoint) at ($(a)!0.5!(b)$);
%% Draw a line starting 2 units above the midpoint, and
%% ending 2 units below the midpoints
\draw [dashed] ($(midpoint) + (0, 0.8)$) -- ($(midpoint) + (0,-0.8)$);
\end{feynman}
\end{tikzpicture}
}
\end{gathered}
= \int\frac{\,d^d k}{i\pi^{d/2}} \left[2\pi i\: \theta(k^0)\delta(k^2-m^2)\right]\left[2\pi i\: \theta(q^0-k^0)\delta((q-k)^2)\right]%
\end{equation}
\end{document}
这是我想做的事情
\documentclass[12pt]{article}
\usepackage{amssymb}
% !TEX program = lualatex
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{tikz}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\begin{equation}
\begin{split}
2\Im\left(F(q^2)\right) &=
\begin{gathered}
\scalebox{0.7}{
\begin{tikzpicture}
\begin{feynman}
\vertex (i1) {\(s\)};
\vertex [right=of i1] (a);
\vertex [right=of a] (b);
\vertex [right=of b] (i2);
\diagram* {
i1 -- a --[half left] b -- i2,
b --[half left, double] a,
};
%% Find the midpoint which is halfway between a and b
\coordinate (midpoint) at ($(a)!0.5!(b)$);
%% Draw a line starting 2 units above the midpoint, and
%% ending 2 units below the midpoints
\draw [dashed] ($(midpoint) + (0, 0.8)$) -- ($(midpoint) + (0,-0.8)$);
\end{feynman}
\end{tikzpicture}
}
\end{gathered}\
&= \int\frac{\,d^d k}{i\pi^{d/2}} \left[2\pi i\: \theta(k^0)\delta(k^2-m^2)\right]\left[2\pi i\: \theta(q^0-k^0)\delta((q-k)^2)\right]%
\end{split}
\end{equation}
\end{document}
后者returns在split环境下聚集导致的错误
你们知道解决我的问题的方法吗?
我不清楚你想要的结果到底应该是什么样子,但我认为这应该大致是你想要的:
\documentclass[12pt]{article}
\usepackage{amssymb}
% !TEX program = lualatex
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{tikz}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\begin{align}
2\Im\left(F(q^2)\right) &=
\parbox{0.5\linewidth}{%
\scalebox{0.7}{
\begin{tikzpicture}
\begin{feynman}
\vertex (i1) {\(s\)};
\vertex [right=of i1] (a);
\vertex [right=of a] (b);
\vertex [right=of b] (i2);
\diagram* {
i1 -- a --[half left] b -- i2,
b --[half left, double] a,
};
%% Find the midpoint which is halfway between a and b
\coordinate (midpoint) at ($(a)!0.5!(b)$);
%% Draw a line starting 2 units above the midpoint, and
%% ending 2 units below the midpoints
\draw [dashed] ($(midpoint) + (0, 0.8)$) -- ($(midpoint) + (0,-0.8)$);
\end{feynman}
\end{tikzpicture}
}
} \
&= \int\frac{\,d^d k}{i\pi^{d/2}} \left[2\pi i\: \theta(k^0)\delta(k^2-m^2)\right]\left[2\pi i\: \theta(q^0-k^0)\delta((q-k)^2)\right] \notag
\end{align}
\end{document}
结果如下: