Re: [O] latex equation and html export
Aloha Joseph, Joseph Vidal-Rosset writes: > Unfortunately, this code does not give a good translation in latex , here > is the result in the tex file: > > \begin{equation} > \label{eq:2} > A [image: \to] [image: \neg{}] B > \end{equation} I get this LaTeX, which works as expected: \begin{equation} \label{eq:2} A \(\to\) \(\neg{}\) B \end{equation} % Emacs 24.3.1 (Org mode 8.2.4) Also, IIUC the Org mode manual at section 11.8, the HTML back-end wraps its contents within a `' tag (although I get ). I don't work with HTML export much, but I believe this is what you need to format the output with a style sheet. hth, Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] latex equation and html export
Aloha Joseph, Joseph Vidal-Rosset writes: > With numbered equation, I do not succeed to get a code working both for > LateX export AND html export . > > For example this code: > > #+BEGIN_LaTeX > \begin{equation} > \label{eq:2} > A \to \neg B > \end{equation} > #+END_LaTeX > > works fine in org-mode : latex syntax is highleted and the export to pdf > works. But it does not work with html export: the formula does not appear. > Your code is targeted to the LaTeX back-end and should be ignored by other back-ends (as you've discovered). Something like this might do what you want: #+NAME: eq:2 #+BEGIN_EQUATION A \to \neg B #+END_EQUATION See Section 11.8 of the manual, Special Blocks. hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Contribution: ob-groovy.el
Aloha Miro, Miro Bezjak writes: > can I do all those tasks over the couple of days - when I have more time? Yes, of course. The FSF papers will probably take several weeks to complete, if you haven't already done so. > > Should I just add the documentation before ob-groovy.el is accepted? > I don't see any problem with adding the documentation at your convenience. Eric Schulte will review ob-groovy.el and work with you to find its appropriate place in Org mode. I'll be happy to review and edit the documentation, if you'd like. > For now, I've updated languages to include scala. > http://orgmode.org/worg/org-contrib/babel/languages.html Thanks! I'll take this off my TODO list. All the best, Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] Contribution: ob-groovy.el
Aloha Miro, Thanks for your contribution to Org mode. Have you signed the FSF papers so that ob-groovy.el can be added to Org mode? See: http://orgmode.org/worg/org-contribute.html#sec-6 Contributions by authors who have not signed the FSF papers are typically added to the contrib directory and are not distributed with Emacs. Also, are you willing to draft documentation? For a link to a documentation template, see: http://orgmode.org/worg/org-contrib/babel/languages.html I was going to suggest that you use the Scala documentation as a guide, but it doesn't exist! In fact, Scala doesn't appear in Worg's list of languages supported by Babel. One of those days ... Thanks again for your contribution. All the best, Tom Miro Bezjak writes: > Hi all, > > I would like to contribute org-babel functions for Groovy evaluation. I > simply > copy/pasted ob-scala.el and made appropriate changes. > > I'm attaching ob-groovy.el as a file. > > All 3 tests pass, although I haven't created `testing/test-ob-groovy.el` - > I'll > look into that. > > --- testing last result > #+BEGIN_SRC groovy > println "ignored" > 1 + 2 > #+END_SRC > > #+RESULTS: > : 3 > > > --- testing results output -- > #+BEGIN_SRC groovy :results output > println '1' > println '2' > println 1 + 2 > #+END_SRC > > #+RESULTS: > =1 > 2 > 3 > > > --- testing table -- > #+BEGIN_SRC groovy :results verbatim raw > """ > | 1 | 2 > |-- > | a | b > """.trim() > #+END_SRC > > #+RESULTS: > | 1 | 2 | > |---+---| > | a | b | > > > > Kind Regards, > Miro Bezjak > Hi all, > > I would like to contribute org-babel functions for Groovy evaluation. > I simply > copy/pasted ob-scala.el and made appropriate changes. > > I'm attaching ob-groovy.el as a file. > > All 3 tests pass, although I haven't created > `testing/test-ob-groovy.el` - I'll > look into that. > > --- testing last result > #+BEGIN_SRC groovy > println "ignored" > 1 + 2 > #+END_SRC > > #+RESULTS: > : 3 > > > --- testing results output -- > #+BEGIN_SRC groovy :results output > println '1' > println '2' > println 1 + 2 > #+END_SRC > > #+RESULTS: > =1 > 2 > 3 > > > --- testing table -- > #+BEGIN_SRC groovy :results verbatim raw > """ > | 1 | 2 > |-- > | a | b > """.trim() > #+END_SRC > > #+RESULTS: > | 1 | 2 | > |---+---| > | a | b | > > > Kind Regards, > Miro Bezjak > > -- Thomas S. Dye http://www.tsdye.com
Re: [O] LaTeX export, problem with quotes
Aloha Nicolas, Ah, I see what's happening now. I've set up asynchronous export to use the Org mode that ships with Emacs, rather than the one from the git repo. Of course, that doesn't track your changes. In this case, where many potential users of my reproducible research document aren't using the latest Org mode, a file-specific org-entities-user entry looks like the best solution. Thanks for your patience as I puzzled this out online. All the best, Tom Nicolas Goaziou writes: > t...@tsdye.com (Thomas S. Dye) writes: > >> I'm getting the same incorrect result as before with: >> >> Org-mode version 8.2.4 (release_8.2.4-391-g954168 @ >> /Users/dk/.emacs.d/src/org-mode/lisp/) > > Did you reload Org? I cannot reproduce the problem anymore. > >>> Nevertheless, there will always be failing cases in smart quote >>> detection (see `org-export-smart-quotes-regexps'). >> >> I can't comprehend the regular expression(s) there, unfortunately. If it >> is the case that there will always be failing cases, and my goal is to >> create a stable piece of reproducible research, would you recommend an >> approach that sets org-entities-user appropriately at the file-local >> level, or something else? > > I mean that choosing between an opening quote, a closing quote, or > nothing is done with a regexp. It cannot cover all cases, and some > tricky situations will fool smart quote mechanism. > > If that happens, and if `org-export-smart-quotes-regexps' cannot be > improved to handle the situation consistently, you will have to specify > LaTeX quote code manually (e.g. with an export snippet, or an entity). > > I cannot see the link with reproducible research, though. > > > Regards, -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] LaTeX export, problem with quotes
Nicolas Goaziou writes: > t...@tsdye.com (Thomas S. Dye) writes: > >> I'm getting the same incorrect result as before with: >> >> Org-mode version 8.2.4 (release_8.2.4-391-g954168 @ >> /Users/dk/.emacs.d/src/org-mode/lisp/) > > Did you reload Org? I cannot reproduce the problem anymore. Hmm, "later" and "{l}ater" both work for me, but "[l]ater" and "(l)ater" both fail. I'm exporting asynchronously. > I mean that choosing between an opening quote, a closing quote, or > nothing is done with a regexp. It cannot cover all cases, and some > tricky situations will fool smart quote mechanism. > > If that happens, and if `org-export-smart-quotes-regexps' cannot be > improved to handle the situation consistently, you will have to specify > LaTeX quote code manually (e.g. with an export snippet, or an entity). > > I cannot see the link with reproducible research, though. I'm perhaps too wary of regressions here. All the best, Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] LaTeX export, problem with quotes
Aloha Nicolas, Nicolas Goaziou writes: > Hello, > > t...@tsdye.com (Thomas S. Dye) writes: > >> I'm having a problem with exporting quotes. I have the #+OPTIONS ':t. >> >> This input in the Org mode file: >> >> "[l]ater walls ..." >> >> produces this in the tex file (open quote wrong, close quote OK): >> "[l]ater walls ...'' >> >> I'm expecting this in the tex file: >> ''[l]ater walls ...'' > > I fixed it in maint. Thank you for reporting it. I'm getting the same incorrect result as before with: Org-mode version 8.2.4 (release_8.2.4-391-g954168 @ /Users/dk/.emacs.d/src/org-mode/lisp/) > > Nevertheless, there will always be failing cases in smart quote > detection (see `org-export-smart-quotes-regexps'). I can't comprehend the regular expression(s) there, unfortunately. If it is the case that there will always be failing cases, and my goal is to create a stable piece of reproducible research, would you recommend an approach that sets org-entities-user appropriately at the file-local level, or something else? All the best, Tom -- Thomas S. Dye http://www.tsdye.com
[O] org-entities in #+captions
Aloha all, With this local variable: # eval: (add-to-list 'org-entities-user '("amacron" "\\={a}" nil "ā" "a" "a" "ā")) the org-entity \amacron isn't handled inside a caption: #+caption: *Level assignments in the Kahua 1 and P\amacron{}hinahina detailed study area.* The caption exports to LaTeX correctly, but it looks a bit weird in the Org mode buffer. Is this the expected behavior? All the best, Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] Getting custom LaTeX exports to work
Hi Uwe, Uwe Ziegenhagen writes: > ;; now let's add a few custom class export templates > (add-to-list 'org-latex-classes > '("koma-artikel" > "\\documentclass{scrartcl}" > ("\\section{%s}" . "\\section*{%s}") > ("\\subsection{%s}" . "\\subsection*{%s}") > ("\\subsubsection{%s}" . "\\subsubsection*{%s}") > ("\\paragraph{%s}" . "\\paragraph*{%s}") > ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) > > (add-to-list 'org-latex-classes > '("scrlttr" > "\\documentclass[11pt]{scrlttr2}\n > \\usepackage[utf8]{inputenc}\n > \\usepackage[T1]{fontenc}\n > \\usepackage{xcolor}" > > ("\\section{%s}" . "\\section*{%s}") > ("\\subsection{%s}" . "\\subsection*{%s}") > ("\\subsubsection{%s}" . "\\subsubsection*{%s}") > ("\\paragraph{%s}" . "\\paragraph*{%s}") > ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) > > In my simple org-file I have the following in the first line: > > #+LaTeX_CLASS: koma-article > > Unfortunately I still get "Unknown LaTeX Class `koma-article`" when > executing -c-e l L You've named it `koma-artikel', not `koma-article'. hth, Tom -- Thomas S. Dye http://www.tsdye.com
[O] LaTeX export, problem with quotes
Aloha all, I'm having a problem with exporting quotes. I have the #+OPTIONS ':t. This input in the Org mode file: "[l]ater walls ..." produces this in the tex file (open quote wrong, close quote OK): "[l]ater walls ...'' I'm expecting this in the tex file: ''[l]ater walls ...'' I'm using Org-mode version 8.2.4 (release_8.2.4-329-g149eaf @ /Users/dk/.emacs.d/src/org-mode/lisp/) All the best, Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] [PATCH] Add ob-J.el
Aloha Oleh, The documentation looks good. Thanks for this contribution to Org mode. All the best, Tom Oleh writes: > Hi all, > > The doc for ob-J is now available at > http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-J.html > > regards, > Oleh > > On Fri, Dec 20, 2013 at 6:22 PM, Thomas S. Dye wrote: >> Aloha Oleh, >> >> Oleh writes: >> >>> Hi all, >>> >>> Here's a patch to add babel support for J. >>> I couldn't figure out how to make ob-J.elc a target for make, >>> maybe someone can fix this. >>> >>> regards, >>> Oleh >>> >> >> Are you willing to draft documentation for ob-J.el? You can find a link >> for a documentation template here: >> >> http://orgmode.org/worg/org-contrib/babel/languages.html#develop >> >> I'm happy to proof-read and edit draft documentation, if you'd like. >> We're slowly catching up with the documentation for babel languages. >> >> Thanks for your contribution to Org mode! >> >> All the best, >> Tom >> >> -- >> Thomas S. Dye >> http://www.tsdye.com > > -- Thomas S. Dye http://www.tsdye.com
Re: [O] [PATCH] Add ob-J.el
Aloha Oleh, Oleh writes: > Hi all, > > Here's a patch to add babel support for J. > I couldn't figure out how to make ob-J.elc a target for make, > maybe someone can fix this. > > regards, > Oleh > Are you willing to draft documentation for ob-J.el? You can find a link for a documentation template here: http://orgmode.org/worg/org-contrib/babel/languages.html#develop I'm happy to proof-read and edit draft documentation, if you'd like. We're slowly catching up with the documentation for babel languages. Thanks for your contribution to Org mode! All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] [RFC] About `org-export-with-\(fixed-width\|tables\)'
Nicolas Goaziou writes: > Hello, > > t...@tsdye.com (Thomas S. Dye) writes: > >> Nicolas Goaziou writes: >> Removal is fine with me. For years now, I've inserted the automatic >> boilerplate at the top of my Org mode documents, which has ::t and |:t. >> If the functions are removed, then it would be great if it wasn't necessary >> to go back and get rid of the obsolete OPTIONS in all those old, but >> still active, files. > > For clarification, you needn't change old OPTIONS lines. It is the same > as @:t in Org files written before 8.0: it doesn't mean anything > anymore, but doesn't hurt either. Perfect (as usual). Thanks! All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] [RFC] About `org-export-with-\(fixed-width\|tables\)'
Nicolas Goaziou writes: > Hello, > > At the moment, `org-export-with-fixed-width' and > `org-export-with-tables' (or their OPTIONS equivalent ::t and |:t) are > broken when not set to their default value. Also, "fixing" them is not > trivial. I think this is a good time to ponder about their usefulness. > > Indeed, I don't think anyone would want to remove tables (or fixed-width > areas) from Org syntax. These variables were probably written because > tables and fixed-width can occasionally get in the way, on very specific > lines. > > However, Org already provides ways to work around such problems. For > example, a table can be wrapped within an example block, or an offending > line can start with \vert instead of "|". > > Therefore, in today's Org, they don't make much sense anymore. As > a consequence, I'd like to either: > > 1. Remove them completely from code base; Removal is fine with me. For years now, I've inserted the automatic boilerplate at the top of my Org mode documents, which has ::t and |:t. If the functions are removed, then it would be great if it wasn't necessary to go back and get rid of the obsolete OPTIONS in all those old, but still active, files. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] #+TEXT: disappeared
Manfred Lotz writes: > On Tue, 17 Dec 2013 15:53:25 +0100 > "Sebastien Vauban" > wrote: > >> Manfred Lotz wrote: >> > I just found that #+TEXT: from pre 8 org-mode has disappeared. >> > >> > Does anybody know how this is done with org-mode 8? >> >> IIUC, it became `#+ascii:'. >> >> Best regards, >> Seb >> > > Hm, when I try this it won't even appear in the .tex file. I'm not sure what your expectations might be, but if you want to add special code to a .tex file, Section 12.7.3 of the manual, Quoting LaTeX code, describes how to do that. hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Old style backquotes in ox-texinfo.el
James Harkins writes: >>> If this has been fixed in master, then I'm content to leave it at that. >> >> I don't know about this. My guess is that your Org-mode installation is >> messed up somehow. > > I'm unclear how. I didn't see this message in Emacs. It's during > "make." That has to do only with the git repository, nothing about > installation. I see in the git log for ox-texinfo that Carsten got rid of old style backquoting on September 19th. Yours must be older than that? All the best, Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] Old style backquotes in ox-texinfo.el
James Harkins writes: > Incidentally, while I was trying different versions last night (for > the LaTeX starred-figure issue), I saw the following warnings during > "make": > > In toplevel form: > ox-texinfo.el:1683:1:Warning: !! The file uses old-style backquotes !! > This functionality has been obsolete for more than 10 years already > and will be removed soon. See (elisp)Backquote in the manual. > ox-texinfo.el:1717:1:Warning: !! The file uses old-style backquotes !! > This functionality has been obsolete for more than 10 years already > and will be removed soon. See (elisp)Backquote in the manual. I can't reproduce this. The lines that throw warnings for you are both docstrings with the version of ox-texinfo.el I just pulled from git-master. hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] how to adjust vertical spacing between lines in a simple list, pdflatex export
Aloha Chris, "Christopher W. Ryan" writes: > In LaTeX, I would typically use the enumitem package, and then start an > itemized list with > > \begin{itemize}[itemsep= ] > > where itemsep could equal whatever spacing I wanted. > > How do I change the inter-item vertical spacing (specifically, decrease > it) in org-mode with pdflatex export? > You'll need to make certain enumitem is loaded. Then, this should work: #+ATTR_LATEX: :options itemsep=1pt - One - Two - Three \begin{itemize}[itemsep=1pt] \item One \item Two \item Threee \end{itemize} % Emacs 24.3.1 (Org mode 8.2.3c) All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] How do I specify the language for a :results code block
Aloha Alan, Alan Schmitt writes: > Unfortunately, if I export this, the code is duplicated. Here is the > generated html, for instance: Yes, the code is partially duplicated when I run it. It looks to me as if the problem stems from :results raw and the fact that results is itself a source code block that includes lines like #+BEGIN_SRC and #+END_SRC. Perhaps the same confusion shows if you change the :results raw header argument for the call line to :results org, evaluate, change back to :results raw, and then evaluate again. You should find an extra #+END_SRC in the buffer. IIUC, your goal is to export the coq source code blocks. Does the following, which uses :results org, do what you want? It seems to work for me. #+name: fetchcoq2 #+BEGIN_SRC sh :exports none :results raw :var f="demo.v" echo "#+BEGIN_SRC coq" echo $f echo "#+END_SRC" #+END_SRC #+results: fetchcoq2 #+BEGIN_SRC coq demo.v #+END_SRC #+name: fetchcoq-call #+call: fetchcoq2("demo.v") :results org #+results: fetchcoq-call #+BEGIN_SRC org ,#+BEGIN_SRC coq demo.v ,#+END_SRC #+END_SRC hth, Tom P.S. I remembered :wrap just now. This doesn't export well, though. #+call: fetchcoq2("demo.v") :wrap src coq #+results: #+BEGIN_src coq demo.v #+END_src Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] Babel support for the D language
Aloha Thierry, Thierry Banel writes: > Done ! > The first draft of > http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-D.html > has been committed. I pushed some minor edits. Looks good! All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] How do I specify the language for a :results code block
Alan Schmitt writes: > I tried this alternate approach, to directly generate the block: > > #+name: fetchcoq2 > #+BEGIN_SRC sh :exports none :results raw :var f="demo.v" > echo "#+BEGIN_SRC coq" > head $f > echo > echo "#+END_SRC" > #+END_SRC > > #+call: fetchcoq2("demo.v") > > But then I get a result like this, with extra quoting: > > #+RESULTS: > : #+BEGIN_SRC coq > : Definition toto : forall x, exists y, x = y. > : > : Lemma foo: forall x, x=x. > : #+END_SRC > > I feel like I'm missing something obvious. ":results code" is exactly > what I want (put the results in a SRC block), but I don't know how to > specify the headers of the generated code block. You need :results raw at the end of the call line. #+name: fetchcoq2 #+BEGIN_SRC sh :exports none :results raw :var f="demo.v" echo "#+BEGIN_SRC coq" echo $f echo "#+END_SRC" #+END_SRC #+results: fetchcoq2 #+BEGIN_SRC coq demo.v #+END_SRC #+call: fetchcoq2("demo.v") :results raw #+results: #+BEGIN_SRC coq demo.v #+END_SRC hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] How do I specify the language for a :results code block
Aloha Alan, Alan Schmitt writes: > Hello, > > I'm trying to write a block in some language (right now shell, but it > will probably be something different) whose output is an org source > block is some language (here coq). I keep looking at the documentation > and I cannot see how to specify the language. If I try something like: > > #+BEGIN_SRC sh :results code > head -n 3 demo.v > #+END_SRC > > When I evaluate the block I get: > > #+RESULTS: > #+BEGIN_SRC sh > Definition toto : forall x, exists y, x = y. > > Lemma foo: forall x, x=x. > #+END_SRC > > How can I have a block with "#+BEGIN_SRC coq" instead? I looked at > http://orgmode.org/manual/Specific-header-arguments.html#Specific-header-arguments > and at http://orgmode.org/manual/results.html#results and could not find > where one would specify the language. I think this can be accomplished by chaining: #+name: first-link #+begin_src sh ECHO "XXX" #+end_src #+begin_src emacs-lisp :var x=first-link() (princ x) #+end_src #+results: : XXX hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] LaTeX export with documentclass ltugboat
Jason Lewis writes: > (require 'org-latex) > (unless (boundp 'org-export-latex-classes) > (add-to-list 'org-export-latex-classes > '("ltugboat" >"\\documentclass{ltugboat}" >("\\section{%s}" . "\\section*{%s}") >("\\subsection{%s}" . "\\subsection*{%s}") >("\\subsubsection{%s}" . "\\subsubsection*{%s}") >("\\paragraph{%s}" . "\\paragraph*{%s}") >("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) It looks like you are using < 8.0 functions. Try something like this: (require 'ox-latex) (add-to-list 'org-latex-classes '("ltugboat" "\\documentclass{ltugboat}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) Note: org-latex -> ox-latex org-export-latex-classes -> org-latex-classes hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Babel support for the D language
Thierry Banel writes: > By the way, are you aware of a location to store a *.el in Worg ? poto:worg dk$ find . -name "*.el" -print ./.dir-locals.el ./.dir-settings.el ./code/elisp/davidam.el ./code/elisp/dto-org-gtd.el ./code/elisp/org-collector.el ./code/elisp/org-effectiveness.el ./code/elisp/org-exchange-capture.el ./code/elisp/org-issue.el ./code/elisp/org-license.el ./code/elisp/org-player.el ./code/elisp/worg-fortune.el ./code/elisp/worg.el ./color-themes/color-theme-folio.el ./color-themes/color-theme-manoj.el ./color-themes/color-theme-railscast.el ./color-themes/color-theme-tangotango.el ./color-themes/color-theme-zenash.el ./color-themes/color-theme-zenburn.el ./org-contrib/babel/ob-template.el ./org-tests/ert-publish-test.el ./org-tests/tools/el-expectations.el ./org-tests/tools/el-mock.el ./org-tests/tools/ert.el ./worgtest-init.el > I happily accept your help for proof-reading the yet-to-be-written > documentation. Great. Let me know when you've pushed a draft to Worg. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Babel support for the D language
string >;;"/" "" >;;(org-babel-process-file-name tmp-src-file > > (full-body (org-babel-D-expand body params))) > (with-temp-file tmp-src-file (insert full-body)) > > ;; add path to D binaries if not already there > ;;(let ((bin "c:/DLang/dmd2/windows/bin;") > ;; (path (getenv "PATH"))) > ;; (unless (string-match bin path) > ;;(setenv "PATH" (concat bin path > > (org-babel-eval rdmd ""))) > > (defun org-babel-D-expand (body params) > "Expand a block of D code with org-babel according to > its header arguments." > (let ((vars (mapcar #'cdr (org-babel-get-header params :var))) > (colname-names (cdr (car (org-babel-get-header params :colname-names > (main-p (not (string= (cdr (assoc :main params)) "no"))) > (imports (mapcar #'cdr (org-babel-get-header params :import > (mapconcat 'identity > (list > "module aaa;\n" > ;; imports > (mapconcat > (lambda (inc) (format "import %s;" inc)) > imports "\n") > ;; variables > (mapconcat 'org-babel-D-var-to-D vars "\n") > (mapconcat 'org-babel-D-colnames-to-D colname-names "\n") > ;; body > (if main-p > (org-babel-D-ensure-main-wrap body) >body) "\n") "\n"))) > > (defun org-babel-D-ensure-main-wrap (body) > "Wrap body in a \"main\" function call if none exists." > (if (string-match "^[ \t]*[intvod]+[ \t\n\r]*main[ \t]*(.*)" body) > body > (format "int main() {\n%s\nreturn(0);\n}\n" body))) > > (defun org-babel-prep-session:D (session params) > "This function does nothing as D is a compiled language with no > support for sessions" > (error "D is a compiled languages -- no support for sessions")) > > (defun org-babel-load-session:D (session body params) > "This function does nothing as D is a compiled language with no > support for sessions" > (error "D is a compiled languages -- no support for sessions")) > > ;; helper functions > > (defun org-babel-D-var-to-D (pair) > "Convert an elisp value into a string of D code specifying a variable > of the same value." > (let ((var (car pair)) > (val (cdr pair))) > (when (symbolp val) > (setq val (symbol-name val)) > (when (= (length val) 1) > (setq val (string-to-char val > (cond > ((integerp val) > (format "int %S = %S;" var val)) > ((floatp val) > (format "double %S = %S;" var val)) > ((stringp val) > (format "string %S = \"%s\";" var val)) > ((listp val) > (if (assoc var colname-names) () > (setq colname-names > (cons (cons > var > (let ((i 0)) (mapcar (lambda (x) (setq i (1+ i)) (format > "$%s" i)) > (car val > colname-names))) > (format "string[][] %S = [\n[%s]];" var > (mapconcat (lambda (row) >(if (listp row) >(mapconcat (lambda (v) (format "\"%s\"" v)) > row > ","))) > val > "],\n["))) > (t > (format "u32 %S = %S;" var val) > > (defun org-babel-D-colnames-to-D (pair) > "Convert an elisp list of header table into a D vector > specifying a variable with the name of the table" > (let ((table (car pair)) > (headers (cdr pair))) > (format "string[] %S_headers = [%s];" > table > (mapconcat (lambda (h) (format "%S" h)) headers "," > > (provide 'ob-D) > > ;;; ob-D.el ends here > > -8<--(end of ob-D.el)--->8 > > > > -- Thomas S. Dye http://www.tsdye.com
Re: [O] imaxima babel
writes: > There is actually already some maxima documentation on worg that got me > started as I was unsure if maxima is supported at all, I have added the > link in the summary. It would probably be good to merge to worg, but I > have no access to it and not time right now to learn how it works. Feel > free to copy paste whatever is useful to amend it though. I added this to ob-doc-maxima. It might require some editing. You can learn how to edit Worg here: http://orgmode.org/worg/worg-git.html All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] commit 5ea0228 has problem opening big org-mode file
Nick Dokos writes: > Nick Dokos writes: > >> The best solution I can think of so far: revert commit 5ea0228, >> and change org-mode-restart to call normal-mode, instead of org-mode. >> normal-mode splits the setting of the mode from the setting of local >> variables, so it would avoid the recursion. >> >> I think (but I have not verified yet) that this would fix both the >> problem that gave rise to commit 5ea0228 in the first place and this >> bottomless recursion, without causing any other problems. I'll try it >> out tomorrow if I find the time and submit a patch. > > Patch attached. It passed the two tests, but I have not done anything > more. Can both interested parties (York Zhao and Tom Dye) please test it > and let me know of any problems? Hi Nick, The patch appears to work for me. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] commit 5ea0228 has problem opening big org-mode file
Nick Dokos writes: > It may be that hack-local-variables takes a long time to process a large > file, although I don't think so: iirc, it limits itself to a tail of the > file of a given size, or the last "page" of the file (demarcated by ^L), > whichever is smaller. Hi Nick, I haven't noticed any slowdown or hangs since hack-local-variables was introduced. I have noticed that I need to answer the query about loading file local variables twice: Please type y, n, or !, or C-v to scroll: y [2 times] The first y has no apparent effect (except to make the second y effective). hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] reference #+label: in export to both LaTeX and HTML
Hi Eric, Will this work? #+name: mutation-ops [[file:mut-ops.svg]] Figure [[mutation-ops]] shows ... hth, Tom Eric Schulte writes: > Hi, > > How would I reference a label in export to HTML? For example. > > #+label: mutation-ops > [[file:mut-ops.svg]] > > In LaTeX export I could use \ref{mutation-ops} which would be passed > directly through to LaTeX, however this syntax is not understood by the > HTML backend. > > Is there a general Org-mode construct for referencing labels? > > Thanks, -- Thomas S. Dye http://www.tsdye.com
[O] [Babel] Bug reading example blocks?
Aloha all, Responding to a query by Gary Oberbrunner, I tried to point out the use of example blocks to name arbitrary pieces of text. What I found is that the example block isn't passed whole to a babel source block--whitespace is removed from the first line. * Whitespace on first line of example block removed #+name: example #+begin_example 1. this is the first line 2. this is the second line with %VARIANT% as the value 3. this is the third line #+end_example #+name: repeated-text #+header: :var x="" #+header: :var eg="" #+begin_src emacs-lisp (let ((result)) (setf result (replace-regexp-in-string "%VARIANT%" x eg t)) result) #+end_src #+call: repeated-text(x="foo",eg=example) :results raw #+results: 1. this is the first line 2. this is the second line with foo as the value 3. this is the third line This happens, AFAICT, regardless of the value of org-src-preserve-indentation. Is there a reason for this? Or, is it a bug? Or, am I going about this task in the wrong way? All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Refresh buffer properties and local variables
Nick Dokos writes: > Bastien writes: > >> Looks good, please push! >> > > Pushed to master (I hope...) Let me know if there is a problem. Thanks Nick. After a pull this morning, my file's local variables aren't lost when I refresh buffer properties. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Refresh buffer properties and local variables
Hi Nick, Nick Dokos writes: > Looking at what normal-mode does, I came up with the following hack. > Does it fix things for you? > > diff --git a/lisp/org.el b/lisp/org.el > index febee75..caf0348 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -5512,7 +5512,8 @@ The following commands are available: > (unless org-inhibit-startup-visibility-stuff > (org-set-startup-visibility >;; Try to set org-hide correctly > - (set-face-foreground 'org-hide (org-find-invisible-foreground))) > + (set-face-foreground 'org-hide (org-find-invisible-foreground)) > + (hack-local-variables)) > > ;; Update `customize-package-emacs-version-alist' > (add-to-list 'customize-package-emacs-version-alist Yes, it seems to fix things for me. What an unfortunate function name! Thanks for your help. Is there something else I can do to get this change into Org? All the best, Tom -- Thomas S. Dye http://www.tsdye.com
[O] Refresh buffer properties and local variables
Aloha all, I just discovered that refreshing buffer properties, C-c C-c at the top of my Org mode file, resets Local Variables to their default values (I think). At any rate, the Local Variables I set at the end of the file are changed by refreshing buffer properties. Is this intended? I end up running M-x normal-mode afterwards, which is sometimes difficult to remember. All the best, Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] Lisp code blocks fail
Hi Eric, No problem with the "slow" reply. Thanks for the fix, which gets me back up and running. All the best, Tom Eric Schulte writes: > Hi Tom, > > Sorry about the slow reply, I've been busy as usual. > > I just pushed up a fix for this problem. As you've discovered, the > slime function returns a two-element list holding any strings written to > STDOUT, and the value of the evaluated code. In two different places > org-babel-execute:lisp was trying to split this list into the separate > values however by the second time the list had been reduced to "2". > > I've just pushed up a fix. > > Best, > > t...@tsdye.com (Thomas S. Dye) writes: > >> Hi Eric, >> >> I understand this a bit better now. >> >> In org-babel-execute:lisp, the local variable result is getting set to >> ("" "2"). >> >> With :results value, the call to read in org-babel-result-cond is being >> passed "2" when it expects a list. With :results output, it gets "", >> which triggers the same error. >> >> As I noted earlier, slime-eval executes the lisp code properly, but for >> some reason it appears to be returning a string instead of a vector or a >> list. >> >> I'm not sure what I did to make this stop working. It was fine >> a week ago. I haven't changed slime in six months AFAIK. >> >> Other babel languages work as usual. My problem appears to be confined >> to lisp. >> >> All the best, >> Tom >> >> t...@tsdye.com (Thomas S. Dye) writes: >> >>> Hi Eric, >>> >>> An edebug adventure :) >>> >>> AFAICT, the error is thrown by this call to a macro: >>> (org-babel-result-cond ("replace") (car result)), where result has been >>> set to "2" by the long (funcall) in (let). >>> >>> Specifically, (org-babel-lisp-vector-to-list "2") appears to trigger the >>> (error)--at least that is the last code line edebug stops at before >>> getting to the (error) line. The modeline says Result: "2" just before >>> the error. >>> >>> Does this help? >>> >>> Tom >>> >>> Eric Schulte writes: >>> >>>> Hi Tom, >>>> >>>> That example works for me. Perhaps you could edebug (C-u C-M-x) the >>>> `org-babel-execute:lisp' function and then run that code block again to >>>> see at which statement the error is thrown. >>>> >>>> I'm not sure what the problem could be. >>>> >>>> Best, >>>> >>>> t...@tsdye.com (Thomas S. Dye) writes: >>>> >>>>> Hi Eric, >>>>> >>>>> #+begin_src lisp >>>>> (+ 1 1) >>>>> #+end_src >>>>> >>>>> Debugger entered--Lisp error: (wrong-type-argument listp "2") >>>>> byte-code("\211A@)\207" [result x] 2) >>>>> org-babel-execute:lisp("(+ 1 1)" ((:comments . "") (:shebang . "") >>>>> (:cache . "no") (:padline . "") (:noweb . "yes") (:tangle . "no") >>>>> (:exports . "code") (:results . "replace") (:session . "none") >>>>> (:hlines . "no") (:result-type . value) (:result-params "replace") >>>>> (:rowname-names) (:colname-names))) >>>>> org-babel-execute-src-block(nil) >>>>> org-babel-execute-src-block-maybe() >>>>> org-babel-execute-maybe() >>>>> org-babel-execute-safely-maybe() >>>>> run-hook-with-args-until-success(org-babel-execute-safely-maybe) >>>>> org-ctrl-c-ctrl-c(nil) >>>>> ad-Orig-call-interactively(org-ctrl-c-ctrl-c nil nil) >>>>> (with-no-warnings (ad-Orig-call-interactively function record-flag >>>>> keys)) >>>>> (setq ad-return-value (with-no-warnings >>>>> (ad-Orig-call-interactively function record-flag keys))) >>>>> (let ((ido-ubiquitous-next-override >>>>> (ido-ubiquitous-get-command-override function))) (setq ad-return-value >>>>> (with-no-warnings (ad-Orig-call-interactively function record-flag >>>>> keys >>>>> (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override >>>>> function) (setq ad-return-value (with-no-warnings >>>>> (ad-Orig-call-interactively function record-flag keys >>>>> (let (ad-return-value) (ido-ubiquitous-with-override >>>>> (ido-ubiquitous-get-command-override function) (setq ad-return-value >>>>> (with-no-warnings (ad-Orig-call-interactively function record-flag >>>>> keys ad-return-value) >>>>> call-interactively(org-ctrl-c-ctrl-c nil nil) >>>>> >>>>> Org-mode version 8.2.3b (release_8.2.3b-200-gb6522a @ >>>>> /Users/dk/.emacs.d/src/org-mode/lisp/) >>>>> >>>>> All the best, >>>>> Tom >>>>> >>>>> Eric Schulte writes: >>>>> >>>>>> Hi Tom, >>>>>> >>>>>> Could you provide a minimal example? I'm unable to debug from the stack >>>>>> trace alone. -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] Is it possible to repeat a block of org-mode text on export, maybe with replacement?
Hi Gary, I came up with this, which uses example blocks. #+name: example #+begin_example 1. this is the first line 2. this is the second line with %VARIANT% as the value 3. this is the third line #+end_example #+name: repeated-text #+header: :results raw #+header: :var x="" #+header: :var eg=example #+begin_src emacs-lisp (let ((result)) (setf result (replace-regexp-in-string "%VARIANT%" x eg t)) result) #+end_src #+call: repeated-text(x="foo") :results raw #+results: 1. this is the first line 2. this is the second line with foo as the value 3. this is the third line #+call: repeated-text(x="bar") :results raw #+results: 1. this is the first line 2. this is the second line with bar as the value 3. this is the third line #+call: repeated-text(x="baz") :results raw #+results: 1. this is the first line 2. this is the second line with baz as the value 3. this is the third line All the best, Tom Gary Oberbrunner writes: > I don't know if this is beyond the capabilities of org-mode or not. I'd > like to have a block of text repeated multiple times with slight > variations. For the sake of the example, a numbered list: > > 1. this is the first line > 1. this is the second line with %VARIANT% as the value > 1. this is the third line > > When exported, say as ASCII, I'd like this: > > 1. this is the first line > 2. this is the second line with foo as the value > 3. this is the third line > > 1. this is the first line > 2. this is the second line with bar as the value > 3. this is the third line > > 1. this is the first line > 2. this is the second line with baz as the value > 3. this is the third line > > I'm not sure how to go about this; I assume I'd use org-babel with source > blocks that contain org-mode text or elisp or something. > > Of course if the right answer is I should write a python script to generate > my org-mode text, well, that's OK too. :-) > > -- > Gary > I don't know if this is beyond the capabilities of org-mode or not. I'd > like to have a block of text repeated multiple times with slight > variations. For the sake of the example, a numbered list: > > 1. this is the first line > 1. this is the second line with %VARIANT% as the value > 1. this is the third line > > When exported, say as ASCII, I'd like this: > > 1. this is the first line > 2. this is the second line with foo as the value > 3. this is the third line > > 1. this is the first line > 2. this is the second line with bar as the value > 3. this is the third line > > 1. this is the first line > 2. this is the second line with baz as the value > 3. this is the third line > > I'm not sure how to go about this; I assume I'd use org-babel with > source blocks that contain org-mode text or elisp or something. > > Of course if the right answer is I should write a python script to > generate my org-mode text, well, that's OK too. :-) -- Thomas S. Dye http://www.tsdye.com
Re: [O] [babel] header lines in unnamed lisp code blocks
Aloha all, Noise, sorry. The code block fails because it is at the top of buffer. If I put a headline before it, all is well. Tom t...@tsdye.com (Thomas S. Dye) writes: > Hi Eric, > > This code doesn't return. > > #+header: :results value > #+begin_src lisp > (+ 1 1) > #+end_src > > If I add #+name: xxx, then it does run and returns the error I noted > earlier. > > I have edebug activated on org-babel-execute:lisp and it isn't triggered > when I press C-c C-c in the code block above. > > All the best, > Tom -- Thomas S. Dye http://www.tsdye.com
[O] [babel] header lines in unnamed lisp code blocks
Hi Eric, This code doesn't return. #+header: :results value #+begin_src lisp (+ 1 1) #+end_src If I add #+name: xxx, then it does run and returns the error I noted earlier. I have edebug activated on org-babel-execute:lisp and it isn't triggered when I press C-c C-c in the code block above. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Lisp code blocks fail
Hi Eric, I understand this a bit better now. In org-babel-execute:lisp, the local variable result is getting set to ("" "2"). With :results value, the call to read in org-babel-result-cond is being passed "2" when it expects a list. With :results output, it gets "", which triggers the same error. As I noted earlier, slime-eval executes the lisp code properly, but for some reason it appears to be returning a string instead of a vector or a list. I'm not sure what I did to make this stop working. It was fine a week ago. I haven't changed slime in six months AFAIK. Other babel languages work as usual. My problem appears to be confined to lisp. All the best, Tom t...@tsdye.com (Thomas S. Dye) writes: > Hi Eric, > > An edebug adventure :) > > AFAICT, the error is thrown by this call to a macro: > (org-babel-result-cond ("replace") (car result)), where result has been > set to "2" by the long (funcall) in (let). > > Specifically, (org-babel-lisp-vector-to-list "2") appears to trigger the > (error)--at least that is the last code line edebug stops at before > getting to the (error) line. The modeline says Result: "2" just before > the error. > > Does this help? > > Tom > > Eric Schulte writes: > >> Hi Tom, >> >> That example works for me. Perhaps you could edebug (C-u C-M-x) the >> `org-babel-execute:lisp' function and then run that code block again to >> see at which statement the error is thrown. >> >> I'm not sure what the problem could be. >> >> Best, >> >> t...@tsdye.com (Thomas S. Dye) writes: >> >>> Hi Eric, >>> >>> #+begin_src lisp >>> (+ 1 1) >>> #+end_src >>> >>> Debugger entered--Lisp error: (wrong-type-argument listp "2") >>> byte-code("\211A@)\207" [result x] 2) >>> org-babel-execute:lisp("(+ 1 1)" ((:comments . "") (:shebang . "") >>> (:cache . "no") (:padline . "") (:noweb . "yes") (:tangle . "no") >>> (:exports . "code") (:results . "replace") (:session . "none") >>> (:hlines . "no") (:result-type . value) (:result-params "replace") >>> (:rowname-names) (:colname-names))) >>> org-babel-execute-src-block(nil) >>> org-babel-execute-src-block-maybe() >>> org-babel-execute-maybe() >>> org-babel-execute-safely-maybe() >>> run-hook-with-args-until-success(org-babel-execute-safely-maybe) >>> org-ctrl-c-ctrl-c(nil) >>> ad-Orig-call-interactively(org-ctrl-c-ctrl-c nil nil) >>> (with-no-warnings (ad-Orig-call-interactively function record-flag keys)) >>> (setq ad-return-value (with-no-warnings >>> (ad-Orig-call-interactively function record-flag keys))) >>> (let ((ido-ubiquitous-next-override >>> (ido-ubiquitous-get-command-override function))) (setq ad-return-value >>> (with-no-warnings (ad-Orig-call-interactively function record-flag >>> keys >>> (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override >>> function) (setq ad-return-value (with-no-warnings >>> (ad-Orig-call-interactively function record-flag keys >>> (let (ad-return-value) (ido-ubiquitous-with-override >>> (ido-ubiquitous-get-command-override function) (setq ad-return-value >>> (with-no-warnings (ad-Orig-call-interactively function record-flag >>> keys ad-return-value) >>> call-interactively(org-ctrl-c-ctrl-c nil nil) >>> >>> Org-mode version 8.2.3b (release_8.2.3b-200-gb6522a @ >>> /Users/dk/.emacs.d/src/org-mode/lisp/) >>> >>> All the best, >>> Tom >>> >>> Eric Schulte writes: >>> >>>> Hi Tom, >>>> >>>> Could you provide a minimal example? I'm unable to debug from the stack >>>> trace alone. -- Thomas S. Dye http://www.tsdye.com
Re: [O] Lisp code blocks fail
Hi Eric, An edebug adventure :) AFAICT, the error is thrown by this call to a macro: (org-babel-result-cond ("replace") (car result)), where result has been set to "2" by the long (funcall) in (let). Specifically, (org-babel-lisp-vector-to-list "2") appears to trigger the (error)--at least that is the last code line edebug stops at before getting to the (error) line. The modeline says Result: "2" just before the error. Does this help? Tom Eric Schulte writes: > Hi Tom, > > That example works for me. Perhaps you could edebug (C-u C-M-x) the > `org-babel-execute:lisp' function and then run that code block again to > see at which statement the error is thrown. > > I'm not sure what the problem could be. > > Best, > > t...@tsdye.com (Thomas S. Dye) writes: > >> Hi Eric, >> >> #+begin_src lisp >> (+ 1 1) >> #+end_src >> >> Debugger entered--Lisp error: (wrong-type-argument listp "2") >> byte-code("\211A@)\207" [result x] 2) >> org-babel-execute:lisp("(+ 1 1)" ((:comments . "") (:shebang . "") >> (:cache . "no") (:padline . "") (:noweb . "yes") (:tangle . "no") >> (:exports . "code") (:results . "replace") (:session . "none") >> (:hlines . "no") (:result-type . value) (:result-params "replace") >> (:rowname-names) (:colname-names))) >> org-babel-execute-src-block(nil) >> org-babel-execute-src-block-maybe() >> org-babel-execute-maybe() >> org-babel-execute-safely-maybe() >> run-hook-with-args-until-success(org-babel-execute-safely-maybe) >> org-ctrl-c-ctrl-c(nil) >> ad-Orig-call-interactively(org-ctrl-c-ctrl-c nil nil) >> (with-no-warnings (ad-Orig-call-interactively function record-flag keys)) >> (setq ad-return-value (with-no-warnings >> (ad-Orig-call-interactively function record-flag keys))) >> (let ((ido-ubiquitous-next-override >> (ido-ubiquitous-get-command-override function))) (setq ad-return-value >> (with-no-warnings (ad-Orig-call-interactively function record-flag >> keys >> (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override >> function) (setq ad-return-value (with-no-warnings >> (ad-Orig-call-interactively function record-flag keys >> (let (ad-return-value) (ido-ubiquitous-with-override >> (ido-ubiquitous-get-command-override function) (setq ad-return-value >> (with-no-warnings (ad-Orig-call-interactively function record-flag >> keys ad-return-value) >> call-interactively(org-ctrl-c-ctrl-c nil nil) >> >> Org-mode version 8.2.3b (release_8.2.3b-200-gb6522a @ >> /Users/dk/.emacs.d/src/org-mode/lisp/) >> >> All the best, >> Tom >> >> Eric Schulte writes: >> >>> Hi Tom, >>> >>> Could you provide a minimal example? I'm unable to debug from the stack >>> trace alone. -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] Implementing Reproducible Research
Aloha Christophe, Thanks for spotting this. I don't know if anyone has written a chapter presenting org. I haven't seen anything on the ML. All the best, Tom Christophe Pouzat writes: > Hi all, > > I've just seen that a book, Implementing Reproducible > Research<http://www.amazon.com/Implementing-Reproducible-Research-Chapman-Series/dp/1466561599>, > edited by V. Stodden, F. Leisch and R. Peng is coming out next year from > CRC. I was wondering if anyone has written a chapter presenting org for > it. Any clue? > > Christophe > > -- > A Master Carpenter has many tools and is expert with most of them. If you > only know how to use a hammer, every problem starts to look like a nail. > Stay away from that trap. > > Richard B Johnson. > > -- > > Christophe Pouzat > MAP5 - Mathématiques Appliquées à Paris 5 > CNRS UMR 8145 > 45, rue des Saints-Pères > 75006 PARIS > France > > tel: +33142863828 > mobile: +33662941034 > web: http://xtof.disque.math.cnrs.fr > Hi all, > > I've just seen that a book, Implementing Reproducible Research, edited > by V. Stodden, F. Leisch and R. Peng is coming out next year from CRC. > I was wondering if anyone has written a chapter presenting org for it. > Any clue? > > Christophe -- Thomas S. Dye http://www.tsdye.com
Re: [O] Lisp code blocks fail
Hi Eric, #+begin_src lisp (+ 1 1) #+end_src Debugger entered--Lisp error: (wrong-type-argument listp "2") byte-code("\211A@)\207" [result x] 2) org-babel-execute:lisp("(+ 1 1)" ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "yes") (:tangle . "no") (:exports . "code") (:results . "replace") (:session . "none") (:hlines . "no") (:result-type . value) (:result-params "replace") (:rowname-names) (:colname-names))) org-babel-execute-src-block(nil) org-babel-execute-src-block-maybe() org-babel-execute-maybe() org-babel-execute-safely-maybe() run-hook-with-args-until-success(org-babel-execute-safely-maybe) org-ctrl-c-ctrl-c(nil) ad-Orig-call-interactively(org-ctrl-c-ctrl-c nil nil) (with-no-warnings (ad-Orig-call-interactively function record-flag keys)) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys))) (let ((ido-ubiquitous-next-override (ido-ubiquitous-get-command-override function))) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override function) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys (let (ad-return-value) (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override function) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys ad-return-value) call-interactively(org-ctrl-c-ctrl-c nil nil) Org-mode version 8.2.3b (release_8.2.3b-200-gb6522a @ /Users/dk/.emacs.d/src/org-mode/lisp/) All the best, Tom Eric Schulte writes: > Hi Tom, > > Could you provide a minimal example? I'm unable to debug from the stack > trace alone. -- Thomas S. Dye http://www.tsdye.com
Re: [O] org-insert-heading
Hi Bastien, Bastien writes: > Hi Thomas, > > t...@tsdye.com (Thomas S. Dye) writes: > >> With the following Org mode file, there is a dead space where >> org-insert-heading doesn't do anything. In the following example, if the >> point is on either of the empty lines marked [dead space] no heading is >> created. >> >> Is this behavior intended? > > I can't reproduce it... anyone? I looked more closely and found that the behavior I described happens when the folded material ends in a list. If I end the list by adding some regular text, then I get the expected behavior. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
[O] Lisp code blocks fail
Aloha all, With a recent pull, Lisp code blocks that I'm fairly certain were working previously started to fail. There is a backtrace below. The Lisp code executes correctly, but Babel doesn't appear to get the results in the form it expects (if I'm reading the backtrace correctly). Have I mucked up somehow? Debugger entered--Lisp error: (wrong-type-argument listp "((\"t2\" \"b\"))") byte-code("\211A@)\207" [result x] 2) org-babel-execute:lisp("(unless (boundp '*cycle-graph*)\n(defvar *cycle-graph*))\n(setq *cycle-graph* (populate (make-instance 'digraph)))\n(let ((r)\n (flag))\n (dolist (e edges r)\n(add-edge *cycle-graph*\n (list (read-from-string (first e))\n (read-from-string (second e\n(when (and (not flag) (setf flag (cycles *cycle-graph*))) (push e r" ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "yes") (:tangle . "no") (:exports . "code") (:results . "silent") (:var edges ("t1" "a") ("a" "t2") ("b" "t1") ("t2" "b")) (:colnames . "yes") (:hlines . "no") (:session . "none") (:result-type . value) (:result-params "silent") (:rowname-names) (:colname-names (edges "older" "younger" org-babel-execute-src-block(nil) org-babel-execute-src-block-maybe() org-babel-execute-maybe() org-babel-execute-safely-maybe() run-hook-with-args-until-success(org-babel-execute-safely-maybe) org-ctrl-c-ctrl-c(nil) ad-Orig-call-interactively(org-ctrl-c-ctrl-c nil nil) (with-no-warnings (ad-Orig-call-interactively function record-flag keys)) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys))) (let ((ido-ubiquitous-next-override (ido-ubiquitous-get-command-override function))) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override function) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys (let (ad-return-value) (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override function) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys ad-return-value) call-interactively(org-ctrl-c-ctrl-c nil nil) All the best, Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
[O] org-insert-heading
Aloha all, With the following Org mode file, there is a dead space where org-insert-heading doesn't do anything. In the following example, if the point is on either of the empty lines marked [dead space] no heading is created. Is this behavior intended? * Folded heading ... [dead space] [dead space] * Heading All the best, Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] Guess correct dictionary for Ispell
Aloha Seb, John Kitchin posted some code to the list a while back that uses Nicolas' parser for querying the values of keywords and other elements. I modified his code slightly to include keywords assigned in property drawers. Using this would save your code from having to re-search and presumably would remove the limitation that the tag be one of the first 8 lines of the file. I'm not sure you need this, but I've found it to be generally helpful. All the best, Tom #+name: jk-keywords #+header: :results silent #+begin_src emacs-lisp (defun jk-org-kwds () "parse the buffer and return a cons list of (property . value) from lines like: #+PROPERTY: value" (org-element-map (org-element-parse-buffer 'element) '(keyword node-property) (lambda (keyword) (cons (org-element-property :key keyword) (org-element-property :value keyword) (defun jk-org-kwd (KEYWORD) "get the value of a KEYWORD in the form of #+KEYWORD: value" (cdr (assoc KEYWORD (jk-org-kwds #+end_src #+name: test-properties #+begin_src emacs-lisp (jk-org-kwd "LANGUAGE") #+end_src #+results: test-properties : en "Sebastien Vauban" writes: > Hello, > > In case that can be useful for someone, here is how I detect which dictionary > to use on a file basis: > > (defun my-org-switch-language () > "Switch language if a `#+LANGUAGE:' Org meta-tag is on top 8 lines." > (save-excursion > (goto-line (1+ 8)) > (let (lang > (dico-alist '(("fr" . "francais") > ("en" . "american" > (when (re-search-backward "#\\+LANGUAGE: +\\([[:alpha:]_]*\\)" 1 t) > (setq lang (match-string 1)) > (ispell-change-dictionary (cdr (assoc lang dico-alist))) > > (add-hook 'org-mode-hook 'my-org-switch-language) > > Best regards, > Seb -- Thomas S. Dye http://www.tsdye.com
Re: [O] Fwd: ob-lilypond: pre- and post-processing of source blocks
James Harkins writes: > Incidentally, it would be very useful if babel offered a header argument > for commandline switches. If there is one, it was not obvious at [1] which > one it should be. A header argument for command line switches is implemented for some babel languages. See lines 68-79 of ob-dot.el, for instance, which implements a :cmdline header argument. It might be easy to implement something similar for ob-lilypond.el, as well. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] R contingency table axes labels in org
Jarmo Hurri writes: > Greetings again. > > I need to represent a contingency table generated by R in an org file. R > output shows the labes of the vertical and the horizontal axes, but > these are pruned from the output in org-mode. Is there a nice way to > reintroduce the axes labels? > > # -- > * interesting data > #+BEGIN_SRC R :exports results :rownames yes :colnames yes > org.files <- c (1, 0, 2, 2, 2, 2, 1) > happiness <- c (1, 0, 2, 2, 2, 1, 2) > data <- data.frame (org.files, happiness) > table (data) > #+END_SRC > > #+RESULTS: > | | 0 | 1 | 2 | > |---+---+---+---| > | 0 | 1 | 0 | 0 | > | 1 | 0 | 1 | 1 | > | 2 | 0 | 1 | 3 | > # -- > > All the best, > > Jarmo > > > library(ascii) ... print(ascii(table(data)), type="org") hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Exporting book handouts
Jarmo Hurri writes: > What is the mechanism you use to select the subtrees that you are > exporting? Are you employing SELECT_TAGS or something else? Interleaving is too complex for me. I use separate sub-trees and then restrict export to one sub-tree or another. This way, when I make a mistake in one document, another document doesn't suffer, too. I also like to keep common material, such as data tables and figures, together. I find that I tinker a lot as I'm writing and it helps me to have all the code for figures, etc. in one place so my tinkering changes can be systematic. * Book ** Chapter 1 ** Chapter 2 * Handouts ** Handout 1 ** Handout 2 * Common Material ** Figures ** Tables All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Exporting book handouts
Aloha Jarmo, I find it easiest to use separate sub-trees for the various different documents I create from a given body of material. In your case, I would make a sub-tree for the book and a sub-tree for the handout. If I try to create two different documents under the same heading, the complexity overwhelms me. Of course, you're writing a math book, so your tolerance for complexity probably exceeds mine :) Where possible, I #+name: the elements that will be used in more than one place and then use #+call: lines to place them where I want. For figures, the source code blocks can be written to expose the variables that let you set font size, etc., so the figures can look different wherever they appear. For other elements, the echo() function, which is part of the library of babel, can be used. ** Echo function #+name: test-list - One - Two - Three #+name: test-table | One | Two | | Three | Four | #+name: echo-table #+call: echo(input=test-table) :results table #+results: echo-table | One | Two | | Three | Four | #+name: echo-list #+call: echo(input=test-list) :results list #+results: echo-list - One - Two - Three I don't know off-hand the full list of elements that can be named and echoed this way. hth, Tom Jarmo Hurri writes: > Greetings. > > I have been writing a math book, and am still exploring the possibility > of using org for the task. Currently all my material is still in plain > LaTeX. The tools used are LaTeX, Asymptote, and R. > > We all know many advantages that the use of org would bring. ;-) For me, > one of the possible benefits would be the use of org to export in > different formats: a PDF containing the whole book, an HTML site with > the same contents, and last, but not least, a set of Beamer handout > slides containing _only some parts_ of the material. I am using the > material to teach, and sometimes give handouts to students. Having to > create the handouts separately is boring and counterproductive. > > Usually handouts contain relatively little information. There is a > title, often accompanied by a figure, and perhaps a sentence or two with > some equations. Typically at least parts of the equations are the same > as in the main text (we may derive the final results in class). The > figures in the book and handouts contain the same information, but the > handout figures may have e.g. larger fonts. The title of a handout may > be a part of the book text, or it may not. > > I guess the things I would need include the following. > > 1. A way to denote that a certain element (figure, equation, part of a >longer equation, a piece of text etc.) goes into the Beamer >export. By default, material should _not_ be included in the Beamer >export. I don't know how to achieve this. > >I did find SELECT_TAGS in the manual, so if I were to export entire >subtrees into Beamer, maybe I could change the value of this when I >am doing a Beamer export. But could I use this for individual >elements, such as an equation or a figure? > > 2. A way to add some material into the Beamer handouts, material that is >not in the book. I think this is easy to achieve with #+BEAMER and >#+BEGIN_BEAMER ... #+END_BEAMER. > > 3. A way to change some values in Asymptote and R Babel blocks depending >on whether I am exporting a Beamer or regular PDF / HTML. I don't >know yet how to achieve this. > > I am still in an explorative stage, so I am sure I will come up with > 10^6 other questions when I need to face the details. But I would first > like to clear these general issues before I even try to proceed. > > All the best, > > Jarmo > > > -- Thomas S. Dye http://www.tsdye.com
Re: [O] org-mode in the wild
Aloha John, This is wonderful! The pdf file is a user-friendly entry into the Org mode compendium *and* an effective way to distribute it. Thanks for your pioneering efforts. All the best, Tom John Kitchin writes: > Hi everyone, > > We had another manuscript written in org-mode accepted in Topics in > Catalysis (http://link.springer.com/article/10.1007%2Fs11244-013-0166-3)! > Check out references 14, 39 and 40 ;) > > The supporting information seems to be freely available ( > http://link.springer.com/content/esm/art:10.1007/s11244-013-0166-3/file/MediaObjects/11244_2013_166_MOESM1_ESM.pdf) > was also prepared in org-mode. It is probably best read with the Adobe PDF > reader. This file is an interesting hybrid of data sharing methods. Some of > the data is in the pdf, some of it is embedded in the pdf, including the > org-mode files for the manuscript and the supporting information file > itself. Anyone interested in seeing how we did it can check it out. > > John > > --- > John Kitchin > Associate Professor > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > http://kitchingroup.cheme.cmu.edu > Hi everyone, > > We had another manuscript written in org-mode accepted in Topics in > Catalysis > (http://link.springer.com/article/10.1007%2Fs11244-013-0166-3)! Check > out references 14, 39 and 40 ;) > > The supporting information seems to be freely available > (http://link.springer.com/content/esm/art:10.1007/s11244-013-0166-3/file/MediaObjects/11244_ > 2013_166_MOESM1_ESM.pdf) was also prepared in org-mode. It is probably > best read with the Adobe PDF reader. This file is an interesting > hybrid of data sharing methods. Some of the data is in the pdf, some > of it is embedded in the pdf, including the org-mode files for the > manuscript and the supporting information file itself. Anyone > interested in seeing how we did it can check it out. > > John > > --- > John Kitchin > Associate Professor > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > http://kitchingroup.cheme.cmu.edu > > -- Thomas S. Dye http://www.tsdye.com
Re: [O] [PATCH] Longtable continuation strings customizable
Nicolas Goaziou writes: > In a nutshell: > > (defun my-personal-table-continuation-strings (row backend info) > (when (org-export-derived-backend-p backend 'latex) > (replace-regexp-in-string >"multicolumn{[0-9]+}{l}{\\(.*\\)}" "\\ldots\\ continued from previous > page" >(replace-regexp-in-string > "multicolumn{[0-9]+}{r}{\\(.*\\)}" "continued on next page \\ldots" > row nil t 1) nil t 1))) Thanks again for your patience and help. This works! All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] [PATCH] Longtable continuation strings customizable
Nicolas Goaziou writes: >> An example filter? > > (defun my-personal-table-continuation-strings (row backend info) > (when (org-export-derived-backend-p 'latex) > (replace-regexp-in-string >"multicolumn{[0-9]+}{l}{\\(.*\\)}" "String 1" >(replace-regexp-in-string > "multicolumn{[0-9]+}{r}{\\(.*\\)}" "String 2" > row nil nil 1) >nil nil 1))) > (add-to-list 'org-export-filter-table-row-functions >'my-personal-table-continuation-strings) > > Untested. I can't get this to work :( I have this, based on the example above: #+name: tsd-continuation-strings #+begin_src emacs-lisp (defun my-personal-table-continuation-strings (row backend info) (when (org-export-derived-backend-p 'latex) (replace-regexp-in-string "multicolumn{[0-9]+}{l}{\\(.*\\)}" "\\ldots\\ continued from previous page" row nil nil 1) (replace-regexp-in-string "multicolumn{[0-9]+}{r}{\\(.*\\)}" "continued on next page \\ldots" row nil nil 1))) (add-to-list 'org-export-filter-table-row-functions 'my-personal-table-continuation-strings) #+end_src I also tried 'org-export-filter-table-functions without success. I always get the default continuation strings. I've looked around for an error message, but there doesn't appear to be one, at least that I can find. The asynchronous export runs through to completion. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] [PATCH] Table continuation strings
Nicolas Goaziou writes: > Hello, > > t...@tsdye.com (Thomas S. Dye) writes: > >> Patch includes table continuation strings for several languages. >> Translations all from the internet. Caveat emptor. > > Applied. Thank you. > >> + ("ja" :utf-8 "前ページから続く") > > [...] > >> + ("ja" :utf-8 "次ページに続く") > > These will not be very helpful, though, as `latex' back-end (the only > one to use this string so far) relies on :latex or :default properties, > never on :utf-8. We'll need a Japanese-speaking LaTeX user to chime in here. I've never typeset Japanese in LaTeX and don't speak or read the language. All the best, Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
[O] [PATCH] Table continuation strings
Aloha all, Patch includes table continuation strings for several languages. Translations all from the internet. Caveat emptor. All the best, Tom >From 0c551e51f5eff759957a415d7d29a830b43631d2 Mon Sep 17 00:00:00 2001 From: Thomas Dye Date: Tue, 29 Oct 2013 14:39:48 -1000 Subject: [PATCH] Table continuation strings for some languages --- lisp/ox.el | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lisp/ox.el b/lisp/ox.el index 141abc4..11a7510 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -5277,9 +5277,21 @@ them." ("zh-CN" :html "作者" :utf-8 "作者") ("zh-TW" :html "作者" :utf-8 "作者")) ("Continued from previous page" - ("fr" :default "Suite de la page précédente")) + ("de" :default "Fortsetzung von vorheriger Seite") + ("es" :default "Continúa de la página anterior") + ("fr" :default "Suite de la page précédente") + ("it" :default "Continua da pagina precedente") + ("ja" :utf-8 "前ページから続く") + ("nl" :default "Vervolg van vorige pagina") + ("pt" :default "Continuação da página anterior")) ("Continued on next page" - ("fr" :default "Suite page suivante")) + ("de" :default "Fortsetzung nächste Seite") + ("es" :default "Continúa en la siguiente página") + ("fr" :default "Suite page suivante") + ("it" :default "Continua alla pagina successiva") + ("ja" :utf-8 "次ページに続く") + ("nl" :default "Vervolg op volgende pagina") + ("pt" :default "Continua na página seguinte")) ("Date" ("ca" :default "Data") ("cs" :default "Datum") -- 1.8.3.3 -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] [PATCH] Longtable continuation strings customizable
Nicolas Goaziou writes: >>> Am I missing something? >> >> An example filter? > > (defun my-personal-table-continuation-strings (row backend info) > (when (org-export-derived-backend-p 'latex) > (replace-regexp-in-string >"multicolumn{[0-9]+}{l}{\\(.*\\)}" "String 1" >(replace-regexp-in-string > "multicolumn{[0-9]+}{r}{\\(.*\\)}" "String 2" > row nil nil 1) >nil nil 1))) > (add-to-list 'org-export-filter-table-row-functions >'my-personal-table-continuation-strings) > > Untested. Thanks! Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] [PATCH] Longtable continuation strings customizable
Nicolas Goaziou writes: > I agree customization is more powerful here (although it means that all > non-English Org users will need to change it), but so it is for every > other multilingual string. > > Since we didn't choose to make multilingual strings customizable, I find > it strange that this particular one is. > > Also, I you can use a filter to modify that string and make it comply to > a specific style, if needed. IOW, you also get 1) and 2) with the > `org-export-dictionary' way, with 1) being more user-friendly and 2) > more difficult than in the current way. > > Am I missing something? An example filter? Otherwise, I agree, there is no need to break the mold here. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] [PATCH] Longtable continuation strings customizable
Carsten Dominik writes: > On 27.10.2013, at 09:05, Nicolas Goaziou wrote: > >> Hello, >> >> t...@tsdye.com (Thomas S. Dye) writes: >> >>> The attached patch should be applied on top of the earlier patch. It >>> makes the continuation strings customizable. >> >> Wouldn't it be better if these strings where hardcoded, but with support >> for internationalization in `org-export-dictionary'? > > I agree that this would be better. > > - Carsten > I think there are two axes of variation here: 1) internationalization, and 2) style guides, e.g., for a particular journal, Chicago Manual, etc. IIUC, hardcoding and org-export-dictionary solve 1) but not 2). In my experience, variation in 2) is idiosyncratic, though I haven't looked specifically at table continuation lines. The user can solve both 1) and 2) with customizable continuation strings, so it might be best to stay on this path instead of hardcoding and internationalization in org-export-dictionary. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
[O] [PATCH] Longtable continuation strings customizable
Aloha all, The attached patch should be applied on top of the earlier patch. It makes the continuation strings customizable. All the best, Tom >From 2b3fbcf9a8ea64ef6207237ef48b9c62cded01ff Mon Sep 17 00:00:00 2001 From: Thomas Dye Date: Sat, 26 Oct 2013 14:37:30 -1000 Subject: [PATCH] Longtable continuation strings customizable --- lisp/ox-latex.el | 21 ++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 6426d55..6bca7a3 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -525,6 +525,19 @@ When nil, no transformation is made." (string :tag "Format string") (const :tag "No formatting"))) +(defcustom org-latex-longtable-continued-on "Continued on next page" + "String to indicate table continued on next page." + :group 'org-export-latex + :version "24.4" + :package-version '(Org . "8.0") + :type 'string) + +(defcustom org-latex-longtable-continued-from "Continued from previous page" + "String to indicate table continued from previous page." + :group 'org-export-latex + :version "24.4" + :package-version '(Org . "8.0") + :type 'string) Text markup @@ -2625,17 +2638,18 @@ a communication channel." ((and longtablep (org-export-table-row-ends-header-p table-row info)) (format "%s \\endfirsthead -\\multicolumn{%d}{l}{Continued from previous page} +\\multicolumn{%d}{l}{%s} %s %s \n %s \\endhead -%s\\multicolumn{%d}{r}{Continued on next page} +%s\\multicolumn{%d}{r}{%s} \\endfoot \\endlastfoot" (if booktabsp "\\midrule" "\\hline") (cdr (org-export-table-dimensions (org-export-get-parent-table table-row) info)) + org-latex-longtable-continued-from (cond ((and booktabsp (memq 'top borders)) "\\toprule\n") ((and (memq 'top borders) (memq 'above borders)) "\\hline\n") @@ -2645,7 +2659,8 @@ a communication channel." (if booktabsp "\\midrule" "\\hline") ;; Number of columns. (cdr (org-export-table-dimensions - (org-export-get-parent-table table-row) info + (org-export-get-parent-table table-row) info)) + org-latex-longtable-continued-on)) ;; When BOOKTABS are activated enforce bottom rule even when ;; no hline was specifically marked. ((and booktabsp (memq 'bottom borders)) "\\bottomrule") -- 1.8.3.3 -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
[O] [PATCH] Add \endifrsthead to longtable export
Aloha all, Previously, export of LaTeX longtables that spanned a page break generated a caption on each page, resulting in multiple entries in the table of contents. The attached patch for ox-latex.el implements the \endfirsthead command so the caption only appears once, at the top of the table. Subsequent pages of the table start with "Continued from previous page". All the best, Tom >From 1e205d7e2a5913580934ddee5285cc8ab0ff6f35 Mon Sep 17 00:00:00 2001 From: Thomas Dye Date: Sat, 26 Oct 2013 13:52:05 -1000 Subject: [PATCH] Add \endfirsthead to longtable export --- lisp/ox-latex.el | 13 + 1 file changed, 13 insertions(+) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index aa1a36c..6426d55 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2624,11 +2624,24 @@ a communication channel." ;; Special case for long tables. Define header and footers. ((and longtablep (org-export-table-row-ends-header-p table-row info)) (format "%s +\\endfirsthead +\\multicolumn{%d}{l}{Continued from previous page} +%s +%s \n +%s \\endhead %s\\multicolumn{%d}{r}{Continued on next page} \\endfoot \\endlastfoot" (if booktabsp "\\midrule" "\\hline") + (cdr (org-export-table-dimensions + (org-export-get-parent-table table-row) info)) + (cond ((and booktabsp (memq 'top borders)) "\\toprule\n") + ((and (memq 'top borders) + (memq 'above borders)) "\\hline\n") + (t "")) + contents + (if booktabsp "\\midrule" "\\hline") (if booktabsp "\\midrule" "\\hline") ;; Number of columns. (cdr (org-export-table-dimensions -- 1.8.3.3 -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] Can't get listings to work
Apologies for the noise. I'm exporting two documents with different requirements and put the configuration in the wrong place. Now that it is in the right place, all works as it should. Is the docstring for org-latex-listing-options correct? I had to use double backslashes instead of the single backslashes shown in the docstring. Tom t...@tsdye.com (Thomas S. Dye) writes: > Aloha all, > > I've set org-latex-listings-options so: > > org-latex-listings-options is a variable defined in `ox-latex.el'. > Its value is (("frame" "lines") > ("basicstyle" "\footnotesize") > ("numbers" "left")) > > But I'm getting this in the LaTeX output: > > \lstset{language=Lisp,label=load-age-relation-data,numbers=none} > > I'm expecting: > > \lstset{language=Lisp,label=load-age-relation-data,numbers=none,frame=lines,basicstyle=\footnotesize,numbers=left} > > Perhaps I'm setting org-latex-listings-options wrong? I'm trying to use > file-local variables: > > # Local Variables: > # eval: (require 'ox-latex) > # eval: (setq org-export-async-init-file (expand-file-name "init-plos.el")) > # org-export-in-background: t > # org-export-async-debug: t > # org-fontify-quote-and-verse-blocks: t > # org-entities-user: nil > # org-latex-listings: 'listings > # eval: (setq org-latex-listings-options > #'(("frame" "lines") > # ("basicstyle" "\footnotesize") > # ("numbers" "left"))) > ... > # End: > > Also, when I tried to add the following pair to the options, the \t was > interpreted as a TAB. > > ("numberstyle" "\tiny") > > I tried "\\tiny", but that didn't work, either. > > Any help much appreciated. > > All the best, > Tom -- Thomas S. Dye http://www.tsdye.com
[O] Can't get listings to work
Aloha all, I've set org-latex-listings-options so: org-latex-listings-options is a variable defined in `ox-latex.el'. Its value is (("frame" "lines") ("basicstyle" "\footnotesize") ("numbers" "left")) But I'm getting this in the LaTeX output: \lstset{language=Lisp,label=load-age-relation-data,numbers=none} I'm expecting: \lstset{language=Lisp,label=load-age-relation-data,numbers=none,frame=lines,basicstyle=\footnotesize,numbers=left} Perhaps I'm setting org-latex-listings-options wrong? I'm trying to use file-local variables: # Local Variables: # eval: (require 'ox-latex) # eval: (setq org-export-async-init-file (expand-file-name "init-plos.el")) # org-export-in-background: t # org-export-async-debug: t # org-fontify-quote-and-verse-blocks: t # org-entities-user: nil # org-latex-listings: 'listings # eval: (setq org-latex-listings-options #'(("frame" "lines") # ("basicstyle" "\footnotesize") # ("numbers" "left"))) ... # End: Also, when I tried to add the following pair to the options, the \t was interpreted as a TAB. ("numberstyle" "\tiny") I tried "\\tiny", but that didn't work, either. Any help much appreciated. All the best, Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] Portable formatting of export?
cal variables. See the following page > of > the Emacs manual. > > (info "(emacs)Specifying File Variables") > > > > Klaus-Dieter Bauer writes: > > > Hello! > > > > I have customized org export to both html and latex extensively > since I > > disliked many of the defaults (e.g. the use of article vs > scrartcl, red > > borders around pdf hyperlinks). > > > > This left me wondering however, if it is possible to create org > files that > > will produce the same output on every machine, regardless of the > local > > emacs customizations (of course assuming that no hacks of the > export engine > > are part of the configuration). > > > > In order to make the files more portable I have been trying to > make changes > > affecting export with things like #+LATEX_HEADER: but e.g. > changing the > > documentclass to scrartcl seems to be possible only by changing > a > > customization variable (org-latex-classes). > > > > Is it possible to make the export engine assume defaults for all > > customization variables for a file (preferably through an > in-file setting) > > and to specify those customization inside the file? > > > > - Klaus > > > -- > Eric Schulte > https://cs.unm.edu/~eschulte > PGP: 0x614CA05D > > -- Thomas S. Dye http://www.tsdye.com
Re: [O] Difficulties Accessing git Repository
Longmin WANG writes: > I also failed to pull last night and this morning with the same errors. > > -- > Longmin Wang (http://math.nankai.edu.cn/~wanglm/) > Nankai University, 94 Weijin Road, Tianjin 300071, P. R. China > <http://math.nankai.edu.cn/~wanglm/> I just failed, too. poto:org-mode dk$ make rm -f git remote update Fetching origin fatal: read error: Connection reset by peer error: Could not fetch origin make: *** [up0] Error 1 hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] [Babel][R] Inclusion of multi-line named code blocks in R code
Hi Alex, I made a first draft of the Babel SQL documentation for Worg. See http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-sql.html Please edit or augment as you see fit. I believe you need FSF papers to contribute to ob-sql.el. If you have those, then by all means, please add Netezza support and get the ball rolling on sessions. All the best, Tom Alexander Vorobiev writes: > Hi Tom, > > Unfortunately I can't have pure SQL output in my org files for two reasons: > > 1. The result set I am dealing with for this particular problem is about > 2 records > 2. My SQL server (Netezza, "big data appliance") is not supported by > Babel-SQL. I configured sql-mode to work with Netezza but session-based SQL > is not supported by Babel either. I started adding support for SQL sessions > to ob-sql.el and it kind of works but the results I am getting are > inconsistent and only a small subset of header parameters is supported. Of > course I haven't tested is with any other database. I can share what I've > done if anybody is interested. > > Regards, > Alex > > > On Wed, Sep 18, 2013 at 5:27 PM, Thomas S. Dye wrote: > >> Aloha Alex, >> >> My work flow in this situation evaluates the SQL to create an Org-mode >> table, which serves as input to the R source code block. >> >> For me, seeing the SQL output in a table is a sanity check. >> >> hth, >> Tom >> >> Alexander Vorobiev writes: >> >> > I have R code which submits SQL statements to a database server. Since >> the >> > SQL is rather complex, I want to put it into a separate code block in >> order >> > to have proper formatting, syntax highlighting, etc: >> > >> > #+name: long-sql >> > #+begin_src sql >> > select * >> > from many, tables >> > where >> > complex_condition1 = 1, >> > complex_condition2 = 2 >> > #+end_src >> > >> > * Load the data to R session >> > #+begin_src R :session *R* :noweb yes >> > result <- submit_query('<>') >> > #+end_src >> > >> > Unfortunately, the R block doesn't work. When I open the file generated >> by >> > Babel, I see this: >> > >> > result <- submit_query('select * >> > result <- submit_query('from many, tables >> > etc >> > >> > instead of the one R submit_query call with my SQL statement as an >> > argument. Is there anything I can do to achieve that? >> > >> > Thanks >> > Alex >> > I have R code which submits SQL statements to a database server. Since >> > the SQL is rather complex, I want to put it into a separate code block >> > in order to have proper formatting, syntax highlighting, etc: >> > >> > #+name: long-sql >> > #+begin_src sql >> > select * >> > from many, tables >> > where >> > complex_condition1 = 1, >> > complex_condition2 = 2 >> > #+end_src >> > >> > * Load the data to R session >> > #+begin_src R :session *R* :noweb yes >> > result <- submit_query('<>') >> > #+end_src >> > >> > Unfortunately, the R block doesn't work. When I open the file >> > generated by Babel, I see this: >> > >> > result <- submit_query('select * >> > result <- submit_query('from many, tables >> > etc >> > >> > instead of the one R submit_query call with my SQL statement as an >> > argument. Is there anything I can do to achieve that? >> > >> > Thanks >> > Alex >> > >> > >> >> -- >> Thomas S. Dye >> http://www.tsdye.com >> > Hi Tom, > > Unfortunately I can't have pure SQL output in my org files for two > reasons: > > 1. The result set I am dealing with for this particular problem is > about 2 records > 2. My SQL server (Netezza, "big data appliance") is not supported by > Babel-SQL. I configured sql-mode to work with Netezza but > session-based SQL is not supported by Babel either. I started adding > support for SQL sessions to ob-sql.el and it kind of works but the > results I am getting are inconsistent and only a small subset of > header parameters is supported. Of course I haven't tested is with any > other database. I can share what I've done if anybody is interested. > > Regards, > Alex > > On Wed, Sep 18, 2013 at 5:27 PM, Thomas S. Dye wrote: > > Aloha Alex,
Re: [O] Babel: Ada, Smalltalk and Objective-C ?
Aloha Mehul, Mehul Sanghvi writes: > Is there any support for Ada, Smalltalk and Objective-C that anyone is > aware of ? Not that I'm aware of. > > Are there any pointers on how to add such support to Babel ? Yes, see http://orgmode.org/worg/org-contrib/babel/languages.html#develop There is a template that outlines what needs to be done. Also a template for preparing on-line documentation. hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] proposal for a tool to translate orgmode outlines into programs
Aloha Isaac, This sounds to me a lot like literate programming, which can be accomplished in Org with very many languages, including ruby and python (but not lua, yet). See http://orgmode.org/worg/org-contrib/babel/languages.html. An advantage of literate programming is that it generates documentation in addition to the program code. hth, Tom Isaac writes: > proposal for a tool to translate orgmode outlines into programs > > Idea: > a program to translate orgmode note into script/programs which can be > used as a template/starting point for a real program after debugging, > refactoring. > > Background and reasons: > As I am accumulating more orgmode notes for problem solving, task > planning, project coordination, I think it would be nice if a tool can > translate the orgmode (especially those problem solving ones) into programs > (as much as it can)- at least a program skeleton, where after > ideas(outlines) are done, we can generate a corresponding program which can > be quickly edited/debugged/re factored/tightened up to be useful running > programs - to facilitate problem solving and task repetition in the future. > > > Questions and Discussions: > 1. whether this would be a worthwhile idea, or such idea has been tried > before? > > 2. do we have alternative solutions? > > 3. if indeed this idea is interesting, what programming language it > would e worthwhile to translate to? > currently I am thinking more along of the line of python, as its > indenting structure more or less resemble outlines. (though my personal take > for writing script is in ruby, lua is another interesting choice). this 3rd > question is what I don't know for sure, I found for me ruby is more > productive for scripting, and python has better supports ... > ruby could be another attractive choice - level 1 headlines maybe > translated to a class, while other levels translate to methods ... > > > Welcome your comments and ideas > > thanks, Isaac > > (while I am doing some search, found > 1. the reverse direction of this is: https://github.com/bjonnh/PyOrgMode > - python reading and writing orgmode, but would I would prefer is orgmode => > python/ruby instead. > 2. another candidate is tangle - but idea here is different, not to > export codes written in orgmode, but to translate/turn orgmode text directly > into codes. > 3. an interesting node.js parser for orgmode: > https://github.com/daitangio/org-mode-parser > > Some further elaboration: > 1. say if a headline is an action: > translate to def ... a function > 2. say if a headline is some description: > translate to class ... > 3. some long lines can be simply turned to comments/docstring > 4. ... maybe ... some NLP can be used to decide what actions to > take? > > > > -- Thomas S. Dye http://www.tsdye.com
Re: [O] [Babel] :colnames "no" no longer default for Emacs Lisp [Was] Lisp error: (wrong-type-argument listp hline)
Hi Eric, I think this breaks Marc-Oliver Ihm's lob-table-operations.org. I use these a lot with #+call: lines. Any tips on how to get the old behavior back? I tried :colnames no with one of Marc-Oliver's code blocks, (and kept :colnames yes with my #+call: line) but this didn't seem to change anything. Instead of the column names from the original tables, which I used to get, I now get names like "t1c2". All the best, Tom Eric Schulte writes: >> >> I always wondered why emacs-lisp is the _only_ language with ":colnames no" >> as >> its default. Is there a reason therefore? If no really good reason, could we >> suppress that? >> > > This seemed to make sense early on because Emacs Lisp could easily > process hlines itself, but at this point it adds more confusion than it > is worth. I've reverted this default for elisp, hopefully it doesn't > break too many peoples existing Org-mode files. > > Best, -- Thomas S. Dye http://www.tsdye.com
Re: [O] input data for babel blocks
Hi Chuck, Neat. Thanks for sharing. All the best, Tom Charles Berry writes: > Alan Schmitt polytechnique.org> writes: > >> >> Hi Charles, >> >> ccberry ucsd.edu writes: >> >> > Lacking that, another alternative to the approach you have crafted is to >> > use elisp src blocks to set up the commands needed to create the >> > objects, >> > and then place the results of executing the elisp src block in the src >> > block of your favored language using noweb, for example >> > >> > #+BEGIN_SRC mylang :noweb yes >> > <> >> > #+END_SRC >> > >> > might convert 'arg2' to an object of the desired type named 'arg1' in a >> > 'mylang' src block. >> >> This looks like a very powerful approach, but it's a bit beyond my >> understanding of babel (which is limited) and noweb (whose existence I >> just discovered after reading http://orgmode.org/manual/noweb.html). >> > > Sorry if it was a bit obtuse. The examples given by others seem to have > helped. And I will give one more. > > [deleted] > >> If you have an example that uses different languages, I'd love to look >> at it. I'll then try to write an example for ocaml. >> > > > Here is what I use for LaTeX thru elisp to R: > > > > * Quote Blocks > > quote-blks takes two args: > > - blk :: a string of comma separated src block names > - sep :: an optional separator for use when there is more than one > block > > I usually save it in a file and load it in with > (org-babel-lob-ingest file). But you can copy and paste and the example > below will still work. > > #+name: quote-blks > #+BEGIN_SRC emacs-lisp :var blk="abc" :var sep="\"\n\"" > (save-excursion > (replace-regexp-in-string "\"\"" "" >(mapconcat > (lambda (x) > (org-babel-goto-named-src-block x) > (format "%S" (cadr (org-babel-get-src-block-info t > (split-string blk "," t) > sep) >t t)) > > #+END_SRC > > > * example of use > > > The LaTeX here can be editted via C-c ' > (i.e. org-edit-special --> org-edit-src-code). > > #+name: lstuff > #+BEGIN_SRC latex :eval never :exports none > Here is a \backslash. And an unmatched quote: '. > #+END_SRC > > > Here is an example using it on the above block. > > The cat statement prints a formatted version. The str statement shows > what R sees (but the outer quotes are not part of the string). > > #+BEGIN_SRC R :noweb yes :results output > some.latex <- > <> > cat(some.latex,"\n") > str(some.latex) > #+END_SRC > > #+RESULTS: > : Here is a \backslash. And an unmatched quote: '. > : chr "Here is a \\backslash. And an unmatched quote: '." > > HTH, > > Chuck > > > -- Thomas S. Dye http://www.tsdye.com
Re: [O] Org Tutorials need more structure
Aloha Suvayu, I like this, too, except that I miss the capabilities of the export framework. How about?: a programmable and dynamic plain-text note taking platform and markup language All the best, Tom Suvayu Ali writes: > Hi, > > On Sat, Sep 28, 2013 at 07:29:26PM -0500, John Hendy wrote: >> On Sat, Sep 28, 2013 at 6:29 PM, Thomas S. Dye wrote: >> > >> > In this vein, I think it would be useful to have a brief statement about >> > Org-mode that gives the interested reader from any background a good >> > feel for the scope of Org-mode and how it presents itself to the user. >> > I don't think the current statements about what Org-mode "is" do this >> > very effectively, though they might have done so in the past. >> > >> >> Absolutely love that, and this puts some of your earlier comments in >> perspective -- you're looking for the 30sec elevator pitch for >> Org-mode, and saying "this outline-y task manager" is not cutting it. > > To me the best way to describe Org is: a programmable and dynamic > plain-text note taking platform. All its features are essentially built > on this ability: planning & task management, authoring or publishing, > literate programming, and what not. On top of this, it can interact > with external applications for tasks like referencing (links, citation, > etc). Of course trying to faithfully outline this in a few words is a > herculean task. -- Thomas S. Dye http://www.tsdye.com
Re: [O] example filter for code blocks?
Thanks Achim, This is good to know. All the best, Tom Achim Gratz writes: > Am 30.09.2013 02:45, schrieb John Kitchin: >> /DOS (xxx) >> /Unix (xxx) >> /Mac (#1) >> >> I have not tried to see if you can put them all in. Let me know if it >> works to put them all in. > > Yes, in fact you should always put all of them since the definitions > for the "other" OS will be empty. > > > Regards, > Achim. > > > -- Thomas S. Dye http://www.tsdye.com
Re: [O] example filter for code blocks?
Hi John, I tried the following, which works on my Mac. #+name: supplementary-material-latex-header #+header: :tangle supplementary-material-header.tex #+begin_src latex \usepackage{attachfile} \newcommand{\LaunchBinary}[2]{% % #1: layer name, % #2: link text \leavevmode% \pdfstartlink attr{/C [0.9 0 0] /Border [0 0 2]} user { /Subtype /Link /A << /F << /DOS (#1) /Mac (#1) /Unix (#1) >> /S /Launch >> } #2% \pdfendlink% } #+end_src Thanks for the link. All the best, Tom John Kitchin writes: > indeed, there is specific code for DOS/Mac I think. > > I grabbed that code from here: > http://stackoverflow.com/questions/2341364/link-to-external-application-in-latex-beamer > > which suggests these options are possible > > /DOS (xxx) > /Unix (xxx) > /Mac (#1) > > I have not tried to see if you can put them all in. Let me know if it > works to put them all in. > > I have some Mac users in my class that might need that! > > > > John > > --- > John Kitchin > Associate Professor > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > http://kitchingroup.cheme.cmu.edu > > > > On Sun, Sep 29, 2013 at 8:33 PM, Thomas S. Dye wrote: > >> Hi John, >> >> John Kitchin writes: >> >> > Hi everyone, >> > Thanks for the tips in using export filters for code blocks. I thought I >> > would share my current solution. The goal was to export all the code >> blocks >> > in an org-file to files systematically named part1/script-%d.py where %d >> is >> > a number. I didnot want to tangle exactly, because I wanted to avoid >> naming >> > the code block tangle files. >> > >> > Then, I wanted to insert a pdf link that would open the file, after the >> > syntax highlighted code. >> > >> > I wanted this because it is not convenient to copy and paste the >> > syntax-highlighted code into an editor. I teach from the pdf that is >> > generated, and it would be convenient to just open the code, edit and >> rerun >> > to explore solutions. >> > >> > So, here is the solution: >> > >> > At the top of my orgfile, I have this definition which creates a pdf >> link. >> > >> > #+LATEX_HEADER: \newcommand{\LaunchBinary}[2]{% >> > #+LATEX_HEADER: % #1: layer name, >> > #+LATEX_HEADER: % #2: link text >> > #+LATEX_HEADER: \leavevmode% >> > #+LATEX_HEADER: \pdfstartlink attr{/C [0.9 0 0] /Border [0 0 2]} user >> { >> > #+LATEX_HEADER: /Subtype /Link >> > #+LATEX_HEADER: /A << >> > #+LATEX_HEADER: /F << >> > #+LATEX_HEADER: /DOS (#1) >> > #+LATEX_HEADER: >> >> > #+LATEX_HEADER: /S /Launch >> > #+LATEX_HEADER: >> >> > #+LATEX_HEADER: } #2% >> > #+LATEX_HEADER: \pdfendlink% >> > #+LATEX_HEADER: } >> >> With this in my LaTeX file: >> >> \LaunchBinary{lkfs-structure.org}{Open the file Org mode file.} >> >> I get a red boxed link in the pdf output. >> >> When I click on it, Adobe Reader complains: >> >> Could not find an application to open the file ' '. >> >> I can't understand the code for LaunchBinary, but noticed "DOS" and >> wondered if the code is somehow dependent on the operating system. >> >> I'm using a Mac. >> >> All the best, >> Tom >> >> > >> > >> > Then, I use the code snippet below to export the file to latex. It is >> > stored in a noexport section at the end of the document. basically I set >> a >> > counter, and wrote a filter function for src blocks. the function >> captures >> > the lines between the first and last (first is \begin{minted}... and last >> > is \end{minted} in this case. I write those lines to a file named >> according >> > to the counter, and finally insert \LaunchBinary... into the string >> > returned by the filter. everything else in this let block is just >> > fine-tuning the latex packages, and export behavior. >> > >> > (let ( >> > ;; these packages are loaded in the latex file >> > (org-latex-default-packages-alist >> >'(("utf8" "inputenc" nil) >> > ("T1" "fo
Re: [O] example filter for code blocks?
ngineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > http://kitchingroup.cheme.cmu.edu > Hi everyone, > Thanks for the tips in using export filters for code blocks. I thought > I would share my current solution. The goal was to export all the code > blocks in an org-file to files systematically named part1/script-%d.py > where %d is a number. I didnot want to tangle exactly, because I > wanted to avoid naming the code block tangle files. > > Then, I wanted to insert a pdf link that would open the file, after > the syntax highlighted code. > > I wanted this because it is not convenient to copy and paste the > syntax-highlighted code into an editor. I teach from the pdf that is > generated, and it would be convenient to just open the code, edit and > rerun to explore solutions. > > So, here is the solution: > > At the top of my orgfile, I have this definition which creates a pdf > link. > > #+LATEX_HEADER: \newcommand{\LaunchBinary}[2]{% > #+LATEX_HEADER: % #1: layer name, > #+LATEX_HEADER: % #2: link text > #+LATEX_HEADER: \leavevmode% > #+LATEX_HEADER: \pdfstartlink attr{/C [0.9 0 0] /Border [0 0 2]} user > { > #+LATEX_HEADER: /Subtype /Link > #+LATEX_HEADER: /A << > #+LATEX_HEADER: /F << > #+LATEX_HEADER: /DOS (#1) > #+LATEX_HEADER: >> > #+LATEX_HEADER: /S /Launch > #+LATEX_HEADER: >> > #+LATEX_HEADER: } #2% > #+LATEX_HEADER: \pdfendlink% > #+LATEX_HEADER: } > > Then, I use the code snippet below to export the file to latex. It is > stored in a noexport section at the end of the document. basically I > set a counter, and wrote a filter function for src blocks. the > function captures the lines between the first and last (first is > \begin{minted}... and last is \end{minted} in this case. I write those > lines to a file named according to the counter, and finally insert > \LaunchBinary... into the string returned by the filter. everything > else in this let block is just fine-tuning the latex packages, and > export behavior. > > (let ( > ;; these packages are loaded in the latex file > (org-latex-default-packages-alist > '(("utf8" "inputenc" nil) > ("T1" "fontenc" nil) > ("" "fixltx2e" nil) > ("" "natbib" t) > ("" "url" t) > ("" "graphicx" t) > ("" "textcomp" t) > ("" "underscore" t) > ("" "amsmath" t) > ("version=3" "mhchem" t) > ("tight,pdftex" "web" nil) > ("" "exerquiz" nil) > ("ImplMulti" "dljslib" nil) > )) > (async nil) > (subtreep nil) > (visible-only nil) > (body-only nil)) > > (setq counter 0) > > (defun ox-mrkup-filter-src-block (text back-end info) > (setq counter (+ counter 1)) > > (let ((filename (format "part1-scripts/script-%d.py" counter))) > (with-temp-buffer > (insert (mapconcat 'identity (butlast (cdr (split-string text "\n" > t))) "\n")) > (write-region (point-min) (point-max) filename)) > > (format "%s > > \\LaunchBinary{%s}{Open the python script (%s).} > > " text filename filename))) > > (let ((org-export-filter-src-block-functions ' > (ox-mrkup-filter-src-block))) > (org-latex-export-to-latex async subtreep visible-only body-only > '(:with-author t > :with-date t > :with-title t > :with-timestamps t > :with-todo-keywords t > :with-toc nil > > After building the pdf with pdflatex, I get a link with a red box > around it that I can click on, and on my system it opens the python > file in the python editor I have configured to open the file! > > Thanks again! > > John > > --- > John Kitchin > Associate Professor > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > http://kitchingroup.cheme.cmu.edu > > -- Thomas S. Dye http://www.tsdye.com
Re: [O] org-export-async-init-file
Of course! Thanks for your help, Tom Rasmus writes: > t...@tsdye.com (Thomas S. Dye) writes: > > > >> My question: how to change the value of org-export-async-init-file when I >> export the subtree? > > Perhaps babel and org-element? I'm not sure of the order of > execution, but perhaps you can can check the title and set the init > file condtional on that. > > In any case based on your example—which may be a simplified reflection > of reality or which I may have misunderstood—it is not necessary to > change the init file to load different packages. > > > Example 1: > > * main doc > lorem ipsum > * supplementary material:noexport: > :PROPERTIES: > :EXPORT_LATEX_HEADER: \usepackage{test} > :END: > more txt > > Alternatively, since you're using different LATEX_CLASSes you could > load different packages here. > > >> In the spirit of an ECM, I offer the following EIM to illustrate what >> I'm trying to do. >> >> #+TITLE: Paper >> #+LATEX_CLASS: journal-article >> >> * Paper Section 1 >> * Paper Section 2 >> * Supplementary Material >> >> Describe supplementary material ... >> >> ** Supplementary Material Document :noexport: >>:PROPERTIES: >>:EXPORT_FILE_NAME: supplementary-material >>:EXPORT_TITLE: Supplementary Material for Paper >>:EXPORT_LATEX_CLASS: journal-article-supplement >>:END: >> >> * Editing setup:noexport: >> #+name: editing-setup >> #+begin_src emacs-lisp >> (require 'ox-latex) >> (setq org-export-in-background t) >> (setq org-export-async-debug t) >> (setq org-export-async-init-file (expand-file-name >> "init-journal-article.el")) >> ... >> #+end_src >> >> * Initialization File for Journal Article :noexport: >> >> #+name: export-setup-journal-article >> #+header: :tangle init-journal-article.el >> #+begin_src emacs-lisp >> (setq org-latex-packages-alist nil) >> (add-to-list 'org-latex-packages-alist '("" "setspace")) >> ... >> #+end_src >> >> * Initialization File for Journal Article Supplementary Material :noexport: >> >> #+name: export-setup-journal-article-supplement >> #+header: :tangle init-journal-article-supplement.el >> #+begin_src emacs-lisp >> (setq org-latex-packages-alist nil) >> (add-to-list 'org-latex-packages-alist '("" "setspace")) >> (add-to-list 'org-latex-packages-alist '("" "attachfile")) >> ... >> #+end_src -- Thomas S. Dye http://www.tsdye.com
[O] org-export-async-init-file
Aloha all, I've been following up on John Kitchin's recipe for creating a pdf file compendium that can be used as the supplementary material for a journal article. The journal I'm targeting provides a list of LaTeX packages that must be used exactly, without omissions or additions. John's recipe uses the LaTeX package attachfile, which is not on the list of packages that can be used in preparing the journal article. It is OK to use attachfile to prepare the pdf file distributed as supplementary material. I'm trying to set up the Org-mode file to use asynchronous export, both for the paper and for the supplementary material. I want to use one init file when I export the paper, and a different init file when I export the subtree that contains the supplementary material. My question: how to change the value of org-export-async-init-file when I export the subtree? In the spirit of an ECM, I offer the following EIM to illustrate what I'm trying to do. #+TITLE: Paper #+LATEX_CLASS: journal-article * Paper Section 1 * Paper Section 2 * Supplementary Material Describe supplementary material ... ** Supplementary Material Document :noexport: :PROPERTIES: :EXPORT_FILE_NAME: supplementary-material :EXPORT_TITLE: Supplementary Material for Paper :EXPORT_LATEX_CLASS: journal-article-supplement :END: * Editing setup:noexport: #+name: editing-setup #+begin_src emacs-lisp (require 'ox-latex) (setq org-export-in-background t) (setq org-export-async-debug t) (setq org-export-async-init-file (expand-file-name "init-journal-article.el")) ... #+end_src * Initialization File for Journal Article :noexport: #+name: export-setup-journal-article #+header: :tangle init-journal-article.el #+begin_src emacs-lisp (setq org-latex-packages-alist nil) (add-to-list 'org-latex-packages-alist '("" "setspace")) ... #+end_src * Initialization File for Journal Article Supplementary Material :noexport: #+name: export-setup-journal-article-supplement #+header: :tangle init-journal-article-supplement.el #+begin_src emacs-lisp (setq org-latex-packages-alist nil) (add-to-list 'org-latex-packages-alist '("" "setspace")) (add-to-list 'org-latex-packages-alist '("" "attachfile")) ... #+end_src All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Org Tutorials need more structure
Aloha John, Marcin, and Charles, Yes, I completely agree with you. Apologies if my remarks were taken to be exclusionary in any way. They weren't intended to be. The diversity of the Org-mode community is one of its great strengths. My comments were intended to be ideas on how we might introduce Org-mode to a wider audience. In this vein, I think it would be useful to have a brief statement about Org-mode that gives the interested reader from any background a good feel for the scope of Org-mode and how it presents itself to the user. I don't think the current statements about what Org-mode "is" do this very effectively, though they might have done so in the past. The "research programming interface" is meant to encompass situations where all of the software's major components are put to use and thus to indicate the software's scope. The bit about scientists likely needs some qualifications to be absolutely true, but it also prepares the reader for an interface of a particular kind, one that is logical and complex rather than "intuitive". The core values bit for me helps distinguish the Org-mode community from innumerable others we all deal with every day. There are probably better ways to give the novice a sense of the Org-mode experience, but these are the things that stand out for me. All the best, Tom John Hendy writes: > On Sat, Sep 28, 2013 at 4:31 PM, Marcin Borkowski > wrote: >> Dnia 2013-09-28, o godz. 16:50:09 >> Charles Millar napisał(a): >> >>> On 9/28/2013 3:52 PM, Thomas S. Dye wrote: >>> > Aloha Carsten, >>> > >>> snip >>> > First, I think that most statements about "what Org-mode is" are >>> > outdated. Many of them are quite good, but they represent the >>> > previous state of an evolving system and so fail to capture the >>> > full scope. To my mind, Org-mode is a "research programming >>> > interface" written by and for scientists who take very seriously >>> > certain core values of the scientific enterprise--reproducibility, >>> > open access, and open source (a partial list). >>> Strongly disagree with the sentiment. My undergraduate degree may >>> gave been Physics, but I work as a freelance paralegal. I use Org >>> Mode for project (file) planning, scheduling, drafting documents, >>> etc. Also, I believe that there are some very active participants on >>> this list who are not scientists and have made great contributions. >> >> +1. Although I'm also a scientist (mathematics), I used Org-mode /once/ >> for science, and it turned out that I felt very much constrained and >> quickly got back to LaTeX, where I felt much more comfortable. >> http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski >> Adam Mickiewicz University >> > > This is starting to remind me of bike-shedding. Org-mode is a toolbox > providing various things that can work toward whatever end one wants. > It's agnostic to field. It doesn't really matter what the end uses are > -- Org-mode "is" what functions it provides. How those are combined by > others in various fields, lines of work, or so on are simply > illustrations of it's capabilities with respect to neat ways of > combining various aspects of what Org "is." > > Thus, I wouldn't try to pitch these things one way or another ("Org is > great for paralegals" or "Org is the answer for those doing > re-producible research"); I'd simply list what it does as what is "is" > and what it can be used "for" as a way to entice new users and help > get into the top results of some google searches for > tools/solutions/etc.. > > It seems we all get what it really "is," (TODOs/agenda, universal > markdown -> export to tons of formats, allowing mixing of > prose/code/results, and so on), but are sort of trying to lay claim to > why these tools make it best suited toward some particular field. > > Whether you use one of Org's features or all of them, it is what it is > and this can be highlighted in a neat manner and made appealing to > those looking for help in these relevant areas of life. > > > John > > -- Thomas S. Dye http://www.tsdye.com
Re: [O] Org Tutorials need more structure
Aloha Carsten, Carsten Dominik writes: > Hi everyone, > > today I looked at our tutorial page at > > http://orgmode.org/worg/org-tutorials/index.html > > and came away with the feeling that that this page has become > somewhat useless for people who are really new to Org. I think > the page should start with a section of true recommendations > for beginners, a path we tell every new users to take in order to > learn about Org mode. > > Can we have a discussion here on how this path should look like? > When you came to Org-mode as a newby, what were the three resources > that really made an impression on by being accessible and > providing feel and promise for digging deeper? > > - Carsten Good idea! Here is my $0.02. First, I think that most statements about "what Org-mode is" are outdated. Many of them are quite good, but they represent the previous state of an evolving system and so fail to capture the full scope. To my mind, Org-mode is a "research programming interface" written by and for scientists who take very seriously certain core values of the scientific enterprise--reproducibility, open access, and open source (a partial list). Its original focus on project planning has expanded with two amazing and fundamental contributions, Eric and Dan's mature Babel implementation and Nicolas' new export framework. These core values are manifest most clearly in the Org-mode community and its organ, the mailing list. There isn't a tutorial on how to use the mailing list! I'm confident that others in the Org-mode community admire Nick Dokos' contributions to the list as much as I do. It would be great to have his perspective and approach in a short, welcoming tutorial. For me, the "philosophy" behind Org-mode shows most clearly in your talk at the Max-Planck Institute. I think this video is a must-see. On the project planning side, I think a good starting place is David O'Toole's popular tutorial. It is an efficient presentation and efficiency is one thing I think we all like about Org-mode. For me, the next step was to learn something about how to plan. I thought I knew how to do this, of course, but I really had no clue and consequently I couldn't make heads or tails of what initially struck me as a complex, ungainly set of inscrutable functions. I bought and read David Allen's little book, then followed Charles Cave's tutorial--it started to make sense! Armed with this new understanding, I found Bernt Hansen's "Organize Your Life in Plain Text" to be a huge repository of practical and useful advice (even though I have no desire to clock my unruly habits). On the research side, John Kitchin's Sci-Py talk seems to me a very good introduction. I'd follow this up with our paper in Journal of Statistical Software, which is now widely distributed. After that, I'd jump straight to John's supporting document for his paper with Alexander Hallenbeck. When this pdf document is opened in Adobe Reader (not Skim) it has links that look like push-pins. The first one of these is the Org-mode file that created the pdf document and when I double-click on it I find the Org source for his document in my Emacs. This is a terrific example of what an Org-mode file used for reproducible research should look like, very clean and disarmingly simple, a real gem. I strongly believe the Emacs newbie needs to steer clear of the temptation to lard .emacs with every tasty tidbit out there. In my experience, this is a BAD IDEA, but nearly everyone just casually says, "put this in your init file." A tutorial that gives very practical advice (some of which will undoubtedly offend or infuriate hard-core Emacs users) would be a real blessing. Finally, many of the tutorials are outdated. A good example is the one I wrote on the old LaTeX exporter. This one is clearly marked now, but it would be very good to corral the older tutorials in their own space, away from where the real tutorial action happens. Apologies for rambling. hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] how to provide feedback to the org documentation on the website?
Hi Jason, It is editable! You can find how to register and use git for editing Worg here: http://orgmode.org/worg/worg-about.html It's actually a pleasure to work on its org-mode files. All the best, Tom Jason Lewis writes: > Hi, > > I noticed a word that is probably wrong in the org doco online. What's > the general procedure for providing feedback? It's not editable like a > wiki is it? > > Specifically on the page http://orgmode.org/manual/Beamer-export.html > > " Eventually, every plain list has support" should read "Finally, every > plain list has support" > > Jason > > -- > Jason Lewis > http://emacstragic.net > > Hi, > > I noticed a word that is probably wrong in the org doco online. What's > the general procedure for providing feedback? It's not editable like a > wiki is it? > > Specifically on the page http://orgmode.org/manual/Beamer-export.html > > " Eventually, every plain list has support" should read "Finally, > every plain list has support" > > Jason -- Thomas S. Dye http://www.tsdye.com
Re: [O] example filter for code blocks?
Hi John, Terrific! There go my plans for the weekend ... :) Good luck with the heavy-handed journal processor. It seems worth pursuing to me. All the best, Tom John Kitchin writes: > I think it is so interesting, we have actually tried a variation of it! I > set up an org-file that exported a supplementary information file, using > attachfile to embed data files and scripts in the pdf. Unfortunately, the > journal "processed" the pdf file, and stripped those files out ;( We > haven't tried to see if we can get our original supplemental pdf accepted. > > > John > > --- > John Kitchin > Associate Professor > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > http://kitchingroup.cheme.cmu.edu > > > > On Thu, Sep 26, 2013 at 3:43 PM, Thomas S. Dye wrote: > >> Hi John, >> >> John Kitchin writes: >> >> > Hi everyone, >> > Thanks for the tips in using export filters for code blocks. I thought I >> > would share my current solution. The goal was to export all the code >> blocks >> > in an org-file to files systematically named part1/script-%d.py where %d >> is >> > a number. I didnot want to tangle exactly, because I wanted to avoid >> naming >> > the code block tangle files. >> > >> > Then, I wanted to insert a pdf link that would open the file, after the >> > syntax highlighted code. >> > >> > I wanted this because it is not convenient to copy and paste the >> > syntax-highlighted code into an editor. I teach from the pdf that is >> > generated, and it would be convenient to just open the code, edit and >> rerun >> > to explore solutions. >> >> This seems like it might be an elegant way to distribute a piece of >> reproducible research. I suspect most readers would prefer to have a pdf >> entry point into a compendium over an Org-mode entry point. Instead of >> distributing the Org-mode file that is configured to make a pdf file, >> carry out calculations, draw figures, etc., one could distribute a >> ready-made pdf file with an appendix of Supplementary Material that has >> all the code for calculations, figures, etc. >> >> What do you think? >> >> All the best, >> Tom >> >> -- >> Thomas S. Dye >> http://www.tsdye.com >> > I think it is so interesting, we have actually tried a variation of > it! I set up an org-file that exported a supplementary information > file, using attachfile to embed data files and scripts in the pdf. > Unfortunately, the journal "processed" the pdf file, and stripped > those files out ;( We haven't tried to see if we can get our original > supplemental pdf accepted. > > John > > --- > John Kitchin > Associate Professor > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > http://kitchingroup.cheme.cmu.edu > > On Thu, Sep 26, 2013 at 3:43 PM, Thomas S. Dye wrote: > > Hi John, > > > John Kitchin writes: > > > Hi everyone, > > Thanks for the tips in using export filters for code blocks. I > thought I > > would share my current solution. The goal was to export all the > code blocks > > in an org-file to files systematically named part1/script-%d.py > where %d is > > a number. I didnot want to tangle exactly, because I wanted to > avoid naming > > the code block tangle files. > > > > Then, I wanted to insert a pdf link that would open the file, > after the > > syntax highlighted code. > > > > I wanted this because it is not convenient to copy and paste the > > syntax-highlighted code into an editor. I teach from the pdf > that is > > generated, and it would be convenient to just open the code, > edit and rerun > > to explore solutions. > > > This seems like it might be an elegant way to distribute a piece > of > reproducible research. I suspect most readers would prefer to have > a pdf > entry point into a compendium over an Org-mode entry point. > Instead of > distributing the Org-mode file that is configured to make a pdf > file, > carry out calculations, draw figures, etc., one could distribute a > ready-made pdf file with an appendix of Supplementary Material > that has > all the code for calculations, figures, etc. > > What do you think? > > All the best, > Tom > > -- > Thomas S. Dye > http://www.tsdye.com > > -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] example filter for code blocks?
Hi John, John Kitchin writes: > Hi everyone, > Thanks for the tips in using export filters for code blocks. I thought I > would share my current solution. The goal was to export all the code blocks > in an org-file to files systematically named part1/script-%d.py where %d is > a number. I didnot want to tangle exactly, because I wanted to avoid naming > the code block tangle files. > > Then, I wanted to insert a pdf link that would open the file, after the > syntax highlighted code. > > I wanted this because it is not convenient to copy and paste the > syntax-highlighted code into an editor. I teach from the pdf that is > generated, and it would be convenient to just open the code, edit and rerun > to explore solutions. This seems like it might be an elegant way to distribute a piece of reproducible research. I suspect most readers would prefer to have a pdf entry point into a compendium over an Org-mode entry point. Instead of distributing the Org-mode file that is configured to make a pdf file, carry out calculations, draw figures, etc., one could distribute a ready-made pdf file with an appendix of Supplementary Material that has all the code for calculations, figures, etc. What do you think? All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] [Babel][R] Inclusion of multi-line named code blocks in R code
Aloha Alex, My work flow in this situation evaluates the SQL to create an Org-mode table, which serves as input to the R source code block. For me, seeing the SQL output in a table is a sanity check. hth, Tom Alexander Vorobiev writes: > I have R code which submits SQL statements to a database server. Since the > SQL is rather complex, I want to put it into a separate code block in order > to have proper formatting, syntax highlighting, etc: > > #+name: long-sql > #+begin_src sql > select * > from many, tables > where > complex_condition1 = 1, > complex_condition2 = 2 > #+end_src > > * Load the data to R session > #+begin_src R :session *R* :noweb yes > result <- submit_query('<>') > #+end_src > > Unfortunately, the R block doesn't work. When I open the file generated by > Babel, I see this: > > result <- submit_query('select * > result <- submit_query('from many, tables > etc > > instead of the one R submit_query call with my SQL statement as an > argument. Is there anything I can do to achieve that? > > Thanks > Alex > I have R code which submits SQL statements to a database server. Since > the SQL is rather complex, I want to put it into a separate code block > in order to have proper formatting, syntax highlighting, etc: > > #+name: long-sql > #+begin_src sql > select * > from many, tables > where > complex_condition1 = 1, > complex_condition2 = 2 > #+end_src > > * Load the data to R session > #+begin_src R :session *R* :noweb yes > result <- submit_query('<>') > #+end_src > > Unfortunately, the R block doesn't work. When I open the file > generated by Babel, I see this: > > result <- submit_query('select * > result <- submit_query('from many, tables > etc > > instead of the one R submit_query call with my SQL statement as an > argument. Is there anything I can do to achieve that? > > Thanks > Alex > > -- Thomas S. Dye http://www.tsdye.com
Re: [O] variable line-spacing in plain lists?
Aloha Christopher, You can put an empty line between list items. It takes two empty lines to end a list. Tom "Poile, Christopher" writes: > Hello all, > This may be an odd request, but is it possible to make org (or emacs) > increase the spacing slightly (a couple pixels) above each item in a > plain-list? In the case of a wrapped line only the first line of that list > item would have the extra spacing above it. For ex: > > - First item | <-- margin ends here > + Second Item | > - Third item, and this one is a wrapped line | <-- with visual line wrap > with the line continuing onto the next line| > and then a third line. Only three lines| > would have spaces above them: the lines| > starting with "First" "Second" and "Third" | > all other lines of this paragraph would be | > spaced with the default line-spacing. > > Thanks for the help, > Chris. > > -- Thomas S. Dye http://www.tsdye.com
Re: [O] LaTeX export question
Aloha Scott, Scott Randby writes: > Whenever I export an org file to LaTeX, the LaTeX file always gives me > these lines in the preamble right before \begin{document} (name these > lines Block 1): > > \hypersetup{ > pdfkeywords={}, > pdfsubject={}, > pdfcreator={}} > > I'd like Block 1 to not appear when I export because I give values to > its options in my org file as follows: (setq org-latex-with-hyperref nil) hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Filters not working
Nicolas Goaziou writes: > Actually, I didn't mean to introduce a type change in filter arguments. > > I fixed it: BACKEND is again a symbol. `org-export-derived-backend-p' > still works, and so does `memq'. Thanks Nicolas. I can confirm that my old filters with memq work again and that the new ones with org-export-derived-backend-p work for me, too. All the best, Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] Filters not working
Charles Berry writes: > The changes introduced in commit > > cea0434c4f7f7f1fc1547e6790b96a76bc217e15 > ox: Change back-ends internal representation to structures > > necessitate extracting the name of the back-end from a vector. > > So, this bit of code > > (memq backend '(beamer latex)) > > will never return t, because backend is a vector. > > Probably what you want is > > (memq (org-export-backend-name backend) '(latex beamer)) Yes, got it now. Thanks for your help. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Filters not working
Aaron Ecay writes: > Thomas, > > Since backends are no longer passed as symbols, but as structs, I > think you should use the `org-export-derived-backend-p' function. > Does your code work if you replace `(memq backend ...)' with > `(org-export-derived-backend-p backend 'latex)'? (beamer is derived > from latex, so you don't need a separate test for it.) Thanks Aaron, that works. Now, to finish off that writing project ... All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Filters not working
Charles Berry writes: > Did you upgrade as in 'git pull'? If not, I cannot help. Yes, Org-mode version 8.0.7 (release_8.0.7-377-gef2d47 @ /Users/dk/.emacs.d/src/org-mode/lisp/) > > If so, > > This bit of org-mode: > > , > | * headline > | > | > | #+BEGIN_SRC emacs-lisp :eval yes :exports both > | (defun test-filter-final (text back-end info) > | "What is back-end?" > | (concat "type-of back-end: " > | (format "%S" (type-of back-end)) > | "\nname of back-end: " > | (symbol-name (org-export-backend-name back-end > | > | (add-to-list 'org-export-filter-final-output-functions 'test-filter-final) > | #+END_SRC > ` > > will export via > > C-c C-e l L y > > as > > , > | type-of back-end: vector > | name of back-end: latex > ` Yes, it does. > > Take a look at "(defstruct (org-export-backend..." in ox.el OK, I had a look at org-export-backend, but not sure what I'm looking for in particular. I did note that you don't test back-end directly, but instead look at org-export-backend-name. Perhaps this is what Nicolas means by "Filters defined here shouldn't make a back-end test, as it may prevent back-ends derived from this one to behave properly"? However, changing my filter so it uses org-export-backend-name doesn't seem to change anything. Or, was I supposed to learn something else from ox.el? Thanks for your help. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
[O] Filters not working
Aloha all, After an upgrade from 8.0.3 this morning I'm unable to export a large writing project that has kept me from reading the ML regularly for the last few months. It seems that filters that used to work, no longer do so. For example, #+name: tsd-parencites #+BEGIN_SRC emacs-lisp (defun tsd-latex-filter-parencites (text backend info) "Replace parencites placeholders in Beamer/LaTeX export." (when (memq backend '(beamer latex)) (replace-regexp-in-string "π" "\\parencites" text nil t))) (add-to-list 'org-export-filter-plain-text-functions 'tsd-latex-filter-parencites) #+END_SRC now lets pi slip through into the LaTeX output, giving this error: ERROR: Package inputenc Error: Unicode char \u8:π not set up for use with LaTeX. My question, is whether this filter is obviously broken given recent changes to Org-mode? Any pointers greatly appreciated. If not, I'll get on with it and try to track down the problem. All the best, Tom -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com
Re: [O] How to pass named table reference in source block variable
Roland Donat writes: >> >> Perhaps this can help: >> >> http://orgmode.org/worg/org-contrib/babel/examples/lob-table- > operations.html >> >> Alternatively, you might pass the table to a code block of a language >> that understands tables, such as an R data frame, and use that language >> to retrieve values by name. >> >> hth, >> Tom >> > > Thank you for the link, I'll check it but seems that it won't solve the > problem. But anyway, I found a workaround that doesn't involve to insert > table reference. What is the workaround? All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] How to pass named table reference in source block variable
Roland Donat writes: > Thorsten Jolitz gmail.com> writes: > >> >> This does the job in Emacs Lisp: >> >> #+TBLNAME: T >> | | x | 1 | >> | ^ | | varx | >> >> #+begin_src emacs-lisp :var x=T[0,-1] >> x >> #+end_src >> >> #+results: >> : 1 >> > > Thanks for the answer but in fact, my objective is precisely to avoid using > the indices of the value I want to pass as input of the code block. > > My goal is to use the cell name reference "varx" which would make the code > block simpler to maintain. Indeed, if I add new data on the top of table T, > I wouldn't have to change the reference in the code block since the name > reference is fixed. > > Perhaps this can help: http://orgmode.org/worg/org-contrib/babel/examples/lob-table-operations.html Alternatively, you might pass the table to a code block of a language that understands tables, such as an R data frame, and use that language to retrieve values by name. hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] import R data frame into org-mode table
Rob Stewart writes: > I have an R script that generates a data frame, that I export to a CSV > file. The data looks something like this: > > "","Variant","Xaxis","N","mean","sd","se" > "1","line1",10,5,111.11,9.33,3.11 > "1","line1",20,5,112.11,9.13,3.14 > "1","line1",30,5,113.11,9.43,3.10 > "1","line2",10,5,101.11,8.33,2.11 > "1","line2",20,5,100.11,8.13,2.12 > "1","line2",30,5,108.11,8.03,2.10 > > I have an ongoing org-mode document in which I'd like to report this > data. I'd like to add a table that looks something like this: > > | Variant | X Axis | Y Axis | N | Mean | Standard Deviation | > Standard Error | > > || > > The data will change frequently over the coming months. I'd like > org-mode to auto-magically read a CSV file, to construct my org-table > on-the-fly. I'd hoping to avoid copying and pasting results each time. > > Is there some org-mode or emacs+ESS magic I can use to populate my > empty table, with source data from my CSV file? > > -- > Rob Hi Rob, Andreas' post answers your specific question. In your situation, I typically don't run through a csv file, but just write the R script so the data frame is returned to the Org mode buffer as the result of the source code block. As for the translation of column heads, see the ascii package for R, which has a print() routine that recognizes Org mode as a type of output, and which has facilities for formatting column names. Here is an example from some work in progress that uses a session: #+property: exports results #+property: colnames yes #+property: session *adzes* #+name: lda-mid-z #+header: :results output org #+begin_src R y <- edxrf[edxrf$lab=='UH-Hilo',] fit <- lda(as.factor(site) ~ rb_ppm + sr_ppm + y_ppm + zr_ppm + nb_ppm, data=y, na.action="na.omit", CV=TRUE) adzes <- y$site=='unknown' cap <- "Assignment of unknowns to sources" z <- ascii(cbind(BPBM=y$bpbm[adzes],round(fit$posterior[adzes,],2)),header=T,include.colnames=T,caption=cap) print(z,type="org") rm(y,fit,adzes,cap,z) #+end_src #+RESULTS: lda-mid-z #+BEGIN_ORG #+CAPTION: Assignment of unknowns to sources | BPBM | Haleakala | Kilauea | Mauna Kea | Nu`u | Pololu | Waiahole | unknown | |---+---+-+---+------+----+--+-| | 1985.134.01 adze | 0 | 0.1 | 0 | 0| 0 | 0.64 | 0.27| | 50-HA-1349-G-5 adze | 0 | 0.85| 0 | 0| 0 | 0| 0.14| | 50-HA-900-P24-1 microadze | 0 | 0 | 1 | 0| 0 | 0| 0 | ... hth, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Help with new exporter
Hi John, I think your search string might better be "\[\]", or something along those lines (perhaps it needs to be "\\[\\]"). hth, Tom John Rakestraw writes: > Hi, list -- > > I understand the value of working on this myself -- what better way to > learn? -- but after a few hours of reading the docs and scouring the > list, I've reached the point of seeking at least a hint for where to go. > (There's much more information higher in this thread, but I'm trying to > focus rather narrowly on the problem here to keep the email relatively > short.) > > I'm trying to export to a pdf, using Phil Hirschhorn's exam.cls. The > document class definition I have (thanks, Robert!) gets me almost to > where I need to be. However, it leaves me with square brackets at > several points in the tex file. I need to delete those brackets. > > That is, I need to change "\begin[]{questions}" to > "{\begin{questions}". > > Following Charles's advice, I'm trying to define and use a filter. > However, I know little enough about LaTeX and lisp that I can't figure > out why what I have isn't working. At the risk of making it very clear I > know even less than nothing, here's what I've worked up: > >(defun jr-org-delete-brackets-from-tex-file > (text backend info) > (while (re-search-forward "\\[]" nil t) > (replace-match "")) > text) > > (add-to-list 'org-export-filter-final-output-functions > 'jr-org-delete-brackets-from-tex-file) > > This doesn't work. > > Can someone at least give me a hint on what I need to do differently? > > Thanks very much. -- Thomas S. Dye http://www.tsdye.com
Re: [O] Lists, exports to LaTeX and cr/lf
Aloha Fabrice, Fabrice Popineau writes: > Hi, > > I have a question regarding lists and Org-mode 8.0.2 (the version I > currently use). > It seems that if I export this : > > - foo foo foo foo foo > bar bar bar bar > - foo foo foo foo foo > bar bar bar bar > > Then I get 2 itemize environments because I broke the line after foo. The line break is not terminating the itemize environment by itself. It is the lack of indentation on the "bar bar" lines that terminates the itemize environments in this case. The following should yield a single itemize environment when it is exported: - foo foo foo foo foo bar bar bar bar - foo foo foo foo foo bar bar bar bar > I don't remember that it was the case previously. > I would find it much more convenient if the end of the environment > was denoted by an empty line, ie: > > - foo foo foo foo foo > bar bar bar bar > > - foo foo foo foo foo > bar bar bar bar The end of the environment can be denoted by two (or more) empty lines. This way it is possible to have multi-paragraph (separated by single empty lines) items in lists. See section 2.7, Plain lists, in the Org-mode manual for a precise description of list indentation and ending. hth, Tom > > Any comment about this or did I miss something already explained on the > list? > > Thanks in advance, > > -- > Fabrice > Hi, > > I have a question regarding lists and Org-mode 8.0.2 (the version I > currently use). > It seems that if I export this : > > - foo foo foo foo foo > bar bar bar bar > - foo foo foo foo foo > bar bar bar bar > > Then I get 2 itemize environments because I broke the line after foo. > I don't remember that it was the case previously. > I would find it much more convenient if the end of the environment > was denoted by an empty line, ie: > > - foo foo foo foo foo > bar bar bar bar > > - foo foo foo foo foo > bar bar bar bar > > Any comment about this or did I miss something already explained on > the list? > > Thanks in advance, -- Thomas S. Dye http://www.tsdye.com
Re: [O] Classification of Org mode elements
Aloha Nicolas, Nicolas Goaziou writes: > Hello, > > t...@tsdye.com (Thomas S. Dye) writes: > >> My idea is to add the table to Nicolas' draft Org Syntax document, and >> use the classes as the basis for editing and restructuring the document >> a bit. > > Please go ahead, as long as the document stays faithful to the > implementation. Yes, this is the editor's challenge. The author need's to keep a sharp eye, too. > > > [...] > >> Also, I'd like to see the Org Syntax document become an appendix to the >> manual. I know some think that it is too developer-ish to be a part of >> the manual, but it has helped me see Org Mode documents more clearly and >> I think it might benefit others, as well. > > I also think that, once it is finalized (i.e. readable), it deserves to > be added to appendix. Great. Unless others object let's set this as a goal. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Classification of Org mode elements
Aloha Thorsten, Thorsten Jolitz writes: > t...@tsdye.com (Thomas S. Dye) writes: > > Hi Thomas, > >> The attached Org mode document contains some notes on the classification >> of Org mode elements that might be a useful addition to Nicolas >> Goaziou's draft Org syntax document >> (http://orgmode.org/worg/dev/org-syntax.org). >> >> It distinguishes nine classes of element and proposes names for them. > > I really like the idea to make Nicolas decisions when modelling Org > syntax more explicit and write them down as a quick reference overview. Well, I'm just summarizing Nicolas' draft Org Syntax document. I don't think I've made anything more explicit than he does in that fine document. I'm glad you like the table. > > I compressed your table a bit to make it fit on a screen/page Much better, a real improvement. Thanks! > , and added > a subtree for each element to the file that could contain a short > (man-page like) descripton of syntax and semantics of that element (see > my attempts for 'Property drawer' as an example). This should not > compete with the manual or the cheat sheet, but rather serve as a > minimal overview of the Org 8+ syntax elements. My idea is to add the table to Nicolas' draft Org Syntax document, and use the classes as the basis for editing and restructuring the document a bit. Perhaps your subtrees would fit in, too? > > Right now I don't have the time to fill the other subtrees, but I might > add to this the next days, maybe others can add to it too and then this > file can be uploaded to Worg? Yes, perhaps we could do that if Nicolas doesn't like the changes I have in mind for the draft Org Syntax document. Also, I'd like to see the Org Syntax document become an appendix to the manual. I know some think that it is too developer-ish to be a part of the manual, but it has helped me see Org Mode documents more clearly and I think it might benefit others, as well. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Slides about LaTeX export
"Fabrice Niessen" writes: > Hello all, > > Yagnesh Raghava Yakkala wrote: >> On Jun 17 2013, tsd-p0awh739ni4avxtiumw...@public.gmane.org (Thomas >> S. Dye) wrote: >>> Carsten Dominik >>> writes: >>>> On 16.6.2013, at 23:00, Nick Dokos >>>> wrote: >>>>> tsd-p0awh739ni4avxtiumw...@public.gmane.org (Thomas S. Dye) writes: >>>>> >>>>>>>> all source code objects are empty yellow squares when I view this >>>>>>>> slide show with Chrome... >>>>>>> >>>>>>> It works as expected for me with Google Chrome. >>>>>> >>>>>> I get empty yellow rectangles with Google Chrome. >>>>> >>>>> IIRC, both you and Carsten use Macs - correct? >>>> >>>> Yes, this is correct on my side. >>> >>> Yes, I'm on a Mac, too. > > Could one of you report (as suggested by Nick) whether it works (or not) from > another browser on the Mac? > > The fact it's limited to Mac would make me think of a font problem? I'm using > Libertine through a require package in my "white" Beamer color theme (based on > the Org theme from Marcin Borkowski). > Mac 10.7.5, Firefox and Camino both show the code in the yellow rectangles. Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] [help] How to export a chapter as appendix
Aloha Feng Shu, Feng Shu writes: > -- > org: > > * This is a appendix > > -- > > latex: > > \appendix{This is a appendix} You might want \appendix \chapter{This is a appendix} In which case: #+LaTeX: \appendix * This is a appendix hth, Tom -- Thomas S. Dye http://www.tsdye.com
[O] Classification of Org mode elements
| true | false | 5 | Element | Lesser element| | Comment | false | false | true | false | 5 | Element | Lesser element| | Comment block | false | false | true | false | 5 | Element | Lesser element| | Diary | false | false | true | false | 5 | Element | Lesser element| | Example block | false | false | true | false | 5 | Element | Lesser element| | Fixed width area| false | false | true | false | 5 | Element | Lesser element| | Horizontal rule | false | false | true | false | 5 | Element | Lesser element| | Keyword | false | false | true | false | 5 | Element | Lesser element| | LaTeX environment | false | false | true | false | 5 | Element | Lesser element| | Sexp| false | false | true | false | 5 | Element | Lesser element| | Source block| false | false | true | false | 5 | Element | Lesser element| |-+-++--+---+---+-+---| | Paragraph | false | false | true | true | 6 | Element | Direct object lesser element | | Verse block | false | false | true | true | 6 | Element | Direct object lesser element | |-+-++--+---+---+-+---| | Clock | false | false | false| false | 7 | Element | Unattributable lesser element | | Planning (Plan?)| false | false | false| false | 7 | Element | Unattributable lesser element | |-+-++--+---+---+-+---| | Node property | false | true | false| false | 8 | Element | Node property | |-+-++--+---+---+-+---| | Table row | false | true | false| true | 9 | Element | Table row | -- Thomas S. Dye http://www.tsdye.com
Re: [O] Slides about LaTeX export
Carsten Dominik writes: > On 16.6.2013, at 23:00, Nick Dokos wrote: > >> t...@tsdye.com (Thomas S. Dye) writes: >> >>>>> Hi Fabrice, >>>>> >>>>> all source code objects are empty yellow squares when I view this >>>>> slide show with Chrome... >>>>> >>>> >>>> It works as expected for me with Google Chrome. >>>> >>> >>> I get empty yellow rectangles with Google Chrome. >>> >> >> IIRC, both you and Carsten use Macs - correct? > > Yes, this is correct on my side. Yes, I'm on a Mac, too. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Slides about LaTeX export
Suvayu Ali writes: > On Sat, Jun 15, 2013 at 12:21:42PM +0200, Carsten Dominik wrote: >> >> On 14.6.2013, at 23:36, Fabrice Niessen wrote: >> >> > Hello, >> > >> > Just to let you know I've made a 1h30 presentation about the LaTeX >> > exporter of >> > Org mode 8 at the "Stage LaTeX de Dunkerque 2013", on last >> > Wednesday (12th of >> > June). >> > >> > My slides are visible on: >> > >> > http://fr.slideshare.net/fniessen/org-modelatexexport >> >> Hi Fabrice, >> >> all source code objects are empty yellow squares when I view this >> slide show with Chrome... >> > > It works as expected for me with Google Chrome. > > Cheers, I get empty yellow rectangles with Google Chrome. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] Guidance for preparing document with code
Aloha SabreWolfy, SabreWolfy writes: > I'm using Org ~7.8 and would like to prepare a document for export to HTML > to make available to others to read. This document will contain heading, > text, etc., R code (for my reference) and the output of the R code. Where > should I look to learn how to do this in R? Org-babel? Org mode should do what you want pretty much out of the box. Note that the exporters all changed with Org 8, so you'll want to distinguish between the old and new exporters if you look for information on line. > Is this literate > programming? I don't think so. The end result of literate programming is typically a computer program rather than a document. > I've read much about Org over the years, and I think I've > probably tried this already once before, but I'd like to know where to start > looking. For your R code blocks, see the :exports header argument. It sounds like you'll want to set that to :exports both so you can see both your R code and its output in the html document. Good luck! hth, Tom -- Thomas S. Dye http://www.tsdye.com