emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Latex newline string "\\" in subtree export properties [9.3.3 (release_9.3.3-405-g817c0c @ /home/flare/.emacs.d/lisp/org-mode/lisp/)]
@ 2020-05-04  1:47 Flareriderdash
  2020-05-16 17:01 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Flareriderdash @ 2020-05-04  1:47 UTC (permalink / raw)
  To: emacs-orgmode

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

When exporting to latex from within an org subtree with properties like
EXPORT_AUTHOR set in a way to extend latex title capabilities
(i.e. adding instructor and institutional affiliation, ref
[[https://en.wikibooks.org/wiki/LaTeX/Title_Creation]]) the "\\" string
within the org property gets escaped to "$\backslash$\" during
export. Latex then doesn't treat this as a newline, deviating from
expected behaviour

This is the org property that is used during latex export
#+BEGIN_EXAMPLE

:EXPORT_AUTHOR: Gabriel S. X. Smith\\ CMST220\\ Professor Voso

#+END_EXAMPLE

This is the expected org to latex conversion
#+BEGIN_EXAMPLE

\author{Gabriel S. X. Smith\\ CMST220\\ Professor Voso}

#+END_EXAMPLE

This is the actual org to latex conversion
#+BEGIN_EXAMPLE

\author{Gabriel S. X. Smith$\backslash$\ CMST220$\backslash$\ Professor
Voso}

#+END_EXAMPLE

If you are familiar with latex you can see that this breaks the newlines
that would be typeset in the author section of the title by the latex
compiler.








Emacs  : GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2020-05-02
Package: Org mode version 9.3.3 (release_9.3.3-405-g817c0c @
/home/flare/.emacs.d/lisp/org-mode/lisp/)

current state:
==============
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-latex-listings 'minted
 org-link-shell-confirm-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-html-format-inlinetask-function
'org-html-format-inlinetask-default-function
 org-edit-src-content-indentation 0
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-latex-pdf-process '("%latex -shell-escape -interaction nonstopmode
-output-directory %o '%f'" "%latex -shell-escape -interaction nonstopmode
-output-directory %o '%f'" "biber %f" "%latex -shell-escape -interaction
nonstopmode -output-directory %o '%f'")
 org-agenda-files '("~/Documents/school/High School/MaiaLearning/TODO.org"
   "~/Documents/school/2018 to 2020 school year/GEO105/Lecture Notes.org"
   "~/Documents/school/2018 to 2020 school year/SITREP.org"
   "~/Documents/school/2018 to 2020 school year/Expenses.org"
   "~/Documents/school/2018 to 2020 school year/JAPN121/Lecture Notes.org"
   "~/Documents/school/2018 to 2020 school year/JAPN121/TODO.org"
   "~/Documents/school/2018 to 2020 school year/CMST220/TODO.org"
   "~/Documents/school/2018 to 2020 school year/GEO105/TODO.org"
   "~/Documents/Personal Work/bin_hacking_local/TODO.org"
   "~/Documents/TODO.org" "~/TODO.org")
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-reveal-start-hook '(org-decrypt-entry)
 org-mode-hook '(#[0 "\301\211\207" [imenu-create-index-function
org-imenu-get-tree] 2]
#[0 "\300\301\302\303\304$\207"
  [add-hook change-major-mode-hook org-show-all append local] 5]
