如何正确定位图像和方程式?

如何正确定位图像和方程式?

我希望得到方程后面的数字(第一个方程后面的第一个数字和第二个方程后面的第二个数字),但我想要公式标签右对齐(就像现在一样)以及要算作标题中的数字

我尝试使用迷你页面,但看起来格式很差,而且图形没有出现在图形列表中......

有什么帮助吗?提前致谢。我有图片下方的代码。

我拥有的

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[style=numeric]{biblatex}
\addbibresource{bib.bib}
\usepackage{array}
\usepackage{placeins}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{graphicx}
\usepackage{float}
\usepackage[left=3cm, right=3cm]{geometry}
\usepackage[acronym]{glossaries}\include{Acronyms}
\usepackage{titlesec}
\titleformat{\chapter}{\normalfont\huge}{\bf\thechapter.}{20pt}{\huge\bf}
\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=blue,
    urlcolor=black
}

\author{\textbf{Names}
\title{Title}

\begin{document}
\begin{align}
    \int\limits_{V} div \ \mathbf{a} \ \mathrm{d}V = \oint\limits_{S} n \ \mathbf{a} \ \mathrm{d}S \label{eq:gauss_theorem} \\
    \int\limits_{S} div \ \mathbf{a} \ \mathrm{d}S = \oint\limits_{C} n \ \mathbf{a} \ \mathrm{d}r \label{eq:stokes_theorem}
\end{align}


\begin{figure}[!ht]
    \centering
    \begin{minipage}[b]{0.4\textwidth}
\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt        
\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-0.9,xscale=0.9]
%uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300

%Shape: Polygon Curved [surface] 
\draw   (210.18,101) .. controls (230.18,91) and (247.72,81.05) .. (300.18,101) .. controls (352.65,120.95) and (376.6,167.77) .. (300.18,161) .. controls (223.77,154.23) and (205.93,183.77) .. (185.93,153.77) .. controls (165.93,123.77) and (190.18,111) .. (210.18,101) -- cycle ;
%Straight Lines [arrow] 
\draw    (186.59,115) -- (162.75,91.86) ;
\draw [shift={(160.6,89.77)}, rotate = 404.15] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (194.6,163.1) -- (166.92,185.86) ;
\draw [shift={(164.6,187.77)}, rotate = 320.57] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (289.92,160.33) -- (288.71,192.1) ;
\draw [shift={(288.6,195.1)}, rotate = 272.18] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (326.59,114.33) -- (352.99,91.72) ;
\draw [shift={(355.27,89.77)}, rotate = 499.42] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;

% Text Node
\draw (236.59,135) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$S$};
% Text Node
\draw (269.92,67) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$C$};
% Text Node
\draw (167,77) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (158,165) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (298,190) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (359,104) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};


\end{tikzpicture}
    \caption{Example of a \\ two-dimensional surface S with \\ a contour C.} \label{fig:surface_contour}
    \end{minipage}
    \begin{minipage}[b]{0.4\textwidth}
\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt        
\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-0.9,xscale=0.9]
%uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300

%Shape: Polygon Curved [volume] 
\draw   (210.18,101) .. controls (230.18,91) and (247.72,81.05) .. (300.18,101) .. controls (352.65,120.95) and (376.6,167.77) .. (300.18,161) .. controls (223.77,154.23) and (205.93,183.77) .. (185.93,153.77) .. controls (165.93,123.77) and (190.18,111) .. (210.18,101) -- cycle ;
%Curve Lines [horizontal depth line] 
\draw  [dash pattern={on 0.84pt off 2.51pt}]  (183.26,143.67) .. controls (223.26,113.67) and (321.28,118.53) .. (346.6,142.43) ;
%Curve Lines [vertical depth line] 
\draw  [dash pattern={on 0.84pt off 2.51pt}]  (259.27,158.43) .. controls (287.93,139.77) and (269.27,88.43) .. (244.6,89.1) ;
%Straight Lines [arrow] 
\draw    (186.59,115) -- (162.75,91.86) ;
\draw [shift={(160.6,89.77)}, rotate = 404.15] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (194.6,163.1) -- (166.92,185.86) ;
\draw [shift={(164.6,187.77)}, rotate = 320.57] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (289.92,160.33) -- (288.71,192.1) ;
\draw [shift={(288.6,195.1)}, rotate = 272.18] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (326.59,114.33) -- (352.99,91.72) ;
\draw [shift={(355.27,89.77)}, rotate = 499.42] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;

