emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: Matthew MacLean <archenoth@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Org Babel blocks exports dollar signs to LaTeX verbatim
Date: Fri, 04 Sep 2015 13:57:11 +0200	[thread overview]
Message-ID: <m2si6u8kiw.fsf@charm-ecran.irisa.fr> (raw)
In-Reply-To: <CA+GZiYrdjZh6AXfA7cCYa+tkLSnq0S98zahXFuKNgRmW7ZKZ+Q@mail.gmail.com> (Matthew MacLean's message of "Tue, 18 Aug 2015 10:13:52 -0600")

[-- Attachment #1: Type: text/plain, Size: 1587 bytes --]

(Still catching up on orgmode mail … sorry if you already found a way to
address the issue)

On 2015-08-18 18:13, Matthew MacLean <archenoth@gmail.com> writes:

> When working with Org Babel source code blocks, if I have a dollar sign in my
> code and export it to PDF using LaTeX, it appears to parse as an internal
> link. (Maybe?)
>
> This is what it looks like:
> Inline image 1
> That comes from the following source code block:
>
> #+BEGIN_SRC sql :eval no :var id=1
> SELECT * FROM blah
> WHERE id=$id
> #+END_SRC
>
> The resulting LaTeX from the source code block is:
>
> \begin{minted}[]{sql}
> SELECT * FROM blah
> WHERE id=$id
> \end{minted}
>
> I have verified that SQL is not the only block type to do this by having a
> Ruby block with nothing except a "$" in it, and got the same result.

These red boxes often come from signaling a syntax error from pygments,
which I confirmed by putting the code in a test.sql file and running:

% pygmentize -f latex test.sql
\begin{Verbatim}[commandchars=\\\{\}]
\PY{k}{SELECT} \PY{o}{*} \PY{k}{FROM} \PY{n}{blah}
\PY{k}{WHERE} \PY{n}{id}\PY{o}{=}\PY{err}{\PYZdl{}}\PY{n}{id}
\end{Verbatim}

You can see the “\PY{err}” that signals a parser error around the dollar
sign.

There are some solutions to hide these boxes here:
http://tex.stackexchange.com/questions/14166/red-box-drawn-around-question-mark-operator-in-minted-erlang-code

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Last week athmospheric CO₂ average (Updated August 31, 2015, Mauna Loa Obs.):
377.82 ppm

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

  reply	other threads:[~2015-09-04 11:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-18 16:13 Org Babel blocks exports dollar signs to LaTeX verbatim Matthew MacLean
2015-09-04 11:57 ` Alan Schmitt [this message]
2015-09-04 16:00   ` Matthew MacLean

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=m2si6u8kiw.fsf@charm-ecran.irisa.fr \
    --to=alan.schmitt@polytechnique.org \
    --cc=archenoth@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).