emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Positioning of images - export to LaTeX
@ 2015-03-10 14:13 Rainer M Krug
  2015-03-10 14:29 ` John Hendy
  2015-03-10 14:35 ` Rasmus
  0 siblings, 2 replies; 4+ messages in thread
From: Rainer M Krug @ 2015-03-10 14:13 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi

I am struggling with float positioning. I would like to have a float at
the bottom of a page. Consider the following code:

--8<---------------cut here---------------start------------->8---
* Some text
#+NAME: test
#+begin_src R :exports results :file-ext pdf :results graphics :width 8 :height 3
plot(runif(100))
#+end_src

#+RESULTS: test
[[file:test.pdf]]
--8<---------------cut here---------------end--------------->8---

which produces a pdf with the float directly after the heading. Now I
would like to have the float at the bottom of the page.

I know about the float placement option, but how can I use them from
org? I have seem
http://orgmode.org/manual/LaTeX-specific-attributes.html but where do I
c=have to put the

,----
| #+ATTR_LATEX: :placement {b}
`----

so that the float is at the bottom of the page?

Rainer

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

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

* Re: Positioning of images - export to LaTeX
  2015-03-10 14:13 Positioning of images - export to LaTeX Rainer M Krug
@ 2015-03-10 14:29 ` John Hendy
  2015-03-10 14:49   ` Rainer M Krug
  2015-03-10 14:35 ` Rasmus
  1 sibling, 1 reply; 4+ messages in thread
From: John Hendy @ 2015-03-10 14:29 UTC (permalink / raw)
  To: Rainer M Krug; +Cc: emacs-orgmode

On Tue, Mar 10, 2015 at 9:13 AM, Rainer M Krug <Rainer@krugs.de> wrote:
> Hi
>
> I am struggling with float positioning. I would like to have a float at
> the bottom of a page. Consider the following code:
>
> --8<---------------cut here---------------start------------->8---
> * Some text
> #+NAME: test
> #+begin_src R :exports results :file-ext pdf :results graphics :width 8 :height 3
> plot(runif(100))
> #+end_src
>
> #+RESULTS: test
> [[file:test.pdf]]
> --8<---------------cut here---------------end--------------->8---
>
> which produces a pdf with the float directly after the heading. Now I
> would like to have the float at the bottom of the page.
>
> I know about the float placement option, but how can I use them from
> org? I have seem
> http://orgmode.org/manual/LaTeX-specific-attributes.html but where do I
> c=have to put the
>
> ,----
> | #+ATTR_LATEX: :placement {b}
> `----
>
> so that the float is at the bottom of the page?

Latex attributes have to go above the =#+results: name= line so that
babel doesn't get confused. If you put it in between the name and file
link, re-running the block will generate a new one, as babel won't
recognize it. This seems to work for me, though from a previous email
I took a cue that I believe you need to also specify it as a float.[1]
Someone else can correct if that's wrong!

#+begin_src org

#+attr_latex: :float t :placement [b]
#+RESULTS: test
[[file:test.pdf]]

#+end_src

I get this as a result:

#+begin_src latex

\section{Some text}
\label{sec-1}
\begin{figure}[b]
\centering
\includegraphics[width=.9\linewidth]{test2.pdf}
\end{figure}

#+end_src

[1] https://www.mail-archive.com/emacs-orgmode@gnu.org/msg82889.html


This pushes it to the bottom for me!



John

>
> Rainer
>
> --
> Rainer M. Krug
> email: Rainer<at>krugs<dot>de
> PGP: 0x0F52F982

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

* Re: Positioning of images - export to LaTeX
  2015-03-10 14:13 Positioning of images - export to LaTeX Rainer M Krug
  2015-03-10 14:29 ` John Hendy
@ 2015-03-10 14:35 ` Rasmus
  1 sibling, 0 replies; 4+ messages in thread
From: Rasmus @ 2015-03-10 14:35 UTC (permalink / raw)
  To: emacs-orgmode


> I am struggling with float positioning. I would like to have a float at
> the bottom of a page.

Maybe something like this:

* Some text
#+LATEX_HEADER: \renewcommand{\topfraction}{1}
#+LATEX_HEADER: \renewcommand{\bottomfraction}{1}

#+NAME: test
#+begin_src R :exports results :file-ext pdf :results graphics :width 8 :height 3
plot(runif(100))
#+end_src

#+ATTR_LATEX: :placement [b]
#+CAPTION: my fig
#+RESULTS: test
[[file:test.pdf]]


-- 
Hvor meget poesi tror De kommer ud af et glas isvand?

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

* Re: Positioning of images - export to LaTeX
  2015-03-10 14:29 ` John Hendy
@ 2015-03-10 14:49   ` Rainer M Krug
  0 siblings, 0 replies; 4+ messages in thread
From: Rainer M Krug @ 2015-03-10 14:49 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

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

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

> On Tue, Mar 10, 2015 at 9:13 AM, Rainer M Krug <Rainer@krugs.de> wrote:
>> Hi
>>
>> I am struggling with float positioning. I would like to have a float at
>> the bottom of a page. Consider the following code:
>>
>> --8<---------------cut here---------------start------------->8---
>> * Some text
>> #+NAME: test
>> #+begin_src R :exports results :file-ext pdf :results graphics :width 8 :height 3
>> plot(runif(100))
>> #+end_src
>>
>> #+RESULTS: test
>> [[file:test.pdf]]
>> --8<---------------cut here---------------end--------------->8---
>>
>> which produces a pdf with the float directly after the heading. Now I
>> would like to have the float at the bottom of the page.
>>
>> I know about the float placement option, but how can I use them from
>> org? I have seem
>> http://orgmode.org/manual/LaTeX-specific-attributes.html but where do I
>> c=have to put the
>>
>> ,----
>> | #+ATTR_LATEX: :placement {b}
>> `----
>>
>> so that the float is at the bottom of the page?
>
> Latex attributes have to go above the =#+results: name= line so that
> babel doesn't get confused. If you put it in between the name and file
> link, re-running the block will generate a new one, as babel won't
> recognize it. This seems to work for me, though from a previous email
> I took a cue that I believe you need to also specify it as a float.[1]
> Someone else can correct if that's wrong!

You are spot on. I was missing the =:float t= part.

Now it works.

Thanks a lot,

Rainer


>
> #+begin_src org
>
> #+attr_latex: :float t :placement [b]
> #+RESULTS: test
> [[file:test.pdf]]
>
> #+end_src
>
> I get this as a result:
>
> #+begin_src latex
>
> \section{Some text}
> \label{sec-1}
> \begin{figure}[b]
> \centering
> \includegraphics[width=.9\linewidth]{test2.pdf}
> \end{figure}
>
> #+end_src
>
> [1] https://www.mail-archive.com/emacs-orgmode@gnu.org/msg82889.html
>
>
> This pushes it to the bottom for me!
>
>
>
> John
>
>>
>> Rainer
>>
>> --
>> Rainer M. Krug
>> email: Rainer<at>krugs<dot>de
>> PGP: 0x0F52F982
>
>

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

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

end of thread, other threads:[~2015-03-10 14:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-10 14:13 Positioning of images - export to LaTeX Rainer M Krug
2015-03-10 14:29 ` John Hendy
2015-03-10 14:49   ` Rainer M Krug
2015-03-10 14:35 ` Rasmus

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