% Text Node
\draw (236.59,135) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$V$};
% Text Node
\draw (269.92,67) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$S$};
% Text Node
\draw (167,77) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (158,165) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (298,190) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (359,104) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};


\end{tikzpicture}
    \caption{Example of a \\ three-dimensional volume V with \\ a surface S.} \label{fig:volume_surface}
    \end{minipage}
    \label{fig:my_label}
\end{figure}



\end{document}

答案1

我认为,如果在文中其他地方引用了相关图表或公式,这样的安排实际上并不能帮助读者引用这些图表或公式。不过,可以通过以下方法实现:

您可以将两张图片放在方框内,然后将它们放在方程式后面。请注意,图片不再是figures,也就是说,它们不再处于浮动环境中。因此,您不能再使用。但是,您可以加载提供宏的\caption包,该宏可用于浮动之外的标题。(我删除了此示例不需要的所有包。)caption\captionof

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{caption}
\usepackage[left=3cm, right=3cm]{geometry}

\begin{document}

\newsavebox{\figa}
\savebox{\figa}{%
\begin{minipage}[b]{0.4\textwidth}
\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt        
\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-0.9,xscale=0.9]
%uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300

%Shape: Polygon Curved [surface] 
\draw   (210.18,101) .. controls (230.18,91) and (247.72,81.05) .. (300.18,101) .. controls (352.65,120.95) and (376.6,167.77) .. (300.18,161) .. controls (223.77,154.23) and (205.93,183.77) .. (185.93,153.77) .. controls (165.93,123.77) and (190.18,111) .. (210.18,101) -- cycle ;
%Straight Lines [arrow] 
\draw    (186.59,115) -- (162.75,91.86) ;
\draw [shift={(160.6,89.77)}, rotate = 404.15] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (194.6,163.1) -- (166.92,185.86) ;
\draw [shift={(164.6,187.77)}, rotate = 320.57] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (289.92,160.33) -- (288.71,192.1) ;
\draw [shift={(288.6,195.1)}, rotate = 272.18] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (326.59,114.33) -- (352.99,91.72) ;
\draw [shift={(355.27,89.77)}, rotate = 499.42] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;

% Text Node
\draw (236.59,135) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$S$};
% Text Node
\draw (269.92,67) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$C$};
% Text Node
\draw (167,77) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (158,165) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (298,190) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (359,104) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};

\end{tikzpicture}\par
\captionof{figure}{Example of a \\ two-dimensional surface S with \\ a contour C.} \label{fig:surface_contour}
\end{minipage}%
}

\newsavebox{\figb}
\savebox{\figb}{%
\begin{minipage}[b]{0.4\textwidth}
\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt        
\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-0.9,xscale=0.9]
%uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300

%Shape: Polygon Curved [volume] 
\draw   (210.18,101) .. controls (230.18,91) and (247.72,81.05) .. (300.18,101) .. controls (352.65,120.95) and (376.6,167.77) .. (300.18,161) .. controls (223.77,154.23) and (205.93,183.77) .. (185.93,153.77) .. controls (165.93,123.77) and (190.18,111) .. (210.18,101) -- cycle ;
%Curve Lines [horizontal depth line] 
\draw  [dash pattern={on 0.84pt off 2.51pt}]  (183.26,143.67) .. controls (223.26,113.67) and (321.28,118.53) .. (346.6,142.43) ;
%Curve Lines [vertical depth line] 
\draw  [dash pattern={on 0.84pt off 2.51pt}]  (259.27,158.43) .. controls (287.93,139.77) and (269.27,88.43) .. (244.6,89.1) ;
%Straight Lines [arrow] 
\draw    (186.59,115) -- (162.75,91.86) ;
\draw [shift={(160.6,89.77)}, rotate = 404.15] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (194.6,163.1) -- (166.92,185.86) ;
\draw [shift={(164.6,187.77)}, rotate = 320.57] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (289.92,160.33) -- (288.71,192.1) ;
\draw [shift={(288.6,195.1)}, rotate = 272.18] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (326.59,114.33) -- (352.99,91.72) ;
\draw [shift={(355.27,89.77)}, rotate = 499.42] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;

