怎样才能让两列变成两列

怎样才能让两列变成两列

我怎样才能使两列看起来像图片中一样?

答案1

也许你可以给tasks包(曾经是exsheets捆绑)尝试一下:

在此处输入图片描述

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{tasks}[2013/04/07]

% renew the {tasks} environment to use bold labels
% and use two columns as default settings:
\RenewTasks[counter-format= tsk.,label-format=\bfseries]{tasks}(2)

\begin{document}

\begin{multicols}{2}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
\begin{tasks}
 \task foo
 \task bar
 \task baz
 \task foobar
 \task foo
 \task bar
 \task baz
 \task foobar
\end{tasks}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr
\begin{tasks}
 \task foo
 \task bar
 \task baz
 \task foobar
 \task foo
 \task bar
 \task baz
 \task foobar
\end{tasks}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr
\begin{tasks}
 \task foo
 \task bar
 \task baz
 \task foobar
 \task foo
 \task bar
 \task baz
 \task foobar
\end{tasks}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr
\begin{tasks}
 \task foo
 \task bar
 \task baz
 \task foobar
 \task foo
 \task bar
 \task baz
 \task foobar
\end{tasks}
\end{multicols}

\end{document}

以下是如何进一步定制外观的示例(感谢科夫打字!)。编辑:更新后的版本需要 v0.10 (2014/07/20) 的\task!语法。

需要跨越整行的项目(下图中的项目 31 和 32)可以通过以下方法之一实现:

  • \task!– 这将强制特定项目使用整行从新行开始。
  • \task*– 这将强制特定项目使用该行的剩余空间。在这种情况下,这意味着如果它恰好是第一列中的项目,它将使用整行。
  • \task*(<num>)– 这意味着如果当前行中有足够的列,则项目将跨<num>列。否则它将使用尽可能多的列。

在此处输入图片描述

