emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Latex export bug? Odd behavior with figures...
@ 2010-05-25 22:26 John Hendy
  2010-05-26  3:37 ` Erik Iverson
  2010-05-26  4:23 ` Nick Dokos
  0 siblings, 2 replies; 7+ messages in thread
From: John Hendy @ 2010-05-25 22:26 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1861 bytes --]

Hi,

I've been working on a report and here is the relevant org file section
(edited for brevity and sanitization):

####### org file ########

* Main header
** Sub section
*** Experiment 1
- an unordered list of several points

|a|table|
|with|data|

**** Notes for experiment 1
blah blah blah

To illustrate the notes, here's a picture:

#+ATTR_LaTeX: width=12cm
#+CAPTION: View of something
[[~/Desktop/Pic1.pdf]]


When I change something, here's a picture of what happens:

#+CAPTION:  View of something else
#+ATTR_LaTeX: width=12cm
[[~/Desktop/Pic2.pdf]]

Some further comments on this.

*** Experiment 2
- An unordered list of several points

|a|table|
|with|data|

**** Notes for experiment 2
- An unordered list of several points

*** Experiment 3

####### org file ##########

Now, here's the order in the exported pdf:

####### latex export order #######
* Main header
** Sub section
*** Experiment 1
- an unordered list of several points

|a|table|
|with|data|

**** Notes for experiment 1
blah blah blah

To illustrate the notes, here's a picture:

*PICTURE 1 SHOULD BE HERE*

When I change something, here's a picture of what happens:

*PICTURE 2 SHOULD BE HERE*

Some further comments on this.

*PICTURE 1 IS ACTUALLY HERE*

*** Experiment 2
- An unordered list of several points

|a|table|
|with|data|

**** Notes for experiment 2
- An unordered list of several points

*PICTURE 2 IS ACTUALLY HERE*

*** Experiment 3
########### latex order ##############

I've inspected the generated .tex file and this shows up where expected in
both picture instances:

\begin{figure}[htb]
\centering
\includegraphics[width=12cm]{/home/jwhendy/Desktop/file[1/2].pdf}
\caption{text here}
\end{figure}

I have generated a pdf from the .tex file and the same happens -- I can't
figure out why it's sticking them in places where they are not called for.


John

