Re: [O] [BUG] attr_latex in new exporter

2013-03-09 Thread Thomas S. Dye
Aaron and Nicolas,

Nicolas Goaziou n.goaz...@gmail.com writes:

 Hello,

 aarone...@gmail.com writes:

 I think the following patch (on top of current master) will fix the
 problem:

 [...]

 It does. Thank you.


Works here now.  Thanks!

All the best,
Tom

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



Re: [O] [BUG] attr_latex in new exporter

2013-03-08 Thread Nicolas Goaziou
Hello,

t...@tsdye.com (Thomas S. Dye) writes:

 I think this behavior was introduced in the last week or so.

 This in the Org file:

 #+attr_latex: :height 2in
 [[file:saa-fig/wet-dry.jpeg]]

 yields this in LaTeX output:

 \begin{figure}[htb]
 \centering
 \includegraphics[width=.9\linewidth,height=2in]{saa-fig/wet-dry.jpeg}
 \end{figure}

 I think when :height is set, then the default :width should not be
 set.

I think it should be fixed. Could you confirm it?

Thank you for reporting it.


Regards,

-- 
Nicolas Goaziou



Re: [O] [BUG] attr_latex in new exporter

2013-03-08 Thread Thomas S. Dye
Nicolas Goaziou n.goaz...@gmail.com writes:

 Hello,

 t...@tsdye.com (Thomas S. Dye) writes:

 I think this behavior was introduced in the last week or so.

 This in the Org file:

 #+attr_latex: :height 2in
 [[file:saa-fig/wet-dry.jpeg]]

 yields this in LaTeX output:

 \begin{figure}[htb]
 \centering
 \includegraphics[width=.9\linewidth,height=2in]{saa-fig/wet-dry.jpeg}
 \end{figure}

 I think when :height is set, then the default :width should not be
 set.

 I think it should be fixed. Could you confirm it?

There is a change, but not a fix.

Now I get this:

\begin{figure}[htb]
\centering
\includegraphics[width=0.7\textwidth,height=2in]{saa-fig/wet-dry.jpeg}
\end{figure}

I'm expecting this:

\begin{figure}[htb]
\centering
\includegraphics[height=2in]{saa-fig/wet-dry.jpeg}
\end{figure}

In other words, I'm looking to preserve the aspect ratio of the source
image. 

All the best,
Tom

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



Re: [O] [BUG] attr_latex in new exporter

2013-03-08 Thread aaronecay
Hi Thomas,

I think the following patch (on top of current master) will fix the
problem:
-cut-here-
diff --git c/lisp/ox-latex.el w/lisp/ox-latex.el
index d17dd60..eefb272 100644
--- c/lisp/ox-latex.el
+++ w/lisp/ox-latex.el
@@ -1811,9 +1811,9 @@ used as a communication channel.
 ;; It is possible to specify width and height in the
 ;; ATTR_LATEX line, and also via default variables.
 (width (format %s (cond ((plist-get attr :width))
-  ((eq float 'figure) 0.7\\textwidth)
+   ((plist-get attr :height) )
+   ((eq float 'figure) 0.7\\textwidth)
   ((eq float 'wrap) 0.48\\textwidth)
-  ((plist-get attr :height) )
   (t org-latex-image-default-width
 (height (format %s (cond ((plist-get attr :height))
((or (plist-get attr :width)
-cut-here-

Nicolas, I’m not sure I understand the logic behind (memq float '(figure
wrap)) in the cond for setting height.  I think that it would be very
rare for someone to set the default height to something other than ,
but in the event that the user does so I don’t see why it shoudl make a
difference whether the image is floating or not.

-- 
Aaron Ecay



Re: [O] [BUG] attr_latex in new exporter

2013-03-08 Thread Nicolas Goaziou
Hello,

aarone...@gmail.com writes:

 I think the following patch (on top of current master) will fix the
 problem:

[...]

It does. Thank you.

 Nicolas, I’m not sure I understand the logic behind (memq float '(figure
 wrap)) in the cond for setting height.  I think that it would be very
 rare for someone to set the default height to something other than ,
 but in the event that the user does so I don’t see why it shoudl make a
 difference whether the image is floating or not.

figure and wrap float provide their own default width. A default height
would probably break image ratio in that case. So it is only used when
no width (implicit or explicit) is given.


Regards,

-- 
Nicolas Goaziou