Graphics, Figures & Tablesmultiple figures surrounded with freely floating text

Information and discussion about graphics, figures & tables in LaTeX documents.
igor_igel
Posts: 7
Joined: Sun Mar 31, 2013 5:41 pm

multiple figures surrounded with freely floating text

Post by igor_igel »

Dear Community,

imagine following situation: We have a results section that starts after another section at an arbitrary point of a page. The results are illustrated with figures which are exactly one page high and about half page wide. I would like one figure on the side of each page beginning with the first complete page of the results section until all figures are shown. The text of the result section shall begin just with the section with full page width and then continue to float besides the figures and after the figures it should continue on full page width. I drew the formatting I am dreaming of and attached it to the post.

I thought about parcolumn but it seems impossible to to have have one column to start and end with full page width while being reduced to half width while the other column is filled.

A more promising idea was to use wrapfigure. But unfortunately it I could not let the same text wrap several figures. See the following example:

Code: Select all

\documentclass{article}
\usepackage{wrapfig}
\usepackage{blindtext}
\begin{document}
This is the text of the presvious section, 
\blindtext
\section*{Results}
\begin{wrapfigure}{RH}{0.4\textwidth}
\rule{5cm}{18cm}\\
\caption{Caption}
\end{wrapfigure}
\begin{wrapfigure}{RH}{0.4\textwidth}
\rule{5cm}{18cm}\\
\caption{Caption}
\end{wrapfigure}
Thats the text that should start with the results section with full page with, float besides the figures and continue on full page width after the figures are shown, 
\Blindtext
\end{document} 
The same issue has been posted in another forum:
http://www.golatex.de/mehrere-seiten-gr ... 10618.html
but nobody could help me (when somebody will answer there unexpectedly, I will let you know). Although I am convinced that there must be a simple solution, please tell me also if I couldn't describe my problem or if you think that my expectations to LaTeX are too high, I can cope with that ;)

Please share any ideas and thank you very much for your time,
Igor Igel
Attachments
latexbspenglish.png
latexbspenglish.png (25.09 KiB) Viewed 15903 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

tommytex
Posts: 39
Joined: Wed Jan 23, 2013 10:04 pm

Re: multiple figures surrounded with freely floating text

Post by tommytex »

8-)
Last edited by tommytex on Mon Apr 01, 2013 1:38 pm, edited 1 time in total.
User avatar
tommytex
Posts: 39
Joined: Wed Jan 23, 2013 10:04 pm

multiple figures surrounded with freely floating text

Post by tommytex »

Hi igor igel,

basically did everything right!
But use the lipsum package please :D i'm not shure what blindtext does to your document.... :roll:

However, your document contains two basic problems

1) your page layout/margins: 18cm is much too high for a figure if you want it to be shown together with some text before the "Results" section. Use the geometry package or your page numbers or figure captions will be cut off...

2) if you want to define your wrapfig properly, you can use

Code: Select all

\begin{wrapfigure}[49]{r}{0.4\textwidth}
to make the text wrap around 49 lines and then go back to full width again


Taking care of all those things i got this:

Code: Select all

\documentclass{article}
\usepackage[english]{babel}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage[top=2cm,bottom=2cm,left=3cm,right=4cm]{geometry}

\begin{document}
This is the text of the presvious section, 
\lipsum[3]

\section*{Results}
\begin{wrapfigure}[44]{r}{0.4\textwidth}
\rule{5cm}{15cm}\\
\caption{Caption}
\end{wrapfigure}
~
\begin{wrapfigure}[49]{r}{0.4\textwidth}
\rule{5cm}{18cm}\\
\caption{Caption}
\end{wrapfigure}

Thats the text that should start with the results section with full page with, float besides the figures and continue on full page width after the figures are shown, 
\lipsum[40-50]

\end{document}
Attachments
TwoColumn.pdf
results...
(35.56 KiB) Downloaded 653 times
User avatar
tommytex
Posts: 39
Joined: Wed Jan 23, 2013 10:04 pm

multiple figures surrounded with freely floating text

Post by tommytex »

sorry i actually forgot to put some text before the figures...

Code: Select all

\documentclass{article}
\usepackage[english]{babel}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage[top=2cm,bottom=2cm,left=3cm,right=4cm]{geometry}

\begin{document}
This is the text of the presvious section, 
\lipsum[3]

\section*{Results}
\lipsum[38-40]
\begin{wrapfigure}[22]{r}{0.4\textwidth}
\rule{5cm}{7cm}\\
\caption{Caption}
\end{wrapfigure}
~
\begin{wrapfigure}[46]{rt}{0.4\textwidth}
\rule{5cm}{15cm}\\
\caption{Caption}
\end{wrapfigure}
Thats the text that should start with the results section with full page with, float besides the figures and continue on full page width after the figures are shown, 
\lipsum[40-50]

