这可能是排版不好,但我的资源有限,我既想又需要节省纸张。这不是要出版的东西,所以数学论文的标准不必适用。这是高中数学课的。
我想创建类似下面的东西:
我可以通过一些小技巧来实现
\documentclass{article}
\usepackage[textwidth=4in]{geometry}
\setlength\parskip{2ex}
\setlength\parindent{0pt}
\usepackage{amsmath}
\newcounter{ae@problem}
\newcommand\problem{\stepcounter{ae@problem}\textbf{P\arabic{ae@problem}}\hspace*{1em}}
\begin{document}
There is one mistake in each of the problems. Identify the mistake by
circling it. Then correct the work.
\problem
\begin{minipage}[t]{2.5in}
\vspace{-\dimexpr\abovedisplayskip+\abovedisplayshortskip+\baselineskip}
\begin{align*}
\text{For } h(x) &= x^{2}+2x+4 \\
h(-3) &= -3^{2}+2(-3)+4 = -9-6+4 \\&= -15 + 4 = -11
\end{align*}
\end{minipage}
\end{document}
是否有更简单的方法或更适合此目的的对齐环境?
我希望文本的第一行按以下方式排列:
\documentclass{article}
\usepackage[textwidth=4in]{geometry}
\setlength\parskip{2ex}
\setlength\parindent{0pt}
\usepackage{amsmath}
\newcounter{ae@problem}
\newcommand\problem{\stepcounter{ae@problem}\textbf{P\arabic{ae@problem}}\hspace*{1em}}
\begin{document}
There is one mistake in each of the problems. Identify the mistake by
circling it. Then correct the work.
\problem For $h(x) = x^{2}+2x+4$.
\begin{align*}
h(-3) &= -3^{2}+2(-3)+4 = -9-6+4 \\&= -15 + 4 = -11
\end{align*}
\end{document}
但是我不喜欢对齐环境的第一个等号与第一行上的函数呈现不一致。
答案1
\documentclass{article}
\usepackage[textwidth=4in]{geometry}
\setlength\parskip{2ex}
\setlength\parindent{0pt}
\usepackage{amsmath}
\newcounter{ae@problem}
\newcommand\problem{\stepcounter{ae@problem}\textbf{P\arabic{ae@problem}}\hspace*{1em}}
\begin{document}
There is one mistake in each of the problems. Identify the mistake by
circling it. Then correct the work.
\begin{flalign*}
\textrm{\problem For } h(x) &= x^{2}+2x+4 &\\[\parskip]
h(-3) &= -3^{2}+2(-3)+4 = -9-6+4 &\\
&= -15 + 4 = -11 &
\end{flalign*}
\end{document}
当然,如果你把它放在flaign
段落开头,空间就会太大。有几种方法可以解决这个问题,但没有一种是理想的。
答案2
下面是另一个选项,它使用某种形式\tag
来放置问题:
\documentclass{article}
\usepackage[textwidth=4in]{geometry}% Just for this example
\usepackage{amsmath}
\makeatletter% http://tex.stackexchange.com/a/193538/5764
\newcommand{\leqnomode}{\tagsleft@true}
\newcommand{\reqnomode}{\tagsleft@false}
\makeatother
\newcounter{problemcnt}
\newenvironment{problem}
{\leqnomode
\refstepcounter{problemcnt}%
\csname align*\endcsname% http://tex.stackexchange.com/a/13994/5764
\tag*{\bfseries P\theproblemcnt}
}{%
\csname endalign*\endcsname
\reqnomode}
\begin{document}
There is one mistake in each of the problems. Identify the mistake by
circling it. Then correct the work.
\begin{problem}
\text{For } h(x) &= x^{2}+2x+4 \\
h(-3) &= -3^{2}+2(-3)+4 = -9-6+4 \\
&= -15 + 4 = -11
\end{problem}
\end{document}