From: Jon Degenhardt <jondegenhardt@yahoo.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Bug: Export to Latex - Incorrect output for list items starting with left bracket [8.2.3c (8.2.3c-elpa @ /Users/jdegenhardt/.emacs.d/elpa/org-20131115/)]
Date: Sat, 11 Jan 2014 13:18:29 -0800 (PST) [thread overview]
Message-ID: <1389475109.23348.YahooMailNeo@web184706.mail.ne1.yahoo.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 4083 bytes --]
Export to Latex (org-latex-export-to-pdf) generates incorrect latex when
list items start with a left square bracket. This occurs because the
\item command interprets the left square bracket as the start of an
argument list. An example:
An item list:
- abc def
- [def] ghi
- [jkl m n o]
- pqr
This produces the latex fragment:
An item list:
\begin{itemize}
\item abc def
\item [def] ghi
\item [jkl m n o]
\item pqr
\end{itemize}
The pdf output renders the second and third items incorrectly. If there
is no right bracket to terminate the argument, then pdf generation may
fail with message:
org-latex-compile: PDF file ./example.pdf wasn't produced: Runaway argument
I fixed these cases in my local environment using defadvise on org-latex-item
to wrap an initial left square bracket in braces. I used this form:
(eval-after-load "ox-latex"
'(progn
(defadvice org-latex-item (after escape-initial-bracket activate)
(setq ad-return-value
(replace-regexp-in-string
"\\\\item \\["
"\\\\item {[}"
ad-return-value)))))
This changes the latex fragment for the above example to:
An item list:
\begin{itemize}
\item abc def
\item {[}def] ghi
\item {[}jkl m n o]
\item pqr
\end{itemize}
This form renders PDF correctly. My knowledge of latex is very limited,
I don't know if this is a reasonable approach or not. There appears to
be one other function in the ox-latex.el generating the \item command:
(org-latex-headline). I did not try to reproduce this case.
------------------------------------------------------------------------
Emacs : GNU Emacs 24.2.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
of 2012-08-27 on bob.porkrind.org
Package: Org-mode version 8.2.3c (8.2.3c-elpa @ /Users/jdegenhardt/.emacs.d/elpa/org-20131115/)
current state:
==============
(setq
org-tab-first-hook '(org-hide-block-toggle-maybe
org-src-native-tab-command-maybe
org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
org-occur-hook '(org-first-headline-recenter)
org-metaup-hook '(org-babel-load-in-session-maybe)
org-log-done 'time
org-confirm-shell-link-function 'yes-or-no-p
org-use-sub-superscripts '{}
org-startup-indented t
org-after-todo-state-change-hook '(org-clock-out-if-current)
org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-babel-pre-tangle-hook '(save-buffer)
org-mode-hook '(#[nil "\300\301\302\303\304$\207"
[org-add-hook change-major-mode-hook org-show-block-all
append local]
5]
#[nil "\300\301\302\303\304$\207"
[org-add-hook change-major-mode-hook
org-babel-show-result-all append local]
5]
org-babel-result-hide-spec org-babel-hide-all-hashes
(lambda nil (turn-on-visual-line-mode) (turn-off-auto-fill)))
org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
org-babel-execute-safely-maybe)
org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
org-cycle-hide-inline-tasks org-cycle-show-empty-lines
org-optimize-window-after-visibility-change)
org-todo-keywords '((sequence "TODO" "STARTED" "ONHOLD" "|" "DONE" "CANCELED")
)
org-latex-packages-alist '(("margin=0.75in" "geometry" nil))
org-confirm-elisp-link-function 'yes-or-no-p
org-metadown-hook '(org-babel-pop-to-session-maybe)
org-agenda-files '("~/Notes/General-Ongoing.org")
org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
)
[-- Attachment #2: Type: text/html, Size: 7055 bytes --]
next reply other threads:[~2014-01-11 21:21 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-11 21:18 Jon Degenhardt [this message]
2014-01-13 0:26 ` Bug: Export to Latex - Incorrect output for list items starting with left bracket [8.2.3c (8.2.3c-elpa @ /Users/jdegenhardt/.emacs.d/elpa/org-20131115/)] Vladimir Lomov
2014-01-13 16:51 ` Nicolas Goaziou
2014-01-13 23:56 ` Vladimir Lomov
2014-01-14 16:39 ` Eric S Fraga
2014-01-14 18:42 ` Nicolas Goaziou
2014-01-14 19:54 ` Eric S Fraga
2014-01-14 20:52 ` Nicolas Goaziou
2014-01-15 8:35 ` Eric S Fraga
2014-01-15 13:18 ` Nicolas Goaziou
2014-01-16 9:55 ` Eric S Fraga
2014-01-16 12:03 ` Sebastien Vauban
2014-01-16 15:10 ` Eric S Fraga
2014-01-16 15:15 ` Nicolas Goaziou
[not found] ` <87ha94vtyj.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-01-16 15:24 ` Sebastien Vauban
2014-01-16 16:42 ` Eric S Fraga
2014-08-03 7:57 ` Nicolas Goaziou
2014-01-16 14:54 ` Nicolas Goaziou
2014-01-18 20:06 ` Jon Degenhardt
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1389475109.23348.YahooMailNeo@web184706.mail.ne1.yahoo.com \
--to=jondegenhardt@yahoo.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.