- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在为一家杂志写一篇文章。我试图在 3 列文档的右上角插入一个( float 的)2 列框,文本很好地环绕它,然后对齐列。我正在使用 tikz 包制作盒子,这样我就可以得到一个带有圆边和背景颜色的盒子。我正在尝试使用 wrapfig 进行包装(我也尝试了一些 minipage 的东西),但我无法让它工作。
这是一些代码,解释了我正在尝试做什么,以及我一直在尝试做什么:
\documentclass{article}
\usepackage{wrapfig}
\usepackage{tikz}
\usepackage{multicol}
\definecolor{col}{rgb}{0.6,0.6,0.9}
\setlength{\columnsep}{0.5cm}
\newcommand{\floatingBox}[3]
{
\noindent
\begin{wrapfigure}{#1}{#2}
\begin{tikzpicture}
\node[rounded corners=5pt, fill=col, text width=\linewidth]{#3};
\end{tikzpicture}
\end{wrapfigure}
}
\begin{document}
\begin{multicols}{3}
\large
Some random rambling to fill a page.
Aardvark AB aback abacus abaft abalone abandon abandoned abandonment abase
abasement abash abashed abate abatement abattoir abbess abbey abbot
abbreviate abbreviation ABC abdicate abdication abdomen abdominal abduct
abduction abeam abed aberrant aberration abet abeyance abhor abhorrence
abhorrent abide abiding ability abject abjure ablaze able able-bodied ABM
abnegation abnormal abnormality aboard abode abolish abolition abolitionist
A-bomb abominable abominate abomination aboriginal aborigine abort abortion
abortionist abortive abound about about-face above aboveboard abracadabra
abrade Abraham abrasion abrasive abreast abridge abridgment abroad abrogate
abrogation abrupt abscess abscond absence absent absentee absenteeism
absent-minded absinthe absolute absolute zero absolution absolutism absolve
absorb absorbency absorbent absorbing absorption abstain abstemious
abstention abstinence abstinent abstract abstracted abstraction abstruse
absurd absurdity abundance abundant abuse abusive abut abutment abysmal
abyss AC acacia academia academic academician academy a cappella accede
accelerate acceleration accelerator accent accentuate accentuation accept
acceptability acceptable acceptance access accessibility accessible
accession.
\floatingBox{tr}{2\columnwidth + 1\columnsep}{
\begin{multicols}{2}
A box that spans 2 columns and should be floating on top of the page with
the text wrapping around it. It's aligned to the right, so it would be
exactly above 2 entire columns, with one column to its left.
\end{multicols}
}
Accessory accident accidental accident-prone acclaim acclamation acclimate
acclimation acclimatization acclimatize accolade accommodate accommodating
accommodation accompaniment accompanist accompany accomplice accomplish
accomplished accomplishment accord accordance accordingly according to
accordion accost account accountability accountable accountant accounting
accouterments accredit accreditation accrue accumulate accumulation
accumulative accuracy accurate accursed accusation accusative accusatory
accuse accused accusingly accustom accustomed ace acerbic acerbity
acetaminophen acetate acetic acid acetone acetylene ache achievable achieve
achievement.
\end{multicols}
\end{document}
最佳答案
根据我的经验,这种布局(图形跨越不止一个,但不是页面上的所有列)很难用 latex 获得。
据我所知,最好的解决方案是 flowfram package .该包允许您在编写文档内容之前定义页面布局(某些框应该放置在哪里)。
下面给出了一个小代码示例。它是 flowfram 包附带的海报示例的重组。
\documentclass[a4wide]{article}
\usepackage{color}
\usepackage{helvet}
\usepackage{flowfram}
\setlength{\columnsep}{0.3cm}
% Base the page layout on 3 column with static header.
\NcolumnStop{3}{1 cm}
% give the static frame a label to make it easier to keep track of
\setstaticframe{\value{maxstatic}}{label={title},backcolor=[cmyk]{0.64,0,0.95,0.40},textcolor=white}
% On the first page, replace last two columns with
% 2 columns and a static above
\setflowframe{2,3}{pages={>1}}
\computeflowframearea{2,3}
\twocolumnStopinarea[1]{0.3\ffareaheight}{\ffareawidth}{\ffareaheight}{\ffareax}{\ffareay}
\setstaticframe{\value{maxstatic}}{label={info},backcolor=[cmyk]{0.26,0,0.76,0},clear}
\setallflowframes{backcolor=[cmyk]{0.15,0,0.69,0}}
\raggedright
\setlength{\parindent}{15pt}
\begin{document}
\begin{staticcontents*}{title}
\begin{center}
\bfseries\Large Creating stuff in \LaTeX\par
\end{center}
\end{staticcontents*}
\pagestyle{empty}
\begin{staticcontents*}{info}
\begin{staticfigure}
The {flowfram} package is designed to enable you to create
frames in a document such that the
contents of the {document} environment flow from one
frame to the next in the order that they were defined.
This is useful for creating posters
or magazines or any other form of document that does not
conform to the standard one or two column layout.
\vfill
\caption{The commands used to define the frames for this document g.}
\protect\label{fig:thisdoc}
\end{staticfigure}
\end{staticcontents*}
This is a modified version of the manual for the {flowfram}
package. It is intended to illustrated what can be done. See the
full manual (ffuserguide.pdf) for
a comprehensive description, as this may now be out of date.
The commands used to define the frames for
this document are shown in Figure~\ref{fig:thisdoc}.
If the columns are very narrow, it may be better to
use {raggedright}, otherwise \TeX\ may have a
problem working out the line breaks.
\section{Introduction}
The {flowfram} package is designed to enable you to create
frames in a document such that the
contents of the {document} environment flow from one
frame to the next in the order that they were defined.
This is useful for creating posters
or magazines or any other form of document that does not
conform to the standard one or two column layout.
\section{Setting up Frames}
The {flowfram} package provides three types of frame:
{flow frames}, {static
frames} and {dynamic frames}.
\subsection{Flow Frames}
The flow frame is the principle type of frame.
The text of the {document} environment will flow from
one frame to the next in order of definition. Each
flow frame has an associated width, height,
position on the page, and optionally a border.
It is recommended that all the flow frames in a document
have the same width, otherwise problems may occur
when a paragraph spans to flow frames of unequal
widths. This is because \TeX's output routine does not
register the change in {hsize} until it reaches
a paragraph break. If it is absolutely necessary for
flow frames to have unequal widths, judicious use of
{framebreak} is required.
\end{document}
关于latex - Multicol 和页面顶部的 float 框,文本环绕在它周围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1693300/
我正在尝试向图像顶部和底部的 ImageView 添加渐变。我不想在 ImageView 之上添加 TextView 。我该如何实现? 最佳答案 看来您简单而干净的解决方案是用 FrameLayout
我可以寻求帮助吗, 我有日期 - “公司名称”和“日期”,例如 $value |"Comp Name"| "Date" | |:----------|----------:| |computer
我有两个表,我试图从中运行查询以返回每个人的最大(或最高)交易。我应该注意,我无法更改表结构。相反,我只能拉数据。 人 +-----------+| id | name |+-----------+|
所以我有一个用管道打开的 n 个流的数组,但是使用 gdb,我发现当我尝试关闭流或管道的写入端时程序失败。我可以很好地写入管道,但关闭它们不起作用。我在程序上运行 valgrind,它所做的只是打印出
大家好,这是我的难题。我正在尝试创建一个标签栏,该标签栏从上到下锚定在左侧,而不是从左到右锚定在底部。我创建了一个工具栏项目,将栏准确地放置在我想要的位置,但我希望选项卡栏相同,具有相同的功能,当然除
http://jsfiddle.net/GuXQZ/3/ header slideshow lates Content
我的图片出了点问题,我无法解决这个问题。这是我的代码.. HTML HIDE CSS #ads { -webkit-border-bottom-right-r
我有一个包含 3(css 网格)列的设计。第二列有嵌套的网格内容需要垂直滚动,而其他两列保持各自的高度。我给第二个嵌套列一个溢出,但我还需要给它一个顶部和底部填充或边距。我的解决方案没有顶部/底部填充
我在 View 中有两个 UIToolbar,分别在顶部和底部。我正在尝试在 iOS 版本中一致地应用外观。从 iOS5 开始有这个 setBackgroundImage: forToolbarPos
一个 div 我使用 top:-26px; 在 css 中设置高度。我有其他 div 其他地方我想与那个 div 对齐。我注意到在 jquery 中编写 .css('top') 得到了我的 css 而
我有这个无序列表 two three 有没有一种方法可以将无序列表添加到无序列表的前面,使其像这样结束? ONE two three 请注意“ONE”已添加到列表
我想检测鼠标何时离开顶部的视口(viewport)(可以说是向北)。我在网上搜了下How can I detect when the mouse leaves the window? .是一个好的开始
运行顶级命令top -c在 Ubuntu 服务器上显示当前正在运行的所有命令。关于 PostgreSQL 命令,括号中的值是什么意思?我说的是图片中红色框旁边的值。 最佳答案 我找不到任何文档来支持这
我想知道将顶部和底部边距添加到 GtkTextView 的正确且普遍接受的方法位于 GtkScrolledWindow 内.有设置左右边距的功能,我正在使用: gtk_text_view_set_le
作为很多“初学者”,我认为使用 TOP_OF_PIPELINE 作为 dst 和 BOTTOM_OF_PIPELINE 作为 src 意味着 ALL_COMMANDS 两者。 Here Nicol B
我正在尝试使用 jQuery/Javascript 解决这个问题: 当浏览器向下滚动且窗口底部到达页脚 DIV 顶部时,执行 CSS 代码更改。 问题示例: https://elodywedding.
我想使用范围 slider 来选择一个值并将该值呈现在 Angular 中的范围选择器顶部。我的html代码是: Raio: {{raio}} metros 在我的 co
我想将手的图片放在靠近脸部的黑色 Canvas 上。这可以吗?有没有办法确定图片的位置? 这是我的代码: var canvas; var canvasContext; window
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 9 年前。 Improve this
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 9 年前。 Improve this
我是一名优秀的程序员,十分优秀!