我想写一个公式,像附图一样,公式的两个部分有两个不同的箭头。我最终可以通过 \xymatrix 编写下面的代码。但第二个箭头的起点不正确。
%
%%-------------------------------------------------------------
%% Modern Particle Physics, Mark Thomson, Cambridge University, 2013
%%-------------------------------------------------------------
%
\documentclass[openany,11pt]{book}
\usepackage{amsthm,amsmath,amssymb,mathrsfs,amsfonts}
%\usepackage[cmex10]{amsmath}
\usepackage[all]{xy}
\usepackage{setspace}
\usepackage{makeidx}
\usepackage{colortbl}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{graphics}
\begin{document}
%-----------------
\begin{eqnarray}
\xymatrix{
|K_L\rangle=\frac{1}{\sqrt{2(1+|\epsilon^2|)}}[(1+\varepsilon)\mkern-25mu&\mkern-25mu|K^0\rangle \ar[rd]%
+/d:(1,1) 5pt/\mkern-25mu&\mkern-25mu - (1 - \varepsilon)\mkern-25mu&\mkern-25mu|\bar{K^0}\ar[rd]%
+/d:(1,1) 5pt/\rangle]. \\\nonumber
\mkern-25mu&\mkern-25mu&\mkern-25mu\pi^-e^+\nu_e \mkern-25mu&\mkern-25mu \mkern-25mu&\mkern-25mu \pi^+e^-\bar{\nu}_e}\mkern-25mu \nonumber
\end{eqnarray}
%-----------------
\end{document}
答案1
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
\[
|K_L\rangle=\frac{1}{\sqrt{2(1+|\varepsilon^2|)}}\left[(1+\varepsilon)|
\tikzmarknode{K1}{K^0}\rangle- (1 - \varepsilon)|
\tikzmarknode{K2}{\overline{K}^0}\rangle\right]
\]
\begin{tikzpicture}[
overlay,remember picture,
arr/.style={-stealth,shorten <=5pt}]
\draw[arr] (K1.south) |-++ (.5,-1) node[at end,right] {$\pi^-e^+\nu_e$};
\draw[arr] (K2.south) |-++ (.5,-.5) node[at end,right] {$\pi^+e^-\overline{\nu}_e$};
\end{tikzpicture}
\end{document}
答案2
在您的帮助下最终完成的代码:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\newcommand{\tikzmarknode}[1]{\tikz[baseline,remember picture] \coordinate (#1) {};}
\begin{document}
\begin{align*}
|K_L\rangle =\frac1{\sqrt{2(1 + \lvert\varepsilon^2\rvert)}}
\Bigl[(1 + \varepsilon)
{|K\tikzmarknode{K1}^0\rangle} - (1 - \varepsilon)
{|\bar K\tikzmarknode{K2}^0\rangle} \Bigr].
\end{align*}
\begin{tikzpicture}[overlay,remember picture,
arr/.style={-stealth,shorten <=5pt}]
\draw[arr] (K1.south) |-++ (.5,-1) node[at end,right] {$\pi^-e^+\nu_e$};
\draw[arr] (K2.south) |-++ (.5,-.5) node[at end,right] {$\pi^+e^-\overline{\nu}_e$};
\end{tikzpicture}
\end{document}
enter code here