Re: [O] LaTeX_HEADER blocks

2015-05-28 Thread Nicolas Goaziou
Hello,

Mark Edgington edgi...@gmail.com writes:

 It is possible in org-mode to do either

 #+LaTeX: \somecommand

 or

 #+BEGIN_LaTeX
 \somecommand
 #+END_LaTeX

 I typically use the latter (the block form) because I often have
 multiple lines of LaTeX I would like to include at certain locations
 of a document.

 Similar to #+LaTeX, there is also #+LaTeX_HEADER, which ensures that
 something is included as part of the preamble.  Unfortunately,
 however, there is no equivalent block form for #+LaTeX_HEADER.  As a
 result, when there are several items one wishes to have in the
 preamble, it's necessary to have many such lines, each with a
 #+LaTeX_HEADER:  prefix.

 For the sake of consistency and convenience, wouldn't it be worthwhile
 to add a LaTeX_HEADER block type to accompany the LaTeX block
 type?

This would not be consistent.

#+LATEX_HEADER was free for grabs but #+BEGIN_LATEX_HEADER already means
something: it is a special block. As a consequence, export back-ends
ignore LATEX_HEADER but handle BEGIN_LATEX_HEADER (basically, they
ignore the wrapper but export the contents). We would need to
make #+begin_latex_header an export block.

However, I plan to change syntax for export blocks for Org 8.4 and it
will not be possible to define arbitrarily export blocks. In fact,

  #+begin_latex
  ...
  #+end_latex

are expected to become

  #+begin_export latex [attributes]
  ...
  #+begin_export

If latex header block idea is implemented, I think it could instead use
a syntax such as

  #+begin_export latex :header t
  ...
  #+end_export


Regards,

-- 
Nicolas Goaziou



Re: [O] LaTeX_HEADER blocks

2015-05-27 Thread Mark Edgington
I noticed there was also a newer thread (around a year old) on this
topic.  It seems that what Nicolas Goaziou proposed earlier (about
using #+attr_latex to modify whether a latex block is a header block
or not) has not yet been implemented.  This would be an alternative,
though I find it more cryptic than just having a #+begin_latex_header
block, so it would probably be more difficult for org-mode users to
find (or remember) this, and as I mentioned in my last message, it
lacks the benefit of consistency with how #+latex and #+begin_latex
relate to each other.

Nicolas' message is here:

http://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg00841.html.



[O] LaTeX_HEADER blocks

2015-05-27 Thread Mark Edgington
Hi Everyone,

It is possible in org-mode to do either

#+LaTeX: \somecommand

or

#+BEGIN_LaTeX
\somecommand
#+END_LaTeX

I typically use the latter (the block form) because I often have
multiple lines of LaTeX I would like to include at certain locations
of a document.

Similar to #+LaTeX, there is also #+LaTeX_HEADER, which ensures that
something is included as part of the preamble.  Unfortunately,
however, there is no equivalent block form for #+LaTeX_HEADER.  As a
result, when there are several items one wishes to have in the
preamble, it's necessary to have many such lines, each with a
#+LaTeX_HEADER:  prefix.

For the sake of consistency and convenience, wouldn't it be worthwhile
to add a LaTeX_HEADER block type to accompany the LaTeX block
type?

It seems like this was proposed a couple years ago by Eric Fraga, but
didn't go anywhere because of concerns over how to decide where to
place the content of such blocks relative to the content of
#+LaTeX_HEADER lines.  It would seem sensible to make it work
identically to how #+LaTeX lines and #+BEGIN_LaTeX blocks work -- they
are simply included in the order in which they are encountered in the
org file.

Regards,

Mark