emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Latex image placement (...again. H vs. h!)
@ 2011-08-20 17:32 John Hendy
  2011-08-20 17:57 ` Thomas S. Dye
  2011-08-21  6:28 ` Stefan Nobis
  0 siblings, 2 replies; 6+ messages in thread
From: John Hendy @ 2011-08-20 17:32 UTC (permalink / raw)
  To: emacs-orgmode

Was just rediscovering how to properly get floats to drop in where I
want them in LaTeX export (right where I say vs. where LaTeX thinks is
convenient). I knew I'd posted on this about a year ago and was trying
to search for the thread. In the process, I came across this from the
manual [1]:

,---
| To modify the placement option of the floating environment,
| add something like ‘placement=[h!]’ to the attributes.
`---

Now, I'm not sure what all the options are, but this didn't work for
me. Only [H] properly dropped my floats in where I wanted them. Is
there a reason for this? In looking in wikibooks, they seem to
indicate that there are a few variants on the "here" option: [2]

,---
| h: Place the float here, i.e., approximately at the same point it occurs
| in the source text (however, not exactly at the spot)
|
| !: Override internal parameters Latex uses for determining "good"
float positions.
|
| H: Places the float at precisely the location in the LaTeX code.
| Requires the float package,[1] e.g., \usepackage{float}.
| This is somewhat equivalent to h!.
`---

So, does my need for [H] mean that LaTeX just really, really, really
wanted to space my images differently than I wanted? It does seem like
h! *should* work based on the wikibooks description, but it didn't. Is
[H] the only absolutely positive way to make sure floats are right
where you want them based on the surrounding text?

Thanks,
John

---
[1] http://orgmode.org/manual/Images-in-LaTeX-export.html
[2] http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Latex image placement (...again. H vs. h!)
  2011-08-20 17:32 Latex image placement (...again. H vs. h!) John Hendy
@ 2011-08-20 17:57 ` Thomas S. Dye
  2011-08-21 14:00   ` John Hendy
  2011-08-21  6:28 ` Stefan Nobis
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas S. Dye @ 2011-08-20 17:57 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

John Hendy <jw.hendy@gmail.com> writes:

> Was just rediscovering how to properly get floats to drop in where I
> want them in LaTeX export (right where I say vs. where LaTeX thinks is
> convenient). I knew I'd posted on this about a year ago and was trying
> to search for the thread. In the process, I came across this from the
> manual [1]:
>
> ,---
> | To modify the placement option of the floating environment,
> | add something like ‘placement=[h!]’ to the attributes.
> `---
>
> Now, I'm not sure what all the options are, but this didn't work for
> me. Only [H] properly dropped my floats in where I wanted them. Is
> there a reason for this? In looking in wikibooks, they seem to
> indicate that there are a few variants on the "here" option: [2]
>
> ,---
> | h: Place the float here, i.e., approximately at the same point it occurs
> | in the source text (however, not exactly at the spot)
> |
> | !: Override internal parameters Latex uses for determining "good"
> float positions.
> |
> | H: Places the float at precisely the location in the LaTeX code.
> | Requires the float package,[1] e.g., \usepackage{float}.
> | This is somewhat equivalent to h!.
> `---
>
> So, does my need for [H] mean that LaTeX just really, really, really
> wanted to space my images differently than I wanted? It does seem like
> h! *should* work based on the wikibooks description, but it didn't. Is
> [H] the only absolutely positive way to make sure floats are right
> where you want them based on the surrounding text?
>
> Thanks,
> John
>
> ---
> [1] http://orgmode.org/manual/Images-in-LaTeX-export.html
> [2] http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions
>
>

Hi John,

I think of [h!] as "try really hard to place the float here" and [H] as
"place the float here regardless of the consequences."

All the best,
Tom
-- 
Thomas S. Dye
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Latex image placement (...again. H vs. h!)
  2011-08-20 17:32 Latex image placement (...again. H vs. h!) John Hendy
  2011-08-20 17:57 ` Thomas S. Dye
@ 2011-08-21  6:28 ` Stefan Nobis
  2011-08-21 14:00   ` John Hendy
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Nobis @ 2011-08-21  6:28 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 993 bytes --]

John Hendy <jw.hendy@gmail.com> writes:

> Was just rediscovering how to properly get floats to drop in where I
> want them in LaTeX export (right where I say vs. where LaTeX thinks
> is convenient).

Another way to tackle this problem may be to just not use floats. As
the name suggests, these construct is meant to let things float. :)

If you want a figure or table to be placed at exactly the point where
you place it, why are you using a float environment? Most people
answer at this point, because they want the captions and all examples
with captions use the float environment. Thats because with captions
and in the general case it makes sense to let LaTeX find the right
place for these things.

If you want exact, controlled placements and also a caption, have a
look at the package 'caption' (version 3.1, author Axel
Sommerfeldt). Then you can get rid of floats and don't have to bother
with obscure placement rules. :)

-- 
Until the next mail...,
Stefan.

