* Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile
@ 2009-10-01 16:18 cgray
2009-10-01 19:49 ` Eric Schulte
0 siblings, 1 reply; 8+ messages in thread
From: cgray @ 2009-10-01 16:18 UTC (permalink / raw)
To: emacs-orgmode
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen. You don't know how to make a good report? See
http://orgmode.org/manual/Feedback.html#Feedback
Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------
Hi,
I am writing a small program using org-babel as a literate programming
tool. When I exported the file to LaTeX, it could not compile. The
problem is that the code blocks are surrounded by \begin{\LaTeX{}} and
\end{\LaTeX{}}, which is an unknown environment to LaTeX. A small
example follows.
The org file contains:
#+srcname: determine the neighbors of the segments that the bisector hits
#+begin_src lua :tangle no :exports code
local s1, s2 = intersecting_segs[1], intersecting_segs[2]
local n1 = table_find_segment(cell.neighbors, s1)
local n2 = table_find_segment(cell.neighbors, s2)
#+end_src
and the output .tex file contains:
\begin{\LaTeX{}}
\begin{verbatim}
local s1, s2 = intersecting_segs[1], intersecting_segs[2]
local n1 = table_find_segment(cell.neighbors, s1)
local n2 = table_find_segment(cell.neighbors, s2)
\end{verbatim}
\end{\LaTeX{}}
I haven't tried this without using org-babel, so I can't say whether
the problem is with org-babel or just with the LaTeX exporter.
Cheers,
Chris
Emacs : GNU Emacs 23.0.91.1 (i486-pc-linux-gnu, GTK+ Version 2.16.0)
of 2009-04-05 on palmer, modified by Debian
Package: Org-mode version 6.31trans
current state:
==============
(setq
org-log-done 'time
org-clock-in-switch-to-state "STARTED"
org-export-with-LaTeX-fragments t
org-todo-keyword-faces '(("TODO" :foreground "red" :weight bold)
("STARTED" :foreground "blue" :weight bold)
("DONE" :foreground "forest green" :weight bold)
("WAITING" :foreground "orange" :weight bold)
("SOMEDAY" :foreground "magenta" :weight bold)
("CANCELLED" :foreground "forest green" :weight bold)
("QUOTATION" :foreground "red" :weight bold)
("QUOTED" :foreground "magenta" :weight bold)
("APPROVED" :foreground "forest green" :weight bold)
("EXPIRED" :foreground "forest green" :weight bold)
("REJECTED" :foreground "forest green" :weight bold)
("PROJECT" :foreground "red" :weight bold)
("PROJDONE" :foreground "forest green" :weight bold))
org-agenda-clockreport-parameter-plist '(:link nil :maxlevel 2)
org-agenda-custom-commands '(("w" "Work tasks" tags-todo "work")
("h" "Home tasks" tags-todo "home")
("r" "Refile New Notes and Tasks" tags "refile"
((org-agenda-todo-ignore-with-date nil)))
)
org-agenda-files '("~/research/code/voronoi-diagram-ipelet/voronoi.org"
"~/todo/work.org" "~/todo/personal.org" "~/todo/todo.org")
org-agenda-include-diary t
org-hide-leading-stars t
org-completion-use-ido t
org-export-preprocess-after-blockquote-hook '(org-special-blocks-make-special-cookies)
org-after-todo-state-change-hook '(org-clock-out-if-current)
org-combined-agenda-icalendar-file "~/public_html/org.ics"
org-clock-history-length 35
org-babel-interpreters '("lua" "sh")
org-todo-state-tags-triggers '(("CANCELLED" ("CANCELLED" . t))
("WAITING" ("WAITING" . t) ("NEXT"))
("SOMEDAY" ("WAITING" . t))
(done ("NEXT") ("WAITING"))
("TODO" ("WAITING") ("CANCELLED"))
("STARTED" ("WAITING"))
("PROJECT" ("CANCELLED") ("PROJECT" . t)))
org-remember-clock-out-on-exit nil
org-agenda-sorting-strategy '((agenda time-up priority-down)
(todo category-keep priority-down)
(tags category-keep priority-down))
org-export-html-after-blockquotes-hook '(org-special-blocks-convert-html-special-cookies)
org-export-latex-after-blockquotes-hook '(org-special-blocks-convert-latex-special-cookies)
org-clock-in-resume t
org-export-preprocess-hook '(org-export-blocks-preprocess
org-export-bibtex-preprocess)
org-tab-first-hook '(yas/org-very-safe-expand org-hide-block-toggle-maybe)
org-src-mode-hook '(org-src-mode-configure-edit-buffer)
org-confirm-shell-link-function 'yes-or-no-p
org-clock-persist t
org-format-latex-header "\\documentclass{article}\n\\usepackage{fullpage} % do not remove\n\\usepackage{amssymb}\n\\usepackage[usenames]{color}\n\\usepackage{amsmath}\n\\usepackage{latexsym}\n\\usepackage[mathscr]{eucal}\n\\pagestyle{empty} % do not remove"
org-highlight-latex-fragments-and-specials t
org-todo-keywords '((sequence "TODO(t)" "STARTED(s!)" "|" "DONE(d!/!)")
(sequence "WAITING(w@/!)" "SOMEDAY(S!)" "|" "CANCELLED(c@/!)")
(sequence "QUOTATION(q!)" "QUOTED(Q!)" "|" "APPROVED(A@)"
"EXPIRED(E@)" "REJECTED(R@)")
(sequence "PROJECT(P@)" "|" "PROJDONE(D@)"))
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-default-notes-file "~/todo/todo.org"
org-directory "~/todo/"
org-blank-before-new-entry nil
org-read-date-popup-calendar nil
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-latex-classes '(("article"
"\\documentclass[11pt,a4paper]{article}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{graphicx}\n\\usepackage{longtable}\n\\usepackage{amsthm}\n\\usepackage{amsmath}\n\\usepackage{hyperref}\n\\usepackage{xspace}\n\\newtheorem{lemma}{Lemma}\n\\newtheorem{theorem}{Theorem}\n\\DeclareMathOperator{\\per}{per}\n"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
("report"
"\\documentclass[11pt,a4paper]{report}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{graphicx}\n\\usepackage{longtable}\n\\usepackage{hyperref}"
("\\part{%s}" . "\\part*{%s}")
("\\chapter{%s}" . "\\chapter*{%s}")
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
("book"
"\\documentclass[11pt,a4paper]{book}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{graphicx}\n\\usepackage{longtable}\n\\usepackage{hyperref}"
("\\part{%s}" . "\\part*{%s}")
("\\chapter{%s}" . "\\chapter*{%s}")
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
("beamer"
"\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n%\\usetheme{Singapore}\n%\\usecolortheme{dove}"
("\\begin{frame}{%s}" "\\end{frame}" "\\begin{frame}{%s}"
"\\end{frame}")
)
)
org-mode-hook '((lambda nil (local-set-key (kbd "RET") (quote org-return-indent)))
(lambda nil (abbrev-mode 1))
#[nil "\300\301\302\303\304$\207"
[org-add-hook change-major-mode-hook org-show-block-all append
local]
5]
(lambda nil (make-variable-buffer-local (quote yas/trigger-key))
(setq yas/trigger-key [tab])
(add-to-list (quote org-tab-first-hook)
(quote yas/org-very-safe-expand))
(define-key yas/keymap [tab] (quote yas/next-field)))
)
org-clock-out-remove-zero-time-clocks t
org-agenda-ndays 1
org-export-latex-image-default-option ""
org-refile-targets '((org-agenda-files :maxlevel . 5) (nil :maxlevel . 5))
org-ctrl-c-ctrl-c-hook '(org-babel-execute-src-block-maybe)
org-confirm-elisp-link-function 'yes-or-no-p
org-refile-use-outline-path 'file
org-log-into-drawer t
org-agenda-mode-hook '((lambda nil (hl-line-mode 1)))
org-agenda-start-on-weekday nil
org-agenda-skip-deadline-if-done t
org-occur-hook '(org-first-headline-recenter)
org-agenda-log-mode-items '(clock)
org-remember-templates '(("TODO" 116 "* TODO %?\n %a\n %u" "~/todo/todo.org" "Tasks")
("Notes" 110 "* %u %?\n %a" "~/todo/notes.org" "Notes")
("Food" 102 "* %U %?" "~/todo/health.org" "Food")
("Exercise" 101 "* %U %?" "~/todo/health.org" "Exercise"))
org-metadown-hook '(org-babel-pop-to-session-maybe)
)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile
2009-10-01 16:18 Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile cgray
@ 2009-10-01 19:49 ` Eric Schulte
2009-10-02 8:30 ` Chris Gray
0 siblings, 1 reply; 8+ messages in thread
From: Eric Schulte @ 2009-10-01 19:49 UTC (permalink / raw)
To: cgray; +Cc: emacs-orgmode
Hi Chris,
I've replied in-line below...
cgray@win.tue.nl writes:
> The org file contains:
>
> #+srcname: determine the neighbors of the segments that the bisector hits
> #+begin_src lua :tangle no :exports code
> local s1, s2 = intersecting_segs[1], intersecting_segs[2]
> local n1 = table_find_segment(cell.neighbors, s1)
> local n2 = table_find_segment(cell.neighbors, s2)
> #+end_src
>
> and the output .tex file contains:
>
> \begin{\LaTeX{}}
> \begin{verbatim}
> local s1, s2 = intersecting_segs[1], intersecting_segs[2]
> local n1 = table_find_segment(cell.neighbors, s1)
> local n2 = table_find_segment(cell.neighbors, s2)
> \end{verbatim}
> \end{\LaTeX{}}
>
I tried to recreate this problem but was unable to do so on my
computer. To recreate I exported
#+srcname: determine the neighbors of the segments that the bisector hits
#+begin_src lua :tangle no :exports code
local s1, s2 = intersecting_segs[1], intersecting_segs[2]
local n1 = table_find_segment(cell.neighbors, s1)
local n2 = table_find_segment(cell.neighbors, s2)
#+end_src
with my personal Emacs configuration and I got the following in the
resulting .tex file
#+begin_example
\lstset{language=lua}
\begin{lstlisting}
local s1, s2 = intersecting_segs[1], intersecting_segs[2]
local n1 = table_find_segment(cell.neighbors, s1)
local n2 = table_find_segment(cell.neighbors, s2)
\end{lstlisting}
#+end_example
Then with an empty Emacs configuration (using emacs -Q) and got the following
#+begin_example
\begin{verbatim}
local s1, s2 = intersecting_segs[1], intersecting_segs[2]
local n1 = table_find_segment(cell.neighbors, s1)
local n2 = table_find_segment(cell.neighbors, s2)
\end{verbatim}
#+end_example
Then with an empty Emacs configuration plus Org-babel and got the following
#+begin_example
\begin{verbatim}
local s1, s2 = intersecting_segs[1], intersecting_segs[2]
local n1 = table_find_segment(cell.neighbors, s1)
local n2 = table_find_segment(cell.neighbors, s2)
\end{verbatim}
#+end_example
note that Org-babel shouldn't have any effect here as it currently
doesn't recognize the lua language.
Sorry I can't be of more help. Maybe try with emacs -Q and
incrementally add your personal configuration until the problem
re-appears.
Best -- Eric
>
> I haven't tried this without using org-babel, so I can't say whether
> the problem is with org-babel or just with the LaTeX exporter.
>
> Cheers,
> Chris
>
> Emacs : GNU Emacs 23.0.91.1 (i486-pc-linux-gnu, GTK+ Version 2.16.0)
> of 2009-04-05 on palmer, modified by Debian
> Package: Org-mode version 6.31trans
>
> current state:
> ==============
> (setq
> org-log-done 'time
> org-clock-in-switch-to-state "STARTED"
> org-export-with-LaTeX-fragments t
> org-todo-keyword-faces '(("TODO" :foreground "red" :weight bold)
> ("STARTED" :foreground "blue" :weight bold)
> ("DONE" :foreground "forest green" :weight bold)
> ("WAITING" :foreground "orange" :weight bold)
> ("SOMEDAY" :foreground "magenta" :weight bold)
> ("CANCELLED" :foreground "forest green" :weight bold)
> ("QUOTATION" :foreground "red" :weight bold)
> ("QUOTED" :foreground "magenta" :weight bold)
> ("APPROVED" :foreground "forest green" :weight bold)
> ("EXPIRED" :foreground "forest green" :weight bold)
> ("REJECTED" :foreground "forest green" :weight bold)
> ("PROJECT" :foreground "red" :weight bold)
> ("PROJDONE" :foreground "forest green" :weight bold))
> org-agenda-clockreport-parameter-plist '(:link nil :maxlevel 2)
> org-agenda-custom-commands '(("w" "Work tasks" tags-todo "work")
> ("h" "Home tasks" tags-todo "home")
> ("r" "Refile New Notes and Tasks" tags "refile"
> ((org-agenda-todo-ignore-with-date nil)))
> )
> org-agenda-files '("~/research/code/voronoi-diagram-ipelet/voronoi.org"
> "~/todo/work.org" "~/todo/personal.org" "~/todo/todo.org")
> org-agenda-include-diary t
> org-hide-leading-stars t
> org-completion-use-ido t
> org-export-preprocess-after-blockquote-hook '(org-special-blocks-make-special-cookies)
> org-after-todo-state-change-hook '(org-clock-out-if-current)
> org-combined-agenda-icalendar-file "~/public_html/org.ics"
> org-clock-history-length 35
> org-babel-interpreters '("lua" "sh")
> org-todo-state-tags-triggers '(("CANCELLED" ("CANCELLED" . t))
> ("WAITING" ("WAITING" . t) ("NEXT"))
> ("SOMEDAY" ("WAITING" . t))
> (done ("NEXT") ("WAITING"))
> ("TODO" ("WAITING") ("CANCELLED"))
> ("STARTED" ("WAITING"))
> ("PROJECT" ("CANCELLED") ("PROJECT" . t)))
> org-remember-clock-out-on-exit nil
> org-agenda-sorting-strategy '((agenda time-up priority-down)
> (todo category-keep priority-down)
> (tags category-keep priority-down))
> org-export-html-after-blockquotes-hook '(org-special-blocks-convert-html-special-cookies)
> org-export-latex-after-blockquotes-hook '(org-special-blocks-convert-latex-special-cookies)
> org-clock-in-resume t
> org-export-preprocess-hook '(org-export-blocks-preprocess
> org-export-bibtex-preprocess)
> org-tab-first-hook '(yas/org-very-safe-expand org-hide-block-toggle-maybe)
> org-src-mode-hook '(org-src-mode-configure-edit-buffer)
> org-confirm-shell-link-function 'yes-or-no-p
> org-clock-persist t
> org-format-latex-header "\\documentclass{article}\n\\usepackage{fullpage} % do not remove\n\\usepackage{amssymb}\n\\usepackage[usenames]{color}\n\\usepackage{amsmath}\n\\usepackage{latexsym}\n\\usepackage[mathscr]{eucal}\n\\pagestyle{empty} % do not remove"
> org-highlight-latex-fragments-and-specials t
> org-todo-keywords '((sequence "TODO(t)" "STARTED(s!)" "|" "DONE(d!/!)")
> (sequence "WAITING(w@/!)" "SOMEDAY(S!)" "|" "CANCELLED(c@/!)")
> (sequence "QUOTATION(q!)" "QUOTED(Q!)" "|" "APPROVED(A@)"
> "EXPIRED(E@)" "REJECTED(R@)")
> (sequence "PROJECT(P@)" "|" "PROJDONE(D@)"))
> org-agenda-before-write-hook '(org-agenda-add-entry-text)
> org-default-notes-file "~/todo/todo.org"
> org-directory "~/todo/"
> org-blank-before-new-entry nil
> org-read-date-popup-calendar nil
> 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-latex-classes '(("article"
> "\\documentclass[11pt,a4paper]{article}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{graphicx}\n\\usepackage{longtable}\n\\usepackage{amsthm}\n\\usepackage{amsmath}\n\\usepackage{hyperref}\n\\usepackage{xspace}\n\\newtheorem{lemma}{Lemma}\n\\newtheorem{theorem}{Theorem}\n\\DeclareMathOperator{\\per}{per}\n"
> ("\\section{%s}" . "\\section*{%s}")
> ("\\subsection{%s}" . "\\subsection*{%s}")
> ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
> ("\\paragraph{%s}" . "\\paragraph*{%s}")
> ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
> ("report"
> "\\documentclass[11pt,a4paper]{report}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{graphicx}\n\\usepackage{longtable}\n\\usepackage{hyperref}"
> ("\\part{%s}" . "\\part*{%s}")
> ("\\chapter{%s}" . "\\chapter*{%s}")
> ("\\section{%s}" . "\\section*{%s}")
> ("\\subsection{%s}" . "\\subsection*{%s}")
> ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
> ("book"
> "\\documentclass[11pt,a4paper]{book}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{graphicx}\n\\usepackage{longtable}\n\\usepackage{hyperref}"
> ("\\part{%s}" . "\\part*{%s}")
> ("\\chapter{%s}" . "\\chapter*{%s}")
> ("\\section{%s}" . "\\section*{%s}")
> ("\\subsection{%s}" . "\\subsection*{%s}")
> ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
> ("beamer"
> "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n%\\usetheme{Singapore}\n%\\usecolortheme{dove}"
> ("\\begin{frame}{%s}" "\\end{frame}" "\\begin{frame}{%s}"
> "\\end{frame}")
> )
> )
> org-mode-hook '((lambda nil (local-set-key (kbd "RET") (quote org-return-indent)))
> (lambda nil (abbrev-mode 1))
> #[nil "\300\301\302\303\304$\207"
> [org-add-hook change-major-mode-hook org-show-block-all append
> local]
> 5]
> (lambda nil (make-variable-buffer-local (quote yas/trigger-key))
> (setq yas/trigger-key [tab])
> (add-to-list (quote org-tab-first-hook)
> (quote yas/org-very-safe-expand))
> (define-key yas/keymap [tab] (quote yas/next-field)))
> )
> org-clock-out-remove-zero-time-clocks t
> org-agenda-ndays 1
> org-export-latex-image-default-option ""
> org-refile-targets '((org-agenda-files :maxlevel . 5) (nil :maxlevel . 5))
> org-ctrl-c-ctrl-c-hook '(org-babel-execute-src-block-maybe)
> org-confirm-elisp-link-function 'yes-or-no-p
> org-refile-use-outline-path 'file
> org-log-into-drawer t
> org-agenda-mode-hook '((lambda nil (hl-line-mode 1)))
> org-agenda-start-on-weekday nil
> org-agenda-skip-deadline-if-done t
> org-occur-hook '(org-first-headline-recenter)
> org-agenda-log-mode-items '(clock)
> org-remember-templates '(("TODO" 116 "* TODO %?\n %a\n %u" "~/todo/todo.org" "Tasks")
> ("Notes" 110 "* %u %?\n %a" "~/todo/notes.org" "Notes")
> ("Food" 102 "* %U %?" "~/todo/health.org" "Food")
> ("Exercise" 101 "* %U %?" "~/todo/health.org" "Exercise"))
> org-metadown-hook '(org-babel-pop-to-session-maybe)
> )
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile
2009-10-01 19:49 ` Eric Schulte
@ 2009-10-02 8:30 ` Chris Gray
2009-10-02 9:36 ` Chris Gray
2009-10-02 15:11 ` Eric Schulte
0 siblings, 2 replies; 8+ messages in thread
From: Chris Gray @ 2009-10-02 8:30 UTC (permalink / raw)
To: emacs-orgmode
Eric Schulte wrote:
Hi Eric,
> I tried to recreate this problem but was unable to do so on my
> computer. To recreate I exported
>
> #+srcname: determine the neighbors of the segments that the bisector hits
> #+begin_src lua :tangle no :exports code
> local s1, s2 = intersecting_segs[1], intersecting_segs[2]
> local n1 = table_find_segment(cell.neighbors, s1)
> local n2 = table_find_segment(cell.neighbors, s2)
> #+end_src
>
> with my personal Emacs configuration and I got the following in the
> resulting .tex file
>
> #+begin_example
> \lstset{language=lua}
> \begin{lstlisting}
> local s1, s2 = intersecting_segs[1], intersecting_segs[2]
> local n1 = table_find_segment(cell.neighbors, s1)
> local n2 = table_find_segment(cell.neighbors, s2)
> \end{lstlisting}
> #+end_example
Are you exporting to LaTeX or some intermediate org-based format? I am
just using C-c C-e L to export. Should I be using an org-babel command?
> note that Org-babel shouldn't have any effect here as it currently
> doesn't recognize the lua language.
Sorry, I should have been more clear about that. I have added the
following to my setup.
(org-babel-add-interpreter "lua")
(add-to-list 'org-babel-tangle-langs '("lua" "lua" "#!/usr/bin/env lua"))
> Sorry I can't be of more help. Maybe try with emacs -Q and
> incrementally add your personal configuration until the problem
> re-appears.
Will do.
Cheers,
Chris
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile
2009-10-02 8:30 ` Chris Gray
@ 2009-10-02 9:36 ` Chris Gray
2009-10-02 10:04 ` Carsten Dominik
2009-10-02 15:11 ` Eric Schulte
1 sibling, 1 reply; 8+ messages in thread
From: Chris Gray @ 2009-10-02 9:36 UTC (permalink / raw)
To: emacs-orgmode
Hi,
The problem was with my org-special-blocks contrib package. The
attached patch fixes it. Sorry for the noise.
Cheers,
Chris
commit 4d327b5f1e80ea0e493aa70d09c53042216a1390
Author: Chris Gray <chrismgray@gmail.com>
Date: Fri Oct 2 11:31:21 2009 +0200
Added a variable to ignore some blocks.
Modified contrib/lisp/org-special-blocks.el
diff --git a/contrib/lisp/org-special-blocks.el b/contrib/lisp/org-special-blocks.el
index b8ce4d5..af50b30 100644
--- a/contrib/lisp/org-special-blocks.el
+++ b/contrib/lisp/org-special-blocks.el
@@ -40,17 +40,23 @@
;; user to add this class to his or her stylesheet if this div is to
;; mean anything.
+(defvar org-special-blocks-ignore-regexp "^\\(LaTeX\\|HTML\\)$"
+ "A regexp indicating the names of blocks that should be ignored
+by org-special-blocks. These blocks will presumably be
+interpreted by other mechanisms.")
+
(defun org-special-blocks-make-special-cookies ()
"Adds special cookies when #+begin_foo and #+end_foo tokens are
seen. This is run after a few special cases are taken care of."
(when (or htmlp latexp)
(goto-char (point-min))
(while (re-search-forward "^#\\+\\(begin\\|end\\)_\\(.*\\)$" nil t)
- (replace-match
- (if (equal (downcase (match-string 1)) "begin")
- (concat "ORG-" (match-string 2) "-START")
- (concat "ORG-" (match-string 2) "-END"))
- t t))))
+ (unless (string-match-p org-special-blocks-ignore-regexp (match-string 2))
+ (replace-match
+ (if (equal (downcase (match-string 1)) "begin")
+ (concat "ORG-" (match-string 2) "-START")
+ (concat "ORG-" (match-string 2) "-END"))
+ t t)))))
(add-hook 'org-export-preprocess-after-blockquote-hook
'org-special-blocks-make-special-cookies)
Chris Gray wrote:
> Eric Schulte wrote:
> Hi Eric,
>> I tried to recreate this problem but was unable to do so on my
>> computer. To recreate I exported
>> #+srcname: determine the neighbors of the segments that the bisector hits
>> #+begin_src lua :tangle no :exports code
>> local s1, s2 = intersecting_segs[1], intersecting_segs[2]
>> local n1 = table_find_segment(cell.neighbors, s1)
>> local n2 = table_find_segment(cell.neighbors, s2)
>> #+end_src
>> with my personal Emacs configuration and I got the following in the
>> resulting .tex file
>> #+begin_example
>> \lstset{language=lua}
>> \begin{lstlisting}
>> local s1, s2 = intersecting_segs[1], intersecting_segs[2]
>> local n1 = table_find_segment(cell.neighbors, s1)
>> local n2 = table_find_segment(cell.neighbors, s2)
>> \end{lstlisting}
>> #+end_example
> Are you exporting to LaTeX or some intermediate org-based format? I am
> just using C-c C-e L to export. Should I be using an org-babel command?
>> note that Org-babel shouldn't have any effect here as it currently
>> doesn't recognize the lua language.
> Sorry, I should have been more clear about that. I have added the
> following to my setup.
> (org-babel-add-interpreter "lua")
> (add-to-list 'org-babel-tangle-langs '("lua" "lua" "#!/usr/bin/env lua"))
>> Sorry I can't be of more help. Maybe try with emacs -Q and
>> incrementally add your personal configuration until the problem
>> re-appears.
> Will do.
> Cheers,
> Chris
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
--
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: Re: Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile
2009-10-02 9:36 ` Chris Gray
@ 2009-10-02 10:04 ` Carsten Dominik
2009-10-02 10:45 ` Chris Gray
0 siblings, 1 reply; 8+ messages in thread
From: Carsten Dominik @ 2009-10-02 10:04 UTC (permalink / raw)
To: Chris Gray; +Cc: emacs-orgmode
Hi Chris,
the error was on my side - I did not remove the backend-specific
markers after selecting the content. This is now again done
correctly, so your patch should not be needed. But maybe you
want it in anyway, with an empty configuration variable?
- Carsten
On Oct 2, 2009, at 11:36 AM, Chris Gray wrote:
> Hi,
>
> The problem was with my org-special-blocks contrib package. The
> attached patch fixes it. Sorry for the noise.
>
> Cheers,
> Chris
>
> commit 4d327b5f1e80ea0e493aa70d09c53042216a1390
> Author: Chris Gray <chrismgray@gmail.com>
> Date: Fri Oct 2 11:31:21 2009 +0200
>
> Added a variable to ignore some blocks.
>
> Modified contrib/lisp/org-special-blocks.el
> diff --git a/contrib/lisp/org-special-blocks.el b/contrib/lisp/org-
> special-blocks.el
> index b8ce4d5..af50b30 100644
> --- a/contrib/lisp/org-special-blocks.el
> +++ b/contrib/lisp/org-special-blocks.el
> @@ -40,17 +40,23 @@
> ;; user to add this class to his or her stylesheet if this div is to
> ;; mean anything.
>
> +(defvar org-special-blocks-ignore-regexp "^\\(LaTeX\\|HTML\\)$"
> + "A regexp indicating the names of blocks that should be ignored
> +by org-special-blocks. These blocks will presumably be
> +interpreted by other mechanisms.")
> +
> (defun org-special-blocks-make-special-cookies ()
> "Adds special cookies when #+begin_foo and #+end_foo tokens are
> seen. This is run after a few special cases are taken care of."
> (when (or htmlp latexp)
> (goto-char (point-min))
> (while (re-search-forward "^#\\+\\(begin\\|end\\)_\\(.*\\)$" nil
> t)
> - (replace-match
> - (if (equal (downcase (match-string 1)) "begin")
> - (concat "ORG-" (match-string 2) "-START")
> - (concat "ORG-" (match-string 2) "-END"))
> - t t))))
> + (unless (string-match-p org-special-blocks-ignore-regexp
> (match-string 2))
> + (replace-match
> + (if (equal (downcase (match-string 1)) "begin")
> + (concat "ORG-" (match-string 2) "-START")
> + (concat "ORG-" (match-string 2) "-END"))
> + t t)))))
>
> (add-hook 'org-export-preprocess-after-blockquote-hook
> 'org-special-blocks-make-special-cookies)
>
>
>
> Chris Gray wrote:
>
>> Eric Schulte wrote:
>
>> Hi Eric,
>
>
>>> I tried to recreate this problem but was unable to do so on my
>>> computer. To recreate I exported
>
>>> #+srcname: determine the neighbors of the segments that the
>>> bisector hits
>>> #+begin_src lua :tangle no :exports code
>>> local s1, s2 = intersecting_segs[1], intersecting_segs[2]
>>> local n1 = table_find_segment(cell.neighbors, s1)
>>> local n2 = table_find_segment(cell.neighbors, s2)
>>> #+end_src
>
>>> with my personal Emacs configuration and I got the following in the
>>> resulting .tex file
>
>>> #+begin_example
>>> \lstset{language=lua}
>>> \begin{lstlisting}
>>> local s1, s2 = intersecting_segs[1], intersecting_segs[2]
>>> local n1 = table_find_segment(cell.neighbors, s1)
>>> local n2 = table_find_segment(cell.neighbors, s2)
>>> \end{lstlisting}
>>> #+end_example
>
>> Are you exporting to LaTeX or some intermediate org-based format?
>> I am
>> just using C-c C-e L to export. Should I be using an org-babel
>> command?
>
>>> note that Org-babel shouldn't have any effect here as it currently
>>> doesn't recognize the lua language.
>
>> Sorry, I should have been more clear about that. I have added the
>> following to my setup.
>
>> (org-babel-add-interpreter "lua")
>
>> (add-to-list 'org-babel-tangle-langs '("lua" "lua" "#!/usr/bin/env
>> lua"))
>
>
>>> Sorry I can't be of more help. Maybe try with emacs -Q and
>>> incrementally add your personal configuration until the problem
>>> re-appears.
>
>> Will do.
>
>> Cheers,
>> Chris
>
>
>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Remember: use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>
> --
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile
2009-10-02 10:04 ` Carsten Dominik
@ 2009-10-02 10:45 ` Chris Gray
2009-10-02 11:12 ` Carsten Dominik
0 siblings, 1 reply; 8+ messages in thread
From: Chris Gray @ 2009-10-02 10:45 UTC (permalink / raw)
To: emacs-orgmode
Carsten Dominik wrote:
> Hi Chris,
> the error was on my side - I did not remove the backend-specific
> markers after selecting the content. This is now again done
> correctly, so your patch should not be needed. But maybe you
> want it in anyway, with an empty configuration variable?
Famous last words, but I don't see how it can hurt. :)
Cheers,
Chris
> - Carsten
> On Oct 2, 2009, at 11:36 AM, Chris Gray wrote:
>> Hi,
>> The problem was with my org-special-blocks contrib package. The
>> attached patch fixes it. Sorry for the noise.
>> Cheers,
>> Chris
>> commit 4d327b5f1e80ea0e493aa70d09c53042216a1390
>> Author: Chris Gray <chrismgray@gmail.com>
>> Date: Fri Oct 2 11:31:21 2009 +0200
>> Added a variable to ignore some blocks.
>> Modified contrib/lisp/org-special-blocks.el
>> diff --git a/contrib/lisp/org-special-blocks.el b/contrib/lisp/org-
>> special-blocks.el
>> index b8ce4d5..af50b30 100644
>> --- a/contrib/lisp/org-special-blocks.el
>>>>> b/contrib/lisp/org-special-blocks.el
>> @@ -40,17 +40,23 @@
>> ;; user to add this class to his or her stylesheet if this div is to
>> ;; mean anything.
>>> (defvar org-special-blocks-ignore-regexp "^\\(LaTeX\\|HTML\\)$"
>>> "A regexp indicating the names of blocks that should be ignored
>>> by org-special-blocks. These blocks will presumably be
>>> interpreted by other mechanisms.")
>> (defun org-special-blocks-make-special-cookies ()
>> "Adds special cookies when #+begin_foo and #+end_foo tokens are
>> seen. This is run after a few special cases are taken care of."
>> (when (or htmlp latexp)
>> (goto-char (point-min))
>> (while (re-search-forward "^#\\+\\(begin\\|end\\)_\\(.*\\)$" nil
>> t)
>> - (replace-match
>> - (if (equal (downcase (match-string 1)) "begin")
>> - (concat "ORG-" (match-string 2) "-START")
>> - (concat "ORG-" (match-string 2) "-END"))
>> - t t))))
>>> (unless (string-match-p org-special-blocks-ignore-regexp
>> (match-string 2))
>>> (replace-match
>>> (if (equal (downcase (match-string 1)) "begin")
>>> (concat "ORG-" (match-string 2) "-START")
>>> (concat "ORG-" (match-string 2) "-END"))
>>> t t)))))
>> (add-hook 'org-export-preprocess-after-blockquote-hook
>> 'org-special-blocks-make-special-cookies)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Re: Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile
2009-10-02 10:45 ` Chris Gray
@ 2009-10-02 11:12 ` Carsten Dominik
0 siblings, 0 replies; 8+ messages in thread
From: Carsten Dominik @ 2009-10-02 11:12 UTC (permalink / raw)
To: Chris Gray; +Cc: emacs-orgmode
I have applied the patch, thanks.
- Carsten
On Oct 2, 2009, at 12:45 PM, Chris Gray wrote:
> Carsten Dominik wrote:
>
>> Hi Chris,
>
>> the error was on my side - I did not remove the backend-specific
>> markers after selecting the content. This is now again done
>> correctly, so your patch should not be needed. But maybe you
>> want it in anyway, with an empty configuration variable?
>
> Famous last words, but I don't see how it can hurt. :)
>
> Cheers,
> Chris
>
>> - Carsten
>
>> On Oct 2, 2009, at 11:36 AM, Chris Gray wrote:
>
>>> Hi,
>
>>> The problem was with my org-special-blocks contrib package. The
>>> attached patch fixes it. Sorry for the noise.
>
>>> Cheers,
>>> Chris
>
>>> commit 4d327b5f1e80ea0e493aa70d09c53042216a1390
>>> Author: Chris Gray <chrismgray@gmail.com>
>>> Date: Fri Oct 2 11:31:21 2009 +0200
>
>>> Added a variable to ignore some blocks.
>
>>> Modified contrib/lisp/org-special-blocks.el
>>> diff --git a/contrib/lisp/org-special-blocks.el b/contrib/lisp/org-
>>> special-blocks.el
>>> index b8ce4d5..af50b30 100644
>>> --- a/contrib/lisp/org-special-blocks.el
>>>>>> b/contrib/lisp/org-special-blocks.el
>>> @@ -40,17 +40,23 @@
>>> ;; user to add this class to his or her stylesheet if this div is to
>>> ;; mean anything.
>
>>>> (defvar org-special-blocks-ignore-regexp "^\\(LaTeX\\|HTML\\)$"
>>>> "A regexp indicating the names of blocks that should be ignored
>>>> by org-special-blocks. These blocks will presumably be
>>>> interpreted by other mechanisms.")
>
>>> (defun org-special-blocks-make-special-cookies ()
>>> "Adds special cookies when #+begin_foo and #+end_foo tokens are
>>> seen. This is run after a few special cases are taken care of."
>>> (when (or htmlp latexp)
>>> (goto-char (point-min))
>>> (while (re-search-forward "^#\\+\\(begin\\|end\\)_\\(.*\\)$" nil
>>> t)
>>> - (replace-match
>>> - (if (equal (downcase (match-string 1)) "begin")
>>> - (concat "ORG-" (match-string 2) "-START")
>>> - (concat "ORG-" (match-string 2) "-END"))
>>> - t t))))
>>>> (unless (string-match-p org-special-blocks-ignore-regexp
>>> (match-string 2))
>>>> (replace-match
>>>> (if (equal (downcase (match-string 1)) "begin")
>>>> (concat "ORG-" (match-string 2) "-START")
>>>> (concat "ORG-" (match-string 2) "-END"))
>>>> t t)))))
>
>>> (add-hook 'org-export-preprocess-after-blockquote-hook
>>> 'org-special-blocks-make-special-cookies)
>
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Re: Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile
2009-10-02 8:30 ` Chris Gray
2009-10-02 9:36 ` Chris Gray
@ 2009-10-02 15:11 ` Eric Schulte
1 sibling, 0 replies; 8+ messages in thread
From: Eric Schulte @ 2009-10-02 15:11 UTC (permalink / raw)
To: emacs-orgmode
Chris Gray <chrismgray@gmail.com> writes:
> Eric Schulte wrote:
>> with my personal Emacs configuration and I got the following in the
>> resulting .tex file
>>
>> #+begin_example
>> \lstset{language=lua}
>> \begin{lstlisting}
>> local s1, s2 = intersecting_segs[1], intersecting_segs[2]
>> local n1 = table_find_segment(cell.neighbors, s1)
>> local n2 = table_find_segment(cell.neighbors, s2)
>> \end{lstlisting}
>> #+end_example
>
> Are you exporting to LaTeX or some intermediate org-based format? I am
> just using C-c C-e L to export. Should I be using an org-babel command?
>
This looks to be resolved, but for completeness the way that I export
using the listing package above is the following configuration
--8<---------------cut here---------------start------------->8---
;; tell org to use listings
(setq org-export-latex-listings t)
;; you must include the listings package
(add-to-list 'org-export-latex-packages-alist '("" "listings"))
;; if you want colored source code then you need to include the color package
(add-to-list 'org-export-latex-packages-alist '("" "color"))
--8<---------------cut here---------------end--------------->8---
Cheers -- Eric
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-10-02 15:11 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-01 16:18 Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile cgray
2009-10-01 19:49 ` Eric Schulte
2009-10-02 8:30 ` Chris Gray
2009-10-02 9:36 ` Chris Gray
2009-10-02 10:04 ` Carsten Dominik
2009-10-02 10:45 ` Chris Gray
2009-10-02 11:12 ` Carsten Dominik
2009-10-02 15:11 ` Eric Schulte
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).