% Text Node
\draw (236.59,135) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$V$};
% Text Node
\draw (269.92,67) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$S$};
% Text Node
\draw (167,77) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (158,165) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (298,190) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (359,104) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};

\end{tikzpicture}\par
\captionof{figure}{Example of a \\ three-dimensional volume V with \\ a surface S.} \label{fig:volume_surface}
\end{minipage}
}

\begin{align}
    &\int\limits_{V} div \ \mathbf{a} \ \mathrm{d}V = \oint\limits_{S} n \ \mathbf{a} \ \mathrm{d}S \label{eq:gauss_theorem}  && \raisebox{-6em}{\usebox{\figa}} \\
    &\int\limits_{S} div \ \mathbf{a} \ \mathrm{d}S = \oint\limits_{C} n \ \mathbf{a} \ \mathrm{d}r \label{eq:stokes_theorem} && \raisebox{-6em}{\usebox{\figb}}
\end{align}

\end{document}

在此处输入图片描述

实际上,将图片放在方程式之前可能会更好:

\begin{align}
    &\raisebox{-6em}{\usebox{\figa}} && \int\limits_{V} div \ \mathbf{a} \ \mathrm{d}V = \oint\limits_{S} n \ \mathbf{a} \ \mathrm{d}S \label{eq:gauss_theorem} \\
    &\raisebox{-6em}{\usebox{\figb}} && \int\limits_{S} div \ \mathbf{a} \ \mathrm{d}S = \oint\limits_{C} n \ \mathbf{a} \ \mathrm{d}r \label{eq:stokes_theorem}
\end{align}

在此处输入图片描述

答案2

在我看来,这些方程式看起来不错,只是似乎没有充分的理由使用\int\limits而不是\int。但是,这可能是一种纯粹的风格“东西”,在这种情况下请继续使用\int\limits

问题在于,每个页面minipage都很0.4\textwidth宽,而且它们被设置在左侧而不是居中。将小页面和其内容居中似乎是一个好主意。

以下屏幕截图中的框线只是为了让人们清楚地了解文本块的宽度。

在此处输入图片描述

