Re: [O] Bug: duplicated output in inline code block exports

2018-07-07 Thread Nicolas Goaziou
Hello,

"Berry, Charles"  writes:

>> On Jul 5, 2018, at 10:46 AM, William Denton  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.

Fixed. Thank you.
> Also, shouldn't the docstring for `org-macro-initialize-templates'
> mention that "n", "author", "email", "keyword", "results", and "title"
> get set?

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: duplicated output in inline code block exports

2018-07-05 Thread Berry, Charles



> On Jul 5, 2018, at 10:46 AM, William Denton  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






[O] Bug: duplicated output in inline code block exports

2018-07-05 Thread William Denton

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

For some reason the "2" is duplicated.

Same thing with Ruby.  I had a look at recent commits (I recompiled from current 
source) but couldn't see where this might have started.


Bill
--
William Denton :: Toronto, Canada   ---   Listening to Art: 
https://listeningtoart.org/
https://www.miskatonic.org/ ---   GHG.EARTH: http://ghg.earth/
Caveat lector.  ---   STAPLR: http://staplr.org/