0

I am looking for a format that allows two columns, with a text box in the center of the page; that is in fact three boxes. Wrapfig does not do the job because it only let text to flow on one side.

  • 1
    see tex.stackexchange.com/questions/124305/… for a manual solution – ebcontrol Oct 16 at 12:34
  • This does not work. The aim is a figure in the center wrapped on both sides. – Nero Oct 16 at 13:14
  • Can you show a screenshot or image for more clarification about your requirement? – MadyYuvi Oct 16 at 13:28
  • 2
    Look at the third example in the linked answer. It seems to be the layout that you ask for. Do you load multicol? – Sveinung Oct 16 at 13:34
1

This solution uses flowfram. The advantage of flowfram is that everything is positioned relative to the page, not the text.

Normally when paragraphs break across frames, the width is not changed. Instead you have to manually break the paragraphs using \nopar, adding them one at a time where needed.

Note that flowfram is incompatible with twocolumn, but one can fake it with more flow frames.

\documentclass{article}
\usepackage[textwidth=6in]{geometry}
\usepackage{flowfram}
\usepackage{graphicx}
\usepackage{lipsum}% MWE only

\newcommand{\nopar}{\strut{\parfillskip=0pt\parskip=0pt\par}\framebreak\noindent}

\newflowframe[1,>2]{\dimexpr 0.5\textwidth-0.5\columnsep}{\textheight}%
  {0pt}{0pt}% normal left column
\newflowframe[1,>2]{\dimexpr 0.5\textwidth-0.5\columnsep}{\textheight}%
  {\dimexpr 0.5\textwidth+0.5\columnsep}{0pt}% normal right column

% the folowing wastes length registers, but is more easily read than using \dimen0 etc.
\newlength{\centerboxheight}
\newlength{\centerboxwidth}
\newlength{\boxsep}

\setlength{\centerboxheight}{2in}
\setlength{\centerboxwidth}{3in}
\setlength{\boxsep}{\intextsep}

\newflowframe[2]{\dimexpr 0.5\textwidth-0.5\columnsep}{\dimexpr 0.5\textheight-0.5\centerboxheight-\boxsep}%
  {0pt}{\dimexpr 0.5\textheight+\centerboxheight/2+\boxsep}% upper left
\newflowframe[2]{\dimexpr 0.5\textwidth-0.5\centerboxwidth-\columnsep}{\dimexpr \centerboxheight+2\boxsep}%
  {0pt}{\dimexpr 0.5\textheight-0.5\centerboxheight-\boxsep}% middle left
\newflowframe[2]{\dimexpr 0.5\textwidth-0.5\columnsep}{\dimexpr 0.5\textheight-0.5\centerboxheight-\boxsep}%
  {0pt}{0pt}% lower left
\newflowframe[2]{\dimexpr 0.5\textwidth-0.5\columnsep}{\dimexpr 0.5\textheight-0.5\centerboxheight-\boxsep}%
  {\dimexpr \dimexpr 0.5\textwidth+0.5\columnsep}{\dimexpr 0.5\textheight+0.5\centerboxheight+\boxsep}% upper right
\newflowframe[2]{\dimexpr 0.5\textwidth-0.5\centerboxwidth-\columnsep}{\dimexpr \centerboxheight+2\boxsep}%
  {\dimexpr 0.5\textwidth+0.5\centerboxwidth+\columnsep}{\dimexpr 0.5\textheight-0.5\centerboxheight-\boxsep}% middle right
\newflowframe[2]{\dimexpr 0.5\textwidth-0.5\columnsep}{\dimexpr 0.5\textheight-0.5\centerboxheight-\boxsep}%
  {\dimexpr \dimexpr 0.5\textwidth+0.5\columnsep}{0pt}% lower right

\newstaticframe[2]{\centerboxwidth}{\centerboxheight}%
  {\dimexpr 0.5\textwidth-0.5\centerboxwidth}{\dimexpr 0.5\textheight-0.5\centerboxheight}[page2]
\begin{staticcontents*}{page2}
  \includegraphics[width=\centerboxwidth,height=\centerboxheight]{example-image}
\end{staticcontents*}

\begin{document}
\sloppy
\lipsum[1-7]

Pellentesque habitant morbi tristique senectus
et netus et malesuada fames ac turpis egestas.
Donec odio elit, dictum in, hendrerit sit amet,
egestas sed, leo. Praesent feugiat sapien aliquet
odio. Integer vitae justo. Aliquam vestibulum
fringilla lorem. Sed neque lectus, consectetuer
at, consectetuer sed, eleifend ac, lectus. Nulla facilisi.
Pellentesque eget lectus. Proin eu metus.
Sed porttitor. In hac habitasse platea dictumst.\nopar
Suspendisse eu lectus. Ut mi mi, lacinia sit amet,
placerat et, mollis vitae, dui. Sed ante tellus, tristique
ut, iaculis eu, malesuada ac, dui. Mauris
nibh leo, facilisis non, adipiscing quis, ultrices a,
dui.

Morbi luctus, wisi viverra faucibus pretium,
nibh est placerat odio, nec\nopar
commodo wisi enim
eget quam. Quisque libero justo, consectetuer
a, feugiat vitae, porttitor eu, libero. Suspendisse
sed mauris vitae elit sollicitudin malesuada.
Maecenas ultricies eros sit amet ante. Ut
venenatis velit. Maecenas sed mi eget dui varius
euismod. Phasellus aliquet volutpat odio.
Vestibulum ante ipsum primis in faucibus orci
luctus et ultrices posuere cubilia Curae; Pellentesque
sit amet pede ac sem eleifend consectetuer.
Nullam elementum, urna vel imperdiet
sodales, elit ipsum pharetra ligula, ac pretium
ante justo a nulla. Curabitur tristique arcu eu
metus. Vestibulum lectus. Proin mauris. Proin
eu nunc eu urna hendrerit faucibus. Aliquam
auctor, pede consequat laoreet varius, eros tellus
scelerisque quam, pellentesque hendrerit ipsum
dolor sed augue. Nulla nec lacus.

Suspendisse vitae elit. Aliquam arcu neque,
ornare in, ullamcorper quis, commodo eu, libero.
Fusce sagittis erat at erat tristique mollis. Maecenas
sapien libero, molestie et, lobortis in, sodales
eget, dui. Morbi ultrices rutrum lorem. Nam elementum
ullamcorper leo. Morbi dui. Aliquam
sagittis. Nunc placerat. Pellentesque tristique
sodales est. Maecenas imperdiet lacinia velit.
Cras non urna. Morbi eros pede, suscipit ac, varius
vel, egestas non, eros. Praesent malesuada,
diam id pretium elementum, eros sem dictum tortor,
vel consectetuer odio sem sed wisi.

Sed feugiat. Cum sociis natoque penatibus et
magnis dis parturient montes, nascetur ridiculus
mus. Ut pellentesque augue sed urna.\nopar
Vestibulum
diam eros, fringilla et, consectetuer eu, nonummy
id, sapien. Nullam at lectus. In sagittis
ultrices mauris. Curabitur malesuada erat sit
amet massa. Fusce blandit. Aliquam erat volutpat.
Aliquam euismod. Aenean vel lectus. Nunc
imperdiet justo nec\nopar
dolor.

\lipsum[12-16]

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.