我想通过将每个解决方案布置成一个表格来压缩我的作业,其中一侧是图片,另一侧是证明。更糟糕的是,我需要能够在这些单元格中包含一些方程对齐(通过谷歌搜索,我发现这可能不可行,但我想找到一种解决方法)。
本质上,我希望它的布局如下:
列举
项目 1 - 问题
图片 | 证明
项目 2 - 问题
图片 | 证明
这是我的代码:
\documentclass[10pt]{article}
\parindent=0pt
\parskip=8pt
\textwidth=5in
\hoffset=.3in
\usepackage{amssymb,amsmath,amsthm,mathrsfs,color}
\usepackage[margin=1in]{geometry}
\usepackage{enumitem}
\setlist{topsep=0pt,parsep=0pt,partopsep=-0pt,itemindent=20pt}
\usepackage{tikz}
\usetikzlibrary{calc}
\pagestyle{headings}
\title{Title}
\author{Author}
\date{Date}
\begin{document}
\maketitle
\section*{\S Number}
\begin{enumerate}
\item
{\bf Prove/disprove the following statement: Polygons are cool.}
\begin{tabular}{p{2in}p{3in}}
\begin{tikzpicture}
\end{tikzpicture}
&
{\it Proof.} The proof is trivial! Just view the problem as a dihedral algebra whose elements are Cauchy manifolds. Then
\begin{align*}
x &= y \\
&= (y^{1/2})^2 \\
&= (z)^2.
\end{align*}
Voi-la! \qed
\end{tabular}
\end{enumerate}
\end{document}
答案1
我很想用minipage
s 来实现这一点——无论采用哪种方法,你都必须用align
某种垂直框来包装
\documentclass[10pt]{article}
\usepackage{amsmath,amsthm}
\usepackage{tikz}
\begin{document}
\begin{enumerate}
\item {\bfseries Prove/disprove the following statement: Polygons are cool.}
\begin{minipage}{.5\textwidth}
\begin{tikzpicture}
\draw circle (2cm);
\end{tikzpicture}
\end{minipage}%
\begin{minipage}{.5\textwidth}
{\itshape Proof.}
The proof is trivial! Just view the problem as a dihedral algebra whose elements are Cauchy manifolds. Then
\begin{align*}
x & = y \\
& = (y^{1/2})^2 \\
& = (z)^2.
\end{align*}
Voi-la! \qed
\end{minipage}
\end{enumerate}
\end{document}
您还可以查看parcolumns
包裹。
请注意,在上文中我使用了\bfseries
代替\bf
和\itshape
代替,\it
如在(例如)中讨论的那样使文本加粗/斜体的“正确”方法是什么?
答案2
有一个解决方案。在枚举之前将物品放入框中
\documentclass[10pt]{article}
\parindent=0pt
\parskip=8pt
\textwidth=5in
\hoffset=.3in
\usepackage{amssymb,amsmath,amsthm,mathrsfs,color}
\usepackage[margin=1in]{geometry}
\usepackage{enumitem}
\setlist{topsep=0pt,parsep=0pt,partopsep=-0pt,itemindent=20pt}
\usepackage{tikz}
%\usetikzlibrary{calc}
\pagestyle{headings}
\title{Title}
\author{Author}
\date{Date}
\begin{document}
\maketitle
\section*{\S Number}
\newsavebox{\prffg}
\savebox{\prffg}{%
% \begin{tikzpicture}
\fbox{This is a Figure box\rule[-5ex]{0ex}{10ex}}
% \end{tikzpicture}
}
\newsavebox{\prfeq}
\savebox{\prfeq}{%
$\begin{array}{ll}
x &= y \\
&= (y^{1/2})^2 \\
&= (z)^2.
\end{array}$
}
\begin{enumerate}
\item
{\bf Prove/disprove the following statement: Polygons are cool.}
\begin{tabular}{p{2in}|p{3in}}
\usebox{\prffg}
&
\begin{tabular}{p{3in}}
{\it Proof.} The proof is trivial! Just view the problem as a
dihedral algebra whose elements are Cauchy manifolds. Then\\
\usebox{\prfeq}\\
Voi-la! \qed\\
\end{tabular}
\end{tabular}
\end{enumerate}
\end{document}