emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Align argument in #+attr_latex for tabular env. is whitespace sensitive
@ 2013-02-12 17:30 John Hendy
  2013-02-12 19:22 ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: John Hendy @ 2013-02-12 17:30 UTC (permalink / raw)
  To: emacs-orgmode

Was not getting the results I expected from #+attr_latex, so I created
a simplified table to test:

#+begin_src org

Centered (will be sent to LaTeX as =\begin{tabular}{cc}=:

#+attr_latex: align=cc
| test           | test |
| test of longer | test |

Left aligned (will be sent to LaTeX as =\begin{tabular}{ll}=:

#+attr_latex: align = cc
| test           | test |
| test of longer | test |

#+end_src

If there's reason for this, I can change my habits. I guess from
various tidy programming habits, I'm just in the practice of
separating equal signs with surrounding white space for easier
readability. For what it's worth, these two behave identically:

#+attr_latex: width=5cm
#+attr_latex: width = 5cm

I'm not sure why the tabular align argument is behaving differently.


Thanks for any feedback,
john

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

* Re: Align argument in #+attr_latex for tabular env. is whitespace sensitive
  2013-02-12 17:30 Align argument in #+attr_latex for tabular env. is whitespace sensitive John Hendy
@ 2013-02-12 19:22 ` Nicolas Goaziou
  2013-02-12 19:40   ` John Hendy
  2013-02-15 10:05   ` Sebastien Vauban
  0 siblings, 2 replies; 9+ messages in thread
From: Nicolas Goaziou @ 2013-02-12 19:22 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

Hello,

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

> Was not getting the results I expected from #+attr_latex, so I created
> a simplified table to test:
>
> #+begin_src org
>
> Centered (will be sent to LaTeX as =\begin{tabular}{cc}=:
>
> #+attr_latex: align=cc
> | test           | test |
> | test of longer | test |
>
> Left aligned (will be sent to LaTeX as =\begin{tabular}{ll}=:
>
> #+attr_latex: align = cc
> | test           | test |
> | test of longer | test |
>
> #+end_src
>
> If there's reason for this, I can change my habits. I guess from
> various tidy programming habits, I'm just in the practice of
> separating equal signs with surrounding white space for easier
> readability. For what it's worth, these two behave identically:
>
> #+attr_latex: width=5cm
> #+attr_latex: width = 5cm
>
> I'm not sure why the tabular align argument is behaving differently.

This syntax is wrong anyway. It should be:

  #+attr_latex: :width "5cm"

or 

  #+attr_latex: :width 5cm

The same goes for :align. Also, for simple alignment strings, you can
provide align cookies within the table.


Regards,

-- 
Nicolas Goaziou

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

* Re: Align argument in #+attr_latex for tabular env. is whitespace sensitive
  2013-02-12 19:22 ` Nicolas Goaziou
@ 2013-02-12 19:40   ` John Hendy
  2013-02-12 19:44     ` Nicolas Goaziou
  2013-02-15 10:05   ` Sebastien Vauban
  1 sibling, 1 reply; 9+ messages in thread
From: John Hendy @ 2013-02-12 19:40 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

On Tue, Feb 12, 2013 at 1:22 PM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> Hello,
>
> John Hendy <jw.hendy@gmail.com> writes:
>
>> Was not getting the results I expected from #+attr_latex, so I created
>> a simplified table to test:
>>
>> #+begin_src org
>>
>> Centered (will be sent to LaTeX as =\begin{tabular}{cc}=:
>>
>> #+attr_latex: align=cc
>> | test           | test |
>> | test of longer | test |
>>
>> Left aligned (will be sent to LaTeX as =\begin{tabular}{ll}=:
>>
>> #+attr_latex: align = cc
>> | test           | test |
>> | test of longer | test |
>>
>> #+end_src
>>
>> If there's reason for this, I can change my habits. I guess from
>> various tidy programming habits, I'm just in the practice of
>> separating equal signs with surrounding white space for easier
>> readability. For what it's worth, these two behave identically:
>>
>> #+attr_latex: width=5cm
>> #+attr_latex: width = 5cm
>>
>> I'm not sure why the tabular align argument is behaving differently.
>
> This syntax is wrong anyway. It should be:
>
>   #+attr_latex: :width "5cm"
>
> or
>
>   #+attr_latex: :width 5cm
>
> The same goes for :align. Also, for simple alignment strings, you can
> provide align cookies within the table.

Ah. Very good to know. Is this documented? This is the syntax I use
for babel blocks, but I've never seen it for #+attr_latex. The manual
also doesn't show any =:option "value"= methods, at least in my
initial peruse:
- http://orgmode.org/manual/Tables-in-LaTeX-export.html
- http://orgmode.org/manual/Images-in-LaTeX-export.html#Images-in-LaTeX-export

It's all in `option=value` format.

Is your syntax (including the comment about cookies, as I haven't seen
that in the org manual either) relevant for the old exporter, or only
the new one? As I said, this is using the old exporter and I haven't
migrated over yet...

Thanks for the prompt response!
John

>
>
> Regards,
>
> --
> Nicolas Goaziou

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

* Re: Align argument in #+attr_latex for tabular env. is whitespace sensitive
  2013-02-12 19:40   ` John Hendy
@ 2013-02-12 19:44     ` Nicolas Goaziou
  2013-02-12 19:51       ` John Hendy
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2013-02-12 19:44 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

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

> On Tue, Feb 12, 2013 at 1:22 PM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>> Hello,
>>
>> John Hendy <jw.hendy@gmail.com> writes:
>>
>>> Was not getting the results I expected from #+attr_latex, so I created
>>> a simplified table to test:
>>>
>>> #+begin_src org
>>>
>>> Centered (will be sent to LaTeX as =\begin{tabular}{cc}=:
>>>
>>> #+attr_latex: align=cc
>>> | test           | test |
>>> | test of longer | test |
>>>
>>> Left aligned (will be sent to LaTeX as =\begin{tabular}{ll}=:
>>>
>>> #+attr_latex: align = cc
>>> | test           | test |
>>> | test of longer | test |
>>>
>>> #+end_src
>>>
>>> If there's reason for this, I can change my habits. I guess from
>>> various tidy programming habits, I'm just in the practice of
>>> separating equal signs with surrounding white space for easier
>>> readability. For what it's worth, these two behave identically:
>>>
>>> #+attr_latex: width=5cm
>>> #+attr_latex: width = 5cm
>>>
>>> I'm not sure why the tabular align argument is behaving differently.
>>
>> This syntax is wrong anyway. It should be:
>>
>>   #+attr_latex: :width "5cm"
>>
>> or
>>
>>   #+attr_latex: :width 5cm
>>
>> The same goes for :align. Also, for simple alignment strings, you can
>> provide align cookies within the table.
>
> Ah. Very good to know. Is this documented? 

It was only announced on this ML.

> This is the syntax I use for babel blocks, but I've never seen it for
> #+attr_latex. The manual also doesn't show any =:option "value"=
> methods, at least in my initial peruse:
> - http://orgmode.org/manual/Tables-in-LaTeX-export.html
> - http://orgmode.org/manual/Images-in-LaTeX-export.html#Images-in-LaTeX-export
>
> It's all in `option=value` format.
>
> Is your syntax (including the comment about cookies, as I haven't seen
> that in the org manual either) relevant for the old exporter, or only
> the new one? As I said, this is using the old exporter and I haven't
> migrated over yet...

The Babel-like syntax is only relevant for the new exporter.

The old exporter had some support for align cookies in table (depending
on the back-end).


Regards,

-- 
Nicolas Goaziou

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

* Re: Align argument in #+attr_latex for tabular env. is whitespace sensitive
  2013-02-12 19:44     ` Nicolas Goaziou
@ 2013-02-12 19:51       ` John Hendy
  0 siblings, 0 replies; 9+ messages in thread
From: John Hendy @ 2013-02-12 19:51 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

On Tue, Feb 12, 2013 at 1:44 PM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> John Hendy <jw.hendy@gmail.com> writes:
>
>> On Tue, Feb 12, 2013 at 1:22 PM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>>> Hello,
>>>
>>> John Hendy <jw.hendy@gmail.com> writes:
>>>
>>>> Was not getting the results I expected from #+attr_latex, so I created
>>>> a simplified table to test:
>>>>
>>>> #+begin_src org
>>>>
>>>> Centered (will be sent to LaTeX as =\begin{tabular}{cc}=:
>>>>
>>>> #+attr_latex: align=cc
>>>> | test           | test |
>>>> | test of longer | test |
>>>>
>>>> Left aligned (will be sent to LaTeX as =\begin{tabular}{ll}=:
>>>>
>>>> #+attr_latex: align = cc
>>>> | test           | test |
>>>> | test of longer | test |
>>>>
>>>> #+end_src
>>>>
>>>> If there's reason for this, I can change my habits. I guess from
>>>> various tidy programming habits, I'm just in the practice of
>>>> separating equal signs with surrounding white space for easier
>>>> readability. For what it's worth, these two behave identically:
>>>>
>>>> #+attr_latex: width=5cm
>>>> #+attr_latex: width = 5cm
>>>>
>>>> I'm not sure why the tabular align argument is behaving differently.
>>>
>>> This syntax is wrong anyway. It should be:
>>>
>>>   #+attr_latex: :width "5cm"
>>>
>>> or
>>>
>>>   #+attr_latex: :width 5cm
>>>
>>> The same goes for :align. Also, for simple alignment strings, you can
>>> provide align cookies within the table.
>>
>> Ah. Very good to know. Is this documented?
>
> It was only announced on this ML.
>
>> This is the syntax I use for babel blocks, but I've never seen it for
>> #+attr_latex. The manual also doesn't show any =:option "value"=
>> methods, at least in my initial peruse:
>> - http://orgmode.org/manual/Tables-in-LaTeX-export.html
>> - http://orgmode.org/manual/Images-in-LaTeX-export.html#Images-in-LaTeX-export
>>
>> It's all in `option=value` format.
>>
>> Is your syntax (including the comment about cookies, as I haven't seen
>> that in the org manual either) relevant for the old exporter, or only
>> the new one? As I said, this is using the old exporter and I haven't
>> migrated over yet...
>
> The Babel-like syntax is only relevant for the new exporter.
>
> The old exporter had some support for align cookies in table (depending
> on the back-end).
>

Good to know. I guess this gives me reason to switch over!

John

>
> Regards,
>
> --
> Nicolas Goaziou

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

* Re: Align argument in #+attr_latex for tabular env. is whitespace sensitive
  2013-02-12 19:22 ` Nicolas Goaziou
  2013-02-12 19:40   ` John Hendy
@ 2013-02-15 10:05   ` Sebastien Vauban
  2013-02-15 13:08     ` Nicolas Goaziou
  1 sibling, 1 reply; 9+ messages in thread
From: Sebastien Vauban @ 2013-02-15 10:05 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Nicolas,

Nicolas Goaziou wrote:
> John Hendy <jw.hendy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>
>> For what it's worth, these two behave identically:
>>
>> #+attr_latex: width=5cm
>> #+attr_latex: width = 5cm
>>
>> I'm not sure why the tabular align argument is behaving differently.
>
> This syntax is wrong anyway. It should be:
>
>   #+attr_latex: :width "5cm"
>
> or
>
>   #+attr_latex: :width 5cm

From the tests I made on images, with the Beamer back-end, those did not work.
It had to be:

    #+ATTR_LaTeX: :options "width=5cm"

Right?

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: Align argument in #+attr_latex for tabular env. is whitespace sensitive
  2013-02-15 10:05   ` Sebastien Vauban
@ 2013-02-15 13:08     ` Nicolas Goaziou
  2013-02-15 18:53       ` Sebastien Vauban
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2013-02-15 13:08 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

>> This syntax is wrong anyway. It should be:
>>
>>   #+attr_latex: :width "5cm"
>>
>> or
>>
>>   #+attr_latex: :width 5cm
>
> From the tests I made on images, with the Beamer back-end, those did not work.
> It had to be:
>
>     #+ATTR_LaTeX: :options "width=5cm"
>
> Right?

Correct. :width is for tables.


Regards,

-- 
Nicolas Goaziou

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

* Re: Align argument in #+attr_latex for tabular env. is whitespace sensitive
  2013-02-15 13:08     ` Nicolas Goaziou
@ 2013-02-15 18:53       ` Sebastien Vauban
  2013-02-15 19:44         ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Sebastien Vauban @ 2013-02-15 18:53 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Nicolas,

Nicolas Goaziou wrote:
> "Sebastien Vauban" writes:
>
>>> This syntax is wrong anyway. It should be:
>>>
>>>   #+attr_latex: :width "5cm"
>>>
>>> or
>>>
>>>   #+attr_latex: :width 5cm
>>
>> From the tests I made on images, with the Beamer back-end, those did not work.
>> It had to be:
>>
>>     #+ATTR_LaTeX: :options "width=5cm"
>>
>> Right?
>
> Correct. :width is for tables.

Thanks.

For my information (and not only for me, I guess), is there a fundamental
reason (I guess yes) why width is a first-class parameter for tables and an
option among others for images?

Looking from a 50 ft perspective, I would even imagine the opposite: images
will have to be scales in almost all cases (that is: have their image
attribute set), while tables will often take the space they need to.

Is there a reason why images can't have their own attributes as well?  I would
find that much, much more easy to apply, if we don't have to write the same
"functional" request in two different manners, depending on the context.

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: Align argument in #+attr_latex for tabular env. is whitespace sensitive
  2013-02-15 18:53       ` Sebastien Vauban
@ 2013-02-15 19:44         ` Nicolas Goaziou
  0 siblings, 0 replies; 9+ messages in thread
From: Nicolas Goaziou @ 2013-02-15 19:44 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Hello,

"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

> For my information (and not only for me, I guess), is there a fundamental
> reason (I guess yes) why width is a first-class parameter for tables and an
> option among others for images?
>
> Looking from a 50 ft perspective, I would even imagine the opposite: images
> will have to be scales in almost all cases (that is: have their image
> attribute set), while tables will often take the space they need to.
>
> Is there a reason why images can't have their own attributes as well?  I would
> find that much, much more easy to apply, if we don't have to write the same
> "functional" request in two different manners, depending on the
> context.

It's LaTeX's fault!

In tables, width is an argument between curly brackets. In other words,
it has a specific location among the command arguments. On the other
hand, in images, width is just an option between square brackets. And
the same brackets can contain other options.

So, the easiest implementation was to follow LaTeX's conventions. An
argument within curly brackets gets its own keyword. Optional arguments
are stuffed within an `:options' keyword.

With care[fn:1], "width" option could be extracted from `:options'
keyword and get its own `:width' keyword. Do you want to give it a try?


Regards,

[fn:1] By deciding what to do when width is specified in both :options
and :width keyword, for example.


-- 
Nicolas Goaziou

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

end of thread, other threads:[~2013-02-15 19:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-12 17:30 Align argument in #+attr_latex for tabular env. is whitespace sensitive John Hendy
2013-02-12 19:22 ` Nicolas Goaziou
2013-02-12 19:40   ` John Hendy
2013-02-12 19:44     ` Nicolas Goaziou
2013-02-12 19:51       ` John Hendy
2013-02-15 10:05   ` Sebastien Vauban
2013-02-15 13:08     ` Nicolas Goaziou
2013-02-15 18:53       ` Sebastien Vauban
2013-02-15 19:44         ` Nicolas Goaziou

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