[-- Attachment #2: Type: application/pgp-signature, Size: 454 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Latex image placement (...again. H vs. h!)
  2011-08-21  6:28 ` Stefan Nobis
@ 2011-08-21 14:00   ` John Hendy
  2011-08-21 14:20     ` Ista Zahn
  0 siblings, 1 reply; 6+ messages in thread
From: John Hendy @ 2011-08-21 14:00 UTC (permalink / raw)
  To: Stefan Nobis; +Cc: emacs-orgmode

On Sun, Aug 21, 2011 at 1:28 AM, Stefan Nobis <stefan-ml@snobis.de> wrote:
> John Hendy <jw.hendy@gmail.com> writes:
>
>> Was just rediscovering how to properly get floats to drop in where I
>> want them in LaTeX export (right where I say vs. where LaTeX thinks
>> is convenient).
>
> Another way to tackle this problem may be to just not use floats. As
> the name suggests, these construct is meant to let things float. :)
>
> If you want a figure or table to be placed at exactly the point where
> you place it, why are you using a float environment? Most people
> answer at this point, because they want the captions and all examples
> with captions use the float environment. Thats because with captions
> and in the general case it makes sense to let LaTeX find the right
> place for these things.

Huh. I didn't realize the captions triggered something than just using
[[./path/to/image]] with attr_latex options passed. I just duplicated
the same section and removed all captions as well as placement=[H]
options and they exported right where I would have wanted them. That's
interesting -- learned something new!

>
> If you want exact, controlled placements and also a caption, have a
> look at the package 'caption' (version 3.1, author Axel
> Sommerfeldt). Then you can get rid of floats and don't have to bother
> with obscure placement rules. :)

I'll definitely take a look at that. I may also just use descriptive
intros prior to each picture, as that would do the same as a caption,
I suppose. It's just weird to me that sometimes the floats don't drop
until a later section, in which case I think that's definitely *too*
late. Sure, if they dump at the end of Section 1.1, fine -- that's
where they are discussed. But now they're showing up in 1.2?


Thanks,
John

>
> --
> Until the next mail...,
> Stefan.
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Latex image placement (...again. H vs. h!)
  2011-08-20 17:57 ` Thomas S. Dye
@ 2011-08-21 14:00   ` John Hendy
  0 siblings, 0 replies; 6+ messages in thread
From: John Hendy @ 2011-08-21 14:00 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs-orgmode

> Hi John,
>
> I think of [h!] as "try really hard to place the float here" and [H] as
> "place the float here regardless of the consequences."
>

Great way to put it!

Thanks,
John

> All the best,
> Tom
> --
> Thomas S. Dye
> http://www.tsdye.com
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Latex image placement (...again. H vs. h!)
  2011-08-21 14:00   ` John Hendy
@ 2011-08-21 14:20     ` Ista Zahn
  0 siblings, 0 replies; 6+ messages in thread
From: Ista Zahn @ 2011-08-21 14:20 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode, Stefan Nobis

On Sun, Aug 21, 2011 at 10:00 AM, John Hendy <jw.hendy@gmail.com> wrote:
> On Sun, Aug 21, 2011 at 1:28 AM, Stefan Nobis <stefan-ml@snobis.de> wrote:
>> John Hendy <jw.hendy@gmail.com> writes:
>>
>>> Was just rediscovering how to properly get floats to drop in where I
>>> want them in LaTeX export (right where I say vs. where LaTeX thinks
>>> is convenient).
>>
>> Another way to tackle this problem may be to just not use floats. As
>> the name suggests, these construct is meant to let things float. :)
>>
>> If you want a figure or table to be placed at exactly the point where
>> you place it, why are you using a float environment? Most people
>> answer at this point, because they want the captions and all examples
>> with captions use the float environment. Thats because with captions
>> and in the general case it makes sense to let LaTeX find the right
>> place for these things.
>
> Huh. I didn't realize the captions triggered something than just using
> [[./path/to/image]] with attr_latex options passed. I just duplicated
> the same section and removed all captions as well as placement=[H]
> options and they exported right where I would have wanted them. That's
> interesting -- learned something new!
>
>>
>> If you want exact, controlled placements and also a caption, have a
>> look at the package 'caption' (version 3.1, author Axel
>> Sommerfeldt). Then you can get rid of floats and don't have to bother
>> with obscure placement rules. :)
>
> I'll definitely take a look at that. I may also just use descriptive
> intros prior to each picture, as that would do the same as a caption,
> I suppose. It's just weird to me that sometimes the floats don't drop
> until a later section, in which case I think that's definitely *too*
> late. Sure, if they dump at the end of Section 1.1, fine -- that's
> where they are discussed. But now they're showing up in 1.2?

The placeins package offers a solution to this problem.

Best,
Ista

>
>
> Thanks,
> John
>
>>
>> --
>> Until the next mail...,
>> Stefan.
>>
>
>



-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-08-21 14:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-20 17:32 Latex image placement (...again. H vs. h!) John Hendy
2011-08-20 17:57 ` Thomas S. Dye
2011-08-21 14:00   ` John Hendy
2011-08-21  6:28 ` Stefan Nobis
2011-08-21 14:00   ` John Hendy
2011-08-21 14:20     ` Ista Zahn

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).