emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Setting width of babel-generated image in LaTeX export?
@ 2012-10-24 21:08 Michael Gauland
  2012-10-24 21:51 ` myles english
  2012-10-24 21:55 ` Thomas S. Dye
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Gauland @ 2012-10-24 21:08 UTC (permalink / raw)
  To: emacs-orgmode

I'm having trouble specifying the width of an image I export to LaTeX (with
either the new or old exporter). The snippet below demonstrates my problem. It
uses plantuml to generate an image file, using ATTR_LaTeX to specify the width.
When exported, the .tex file specifies the default width (.9\linewidth) for the
first image; the second image correctly specifies a width of 4cm.

Am I doing something wrong, or is this a bug?
Thanks,
Mike

* Snippet
  #+ATTR_LaTeX[width=3cm]:
  #+BEGIN_SRC plantuml :file test-output.png
  FirstState: A Really Wide State To Make The Image Wider Than The Text
  SecondState: Another Really Wide State To Make The Image Wider Than The Text
  FirstState -right-> SecondState
  #+END_SRC

  #+RESULTS:
  [[file:test-output.png]]


  #+ATTR_LaTeX: width=4cm
  [[file:test-output.png]]

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

* Re: Setting width of babel-generated image in LaTeX export?
  2012-10-24 21:08 Setting width of babel-generated image in LaTeX export? Michael Gauland
@ 2012-10-24 21:51 ` myles english
  2012-10-24 21:55 ` Thomas S. Dye
  1 sibling, 0 replies; 4+ messages in thread
From: myles english @ 2012-10-24 21:51 UTC (permalink / raw)
  To: Michael Gauland; +Cc: emacs-orgmode


Hi Michael,

Michael Gauland writes:

> I'm having trouble specifying the width of an image I export to LaTeX (with
> either the new or old exporter). The snippet below demonstrates my problem. It
> uses plantuml to generate an image file, using ATTR_LaTeX to specify the width.
> When exported, the .tex file specifies the default width (.9\linewidth) for the
> first image; the second image correctly specifies a width of 4cm.
>
> Am I doing something wrong, or is this a bug?
> Thanks,
> Mike
>
> * Snippet
>   #+ATTR_LaTeX[width=3cm]:

Try:

#+ATTR_LaTeX: width=3cm

Myles

>   #+BEGIN_SRC plantuml :file test-output.png
>   FirstState: A Really Wide State To Make The Image Wider Than The Text
>   SecondState: Another Really Wide State To Make The Image Wider Than The Text
>   FirstState -right-> SecondState
>   #+END_SRC
>
>   #+RESULTS:
>   [[file:test-output.png]]
>
>
>   #+ATTR_LaTeX: width=4cm
>   [[file:test-output.png]]

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

* Re: Setting width of babel-generated image in LaTeX export?
  2012-10-24 21:08 Setting width of babel-generated image in LaTeX export? Michael Gauland
  2012-10-24 21:51 ` myles english
@ 2012-10-24 21:55 ` Thomas S. Dye
  2012-10-24 23:08   ` Michael Gauland
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas S. Dye @ 2012-10-24 21:55 UTC (permalink / raw)
  To: Michael Gauland; +Cc: emacs-orgmode

Aloha Mike,

Perhaps #+ATTR_LaTeX: width=3cm will work?  I don't believe the square
brackets following #+ATTR_LaTeX in your initial image are correct.

Here is how I've been generating figures for LaTeX export using the new
exporter:

#+name: fundamental-model
#+header: :exports results
#+header: :file fundamental-model.pdf
#+BEGIN_SRC dot
  graph G
        { 
        graph [margin="0.01"];
          d [label = "Dated event", shape ="box"];
          t [label = "Target event"];
          d -- t [label = "Association", dir = "both", len = 2];
          {rank=same; d t;}
          }
#+END_SRC          

#+CAPTION[The fundamental relationship of a chronological model]: 
#+CAPTION: The fundamental relationship of a chronological model based on radiometric dating.
#+ATTR_LaTeX: width=232pt
#+NAME: fig:fundamental
#+RESULTS: fundamental-model
[[file:fundamental-model.pdf]]

Naming the results lets me cross reference, e.g.,

These two types of events are often referred to as the dated
event and the target event, respectively (fig. [[fig:fundamental]]).

hth,
Tom


Michael Gauland <mikelygee@no8wireless.co.nz> writes:

> I'm having trouble specifying the width of an image I export to LaTeX (with
> either the new or old exporter). The snippet below demonstrates my problem. It
> uses plantuml to generate an image file, using ATTR_LaTeX to specify the width.
> When exported, the .tex file specifies the default width (.9\linewidth) for the
> first image; the second image correctly specifies a width of 4cm.
>
> Am I doing something wrong, or is this a bug?
> Thanks,
> Mike
>
> * Snippet
>   #+ATTR_LaTeX[width=3cm]:
>   #+BEGIN_SRC plantuml :file test-output.png
>   FirstState: A Really Wide State To Make The Image Wider Than The Text
>   SecondState: Another Really Wide State To Make The Image Wider Than The Text
>   FirstState -right-> SecondState
>   #+END_SRC
>
>   #+RESULTS:
>   [[file:test-output.png]]
>
>
>   #+ATTR_LaTeX: width=4cm
>   [[file:test-output.png]]
>
>
>
>

-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: Setting width of babel-generated image in LaTeX export?
  2012-10-24 21:55 ` Thomas S. Dye
@ 2012-10-24 23:08   ` Michael Gauland
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Gauland @ 2012-10-24 23:08 UTC (permalink / raw)
  To: emacs-orgmode

Thomas S. Dye <tsd <at> tsdye.com> writes:
> ...Here is how I've been generating figures for LaTeX export using the new
> exporter:

Thanks--that's just what I was looking for.

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

end of thread, other threads:[~2012-10-24 23:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-24 21:08 Setting width of babel-generated image in LaTeX export? Michael Gauland
2012-10-24 21:51 ` myles english
2012-10-24 21:55 ` Thomas S. Dye
2012-10-24 23:08   ` Michael Gauland

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