[Orgmode] Re: Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile
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
[Orgmode] Re: Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile
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 chrismg...@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
Re: [Orgmode] Re: Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile
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 chrismg...@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 ___ 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
[Orgmode] Re: Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile
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 chrismg...@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
Re: [Orgmode] Re: Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile
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 chrismg...@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 ___ 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
Re: [Orgmode] Re: Org-mode version 6.31trans; Exporting src blocks to LaTeX produces .tex file that fails to compile
Chris Gray chrismg...@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 ___ 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