这是我的代码:
\documentclass[12pt,a4paper]{report}
\usepackage{multicol}
\usepackage{enumitem}
\usepackage{amsmath}
\begin{document}
\section{New Section}
\begin{multicols}{2}
\begin{enumerate}[label=,leftmargin=0cm]
\item \[ \text{Example 1} \]
\begin{align*}
1 \\
2 \\
3
\end{align*}
\[ 123 \]
\item \[ \text{Example 2} \]
\begin{align*}
1 \\
2 \\
3
\end{align*}
\[ 123 \]
\end{enumerate}
\end{multicols}
\end{document}
编译后显示:
但我想像这样把它装箱:
谢谢!
答案1
我会使用 atabular*
而不是multicols
。
\documentclass[12pt,a4paper]{report}
\usepackage[margin=2cm]{geometry} % or it would not stay
\usepackage{amsmath}
\begin{document}
\begin{center}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}cc@{}}
\textbf{Example 1} & \textbf{Example 2} \\
\fbox{\begin{minipage}[t]{0.45\linewidth}
\vspace{0pt}
\begin{center}
$\begin{aligned}
y & =ax+\dfrac{x^2}{b} & \text{Non-Linear} \\[1ex]
\dfrac{y}{x} & =\dfrac{ax}{x}+\dfrac{x^2}{bx} \\[1ex]
& =a+\dfrac{x}{b} & \text{Linear} \\[1ex]
\dfrac{y}{x} & =\dfrac{1}{b}\cdot x+a \\[1ex]
Y & =m\cdot X+c
\end{aligned}$
\end{center}
Comparing the last two equations:
\[ Y=\dfrac{y}{x},\quad m=\dfrac{1}{b},\quad X=x,\quad c=a \]
\end{minipage}}
&
\fbox{\begin{minipage}[t]{.45\linewidth}
\vspace{0pt}
\begin{center}
$\begin{aligned}
y & =a\mathrm{e}^{bx} & \text{Non-Linear} \\
\ln y & =\ln\left(a\mathrm{e}^{bx}\right) \\
& =\ln a+\ln\mathrm{e}^{bx} \\
& =\ln a+bx\ln\mathrm{e} & \text{Linear} \\
\ln y & =b\cdot x+\ln a \\
Y & =m\cdot X+c
\end{aligned}$
\end{center}
Comparing the last two equations:
\[ Y=\ln y,\quad m=b,\quad X=x,\quad c=\ln a \]
\end{minipage}}
\end{tabular*}
\end{center}
\end{document}
请注意,如果您确实希望常数“e”直立,则应将其输入为\mathrm{e}
,而不是\text{e}
(我认为没有理由,但我是数学家)。