emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: duplicated output in inline code block exports
@ 2018-07-05 17:46 William Denton
  2018-07-05 19:14 ` Berry, Charles
  0 siblings, 1 reply; 3+ messages in thread
From: William Denton @ 2018-07-05 17:46 UTC (permalink / raw)
  To: emacs-org

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/

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

* Re: Bug: duplicated output in inline code block exports
  2018-07-05 17:46 Bug: duplicated output in inline code block exports William Denton
@ 2018-07-05 19:14 ` Berry, Charles
  2018-07-07 10:59   ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Berry, Charles @ 2018-07-05 19:14 UTC (permalink / raw)
  To: William Denton; +Cc: emacs-org



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

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

* Re: Bug: duplicated output in inline code block exports
  2018-07-05 19:14 ` Berry, Charles
@ 2018-07-07 10:59   ` Nicolas Goaziou
  0 siblings, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2018-07-07 10:59 UTC (permalink / raw)
  To: Berry, Charles; +Cc: William Denton, emacs-org

Hello,

"Berry, Charles" <ccberry@ucsd.edu> writes:

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

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

end of thread, other threads:[~2018-07-07 10:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-05 17:46 Bug: duplicated output in inline code block exports William Denton
2018-07-05 19:14 ` Berry, Charles
2018-07-07 10:59   ` 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).