Graphics, Figures & Tablesfigures spillover

Information and discussion about graphics, figures & tables in LaTeX documents.
syounis
Posts: 12
Joined: Tue Apr 05, 2011 12:14 pm

figures spillover

Post by syounis »

hi,

i have a problem of figures from a previuos section (or even chapter) spill over to the next section how can i prevent this from happening?

i want a structure that will look like this

***section 1***
text 1
fig 1.1
fig 1.2
***section 2***
text 2
fig 2.1
fig 2.2

please help, i don't know how to even call this issue

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

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

figures spillover

Post by Stefan Kottwitz »

Hi syounis,

welcome to the board!

You could use the placeins package for that:

Code: Select all

\usepackage[section]{placeins}
This prevents figures from floating across section boundaries. To set you own barriers, you could use the command \FloatBarrier after you have loaded placeins in your preamble.

Often it's recommendable to extend figure placement options. You could learn more about that in the free sample chapter Creating Tables and Inserting Pictures, in the last part, Controlling the placement of figures and tables.

Stefan
LaTeX.org admin
syounis
Posts: 12
Joined: Tue Apr 05, 2011 12:14 pm

Re: figures spillover

Post by syounis »

wow man!

thnx a lot!!

one problem solved

i still though have the text that follows SOME of the picture "glued" to the caption so as one might think that the caption continues on

how can i force a space between the caption and the rest of the text? (i want to do what an "enter" command does in word after the caption)

also, for some reason "\centering" works only on the picture and not on the caption that stays to the left
i didn't see you writing additional commands to get your captions aligned so what is this issue?
thnx in advance mate!!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

figures spillover

Post by Stefan Kottwitz »

Hi syounis,

I recommend to use the caption package. It provides features for justifying captions and for customizing their spacing, just have a look at the package documentation. It's a great package and well documented.

Stefan
LaTeX.org admin
syounis
Posts: 12
Joined: Tue Apr 05, 2011 12:14 pm

Re: figures spillover

Post by syounis »

thnx again, that was pretty helpful!

only thing left is the damn pdf font issue

my supervisor can't edit my pdfs generated with latex because of font issues. why doesn't latex use a normal standard font instead of this weird nimbus thing?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

figures spillover

Post by Stefan Kottwitz »

I guess with "normal standard font" you mean a Truetype font? LaTeX fonts are usually higher quality Type 1 fonts.

If you would like to use Truetype fonts, you could use XeLaTeX.

Stefan
LaTeX.org admin
syounis
Posts: 12
Joined: Tue Apr 05, 2011 12:14 pm

Re: figures spillover

Post by syounis »

hi again,

i found a XelateX link on the web and tried running a sample code i found there to write in Tahuma but my editor (latex editor, LEd) said that something called XeteX is required, i've never installed packages into latex. where can i get a windows version of xetex and how can i install it on my system?

Regards,
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: figures spillover

Post by Stefan Kottwitz »

XeTeX is supported by MiKTeX and by TeX Live. Probably it's already on your system and you just need to call xelatex instead of latex/pdflatex.

For example, the editor TeXworks supports XeLaTeX among various engines: just choose XeLaTeX in a drop down list of TeX engines to compile.

Other editors may handle it differently, it may be required to change the compiling command line in the editor options in order to use xelatex. You also could use xelatex on the command prompt.

Stefan
LaTeX.org admin
syounis
Posts: 12
Joined: Tue Apr 05, 2011 12:14 pm

Re: figures spillover

Post by syounis »

yea yea yaahhhhhhhhh

FAAAAANtastic....finally!

i can write (and edit) with pagella!!!!pagella!!

dude you'RE the man!
syounis
Posts: 12
Joined: Tue Apr 05, 2011 12:14 pm

Re: figures spillover

Post by syounis »

well...my joy was a bit too soon. the sample file worked ok but when i tried to run my actual file (which had previously: \usepackage[T1]{fontenc})
it ran ok but gave me (editable) pagella jibrish (i used \usepackage{fontspec} instead as that was the way the sample code was given

what's his problem now?
Post Reply