[-- Attachment #1.2: Type: text/html, Size: 2286 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Latex export bug? Odd behavior with figures...
  2010-05-25 22:26 Latex export bug? Odd behavior with figures John Hendy
@ 2010-05-26  3:37 ` Erik Iverson
  2010-05-26  3:45   ` John Hendy
  2010-05-26  4:23 ` Nick Dokos
  1 sibling, 1 reply; 7+ messages in thread
From: Erik Iverson @ 2010-05-26  3:37 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

<snip>
> ########### latex order ##############
> 
> I've inspected the generated .tex file and this shows up where expected 
> in both picture instances:
> 
> \begin{figure}[htb]
> \centering
> \includegraphics[width=12cm]{/home/jwhendy/Desktop/file[1/2].pdf}
> \caption{text here}
> \end{figure}
> 
> I have generated a pdf from the .tex file and the same happens -- I 
> can't figure out why it's sticking them in places where they are not 
> called for.

Not at all an expert on this, but what if you substitute [!htb] instead of [htb] 
in the LaTeX and generate a PDF?  Obviously, not an org-mode solution, but does 
that do what you want?

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

* Re: Latex export bug? Odd behavior with figures...
  2010-05-26  3:37 ` Erik Iverson
@ 2010-05-26  3:45   ` John Hendy
  0 siblings, 0 replies; 7+ messages in thread
From: John Hendy @ 2010-05-26  3:45 UTC (permalink / raw)
  To: Erik Iverson; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1197 bytes --]

Just looked up what [htb] did and will definitely try that when I'm back at
work tomorrow. Though not identical, I have two other emails out to the
group that would be along these lines were this to be the solution. Namely:
what's the best way to pass particular options to LaTeX from org-mode?

Is there any clean way to pass some option like this with a figure or table
or what have you?

I'll try this tomorrow and post back. Thanks for the help.


John

On Wed, May 26, 2010 at 3:37 AM, Erik Iverson <eriki@ccbr.umn.edu> wrote:

> <snip>
>
>  ########### latex order ##############
>>
>> I've inspected the generated .tex file and this shows up where expected in
>> both picture instances:
>>
>> \begin{figure}[htb]
>> \centering
>> \includegraphics[width=12cm]{/home/jwhendy/Desktop/file[1/2].pdf}
>> \caption{text here}
>> \end{figure}
>>
>> I have generated a pdf from the .tex file and the same happens -- I can't
>> figure out why it's sticking them in places where they are not called for.
>>
>
> Not at all an expert on this, but what if you substitute [!htb] instead of
> [htb] in the LaTeX and generate a PDF?  Obviously, not an org-mode solution,
> but does that do what you want?
>

[-- Attachment #1.2: Type: text/html, Size: 1694 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Latex export bug? Odd behavior with figures...
  2010-05-25 22:26 Latex export bug? Odd behavior with figures John Hendy
  2010-05-26  3:37 ` Erik Iverson
@ 2010-05-26  4:23 ` Nick Dokos
  2010-05-26  7:11   ` Thomas S. Dye
  2010-05-26 14:00   ` Nick Dokos
  1 sibling, 2 replies; 7+ messages in thread
From: Nick Dokos @ 2010-05-26  4:23 UTC (permalink / raw)
  To: John Hendy; +Cc: nicholas.dokos, emacs-orgmode

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

> 
> I've inspected the generated .tex file and this shows up where expected in
> both picture instances:
> 
> \begin{figure}[htb]
> \centering
> \includegraphics[width=12cm]{/home/jwhendy/Desktop/file[1/2].pdf}
> \caption{text here}
> \end{figure}
> 

Figures (and tables) are floating environments: latex will place them
at or after the place where they are mentioned in the latex file, at
the first place where it finds space, consistent with the spec ([htb]
above).

You can try this:

#+ATTR_LaTeX: width=12cm placement=[H]

The spacing will probably be awful.

Another way to force the order is to forego the CAPTION: that will
translate the images into \includegraphics without the figure
environment. The spacing might be awful but the order will be preserved.

There was a discussion about such matters some time ago on the mailing
list (in particular, how CAPTIONS affect output), but I don't remember
the resolution and I'm too tired to go look. Seek and ye shall find.

You can also look in the TeX FAQ,
e.g. http://www.tex.ac.uk/cgi-bin/texfaq2html?label=figurehere, for
more.

HTH,
Nick

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

* Re: Latex export bug? Odd behavior with figures...
  2010-05-26  4:23 ` Nick Dokos
@ 2010-05-26  7:11   ` Thomas S. Dye
  2010-05-26 14:00   ` Nick Dokos
  1 sibling, 0 replies; 7+ messages in thread
From: Thomas S. Dye @ 2010-05-26  7:11 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

Hi John,

Roughly speaking, the larger the floating figure the farther it will  
float in LaTeX.  If there is a large floating figure at the beginning  
of a group of figures, then the later ones will dam up behind it and  
get pushed to the back of the document.  Often, changing figure size  
by a small amount works wonders.  I often try 90% first time around,  
then adjust for appearance and float placement.  This is one of the  
last things one does before a final printing (adjusting figure sizes  
can help eliminate widows and orphans), so you might want to work  
directly on the generated .tex file, rather than try to get it right  
at the org-mode stage.

HTH,
Tom

On May 25, 2010, at 6:23 PM, Nick Dokos wrote:

> John Hendy <jw.hendy@gmail.com> wrote:
>
>>
>> I've inspected the generated .tex file and this shows up where  
>> expected in
>> both picture instances:
>>
>> \begin{figure}[htb]
>> \centering
>> \includegraphics[width=12cm]{/home/jwhendy/Desktop/file[1/2].pdf}
>> \caption{text here}
>> \end{figure}
>>
>
> Figures (and tables) are floating environments: latex will place them
> at or after the place where they are mentioned in the latex file, at
> the first place where it finds space, consistent with the spec ([htb]
> above).
>
> You can try this:
>
> #+ATTR_LaTeX: width=12cm placement=[H]
>
> The spacing will probably be awful.
>
> Another way to force the order is to forego the CAPTION: that will
> translate the images into \includegraphics without the figure
> environment. The spacing might be awful but the order will be  
> preserved.
>
> There was a discussion about such matters some time ago on the mailing
> list (in particular, how CAPTIONS affect output), but I don't remember
> the resolution and I'm too tired to go look. Seek and ye shall find.
>
> You can also look in the TeX FAQ,
> e.g. http://www.tex.ac.uk/cgi-bin/texfaq2html?label=figurehere, for
> more.
>
> HTH,
> Nick
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Latex export bug? Odd behavior with figures...
  2010-05-26  4:23 ` Nick Dokos
  2010-05-26  7:11   ` Thomas S. Dye
@ 2010-05-26 14:00   ` Nick Dokos
  2010-05-26 21:43     ` John Hendy
  1 sibling, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2010-05-26 14:00 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> wrote:

> Figures (and tables) are floating environments: latex will place them
> at or after the place where they are mentioned in the latex file, at
> the first place where it finds space, consistent with the spec ([htb]
> above).
> 
Not quite right: depending on the spec, it *can* end up at the top of the
page with the reference in the text, i.e. *before* that reference.

> ...
> There was a discussion about such matters some time ago on the mailing
> list (in particular, how CAPTIONS affect output), but I don't remember
> the resolution and I'm too tired to go look. Seek and ye shall find.
> 

I looked this up: check

  http://thread.gmane.org/gmane.emacs.orgmode/17814

particularly Carsten's note of 2009/10/03.

Nick

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

* Re: Latex export bug? Odd behavior with figures...
  2010-05-26 14:00   ` Nick Dokos
@ 2010-05-26 21:43     ` John Hendy
  0 siblings, 0 replies; 7+ messages in thread
From: John Hendy @ 2010-05-26 21:43 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1558 bytes --]