\end{document}

i'm not shure how to get rid of that lousy gap between one-column and two-column text.... :cry:
Attachments
Auswahl_003.png
Auswahl_003.png (170.34 KiB) Viewed 15877 times
Last edited by Stefan Kottwitz on Mon Apr 01, 2013 2:51 pm, edited 1 time in total.
igor_igel
Posts: 7
Joined: Sun Mar 31, 2013 5:41 pm

multiple figures surrounded with freely floating text

Post by igor_igel »

Hi,

thank you very much for your suggestion!
But that's not exactly what I as looking for, I think I couldn't describe the wanted formatting precisely: Yes the figures are one page high and no they shall not start on the first page of the results section, but rather on the second one, where the whole page height can be used.

I think the searched formating can be understood most easily by looking at the graphic that has been attached to the first post.

Here comes a second attempt to describe it:

Lets consider an example of 4 pages. The previous section ends at the first page and the result section, with its text, starts there with full page width. The second and third page have figures on the right side, which have width of about half the page and are exactly one page high. The text of the results section continues at side of the figures and at the forth page there is no figure and the text will continue with full page width.

I tried to change your suggested code so that the figures are one page high and that they will start at the beginning of the new page (by using the [H] option of the \wrapfigure) and again the same unwanted behaviour, that the text of the results starts with the second figure, appeared. Here is the code:

Code: Select all

\documentclass{article}
\usepackage[english]{babel}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage[top=2cm,bottom=2cm,left=3cm,right=4cm]{geometry}

\begin{document}
This is the text of the previous section,
\lipsum[3]

\section*{Results}
\begin{wrapfigure}[55]{RH}{0.4\textwidth}
\rule{5cm}{23cm}\\
\caption{Caption}
\end{wrapfigure}
~
\begin{wrapfigure}[55]{RH}{0.4\textwidth}
\rule{5cm}{23cm}\\
\caption{Caption}
\end{wrapfigure}
Thats the text that should start with the results section with full page with, float besides the figures and continue on full page width after the figures are shown,
\lipsum[40-50]

\end{document}
Any ideas?

Thank you again very much for sharing your time!
User avatar
tommytex
Posts: 39
Joined: Wed Jan 23, 2013 10:04 pm

multiple figures surrounded with freely floating text

Post by tommytex »

hi,

thank you for describing the issue more clearly :)
you mean like this?...

Code: Select all

\documentclass{article}
\usepackage[english]{babel}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage{geometry}
 \usepackage{marginnote}

\begin{document}
This is the text of the previous section,
\lipsum[3]



\section*{Results}

Thats the text that should start with the results section with full page with, float besides the figures and continue on full page width after the figures are shown,\lipsum[40-43]

\newgeometry{top=3cm, bottom=3cm,inner=3cm, outer=7cm, heightrounded, marginparwidth=5cm, marginparsep=-3cm}

\lipsum[40-42]


\begin{figure}
\marginnote{
\rule{5cm}{23cm}\\
\caption{caption1}
}[0cm]
\end{figure}

\lipsum[40-45]


\begin{figure}
\marginnote{
\rule{5cm}{23cm}\\
\caption{caption2}
}[0cm]
\end{figure}


\restoregeometry

\lipsum[50-52]

\end{document}
I am using the margin notes here....

see http://en.wikibooks.org/wiki/LaTeX/Foot ... rgin_Notes
and http://en.wikibooks.org/wiki/LaTeX/Page_Layout

I think it'll be best to split the text up insted of having one big pita in there...
LaTeX obviously has problems with that....

i hope this was useful :)

greez and happy TeXing :geek:
Attachments
TwoColumn2.pdf
(37.84 KiB) Downloaded 482 times
igor_igel
Posts: 7
Joined: Sun Mar 31, 2013 5:41 pm

multiple figures surrounded with freely floating text

Post by igor_igel »

Hi,

thank you very much for your answer!
That is the formatting I was looking for, but unfortunately my minimal example seems to be to minimal. The behaviour with the needed \documentclass[smallextended]{svjour3} is different, see the following pdf, which has been created by only changing the documentclass in the code you suggested.
bspfuerforum2.pdf
(33.03 KiB) Downloaded 517 times
Apparently svjour3 is not one of the standard documentclasses, and I can't find a standard class which is similar in the aspect, that it has a bar above each page. The problem with the bar is that its position and length is changed by the new geometry. In our version with \documentclass{article} that problem can may be seen in a less severe aspect: the page numberings position is changing.
I tried to fix that problem by changing the \hsize instead of the whole geometry by using