#[0 "\300\301\302\303\304$\207"
  [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 "Custom keybinds for org mode" (interactive)
 (local-set-key (kbd "C-c i l l")
  (quote (lambda nil "" (interactive) (insert "#+LATEX:"))))
 (local-set-key (kbd "C-c i l h")
  (quote (lambda nil "" (interactive) (insert "#+LATEX_HEADER:"))))
 (local-set-key (kbd "C-c i l a")
  (quote (lambda nil "" (interactive) (insert "#+ATTR_LATEX:"))))
 (local-set-key (kbd "C-c i o c")
  (quote
   (lambda nil "" (interactive) (insert "#+BEGIN_COMMENT") (newline 2)
    (insert "#+END_COMMENT") (previous-line 1))
   )
  )
 (local-set-key (kbd "C-c i o e")
  (quote
   (lambda nil "" (interactive) (insert "#+BEGIN_EXAMPLE") (newline 2)
    (insert "#+END_EXAMPLE") (previous-line 1))
   )
  )
 (local-set-key (kbd "C-c i c c")
  (quote (lambda nil "" (interactive) (__org-insert-src-block "C"))))
 (local-set-key (kbd "C-c i c m")
  (quote (lambda nil "" (interactive) (__org-insert-src-block "makefile"))))
 (local-set-key (kbd "C-c i c s")
  (quote (lambda nil "" (interactive) (__org-insert-src-block "shell"))))
 (local-set-key (kbd "C-c l s") (quote org-store-link))
 (local-set-key (kbd "C-c l i") (quote org-insert-link))
 (local-set-key (kbd "C-c o t w") (quote org-table-wrap-region))
 (local-set-key (kbd "C-c m g l") (quote make-geo-item-org-item))
 (load-library "org-beautify-theme") (org-bullets-mode t))
)
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-babel-pre-tangle-hook '(save-buffer)
 org-latex-compiler "xelatex"
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-babel-load-languages '((C . t) (ditaa . t) (shell . t) (python . t))
 org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS
WIDTH)"]
 org-agenda-loop-over-headlines-in-active-region nil
 org-occur-hook '(org-first-headline-recenter)
 org-log-into-drawer "LOGBOOK"
 org-cycle-hook '(org-cycle-hide-archived-subtrees
org-cycle-show-empty-lines
 org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
 org-attach-id-dir "Attachments/"
 org-odt-format-inlinetask-function
'org-odt-format-inlinetask-default-function
 org-babel-tangle-lang-exts '(("python" . "py") ("D" . "d") ("C++" . "cpp")
     ("emacs-lisp" . "el") ("elisp" . "el"))
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("attachment" :follow org-attach-follow :export
org-export-link-as-file :complete org-attach-complete-link)
      ("id" :follow org-id-open)
      ("eww" :follow org-eww-open :store org-eww-store-link)
      ("rmail" :follow org-rmail-open :store org-rmail-store-link)
      ("mhe" :follow org-mhe-open :store org-mhe-store-link)
      ("irc" :follow org-irc-visit :store org-irc-store-link :export
org-irc-export)
      ("info" :follow org-info-open :export org-info-export :store
org-info-store-link)
      ("gnus" :follow org-gnus-open :store org-gnus-store-link)
      ("docview" :follow org-docview-open :export org-docview-export :store
org-docview-store-link)
      ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link)
      ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete
org-bbdb-complete-link :store org-bbdb-store-link)
      ("w3m" :store org-w3m-store-link)
      ("nov" :follow nov-org-link-follow :store nov-org-link-store)
      ("file+sys") ("file+emacs") ("shell" :follow org-link--open-shell)
      ("news" :follow
#[514 "\301\300\302Q\"\207" ["news" browse-url ":"] 6
 "\n\n(fn URL ARG)"]
)
      ("mailto" :follow
#[514 "\301\300\302Q\"\207" ["mailto" browse-url ":"] 6
 "\n\n(fn URL ARG)"]
)
      ("https" :follow
#[514 "\301\300\302Q\"\207" ["https" browse-url ":"] 6
 "\n\n(fn URL ARG)"]
)
      ("http" :follow
#[514 "\301\300\302Q\"\207" ["http" browse-url ":"] 6
 "\n\n(fn URL ARG)"]
)
      ("ftp" :follow
#[514 "\301\300\302Q\"\207" ["ftp" browse-url ":"] 6
 "\n\n(fn URL ARG)"]
)
      ("help" :follow org-link--open-help)
      ("file" :complete org-link-complete-file)
      ("elisp" :follow org-link--open-elisp)
      ("doi" :follow org-link--open-doi))
 org-latex-format-headline-function
'org-latex-format-headline-default-function
 org-link-elisp-confirm-function 'yes-or-no-p
 org-latex-format-inlinetask-function
