emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Macro question


From: Fabrice Popineau
Subject: Re: [O] Macro question
Date: Sat, 24 Oct 2015 11:39:24 +0200



2015-10-24 0:18 GMT+02:00 Nicolas Goaziou <address@hidden>:
Fabrice Popineau <address@hidden> writes:

> I agree that raw html can be output by macros, but it can easily break
> too.

I think you are missing the "inline part". You cannot use macros to
generate, or even replace a block element in HTML (e.g., a paragraph).

Well, thinking about it, "raw inline html" needs to be clarified for me, because
even a mere :

@@html:<br/>@@ 

is surrounded by a paragraph.

My point is that what can be achieved by macros depends on the backend, 
which defeats part of the purpose of having a high level markup language.

#+MACRO: newline @@latex:\\@@ @@html:<br/>@@

This works for LaTeX, because LaTeX has no markup for paragraphs (I agree it is pure luck), but fails
for HTML because there is one.

OTOH, resorting to babel blocks to insert a newline is not viable option: it takes much more to achieve something very simple.

Basically, macros are of no help to solve this :

------------------------------------------------------------------------------------------
#+MACRO: newline @@latex:\\@@ @@html:<br/>@@

* Section 2

Some text.

{{{newline}}}

Some other text.

#+html: <br/>
#+latex: \\

Some other other text.
------------------------------------------------------------------------------------------

The macro way isn't a proper way: the <br/> will be embedded in a paragraph, where it shouldn't.
Only the second way achieves cleanly the expected effect. Well, not quite because in LaTeX, the \\ should stick to the paragraph.
So it should be :

Some other text.
#+latex: \\

#+html: <br/>

If I'm wrong, thanks for pointing me to the right way to use macros.
And if I'm right, maybe in the long term, Org needs another, different, macro system
to help at this level.

Regards,

Fabrice

reply via email to

[Prev in Thread] Current Thread [Next in Thread]