emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Fabrice Popineau <fabrice.popineau@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Macro question
Date: Sat, 24 Oct 2015 11:53:59 +0200	[thread overview]
Message-ID: <87a8r8y4lk.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CAFgFV9Osqjq1uMs8+zz9RBeA=omDWmwfxs-e6mbeCYgPADZ08w@mail.gmail.com> (Fabrice Popineau's message of "Sat, 24 Oct 2015 11:39:24 +0200")

Fabrice Popineau <fabrice.popineau@gmail.com> writes:

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

Exactly. Macros are not a solution for that, which is fine, IMO.

> 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/>

I don't get it.

What about simply writing

  Some other text.
  \\

?

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

Org already provides various tools. If a macro doesn't fit, you can use
a filter, or Babel, etc.

Regards,

  reply	other threads:[~2015-10-24  9:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23 20:24 Macro question Fabrice Popineau
2015-10-23 20:37 ` Nicolas Goaziou
2015-10-23 21:33   ` Fabrice Popineau
2015-10-23 22:18     ` Nicolas Goaziou
2015-10-24  9:39       ` Fabrice Popineau
2015-10-24  9:53         ` Nicolas Goaziou [this message]
2015-10-24 11:37           ` Fabrice Popineau
2015-10-24 11:44             ` Nicolas Goaziou
2015-10-24 17:02             ` Eric S Fraga
2015-10-25  9:45               ` Fabrice Popineau
2015-10-25 12:04                 ` Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a8r8y4lk.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=fabrice.popineau@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).