emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Bug] ~Verbatim~ in headlines breaks LaTeX
@ 2015-05-30  3:38 Titus von der Malsburg
  2015-05-30  4:32 ` Nick Dokos
  0 siblings, 1 reply; 13+ messages in thread
From: Titus von der Malsburg @ 2015-05-30  3:38 UTC (permalink / raw)
  To: Org Mode

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



#+BEGIN_EXAMPLE
* The variable ~JAVA_HOME~
…
#+END_EXAMPLE

Exporting this to LaTeX and then compiling to PDF, produces the
following error:

  ! Missing $ inserted.
  <inserted text> 
                  $
  l.35 \section{The variable \verb~JAVA_HOME~}

Apparently, \verb is not allow in command arguments:

  http://www.tex.ac.uk/cgi-bin/texfaq2html?label=verbwithin

One solution is uses \cprotect:

  \cprotect\section{The variable \verb~JAVA_HOME~}

I don’t know how the exporter works but I wouldn’t be surprised if it
wasn’t entirely trivial to implement this.

The problem also exists in other situations where ~verbatim~ is used in
embedded contexts, for example when used in link descriptions:

  [[https://encrypted.google.com/search?q=JAVA_HOME][Google
  ~JAVA_HOME~]]

Is there anything that speaks against using \texttt for ~verbatim~?  The
HTML exporter uses the code tag for ~verbatim~ and =code=.

  Titus

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

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

end of thread, other threads:[~2015-06-06 23:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-30  3:38 [Bug] ~Verbatim~ in headlines breaks LaTeX Titus von der Malsburg
2015-05-30  4:32 ` Nick Dokos
2015-05-30  5:18   ` Titus von der Malsburg
2015-05-30  8:09     ` Nicolas Goaziou
2015-05-30 15:19       ` Titus von der Malsburg
2015-05-31  8:40         ` Nicolas Goaziou
2015-06-05 19:28           ` Titus von der Malsburg
2015-06-05 21:27             ` Nicolas Goaziou
2015-06-05 22:58               ` Titus von der Malsburg
2015-06-06  7:28                 ` Nicolas Goaziou
2015-06-06 17:32                   ` Titus von der Malsburg
2015-06-06 22:15                   ` Suvayu Ali
2015-06-06 23:20                     ` 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).