emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Charles C. Berry" <ccberry@ucsd.edu>
To: Scott Randby <srandby@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Multiple underscores crash org latex export; other exporters survive
Date: Sat, 3 Dec 2016 14:31:08 -0800	[thread overview]
Message-ID: <alpine.OSX.2.20.1612031415030.1214@charles-berrys-macbook.local> (raw)
In-Reply-To: <49b70a0c-f81b-660b-e2f5-9921ab488d65@gmail.com>

On Sat, 3 Dec 2016, Scott Randby wrote:

> On 12/03/2016 02:40 PM, Scott Otterson wrote:
>> When an org file contains a string with more than one underscore, the
>> orgmode export result will crash latex (example attached).   On the
>> other hand, the org html export does finish successfully, and while
>> result is odd, it's odd in a way that makes the problem visible and easy
>> to identify.
>
> I exported your file using LaTeX export without trouble. The result does
> look odd, but that is because the string you gave is missing the braces
> needed to make it export properly. The output messages warn that the
> string contains a double subscript, so the problem is with the string
> and not Org's LaTeX export.
>
> Your string: a_variable_deleteThisAndItWorks
>
> Properly formed string: a_{variable_{deleteThisAndItWorks}}

I don't think the OP wanted double subscripts.  If the OP really wanted 
"heavily underscored code snippets", something like:

Code snippet:  ~a_variable_deleteThisAndItWorks~

seems like the way to go.

See (info "(org) Emphasis and monospace")

That way the latex is

: \texttt{a\_variable\_deleteThisAndItWorks}

and that idiom would properly render html as

: <code>a_variable_deleteThisAndItWorks</code>

rather than

: a<sub>variable</sub><sub>deleteThisAndItWorks</sub></p>

as in OPs case. The latter is valid html, but doesn't seem quite like the 
right thing to do for code snippets.

HTH,

Chuck

>
> Scott Randby
>
>>
>> Many people have orgfiles with heavily underscored code snippets buried
>> deep inside.  To them, the latex crashes are probably as mysterious as
>> they were to me.  So I'd like to suggest that the org latex exporter
>> adopt something like the org html exporter behavior.
>>
>>
>
>

  reply	other threads:[~2016-12-03 22:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-03 19:40 Multiple underscores crash org latex export; other exporters survive Scott Otterson
2016-12-03 21:24 ` Scott Randby
2016-12-03 22:31   ` Charles C. Berry [this message]
2016-12-04  4:53     ` Scott Randby
2016-12-04 10:13       ` Nicolas Goaziou
2016-12-04 16:03         ` Scott Randby
2016-12-05  8:36         ` Scott Otterson
2016-12-06  1:33           ` Scott Randby
     [not found]             ` <CAPY3P0QcpouDjmNpmaY6FzNSNjZyHAGufrbVtSuBzPxr6mUAzg@mail.gmail.com>
2016-12-06 18:18               ` Scott Randby
2016-12-06 23:50             ` Nicolas Goaziou
2016-12-07  2:06               ` Scott Randby
2016-12-07 11:21                 ` Nicolas Goaziou
2016-12-10 23:24                   ` Scott Randby
2016-12-11  0:05                     ` Nicolas Goaziou
2016-12-12  3:37                       ` Scott Randby
2016-12-12  7:46                         ` Nicolas Goaziou
2016-12-12 15:18                           ` Scott Otterson
2016-12-13 12:54                             ` Nicolas Goaziou
2016-12-05 17:30         ` Charles C. Berry

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=alpine.OSX.2.20.1612031415030.1214@charles-berrys-macbook.local \
    --to=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=srandby@gmail.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).