emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* LaTeX_HEADER blocks
@ 2015-05-28  4:28 Mark Edgington
  2015-05-28  4:52 ` Mark Edgington
  2015-05-28 17:17 ` Nicolas Goaziou
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Edgington @ 2015-05-28  4:28 UTC (permalink / raw)
  To: emacs-orgmode

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

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

* Re: LaTeX_HEADER blocks
  2015-05-28  4:28 LaTeX_HEADER blocks Mark Edgington
@ 2015-05-28  4:52 ` Mark Edgington
  2015-05-28 17:17 ` Nicolas Goaziou
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Edgington @ 2015-05-28  4:52 UTC (permalink / raw)
  To: emacs-orgmode

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.

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

* Re: LaTeX_HEADER blocks
  2015-05-28  4:28 LaTeX_HEADER blocks Mark Edgington
  2015-05-28  4:52 ` Mark Edgington
@ 2015-05-28 17:17 ` Nicolas Goaziou
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2015-05-28 17:17 UTC (permalink / raw)
  To: Mark Edgington; +Cc: emacs-orgmode

Hello,

Mark Edgington <edgimar@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

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

end of thread, other threads:[~2015-05-28 17:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-28  4:28 LaTeX_HEADER blocks Mark Edgington
2015-05-28  4:52 ` Mark Edgington
2015-05-28 17:17 ` 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).