[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Bug: duplicated output in inline code block exports
From: |
Berry, Charles |
Subject: |
Re: [O] Bug: duplicated output in inline code block exports |
Date: |
Thu, 5 Jul 2018 19:14:31 +0000 |
> On Jul 5, 2018, at 10:46 AM, William Denton <address@hidden> wrote:
>
> Here's a very simple R command in an inline code block:
>
> # -----
> What is 1 + 1? src_R{1+1} {{{results(=2=)}}}
> # -----
>
> Exporting this to PDF we get:
>
> # -----
> What is 1 + 1? 2 2
Or exporting to to latex
What is 1 + 1? \texttt{2} \texttt{2}
The results macro gets initialized by `org-macro-initialize-templates' which is
run run before babel, the macro returns `=2=', and babel does not remove this
when it adds the result again.
A work-around is to put this null macro:
# ----
#+macro: results
# ----
in your buffer to strip out the existing inline results.
I do not get why this wasn't detected before - the pre-babel call to
{{{results( )}}} has been in the code since last year.
Also, shouldn't the docstring for `org-macro-initialize-templates' mention
that "n", "author", "email", "keyword", "results", and "title" get set?
Chuck