如何在并排方程式之间添加粗箭头

如何在并排方程式之间添加粗箭头
\documentclass{article}
\usepackage{tikz-cd}
\usepackage{chemfig}
\usepackage{amsmath}
\usepackage[charter]{mathdesign}
\usepackage{tikz}
\usepackage{tikz-cd}

\usetikzlibrary{arrows.meta,tikzmark}
\definecolor{voilet}{cmyk}{.69,.93,0,0}

\begin{document}

\newcommand{\myarrow}{\raisebox{0pt}{\tikz \draw[-Latex, thick,line width=2pt,node distance=3pt,color=red] (0,0) -- (1,0);}}

\begin{align}
\tikzmarknode{c}{\mathrm{C}}_{\mathrm{H}}=\frac{\tikzmarknode{g}{\mathrm{g}}({\Delta \tikzmarknode{H}{\mathrm{H}}_{\mathrm{p},l}})}{\tikzmarknode{n}{\mathrm{n}}_1^2 \tikzmarknode{D}{\mathrm{D}}_1^2}=\frac{\mathrm{g}({\Delta \tikzmarknode{HH}{\mathrm{H}}_{\mathrm{p},2}})}{\tikzmarknode{nn}{\mathrm{n}}_2^2 \tikzmarknode{DD}{\mathrm{D}}_2^2}
&\qquad\myarrow\qquad
\frac{\Delta \mathrm{H}_{\mathrm{p},2}}{\Delta \mathrm{H}_{\mathrm{p},1}}=\frac{\mathrm{n}_2^2 \mathrm{D}_2^2}{\mathrm{n}_1^2 \mathrm{D}_1^2}
\end{align}
\begin{tikzpicture}[overlay,remember picture,
    color=voilet,
    >=Latex,node distance=.5cm,
    lbl/.style = {align=center, font=\footnotesize}  % <--- new
                        ]
\draw[<-] (c) -- ++ (-0.5,0)    node[lbl,left]        {head coefficient}; % <--- now the text is in two lines
\draw[<-] (g) -- ++ (-0.3,0.3)  node[lbl,above left]  {gravitational acceleration}; % node position is moved to left
\draw[<-] (H) -- ++ ( 0.5,0.5)  node[lbl,above right] {head capacity};% node position is moved to right
\draw[<-] (n) -- ++ (-0.5,-0.4)  node[lbl,below left]       {};
\draw[<-] (HH) -- ++ ( -0.5,0.5)  node[lbl,below left] {};% node position is moved to right
\draw[<-] (nn) -- ++ (-0.3,-0.4)  node[lbl,below left]       {rotation speed in revolution per unit time};
\draw[<-] (D) -- ++ (0.9,-0.9)  node[lbl,below right]       {};
\draw[<-] (DD) -- ++ (-0.9,-0.3)  node[lbl,below left]       {\hspace*{-35pt}impeller diameter};
\end{tikzpicture}

\end{document}

输出必须如下图所示。请提出建议。

答案1

您可以使用 tikzlibrary shapes.arrows(手册第 72.5 节,第 808 页)来定义:

\newcommand\myarrow{%
   \tikz[baseline={([yshift=-1ex]current bounding box.center)}]
           {\node at(0,)[red arrow]{};}%
}

其中的样式red arrow

\tikzset{
  red arrow/.style={single arrow, thick,draw=red,fill=red!60, minimum height=12mm}
}

有了这个定义,\myarrow您的代码将生成:

在此处输入图片描述

完整代码如下:

\documentclass{article}
\usepackage{tikz-cd}
\usepackage{chemfig}
\usepackage{amsmath}
\usepackage[charter]{mathdesign}
\usepackage{tikz}
\usepackage{tikz-cd}

\usetikzlibrary{arrows.meta,tikzmark, shapes.arrows}
\definecolor{voilet}{cmyk}{.69,.93,0,0}

\tikzset{
  red arrow/.style={single arrow,shape border rotate=0,
                            thick,draw=red,fill=red!60,
                            minimum height=10mm}
}
\newcommand\myarrow{\tikz[baseline={([yshift=-1ex]current bounding box.center)}]{\node at(0,)[red arrow]{};}}

\begin{document}

\begin{align}
\tikzmarknode{c}{\mathrm{C}}_{\mathrm{H}}=\frac{\tikzmarknode{g}{\mathrm{g}}({\Delta \tikzmarknode{H}{\mathrm{H}}_{\mathrm{p},l}})}{\tikzmarknode{n}{\mathrm{n}}_1^2 \tikzmarknode{D}{\mathrm{D}}_1^2}=\frac{\mathrm{g}({\Delta \tikzmarknode{HH}{\mathrm{H}}_{\mathrm{p},2}})}{\tikzmarknode{nn}{\mathrm{n}}_2^2 \tikzmarknode{DD}{\mathrm{D}}_2^2}
&\qquad\myarrow\qquad
\frac{\Delta \mathrm{H}_{\mathrm{p},2}}{\Delta \mathrm{H}_{\mathrm{p},1}}=\frac{\mathrm{n}_2^2 \mathrm{D}_2^2}{\mathrm{n}_1^2 \mathrm{D}_1^2}
\end{align}
\begin{tikzpicture}[overlay,remember picture,
    color=voilet,
    >=Latex,node distance=.5cm,
    lbl/.style = {align=center, font=\footnotesize}  % <--- new
                        ]
\draw[<-] (c) -- ++ (-0.5,0)    node[lbl,left]        {head coefficient}; % <--- now the text is in two lines
\draw[<-] (g) -- ++ (-0.3,0.3)  node[lbl,above left]  {gravitational acceleration}; % node position is moved to left
\draw[<-] (H) -- ++ ( 0.5,0.5)  node[lbl,above right] {head capacity};% node position is moved to right
\draw[<-] (n) -- ++ (-0.5,-0.4)  node[lbl,below left]       {};
\draw[<-] (HH) -- ++ ( -0.5,0.5)  node[lbl,below left] {};% node position is moved to right
\draw[<-] (nn) -- ++ (-0.3,-0.4)  node[lbl,below left]       {rotation speed in revolution per unit time};
\draw[<-] (D) -- ++ (0.9,-0.9)  node[lbl,below right]       {};
\draw[<-] (DD) -- ++ (-0.9,-0.3)  node[lbl,below left]       {\hspace*{-35pt}impeller diameter};
\end{tikzpicture}

\end{document}

相关内容