\documentclass{book}
%% (I've simplified the preamble as much as possible for this example.)
%\usepackage[utf8]{inputenc} % that's the default nowadays
\usepackage[T1]{fontenc} % <-- unless you have an excellent reason for using 'OT1'
%\usepackage[style=numeric]{biblatex}
%\addbibresource{bib.bib}

%\usepackage{array}
%\usepackage{placeins}
%\usepackage{pgfplots}
%\pgfplotsset{compat=1.17}

%\usepackage{booktabs}
%\usepackage{multirow}
\usepackage{tikz}
\usepackage{amsmath} % for 'align' env.
%\usepackage{siunitx}
%\usepackage{graphicx}
%\usepackage{float}
\usepackage[hmargin=3cm,showframe]{geometry} % remove 'showframe' in real doc.
%\usepackage[acronym]{glossaries}\include{Acronyms}
%\usepackage{titlesec}
%\titleformat{\chapter}{\normalfont\huge}{\bf\thechapter.}{20pt}{\huge\bf}
%\usepackage{hyperref}
%\hypersetup{
%    colorlinks,
%    citecolor=black,
%    filecolor=black,
%    linkcolor=blue,
%    urlcolor=black
%}

%\author{\textbf{Names}
%\title{Title}

\begin{document}
\begin{align}
    \int_{V} div \ \mathbf{a} \,\mathrm{d}V = \oint_{S} n \ \mathbf{a} \,\mathrm{d}S \label{eq:gauss_theorem} \\[1ex]
    \int_{S} div \ \mathbf{a} \,\mathrm{d}S = \oint_{C} n \ \mathbf{a} \,\mathrm{d}r \label{eq:stokes_theorem}
\end{align}
    
\begin{figure}[!ht]
\hfill % first of three '\hfill' directives
\begin{minipage}[b]{0.4\textwidth}
\centering % <-- center the contents of the 'minipage' env.
\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt        
\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-0.9,xscale=0.9]
%uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300

%Shape: Polygon Curved [surface] 
\draw   (210.18,101) .. controls (230.18,91) and (247.72,81.05) .. (300.18,101) .. controls (352.65,120.95) and (376.6,167.77) .. (300.18,161) .. controls (223.77,154.23) and (205.93,183.77) .. (185.93,153.77) .. controls (165.93,123.77) and (190.18,111) .. (210.18,101) -- cycle ;
%Straight Lines [arrow] 
\draw    (186.59,115) -- (162.75,91.86) ;
\draw [shift={(160.6,89.77)}, rotate = 404.15] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (194.6,163.1) -- (166.92,185.86) ;
\draw [shift={(164.6,187.77)}, rotate = 320.57] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (289.92,160.33) -- (288.71,192.1) ;
\draw [shift={(288.6,195.1)}, rotate = 272.18] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (326.59,114.33) -- (352.99,91.72) ;
\draw [shift={(355.27,89.77)}, rotate = 499.42] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;

% Text Node
\draw (236.59,135) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$S$};
% Text Node
\draw (269.92,67) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$C$};
% Text Node
\draw (167,77) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (158,165) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (298,190) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (359,104) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};

\end{tikzpicture}
\caption{Example of a two-dimensional surface $S$ with a contour $C$.} \label{fig:surface_contour}
\end{minipage}%
\hfill
\begin{minipage}[b]{0.4\textwidth}
\centering
\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt        
\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-0.9,xscale=0.9]
%uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300

%Shape: Polygon Curved [volume] 
\draw   (210.18,101) .. controls (230.18,91) and (247.72,81.05) .. (300.18,101) .. controls (352.65,120.95) and (376.6,167.77) .. (300.18,161) .. controls (223.77,154.23) and (205.93,183.77) .. (185.93,153.77) .. controls (165.93,123.77) and (190.18,111) .. (210.18,101) -- cycle ;
%Curve Lines [horizontal depth line] 
\draw  [dash pattern={on 0.84pt off 2.51pt}]  (183.26,143.67) .. controls (223.26,113.67) and (321.28,118.53) .. (346.6,142.43) ;
%Curve Lines [vertical depth line] 
\draw  [dash pattern={on 0.84pt off 2.51pt}]  (259.27,158.43) .. controls (287.93,139.77) and (269.27,88.43) .. (244.6,89.1) ;
%Straight Lines [arrow] 
\draw    (186.59,115) -- (162.75,91.86) ;
\draw [shift={(160.6,89.77)}, rotate = 404.15] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (194.6,163.1) -- (166.92,185.86) ;
\draw [shift={(164.6,187.77)}, rotate = 320.57] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (289.92,160.33) -- (288.71,192.1) ;
\draw [shift={(288.6,195.1)}, rotate = 272.18] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [arrow] 
\draw    (326.59,114.33) -- (352.99,91.72) ;
\draw [shift={(355.27,89.77)}, rotate = 499.42] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;

% Text Node
\draw (236.59,135) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$V$};
% Text Node
\draw (269.92,67) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$S$};
% Text Node
\draw (167,77) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (158,165) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (298,190) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (359,104) node [anchor=north west][inner sep=0.75pt]  [xscale=0.7,yscale=0.7] [align=left] {$n$};