'org-latex-format-inlinetask-default-function
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-latex-packages-alist '(("" "multicol") ("" "xcolor") ("" "fontspec" t
("xelatex"))
   ("" "ltablex") ("" "fancyhdr") ("margin=1in" "geometry")
   ("" "minted"))
 org-latex-classes '(("article"
     "\\documentclass{article} [PACKAGES]
\\definecolor{codegray}{HTML}{ebebeb} \n[EXTRA]"
     ("\\section{%s}" . "\\section*{%s}")
     ("\\subsection{%s}" . "\\subsection*{%s}")
     ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
    ("article" "\\documentclass[11pt]{article}"
     ("\\section{%s}" . "\\section*{%s}")
     ("\\subsection{%s}" . "\\subsection*{%s}")
     ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
     ("\\paragraph{%s}" . "\\paragraph*{%s}")
     ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
    ("report" "\\documentclass[11pt]{report}" ("\\part{%s}" . "\\part*{%s}")
     ("\\chapter{%s}" . "\\chapter*{%s}")
     ("\\section{%s}" . "\\section*{%s}")
     ("\\subsection{%s}" . "\\subsection*{%s}")
     ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
    ("book" "\\documentclass[11pt]{book}" ("\\part{%s}" . "\\part*{%s}")
     ("\\chapter{%s}" . "\\chapter*{%s}")
     ("\\section{%s}" . "\\section*{%s}")
     ("\\subsection{%s}" . "\\subsection*{%s}")
     ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
    )
 org-html-format-headline-function
'org-html-format-headline-default-function
 org-src-window-setup 'current-window
 org-confirm-babel-evaluate nil
 org-latex-minted-options '(("bgcolor" "codegray") ("frame" "lines")
("linenos" ""))
 )

[-- Attachment #2: Type: text/html, Size: 12802 bytes --]

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

* Re: Bug: Latex newline string "\\" in subtree export properties [9.3.3 (release_9.3.3-405-g817c0c @ /home/flare/.emacs.d/lisp/org-mode/lisp/)]
  2020-05-04  1:47 Bug: Latex newline string "\\" in subtree export properties [9.3.3 (release_9.3.3-405-g817c0c @ /home/flare/.emacs.d/lisp/org-mode/lisp/)] Flareriderdash
@ 2020-05-16 17:01 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2020-05-16 17:01 UTC (permalink / raw)
  To: Flareriderdash; +Cc: emacs-orgmode

Hello,

Flareriderdash <flareriderdash@gmail.com> writes:

> When exporting to latex from within an org subtree with properties like
> EXPORT_AUTHOR set in a way to extend latex title capabilities
> (i.e. adding instructor and institutional affiliation, ref
> [[https://en.wikibooks.org/wiki/LaTeX/Title_Creation]]) the "\\" string
> within the org property gets escaped to "$\backslash$\" during
> export. Latex then doesn't treat this as a newline, deviating from
> expected behaviour
>
> This is the org property that is used during latex export
>
> #+BEGIN_EXAMPLE
>
> :EXPORT_AUTHOR: Gabriel S. X. Smith\\ CMST220\\ Professor Voso
>
> #+END_EXAMPLE
>
>
> This is the expected org to latex conversion
>
> #+BEGIN_EXAMPLE
>
> \author{Gabriel S. X. Smith\\ CMST220\\ Professor Voso}
>
> #+END_EXAMPLE

No, this is not the expected conversion. AUTHOR, like TITLE, expects Org
syntax, not LaTeX.

You could write, e.g.,

  :EXPORT_AUTHOR: Gabriel S. X. Smith@@latex:\\@@ CMST220@@latex:\\@@ Professor Voso

Regards,

-- 
Nicolas Goaziou


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

end of thread, other threads:[~2020-05-16 17:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04  1:47 Bug: Latex newline string "\\" in subtree export properties [9.3.3 (release_9.3.3-405-g817c0c @ /home/flare/.emacs.d/lisp/org-mode/lisp/)] Flareriderdash
2020-05-16 17:01 ` 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).