我正在multicolumn
制作一个文档,其中部分内容占两列,其他部分则占满整个页面宽度。到目前为止,一切正常。MWE 如下:
\documentclass[12pt, a4paper,draft=true]{scrbook}
\usepackage[UTF8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\RequirePackage[ngerman=ngerman-x-latest]{hyphsubst}
\usepackage{microtype}
\usepackage{multicol}
\usepackage[onehalfspacing]{setspace}
\KOMAoptions{DIV=calc}
\usepackage{lipsum}
\setlength{\columnsep}{0.3in}
\begin{document}
\begin{center}
\chapter*{Chapter 1}
\end{center}
\vspace{2\baselineskip}
\lipsum[1]
\begin{multicols}{2}
\lipsum[1-8]
\end{multicols}
\end{document}
现在我想添加一个框或类似的东西,其中包含有关主题的附加信息。浮动会很好,但不是必需的,也可以固定。乍一听很简单。但我想要实现的是,框具有一列 + 另一列的三分之一。所以一般来说它应该看起来像这样:
#######################
#######################
#######################
########## ############
########## ############
########## ############
########## ############
########## ############
###### ****************
###### ****************
###### ****************
###### ****************
###### ****************
########## ############
########## ############
尝试类似\parbox{1.3\columnwidth}
或的东西multispan
并没有帮助。
答案1
这使用了wrapfigure
悬垂于整个第二列的 。必须手动将空白插入\parbox
到第二列的正确位置(它算作一个单词)。
这\vspace
是为了弥补用一个大框替换多行文本造成的粘连不足而进行的临时添加。同样,我从宽度中减去了 1em,以消除“太宽”警告。
\documentclass[12pt, a4paper,draft=true]{scrbook}
\usepackage[UTF8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\RequirePackage[ngerman=ngerman-x-latest]{hyphsubst}
\usepackage{microtype}
\usepackage[onehalfspacing]{setspace}
\KOMAoptions{DIV=calc}
\usepackage{multicol}
\usepackage{wrapfig}
\usepackage{lipsum}
\setlength{\columnsep}{0.3in}
\newsavebox{\tempbox}
\begin{document}
\begin{multicols}{2}
Lorem ipsum dolor sit amet, con-
sectetuer adipiscing elit. Ut purus
elit, vestibulum ut, placerat ac, adi-
piscing vitae, felis. Curabitur dictum
gravida mauris. Nam arcu libero, no-
nummy eget, consectetuer id, vulpu-
tate a, magna. Donec vehicula augue
eu neque. Pellentesque habitant mor-
bi tristique senectus et netus et male-
suada fames ac turpis egestas. Mau-
ris ut leo. Cras viverra metus rhoncus
sem. Nulla et lectus vestibulum ur-
na fringilla ultrices. Phasellus eu tel-
\begin{wrapfigure}{r}[\dimexpr \columnsep+\columnwidth]{1.333\columnwidth}
\global\setbox\tempbox=\vbox{\lipsum[4]}
\usebox{\tempbox}
\end{wrapfigure}
lus sit amet tortor gravida placerat.
Integer sapien est, iaculis in, preti-
um quis, viverra ac, nunc. Praesent
eget sem vel leo ultrices bibendum.
Aenean faucibus. Morbi dolor nulla,
malesuada eu, pulvinar at, mollis ac,
nulla. Curabitur auctor semper nul-
la. Donec varius orci eget risus. Duis
nibh mi, congue eu, accumsan elei-
fend, sagittis quis, diam. Duis eget
orci sit amet orci dignissim rutrum.
\lipsum[2]
Nulla malesuada porttitor diam.
\vspace{0pt plus 1ex minus 1ex}%
\parbox{\dimexpr \columnwidth-1em}% note the added \baselineskip for setspace
{\rule{0pt}{\dimexpr \ht\tempbox+\dp\tempbox+2\intextsep+\baselineskip}}
Donec felis erat, congue non, vo-
lutpat at, tincidunt tristique, libe-
ro. Vivamus viverra fermentum felis.
Donec nonummy pellentesque ante.
Phasellus adipiscing semper elit. Pro-
in fermentum massa ac quam. Sed di-
am turpis, molestie vitae, placerat a,
molestie nec, leo. Maecenas lacinia.
Nam ipsum ligula, eleifend at, ac-
cumsan nec, suscipit a, ipsum. Mor-
bi blandit ligula feugiat magna. Nunc
eleifend consequat lorem. Sed lacinia
nulla vitae enim. Pellentesque tincid-
unt purus vel magna. Integer non en-
im. Praesent euismod nunc eu pu-
rus. Donec bibendum quam in tellus.
Nullam cursus pulvinar lectus. Donec
et mi. Nam vulputate metus eu enim.
Vestibulum pellentesque felis eu massa.
\end{multicols}
\end{document}