\end{tikzpicture}
\caption{Example of a three-dimensional volume $V$ with a surface $S$.} \label{fig:volume_surface}
\end{minipage}
\hfill\null
\end{figure}

\end{document}

答案3

这是一个解决方案floatrow

\documentclass{book}
\usepackage[style=numeric]{biblatex}
\addbibresource{bib.bib}
\usepackage{array}
%\usepackage{placeins}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{floatrow}
\usepackage{tikz}
\usepackage{amsmath}
\DeclareMathOperator{\divg}{div}
 \newcommand*{\dd}{\mathop{}\!\mathrm{d}}
\usepackage{siunitx}
\usepackage{graphicx}
\usepackage{float}
\usepackage[left=3cm, right=3cm, showframe]{geometry}
\usepackage[acronym]{glossaries}\include{Acronyms}
\usepackage{titlesec}
\titleformat{\chapter}{\normalfont\huge}{\bf\thechapter.}{20pt}{\huge\bf}
\usepackage{hyperref}
\hypersetup{colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=blue,
    urlcolor=black}

\author{\textbf{Names}}
\title{Title}

\begin{document}

\leavevmode\vskip 1cm

\begin{minipage}{0.45\textwidth}
\begin{equation}
    \int\limits_{S} \divg \mathbf{a} \dd S = \oint\limits_{C} n \ \mathbf{a} \dd r \label{eq:stokes_theorem}
\end{equation}
\end{minipage}
\hfill
\begin{minipage}{0.45\textwidth}
\begin{equation}
    \int\limits_{V} \divg \mathbf{a} \dd V = \oint\limits_{S} n \ \mathbf{a} \dd S \label{eq:gauss_theorem}
\end{equation}
\end{minipage}

\begin{figure}[!ht]
    \centering
\renewcommand*{\floatrowsep}{\hskip 4em}
    \begin{floatrow}[2] \centering
\ffigbox[1.15\FBwidth]{%
\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt
\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-0.9,xscale=0.9]
%uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300

