emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Comment lines interfere with figure options
@ 2015-10-30 12:23 Mark Edgington
  2015-10-30 13:56 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Edgington @ 2015-10-30 12:23 UTC (permalink / raw)
  To: emacs-orgmode

If I have some org-mode content that looks like this...

#+NAME: fig-myimage
#+CAPTION: Caption of Figure
#+ATTR_LaTeX: :width 5cm
#+RESULTS: myimage
[[file:images/myimage.png]]

then I get a centered figure with the appropriate width and caption
when exporting to LaTeX.  If, however, I add a comment (or two)
in-between one of the option-lines...

#+NAME: fig-myimage
#+CAPTION: Caption of Figure
# (this was the original width)
# +ATTR_LaTeX: width 10cm
#+ATTR_LaTeX: :width 5cm
#+RESULTS: myimage
[[file:images/myimage.png]]

then all of the settings above the comments are lost.  Would it be
difficult to modify org-mode so that comment-lines are ignored when
looking for a block of settings lines that precede an image?  This
seems like sensible behavior to me, and there are cases when it would
be convenient to annotate the options you've used, or to temporarily
replace one option-line with another by commenting one out.

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

* Re: Comment lines interfere with figure options
  2015-10-30 12:23 Comment lines interfere with figure options Mark Edgington
@ 2015-10-30 13:56 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2015-10-30 13:56 UTC (permalink / raw)
  To: Mark Edgington; +Cc: emacs-orgmode

Hello,

Mark Edgington <edgimar@gmail.com> writes:

> If I have some org-mode content that looks like this...
>
> #+NAME: fig-myimage
> #+CAPTION: Caption of Figure
> #+ATTR_LaTeX: :width 5cm
> #+RESULTS: myimage
> [[file:images/myimage.png]]
>
> then I get a centered figure with the appropriate width and caption
> when exporting to LaTeX.  If, however, I add a comment (or two)
> in-between one of the option-lines...
>
> #+NAME: fig-myimage
> #+CAPTION: Caption of Figure
> # (this was the original width)
> # +ATTR_LaTeX: width 10cm
> #+ATTR_LaTeX: :width 5cm
> #+RESULTS: myimage
> [[file:images/myimage.png]]
>
> then all of the settings above the comments are lost.  Would it be
> difficult to modify org-mode so that comment-lines are ignored when
> looking for a block of settings lines that precede an image?

It means introducing a special cases for comments (i.e.,
comments-in-attributes). I'm not a big fan of special cases.

However you can comment the attribute above the block, e.g.,

  # (this was the original width)
  # +ATTR_LaTeX: width 10cm
  #+NAME: fig-myimage
  #+CAPTION: Caption of Figure
  #+ATTR_LaTeX: :width 5cm
  #+RESULTS: myimage
  [[file:images/myimage.png]]

It is very easy to do with M-S-up/down, considering you probably don't
have a screenful of attributes for the same block.


Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2015-10-30 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-30 12:23 Comment lines interfere with figure options Mark Edgington
2015-10-30 13:56 ` 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).