因此,我尝试使用minipage
环境将方程式放在图形旁边,但方程式不会在环境中垂直居中以匹配图片。我遗漏了什么?
\documentclass[12pt]{article}
\usepackage{amsmath,amssymb,amsthm,textcomp}
\usepackage{graphicx}
\begin{document}
\begin{figure}[H]
\centering
\begin{minipage}[t]{.45\textwidth}
\centering
\includegraphics[scale=0.7]{parallelplates}
\captionof{figure}{A diagram showing the uniform electric field between two parallel capacitor plates. placeholder citation}
\label{fig:parallelplates}
\end{minipage}%
\hfil
\begin{minipage}[t]{.45\textwidth}
\centering
\begin{equation}
C=Q\Delta V
\label{eq:capacitance}
\end{equation}
\begin{equation}
\frac{1}{C_T}=\frac{1}{C_1}+\frac{1}{C_2}+\cdots + \frac{1}{C_n}
\label{eq:capseries}
\end{equation}
\begin{equation}
C_T=C_1+C_2+\cdots + C_n
\label{eq:capparallel}
\end{equation}
\end{minipage}
\end{figure}
\end{document}
谢谢!这是一张图片!
答案1
这是你想要的吗?
\documentclass[12pt]{article}
\usepackage{amsmath,amssymb,amsthm,textcomp}
\usepackage{graphicx}
\usepackage{caption} % inserted
\usepackage{showframe}% just to exemplify
\begin{document}
\begin{figure}[h]
\centering
\begin{minipage}[c]{.45\textwidth}% changed to c
\centering
% I changed the image width
\includegraphics[width=\linewidth]{example-image-a}
\captionof{figure}{A diagram showing the uniform electric field between two parallel capacitor plates. placeholder citation}
\label{fig:parallelplates}
\end{minipage}%
\hfil
\begin{minipage}[c]{.45\textwidth}% changed to c
\centering
\begin{equation}
C=Q\Delta V
\label{eq:capacitance}
\end{equation}
\begin{equation}
\frac{1}{C_T}=\frac{1}{C_1}+\frac{1}{C_2}+\cdots + \frac{1}{C_n}
\label{eq:capseries}
\end{equation}
\begin{equation}
C_T=C_1+C_2+\cdots + C_n
\label{eq:capparallel}
\end{equation}
\end{minipage}
\end{figure}
% another option
\noindent%
\begin{minipage}[c]{.49\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image-a}
\captionof{figure}{A diagram showing the uniform electric field between two parallel capacitor plates. placeholder citation}
\label{fig:parallelplates}
\end{minipage}%
\hfill
\begin{minipage}[c]{.49\textwidth}
\centering
\begin{equation}
C=Q\Delta V
\label{eq:capacitance}
\end{equation}
\begin{equation}
\frac{1}{C_T}=\frac{1}{C_1}+\frac{1}{C_2}+\cdots + \frac{1}{C_n}
\label{eq:capseries}
\end{equation}
\begin{equation}
C_T=C_1+C_2+\cdots + C_n
\label{eq:capparallel}
\end{equation}
\end{minipage}
\end{document}