\documentclass{article}
\usepackage[left=1.5cm,right=1.5cm,top=1.5cm,bottom=1.5cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{amsmath}

% use tasks v0.10 2014/07/20:
\usepackage{tasks}[2014/07/20]

% declare custom tasks instance that has no stretchable space between
% rows of items:
\DeclareInstance{tasks}{custom}{default}{
  counter-format  = tsk. ,
  label-format    = \bfseries ,
  label-width     = 1.5em ,
  label-offset    = .3333em ,
  after-item-skip = 0pt
}

% renew {tasks} environment to use the new instance and resume the
% item counting:
\RenewTasks[resume,style=custom,label-align=right]{tasks}(2)

\begin{document}

\begin{multicols}{2}
Derivative calculations\par
In Exercises \ref{tsk:st1}--\ref{tsk:end1}, given $y=f(u)$ and $u=g(x)$, find
$dy/dx=f^\prime(g(x))g^\prime(x)$
\begin{tasks}
 \task $y=6u-9,\ u=1/2 x^4$ \label{tsk:st1}
 \task $y=2u^3,\ u=8x-1$
 \task $y=\sin u,\ u=3x+1$
 \task $y=\cos u,\ u=-x/3$
 \task $y=\cos u,\ u=\sin x$
 \task $y=\sin u,\ u=x-\cos x$
 \task $y = \tan u,\ u=10x-5$
 \task $y=-\sec u,\ u=x^2+7x $ \label{tsk:end1}
\end{tasks}

In Exersises  \ref{tsk:st2}--\ref{tsk:end2}, write the function in the form
$y=f(u)$ and $u=g(x)$. Then find $dy/dx$ as a function of $x$.
\begin{tasks}
 \task $y=\left( 2x+1 \right)^5$ \label{tsk:st2} 
 \task $y=\left( 4-3x \right)^9$
 \task $y=\left( 1-\dfrac{x}7 \right)^{-7}$
 \task $y=\left( \dfrac{x}2 -1 \right)^{-10}$
 \task $y=\left( \dfrac{x^2}8 +x -\dfrac1{x} \right)^{4}$
 \task $y=\sqrt{2x^2-4x+6}$
 \task $y=\sec(\tan x)$
 \task $y=\cot\left( \pi -\dfrac1{x} \right)$
 \task $y=\sin^3 x$
 \task $y=5\cos^{-4} x$
 \task $y=e^{-5x}$
 \task $y=e^{2x/3}$
 \task $y=e^{5-7x}$
 \task $y=e^{4\sqrt{x}-x^2}$ \label{tsk:end2}
\end{tasks}

Find the derivatives of the functions in Exercises \ref{eq:st3}--\ref{eq:end3}:
\begin{tasks}
 \task $p=\sqrt{3-t}$ \label{eq:st3}
 \task $q=\sqrt[3]{2r-r^2}$
 \task $s=\dfrac{4}{3\pi}\sin{3t}+\dfrac{4}{5\pi}\cos{5t}$
 \task $s=\sin\dfrac{3\pi t}{2}+\cos\dfrac{3\pi t}{2}$
 \task $r=\left( \csc\theta +\cot\theta \right)^{-1}$
 \task $r=6\left( \sec\theta -\tan\theta \right)^{3/2}$
 \task $y=x^2\sin4x+x\cos^{-2}x$
 \task $y=\dfrac1{x}\sin^{-5}x-\dfrac{x}{3}\cos^{3}x$
 \task! $y=\dfrac1{21}(3x-2)^7+\left( 4-\dfrac1{2x^2}  \right)^{-1}$
 \task! $y=(5-2x)^{-3}+\dfrac1{8}\left( \dfrac2{x}+1  \right)^{4}$
 \task $y=(4x+3)^4(x+1)^{-3}$
 \task $y=(2x-5)^{-1}(x^2-5x)^{6}$
 \task $y=x e^{-x}+e^{3x}$
 \task $y=(1+2x)e^{-2x}$
 \task $y=(x^2-2x+2)e^{5x/2}$
 \task $y=(9x^2-6x+2)e^{x^3}$
 \task $h(x)=x\tan\left( 2\sqrt{x} \right)+7$
 \task $k(x)=x^2\sec\left( \dfrac1x \right)$ \label{eq:end3}
\end{tasks}
\end{multicols}

\end{document}

答案2

这是一个有点幼稚的解决方案。

\documentclass{report}
\usepackage{multicol}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{lmodern}
\usepackage[left=1.5cm,right=1.5cm,top=1.5cm,bottom=1.5cm]{geometry}

\usepackage{newfile}
\newoutputstream{qstream}
\IfFileExists{\jobname.qst}{\input{\jobname.qst}}{}
%
\AtBeginDocument{\openoutputfile{\jobname.qst}{qstream}}
\AtEndDocument{\closeoutputstream{qstream}}
%
\newcount\n
\newdimen\eqboxwd
\eqboxwd=0.38\hsize
\n=0
\newbox\eqbox
\def\qtem$#1${%
\advance\n1\leavevmode\setbox\eqbox=\hbox{\hbox to2em{\hfill$\mathbf{\the\n.}$}\ $#1$\hss}%
\ifnum\wd\eqbox<\eqboxwd \setbox\eqbox=\hbox to\eqboxwd{\unhbox\eqbox\hss}\copy\eqbox%
\else\copy\eqbox\\ \fi%
}

\def\qlab#1{%
\addtostream{qstream}{\noexpand\expandafter\noexpand\def\noexpand\csname[#1]\noexpand\endcsname{\the\n}}
}
\def\qref#1{\ifcsname[#1]\endcsname\csname[#1]\endcsname\else?\fi}

\begin{document}

\begin{multicols}{2}
Derivative calculations\par
In Exercises 
%1--8, 
\qref{eq:st1}--\qref{eq:end1},
given $y=f(u)$ and $u=g(x)$,
find $dy/dx=f^\prime(g(x))g^\prime(x)$. 

\noindent%
\qtem $y=6u-9,\ u=1/2 x^4$ \qlab{eq:st1}%
\qtem $y=2u^3,\ u=8x-1$
\qtem $y=\sin u,\ u=3x+1$
\qtem $y=\cos u,\ u=-x/3$
\qtem $y=\cos u,\ u=\sin x$
\qtem $y=\sin u,\ u=x-\cos x$
\qtem $y = \tan u,\ u=10x-5$
\qtem $y=-\sec u,\ u=x^2+7x $ \qlab{eq:end1}%

In Exersises 
%9--22, 
\qref{eq:st2}--\qref{eq:end2},
write the function in the form $y=f(u)$
and $u=g(x)$. Then find $dy/dx$ as a function of $x$.

\noindent%
\qtem $y=\left( 2x+1 \right)^5$ \qlab{eq:st2}% 
\qtem $y=\left( 4-3x \right)^9$
\qtem $y=\left( 1-\dfrac{x}7 \right)^{-7}$
\qtem $y=\left( \dfrac{x}2 -1 \right)^{-10}$
\qtem $y=\left( \dfrac{x^2}8 +x -\dfrac1{x} \right)^{4}$
\qtem $y=\sqrt{2x^2-4x+6}$
\qtem $y=\sec(\tan x)$
\qtem $y=\cot\left( \pi -\dfrac1{x} \right)$
\qtem $y=\sin^3 x$
\qtem $y=5\cos^{-4} x$
\qtem $y=e^{-5x}$
\qtem $y=e^{2x/3}$
\qtem $y=e^{5-7x}$
\qtem $y=e^{4\sqrt{x}-x^2}$ \qlab{eq:end2}%

Find the derivatives of the functions in Exercises 
%23--50
\qref{eq:st3}--\qref{eq:end3}.

\noindent%
\qtem $p=\sqrt{3-t}$ \qlab{eq:st3}%
\qtem $q=\sqrt[3]{2r-r^2}$
\qtem $s=\dfrac{4}{3\pi}\sin{3t}+\dfrac{4}{5\pi}\cos{5t}$
\qtem $s=\sin\dfrac{3\pi t}{2}+\cos\dfrac{3\pi t}{2}$
\qtem $r=\left( \csc\theta +\cot\theta \right)^{-1}$
\qtem $r=6\left( \sec\theta -\tan\theta \right)^{3/2}$
\qtem $y=x^2\sin4x+x\cos^{-2}x$
\qtem $y=\dfrac1{x}\sin^{-5}x-\dfrac{x}{3}\cos^{3}x$
\qtem $y=\dfrac1{21}(3x-2)^7+\left( 4-\dfrac1{2x^2}  \right)^{-1}$
\qtem $y=(5-2x)^{-3}+\dfrac1{8}\left( \dfrac2{x}+1  \right)^{4}$
\qtem $y=(4x+3)^4(x+1)^{-3}$
\qtem $y=(2x-5)^{-1}(x^2-5x)^{6}$
\qtem $y=x e^{-x}+e^{3x}$
\qtem $y=(1+2x)e^{-2x}$
\qtem $y=(x^2-2x+2)e^{5x/2}$
\qtem $y=(9x^2-6x+2)e^{x^3}$
\qtem $h(x)=x\tan\left( 2\sqrt{x} \right)+7$
\qtem $k(x)=x^2\sec\left( \dfrac1x \right)$ \qlab{eq:end3}%
\end{multicols}

\end{document}

在此处输入图片描述

答案3

这是一个简单的解决方案:

\documentclass[twocolumn]{report}
\usepackage{multicol}

\begin{document}
foo\hrulefill foo
\begin{multicols}{2}
\begin{enumerate}
\item foo\hrulefill foo

\item foo\hrulefill foo

\item foo\hrulefill foo

\item foo\hrulefill foo
\end{enumerate}
\end{multicols}
foo\hrulefill foo

\vfill

foo\hrulefill foo

\end{document}

在此处输入图片描述

相关内容