Code: Select all

\setlength{\hsize}{7cm}
instead of

Code: Select all

 \newgeometry{top=3cm, bottom=3cm,inner=3cm, outer=7cm, heightrounded, marginparwidth=5cm, marginparsep=-3cm}
what left the length and position of the bar (or with the documentclass article of the page numbering) untouched but now I can't get the figures on the right place, see
bspfuerforum3.pdf
(35.43 KiB) Downloaded 459 times
where exactly the two changes, the documentclass and the described change of the geometry have been embedded.
If you like I can find the link for the used documentclass.

Can you help me again?
User avatar
tommytex
Posts: 39
Joined: Wed Jan 23, 2013 10:04 pm

multiple figures surrounded with freely floating text

Post by tommytex »

hi :)

i'm very happy to have something to puzzle over tonight... :lol:

i downloaded the package i found on
http://www.e-publications.org/springer/ ... icago.html
The style you might want to have looks quite similar to fancyhdr which you can easily implement in your article...
i have to admit that i do not like your solution with

Code: Select all

\setlength{\hsize}{7cm}
. Instead i changed the parameters of geometry and left out the inner margin so latex kept the default value...

Code: Select all

\newgeometry{outer=9cm, heightrounded, marginparwidth=9cm, marginparsep=-4.5cm}
the figures are on the right place now but still stick out a bit :|

:?:

Code: Select all

\documentclass{article}
...

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{} 
\fancyhead[C]{} 
\fancyhead[R]{\thepage}
Attachments
TwoColumn3.pdf
(36.97 KiB) Downloaded 502 times
igor_igel
Posts: 7
Joined: Sun Mar 31, 2013 5:41 pm

Re: multiple figures surrounded with freely floating text

Post by igor_igel »

Yes that looks a lot like I dreamed of, thank you so much :)
How do you mean "implement fancyhdr into the article"? By using the \documentclass{article} and emulating the svjour3 style? Hopefully the editor will not become mad when we disassemble the springer style xD I am very curious about your solution.
User avatar
tommytex
Posts: 39
Joined: Wed Jan 23, 2013 10:04 pm

multiple figures surrounded with freely floating text

Post by tommytex »

hi igor,

sorry for expressing myself in such a bad way but that is what i meant.

yes you are right there are some difficulties with the springer stlye :|
i came up with the idea of using minipages...
the problem is that somehow the geometry package does not know how to "restore the geometry twice". i had to find out the default values of the svjour3 instead of the article documentclass...
somehow i managed to reconstruct the style in svjour3, too, but with some very small text on the left, so i used the command \normalsize in the minipage to get rid of the small font size...

here's the result :mrgreen:

Code: Select all

 \documentclass[smallextended]{svjour3}
\usepackage[english]{babel}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage{amsmath}

\usepackage{geometry}
\usepackage{marginnote}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[ER]{}
\fancyhead[OL]{}
\fancyhead[EL]{\thepage}%even left
\fancyhead[OR]{\thepage}%odd right



\begin{document}
This is the text of the previous section,
\lipsum[3]


\section*{Results}

Thats the text that should start with the results section with full page with, float besides the figures and continue on full page width after the figures are shown,\lipsum[40-43]

\newgeometry{top=3cm, bottom=3cm,inner=3.8cm, outer=2.5cm, heightrounded, marginparwidth=5cm, marginparsep=-3cm}
\newpage

\begin{figure}[h]
\begin{minipage}[ht]{0.5\textwidth}
\normalsize\lipsum[40-43]
\end{minipage}
\hfill
\begin{minipage}[ht]{0.3\textwidth}
\rule{5cm}{22cm}\\\caption{\normalsize some caption1}
\end{minipage}
\end{figure}

\restoregeometry

\begin{figure}[h]
\begin{minipage}[ht]{0.5\textwidth}
\normalsize\lipsum[40-43]
\end{minipage}
\hfill
\begin{minipage}[ht]{0.3\textwidth}
\rule{5cm}{22cm}\\\caption{\normalsize some caption1}
\end{minipage}
\end{figure}

\newgeometry{top=3cm, bottom=3cm,inner=3.8cm, outer=2.5cm, heightrounded, marginparwidth=0cm, marginparsep=0cm}
\lipsum[50-52]

\end{document}
Attachments
TwoColumn3.pdf
(47.82 KiB) Downloaded 2606 times
Post Reply