%Shape: Polygon Curved [surface]
\draw (210.18,101) .. controls (230.18,91) and (247.72,81.05) .. (300.18,101) .. controls (352.65,120.95) and (376.6,167.77) .. (300.18,161) .. controls (223.77,154.23) and (205.93,183.77) .. (185.93,153.77) .. controls (165.93,123.77) and (190.18,111) .. (210.18,101) -- cycle ;
%Straight Lines [arrow]
\draw (186.59,115) -- (162.75,91.86) ;
\draw [shift={(160.6,89.77)}, rotate = 404.15] [fill={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.08] [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle ;
%Straight Lines [arrow]
\draw (194.6,163.1) -- (166.92,185.86) ;
\draw [shift={(164.6,187.77)}, rotate = 320.57] [fill={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.08] [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle ;
%Straight Lines [arrow]
\draw (289.92,160.33) -- (288.71,192.1) ;
\draw [shift={(288.6,195.1)}, rotate = 272.18] [fill={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.08] [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle ;
%Straight Lines [arrow]
\draw (326.59,114.33) -- (352.99,91.72) ;
\draw [shift={(355.27,89.77)}, rotate = 499.42] [fill={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.08] [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle ;
% Text Node
\draw (236.59,135) node [anchor=north west][inner sep=0.75pt] [xscale=0.7,yscale=0.7] [align=left] {$S$};
% Text Node
\draw (269.92,67) node [anchor=north west][inner sep=0.75pt] [xscale=0.7,yscale=0.7] [align=left] {$C$};
% Text Node
\draw (167,77) node [anchor=north west][inner sep=0.75pt] [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (158,165) node [anchor=north west][inner sep=0.75pt] [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (298,190) node [anchor=north west][inner sep=0.75pt] [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (359,104) node [anchor=north west][inner sep=0.75pt] [xscale=0.7,yscale=0.7] [align=left] {$n$};
\end{tikzpicture}}
{\caption{Example of a two-dimensional surface S with a contour C.} \label{fig:surface_contour}}
%
\ffigbox[\FBwidth]{%
\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt
\hskip 3em\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-0.9,xscale=0.9]
%uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300
%Shape: Polygon Curved [volume]
\draw (210.18,101) .. controls (230.18,91) and (247.72,81.05) .. (300.18,101) .. controls (352.65,120.95) and (376.6,167.77) .. (300.18,161) .. controls (223.77,154.23) and (205.93,183.77) .. (185.93,153.77) .. controls (165.93,123.77) and (190.18,111) .. (210.18,101) -- cycle ;
%Curve Lines [horizontal depth line]
\draw [dash pattern={on 0.84pt off 2.51pt}] (183.26,143.67) .. controls (223.26,113.67) and (321.28,118.53) .. (346.6,142.43) ;
%Curve Lines [vertical depth line]
\draw [dash pattern={on 0.84pt off 2.51pt}] (259.27,158.43) .. controls (287.93,139.77) and (269.27,88.43) .. (244.6,89.1) ;
%Straight Lines [arrow]
\draw (186.59,115) -- (162.75,91.86) ;
\draw [shift={(160.6,89.77)}, rotate = 404.15] [fill={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.08] [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle ;
%Straight Lines [arrow]
\draw (194.6,163.1) -- (166.92,185.86) ;
\draw [shift={(164.6,187.77)}, rotate = 320.57] [fill={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.08] [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle ;
%Straight Lines [arrow]
\draw (289.92,160.33) -- (288.71,192.1) ;
\draw [shift={(288.6,195.1)}, rotate = 272.18] [fill={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.08] [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle ;
%Straight Lines [arrow]
\draw (326.59,114.33) -- (352.99,91.72) ;
\draw [shift={(355.27,89.77)}, rotate = 499.42] [fill={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.08] [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle ;
% Text Node
\draw (236.59,135) node [anchor=north west][inner sep=0.75pt] [xscale=0.7,yscale=0.7] [align=left] {$V$};
% Text Node
\draw (269.92,67) node [anchor=north west][inner sep=0.75pt] [xscale=0.7,yscale=0.7] [align=left] {$S$};
% Text Node
\draw (167,77) node [anchor=north west][inner sep=0.75pt] [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (158,165) node [anchor=north west][inner sep=0.75pt] [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (298,190) node [anchor=north west][inner sep=0.75pt] [xscale=0.7,yscale=0.7] [align=left] {$n$};
% Text Node
\draw (359,104) node [anchor=north west][inner sep=0.75pt] [xscale=0.7,yscale=0.7] [align=left] {$n$};
\end{tikzpicture}}
{\caption{Example of a three-dimensional volume V with \ a surface S.} \label{fig:volume_surface}}
    \end{floatrow}
\end{figure}

\end{document} 

在此处输入图片描述

答案4

还有一个解决方案:-)

  • 用于方程式和所属图像的定位tabularx
  • 图像被重新绘制(简化和更短的代码)
  • 对于数学使用nccmath
\documentclass{book}
\usepackage[hmargin=3cm]{geometry}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\usetikzlibrary{arrows.meta,
                intersections,
                positioning
                }
\usepackage{array, booktabs, multirow, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}

\usepackage{nccmath}

\usepackage{siunitx}
\usepackage{caption}

\begin{document}
    \begin{center}%{figure}[ht]
    \tikzset{x=0.8pt, y=0.8pt,
        }
\begin{tabularx}{\linewidth}{ X C }
\begin{fleqn}%[1em]
    \begin{equation}\label{eq:gauss_theorem}
\int_{V} \nabla\mathbf{a}\,\mathrm{d}V = \oint_{S} n\mathbf{a}\,\mathrm{d}S
    \end{equation}
\end{fleqn}
    &   \begin{tikzpicture}[baseline, thick, xscale=1, yscale=-1]
\draw[name path=P]   
        (0,0)   .. controls (20,-10) and ( 37,-20) .. ( 90, 0) node[above  left=3mm] {$C$}
                .. controls (142,20) and (166, 66) .. ( 90,60) 
                .. controls ( 13,53) and (- 5, 82) .. (-25,52) node[above right=2mm and 7mm] {$S$}
                .. controls (-55,22) and (-20, 10) .. (  0, 0);
% lines
\coordinate (c1) at (10,30);
\path[name path=a1]  (c1) -- ++ (-135:80) coordinate[label=$a$] (c11) {};
\draw[name intersections={of=P and a1, by=b},->]        (b) -- (c11);
\path[name path=a2]  (c1) -- ++ ( 135:80) coordinate[label=below:$a$] (c12){};
\draw[name intersections={of=P and a2, by=b},->]        (b) -- (c12);
\coordinate (c1) at (90,30);
\path[name path=a1]  (c1) -- ++ (-45:80) coordinate[label=$a$] (c11) {};
\draw[name intersections={of=P and a1, by=b},->]        (b) -- (c11);
\path[name path=a2]  (c1) -- ++ ( 45:80) coordinate[label=below:$a$] (c12){};
\draw[name intersections={of=P and a2, by=b},->]        (b) -- (c12);
    \end{tikzpicture}
\captionof{figure}{Example of a two-dimensional surface S with a contour $C$.} \label{fig:surface_contour}
    \\
\begin{fleqn}%[1em]    
    \begin{equation}\label{eq:gauss_theorem}
\int_{V} \nabla\mathbf{a}\,\mathrm{d}S = \oint_{S} n\mathbf{a}\,\mathrm{d}r
    \end{equation}
\end{fleqn}
    &   \begin{tikzpicture}[baseline, thick, xscale=1, yscale=-1]
\draw[name path=P]
        (0,0)   .. controls (20,-10) and ( 37,-20) .. ( 90, 0) node[above  left=3mm] {$S$}
                .. controls (142,20) and (166, 66) .. ( 90,60)
                .. controls ( 13,53) and (- 5, 82) .. (-25,52) node[above right=2mm and 7mm] {$V$}
                .. controls (-55,22) and (-20, 10) .. (  0, 0);
% lines
\coordinate (c1) at (10,30);
\path[name path=a1]  (c1) -- ++ (-135:80) coordinate[label=$a$] (c11) {};
\draw[name intersections={of=P and a1, by=b},->]        (b) -- (c11);
\path[name path=a2]  (c1) -- ++ ( 135:80) coordinate[label=below:$a$] (c12){};
\draw[name intersections={of=P and a2, by=b},->]        (b) -- (c12);
\coordinate (c1) at (90,30);
\path[name path=a1]  (c1) -- ++ (-45:80) coordinate[label=$a$] (c11) {};
\draw[name intersections={of=P and a1, by=b},->]        (b) -- (c11);
\path[name path=a2]  (c1) -- ++ ( 45:80) coordinate[label=below:$a$] (c12){};
\draw[name intersections={of=P and a2, by=b},->]        (b) -- (c12);
% segments
\draw[dotted]
        (-32,42) .. controls (22,12) and (111, 17) .. (138, 41)
        ( 54,58) .. controls (77,38) and ( 59,-13) .. ( 41,-11) ;
    \end{tikzpicture}
\captionof{figure}{Example of a three-dimensional volume $V$ with a surface $S$.} \label{fig:volume_surface}
\end{tabularx}
    \end{center}%{figure}
\end{document}

在此处输入图片描述

附录: 正如您在下面的评论中所说,您喜欢交换图像和方程式:

在此处输入图片描述

\documentclass{book}
\usepackage[hmargin=3cm]{geometry}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\usetikzlibrary{arrows.meta,
                intersections,
                positioning
                }
\usepackage{array, booktabs, multirow, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}

\usepackage{nccmath}

\usepackage{siunitx}
\usepackage{caption}

\begin{document}
    \begin{center}%{figure}[ht]
    \tikzset{x=0.8pt, y=0.8pt,
        }
\begin{tabularx}{\linewidth}{ C X }
    \begin{tikzpicture}[baseline, thick, xscale=1, yscale=-1]
\draw[name path=P]
        (0,0)   .. controls (20,-10) and ( 37,-20) .. ( 90, 0) node[above  left=3mm] {$C$}
                .. controls (142,20) and (166, 66) .. ( 90,60)
                .. controls ( 13,53) and (- 5, 82) .. (-25,52) node[above right=2mm and 7mm] {$S$}
                .. controls (-55,22) and (-20, 10) .. (  0, 0);
% lines
\coordinate (c1) at (10,30);
\path[name path=a1]  (c1) -- ++ (-135:80) coordinate[label=$a$] (c11) {};
\draw[name intersections={of=P and a1, by=b},->]        (b) -- (c11);
\path[name path=a2]  (c1) -- ++ ( 135:80) coordinate[label=below:$a$] (c12){};
\draw[name intersections={of=P and a2, by=b},->]        (b) -- (c12);
\coordinate (c1) at (90,30);
\path[name path=a1]  (c1) -- ++ (-45:80) coordinate[label=$a$] (c11) {};
\draw[name intersections={of=P and a1, by=b},->]        (b) -- (c11);
\path[name path=a2]  (c1) -- ++ ( 45:80) coordinate[label=below:$a$] (c12){};
\draw[name intersections={of=P and a2, by=b},->]        (b) -- (c12);
    \end{tikzpicture}
\captionof{figure}{Example of a two-dimensional surface S with a contour $C$.} \label{fig:surface_contour}
    &   \begin{fleqn}%[1em]
        \begin{equation}\label{eq:gauss_theorem}
    \int_{V} \nabla\mathbf{a}\,\mathrm{d}V = \oint_{S} n\mathbf{a}\,\mathrm{d}S
        \end{equation}
        \end{fleqn}         \\
    \begin{tikzpicture}[baseline, thick, xscale=1, yscale=-1]
\draw[name path=P]
        (0,0)   .. controls (20,-10) and ( 37,-20) .. ( 90, 0) node[above  left=3mm] {$S$}
                .. controls (142,20) and (166, 66) .. ( 90,60)
                .. controls ( 13,53) and (- 5, 82) .. (-25,52) node[above right=2mm and 7mm] {$V$}
                .. controls (-55,22) and (-20, 10) .. (  0, 0);
% lines
\coordinate (c1) at (10,30);
\path[name path=a1]  (c1) -- ++ (-135:80) coordinate[label=$a$] (c11) {};
\draw[name intersections={of=P and a1, by=b},->]        (b) -- (c11);
\path[name path=a2]  (c1) -- ++ ( 135:80) coordinate[label=below:$a$] (c12){};
\draw[name intersections={of=P and a2, by=b},->]        (b) -- (c12);
\coordinate (c1) at (90,30);
\path[name path=a1]  (c1) -- ++ (-45:80) coordinate[label=$a$] (c11) {};
\draw[name intersections={of=P and a1, by=b},->]        (b) -- (c11);
\path[name path=a2]  (c1) -- ++ ( 45:80) coordinate[label=below:$a$] (c12){};
\draw[name intersections={of=P and a2, by=b},->]        (b) -- (c12);
% segments
\draw[dotted]
        (-32,42) .. controls (22,12) and (111, 17) .. (138, 41)
        ( 54,58) .. controls (77,38) and ( 59,-13) .. ( 41,-11) ;
    \end{tikzpicture}
\captionof{figure}{Example of a three-dimensional volume $V$ with a surface $S$.} \label{fig:volume_surface}
    &   \begin{fleqn}%[1em]
    \begin{equation}\label{eq:gauss_theorem}
\int_{V} \nabla\mathbf{a}\,\mathrm{d}S = \oint_{S} n\mathbf{a}\,\mathrm{d}r
    \end{equation}
\end{fleqn}
\end{tabularx}
    \end{center}%{figure}
\end{document}

相关内容