Thanks everyone -- placement = [H] was exactly what I needed. I went back
and saw it in the manual paragraph as [h!]. Also, the mailing list
discussion was perfect as well.

One suggestion, then... why not just have a nice list of all possible
ATTR_LaTeX options? I have killed myself before looking for a simplified
list. Maybe even just common ones since perhaps any LaTeX option may be
passed?

I love this page, for example: http://orgmode.org/manual/Export-options.html

It is the holy grail of a simple reference when I need an answer quickly.
Why not the same for possible LaTeX attributes for figures and tables? That
would be awesome.

Thanks again, all.


John

On Wed, May 26, 2010 at 9:00 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> Nick Dokos <nicholas.dokos@hp.com> wrote:
>
> > Figures (and tables) are floating environments: latex will place them
> > at or after the place where they are mentioned in the latex file, at
> > the first place where it finds space, consistent with the spec ([htb]
> > above).
> >
> Not quite right: depending on the spec, it *can* end up at the top of the
> page with the reference in the text, i.e. *before* that reference.
>
> > ...
> > There was a discussion about such matters some time ago on the mailing
> > list (in particular, how CAPTIONS affect output), but I don't remember
> > the resolution and I'm too tired to go look. Seek and ye shall find.
> >
>
> I looked this up: check
>
>  http://thread.gmane.org/gmane.emacs.orgmode/17814
>
> particularly Carsten's note of 2009/10/03.
>
> Nick
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 2244 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2010-05-26 21:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-25 22:26 Latex export bug? Odd behavior with figures John Hendy
2010-05-26  3:37 ` Erik Iverson
2010-05-26  3:45   ` John Hendy
2010-05-26  4:23 ` Nick Dokos
2010-05-26  7:11   ` Thomas S. Dye
2010-05-26 14:00   ` Nick Dokos
2010-05-26 21:43     ` John Hendy

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).