emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Bug: Latex export of literal string containing "\__" produces unexpe


From: sharad shrestha
Subject: [O] Bug: Latex export of literal string containing "\__" produces unexpected output [7.5]
Date: Thu, 12 May 2011 07:39:44 +0530

Hi,

I have an Org file that contains a literal string of the form "str1\__str2". When I export it to Latex (for subsequently generating a pdf file), the generated .tex file contains unexpected (wrong) results.

To illustrate this problem, I have tested the following 8 literal string:

1)  str1\__str2
2)  str1\\__str2
3)  str1\_str2
4)  str1\\_str2
5)  str1\str2
6)  str1\\str2
7)  str1_str2
8)  str1__str2

I have defined each of these 8 literal strings in 5 different ways, as shown below using the literal string of test example (1) above:

Case (a)
    : str1\__str2

Case (b)
    #+BEGIN_EXAMPLE
    str1\__str2
    #+END_EXAMPLE

Case (c)
    \verb+str1\__str2+

Case (d)
    #+BEGIN_LaTeX
    str1\__str2
    #+END_LaTeX

Case (e)
    \begin{verbatim}
    str1\__str2
    \end{verbatim}

I find unexpected (wrong) results for the following cases:

Example 1, Cases (c), (d), (e)
Example 2, Cases (c), (d), (e)
Example 4, Case  (d)
Example 7, Cases (c), (d)
Example 8, Case  (d)

The attached file "Latex-export-output.pdf" gives the output in the .tex file for each of the above 8x5 = 40 cases. It also contains what I consider to be the expected output.

Also attached is the Org file "Latex-export-problems.org" containing these test cases.

I have tested all these test cases with and without the following option in the Org file:
#+OPTIONS:     ^:{}

Except for Case 7(c), for all the remaining 39 cases, including or not including this option does not change the resulting .tex output.

For Case 7(c), when this option is not used, the .tex file contains the following output:

\verb+str1$_{\mathrm{str2}}$+

When the option is not used, the .tex file contains the following output:

\verb+str1\_{}str2+

I gratefully appreciate your help in resolving this issue.

Thanks and Best Regards,

Sharad
(address@hidden)


==============================================================

Emacs  : GNU Emacs 23.2.1 (i386-mingw-nt5.1.2600)
 of 2010-05-08 on G41R2F1
Package: Org-mode version 7.5

current state:
==============
(setq
 org-log-done 'note
 org-remember-default-headline "Quick Notes"
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook)
 org-agenda-files '("~/.org/notes.org" "~/.org/JOURNAL.org" "~/.org/TODO.org" "~/.org/Personal.org" "~/.org/Molikpaq.org" "~/TODO.org")
 org-hook '((lambda nil (auto-fill-mode t) (setq fill-column 70) (setq fill-prefix nil)))
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-footnote-section nil
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup)
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe
                      org-babel-hide-result-toggle-maybe)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-startup-indented t
 org-todo-keywords '((sequence "TODO" "FEEDBACK" "VERIFY" "MODIFY" "|" "DONE" "DELEGATED"))
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-default-notes-file "~/.org//notes.org"
 org-directory "~/.org/"
 org-babel-pre-tangle-hook '(save-buffer)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
                  org-cycle-show-empty-lines org-optimize-window-after-visibility-change)
 org-export-preprocess-before-normalizing-links-hook '(org-remove-file-link-modifiers)
 org-mode-hook '((lambda nil
                  (org-add-hook (quote change-major-mode-hook) (quote org-show-block-all)
                   (quote append) (quote local))
                  )
                 (lambda nil
                  (org-add-hook (quote change-major-mode-hook) (quote org-babel-show-result-all)
                   (quote append) (quote local))
                  )
                 org-babel-result-hide-spec org-babel-hide-all-hashes org-mode-reftex-setup
                 (lambda nil (setq reftex-mode 1)) turn-on-font-lock)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-export-interblocks '((lob org-babel-exp-lob-one-liners) (src org-babel-exp-inline-src-blocks))
 org-occur-hook '(org-first-headline-recenter)
 org-from-is-user-regexp nil
 org-export-preprocess-before-selecting-backend-code-hook '(org-beamer-select-beamer-code)
 org-remember-templates '(("Todo" 116 "* TODO %?\n  %i\n  %a" "~/.org/TODO.org" "Tasks")
                          ("Journal" 106 "* %U %?\n\n  %i\n  %a" "~/.org/JOURNAL.org")
                          ("Idea" 105 "* %^{Title}\n  %i\n  %a" "~/.org/JOURNAL.org" "New Ideas")
                          ("Molikpaq" 109 "* TODO %?\n  %i\n  %a" "~/.org/Molikpaq.org" "Tasks")
                          ("MhaPuja" 112 "* TODO %?\n  %i\n  %a" "~/.org/mha-puja.org" "Tasks"))
 org-footnote-define-inline t
 org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc
                               org-beamer-auto-fragile-frames
                               org-beamer-place-default-actions-for-lists)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-export-blocks '((src org-babel-exp-src-block nil)
                     (comment org-export-blocks-format-comment t)
                     (ditaa org-export-blocks-format-ditaa nil)
                     (dot org-export-blocks-format-dot nil))
 )

Attachment: Latex-export-output.pdf
Description: Adobe PDF document

Attachment: Latex-export-problems.org
Description: Binary data

Attachment: Latex-export-problems.tex
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]