emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Berry, Charles" <ccberry@ucsd.edu>
To: William Denton <wtd@pobox.com>
Cc: emacs-org <emacs-orgmode@gnu.org>
Subject: Re: Bug: duplicated output in inline code block exports
Date: Thu, 5 Jul 2018 19:14:31 +0000	[thread overview]
Message-ID: <FAA4A554-559A-4AE4-A5AD-D38B96113AE1@ucsd.edu> (raw)
In-Reply-To: <alpine.DEB.2.02.1807051341410.29956@shell.miskatonic.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

  reply	other threads:[~2018-07-05 19:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-05 17:46 Bug: duplicated output in inline code block exports William Denton
2018-07-05 19:14 ` Berry, Charles [this message]
2018-07-07 10:59   ` Nicolas Goaziou

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=FAA4A554-559A-4AE4-A5AD-D38B96113AE1@ucsd.edu \
    --to=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=wtd@pobox.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).