我不确定我是否正确表达了我的问题,但我的目标是重现这种表现形式。
并在图像右侧添加方程式标签。
我可以使用此代码重现方程式和图像。
\documentclass[pdftex,10pt,letterpaper, oneside, article]{memoir}
\usepackage{amsmath}
\usepackage{tabularx}
\usepackage[pdftex]{graphicx}
\begin{document}
\begin{tabularx}{\textwidth}{m{6 cm} X}
$\displaystyle n_u = f_1 d_f t_1 \text{(N)}$
&
\includegraphics[width=8 cm]{./img/mode_a.jpg}
\end{tabularx}
\end{document}
但是我怎样才能在图像的右侧添加方程式编号标签呢?
答案1
您不需要表格来实现这一点。
\documentclass[pdftex,10pt,letterpaper, oneside, article]{memoir}
\usepackage{amsmath}
\usepackage{tabularx}
\usepackage[pdftex]{graphicx}
\begin{document}
\begin{align}
n_u &= f_1 d_f t_1 \text{(N)}
&
\vcenter{\hbox{\includegraphics[width=8 cm]{./img/mode_a.jpg}}}
\end{align}
\end{document}
编辑因为我说过 Ti 可能会更好看钾Z,我想我需要证明这一点。
\documentclass[10pt,letterpaper, oneside, article]{memoir}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{positioning,calc}
\begin{document}
\begin{align}
n_u &= f_1 d_f t_1 \text{(N)}
&
\begin{tikzpicture}[scale=0.7,font=\sffamily,font=\footnotesize,baseline=(c.base),
murmel/.style={rectangle,thick,ultra thick, minimum width=2cm,minimum
height=0.5cm, draw,inner sep=0pt,align=left,text width=1.9cm,
append after command={% courtesy of Alenanno ref: https://tex.stackexchange.com/questions/287967/drawing-thin-line-around-a-multipart-tikz-shape#comment696552_287972
\pgfextra{\draw (\tikzlastnode.north) -- (\tikzlastnode.south);}}}]
\node[murmel] (l1) at (0,0) {2};
\draw[-stealth,line width=1mm] (l1.west)-- ++ (-1,0);
\node[murmel,above=0cm of l1,xshift=0.5cm] (l2) {1};
\draw[-stealth,line width=1mm] (l2.east)-- ++ (1,0);
\node[murmel] (c) at (6.5,0.25) {1};
\draw[-stealth,line width=1mm] (c.east)-- ++ (1,0);
\node[murmel,above=0cm of c,xshift=-0.5cm] (r1) {1};
\node[murmel,below=0cm of c,xshift=-0.5cm] (r2) {2};
\draw[-stealth,line width=1mm] (r1.west) -- ++(-1,0);
\draw[-stealth,line width=1mm] (r2.west) -- ++(-1,0);
\draw[line width=1.8mm] ($(l2.north)+(0,0.1)$)--($(l2.south)+(0,-0.85)$);
\draw[line width=1.8mm] ($(c.north)+(0,0.85)$)--($(c.south)-(0,0.85)$);
\end{tikzpicture}
\end{align}
\end{document}
答案2
如果您想要一个带标签(数字)的方程式,请使用equation
:
\documentclass{article}
\usepackage{lipsum}
\usepackage[export]{adjustbox}
\begin{document}
\lipsum[1]
\begin{equation}
f(x) = a x^2 + b x + c \qquad
\includegraphics[height = 40pt, valign = c]{example-image}
\end{equation}
\lipsum[2]
\end{document}
由于图形通常设置在基线上,因此您可以借助adjustbox
。使用export
包选项,您可以在放置图形时添加valign = c
以实现c
输入的v
垂直对齐。align
如果您想要多个(堆叠)方程,请使用align
(或类似的东西)。