我正在尝试格式化一个方程,将方程中的定义与文档中的图像放在一起。如果您想象页面上有一个框,我基本上希望方程位于左上角,方程定义位于左下角,图像位于这两个框的右侧。我正在尝试使用 minipage 来执行此操作,但仍然没有找到正确的代码。有人可以建议一种方法来做到这一点吗?
以下是我目前所做的:
\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{subcaption}
\usepackage{cleveref}
\graphicspath{ {Images/} }
\begin{document}
\begin{minipage}{0.5\textwidth}
\begin{equation}
\frac{d[mRNA]}{dt}= k0 + k \cdot TF_{Activator(t - \Delta t)} - \gamma \cdot [mRNA]_t
\label{DDE}
\end{equation}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\begin{flushleft}
Where:\\
\tab $[mRNA] = $Concentration of mRNA\\
\tab$ k0 = $Basal transcription rate \\
\tab$ k = $Activated transcription rate \\
\tab$ TF_{Activator} =$ a transcription factor for the gene \\
\tab$ \gamma = $mRNA degradation rate \\
\tab$ t = $time \\
\tab$ \Delta t = $change in time - i.e. time delay
\end{flushleft}
\end{minipage}
\begin{figure}[h]
\centering
\begin{minipage}{0.5\textwidth}
\includegraphics[height=0.4\textwidth]{DDENetwork}
\label{network1}
\end{minipage}
\end{figure}
\end{document}
答案1
您不希望它浮动,所以不要使用图形。您仍然可以使用标题(如\captionof{figure}{}
。剩下的就是像您那样将其放入小页面中。
\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{subcaption}
\def\tab{\quad}
\begin{document}
\parbox{.45\linewidth}{
\begin{equation}
\frac{d[mRNA]}{dt}= k0 + k \cdot TF_{Activator(t - \Delta t)} - \gamma \cdot [mRNA]_t
\label{DDE}
\end{equation}\vfill
\begin{flushleft}
Where:\\
\tab $[mRNA] = $Concentration of mRNA\\
\tab$ k0 = $Basal transcription rate \\
\tab$ k = $Activated transcription rate \\
\tab$ TF_{Activator} =$ a transcription factor for the gene \\
\tab$ \gamma = $mRNA degradation rate \\
\tab$ t = $time \\
\tab$ \Delta t = $change in time - i.e. time delay
\end{flushleft}
}\hfill
\parbox{.45\linewidth}{
\centering
\includegraphics[width=\linewidth]{example-image}
% \captionof{figure}{Test}\label{network1}
}
\end{document}
答案2
只有一个小页面。我还添加了一些改进:字符串“mRNA”应该始终保持相同的样式,因此我为其引入了一个宏。
解释以数学模式设置,并\text
带有文本部分,以确保一致的间距。
此外,TF 应该是一个单一实体,因此最好将其输入为\mathit
。
\documentclass{article}
\usepackage[
margin=0.5in,
showframe, % just for the present picture
]{geometry}
\usepackage{amsmath}
\usepackage{graphicx}
% ensure uniform style for printing 'mRNA'
\newcommand{\mRNA}{\textup{mRNA}}
\begin{document}
\begin{center}
\begin{minipage}{.5\textwidth}
% disable the spacing above and below the math alignment
\setlength{\abovedisplayskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
% align both parts at the left side; with flalign we get to the left margin
\begin{flalign}
&\frac{d[\mRNA]}{dt}= k_0+k\cdot\mathit{TF}_{\mathrm{Activator}}(t-\Delta t)-\gamma\cdot[\mRNA]_t
&&
\label{DDE}
\\
&\begin{aligned}
\makebox[2em][l]{Where:}&\\
& [\mRNA] = \text{Concentration of \mRNA}\\
& k_0 = \text{Basal transcription rate} \\
& k = \text{Activated transcription rate} \\
& \mathit{TF}_{\mathrm{Activator}} = \text{a transcription factor for the gene} \\
& \gamma = \text{\mRNA degradation rate} \\
& t = \text{time} \\
& \Delta t = \text{change in time -- i.e. time delay}
\end{aligned}
&&\notag
\end{flalign}
\end{minipage}% <--- don't forget
\hfill
\raisebox{-.5\height}{\includegraphics[width=0.4\textwidth]{example-image}}
\end{center}
\end{document}