Re: [O] [help] How to ignore a head but don't ignore it's subhead when export
> * Abstract :ignoreheading: > > #+LATEX: \begin{myabstract} > ... > #+LATEX: \end{myabstract} You can do #+begin_myabstract\n ... #+end_myabstract. –Rasmus -- . . . It begins of course with The Internet. A Net of Peers.
Re: [O] Slides about LaTeX export
Hello all, "Fabrice Niessen" wrote: > Viktor Rosenfeld wrote: >> Fabrice Niessen wrote: >>> Could one of you report (as suggested by Nick) whether it works (or not) >>> from >>> another browser on the Mac? >> >> Snow Leopard 10.6.8: >> >> - Chrome: only yellow boxes >> - Safari: only yellow boxes >> - Firefox: yellow boxes with code > > Thanks to all for your tests. I'll report the problems to SlideShare -- I > think they must have the key. At least, I hope so. For your information, I've opened a ticket on SlideShare. But it seems we can't expect so good news for our Beamer slides: ╭ http://help.slideshare.com/requests/42307 (full ticket report) │ │ Let me send this off to my team to look into to see if this can be │ resolved, but since the majority of files (including PDF's) that we │ receive on SlideShare are from more common file creation tools such as │ PowerPoint, this may take some time, and we may not support PDF's │ created with this process. ╰ Quite disappointing: we use the best tool to typeset our presentations, and they are the worst when displayed on SlideShare... Best regards, Fabrice -- Fabrice Niessen Leuven, Belgium
Re: [O] link abbreviation with multiple params, e. g. for geo locations
Hi Eric On Fri, Jun 14, 2013 at 10:13 PM, Michael Brand wrote: > Is there a better workaround or would you accept :var dummy_name for > my ERT that I mentioned? For the variant of :var dummy_name see my attached patch with the updated ERT. Michael From 576cd364262d33bbf614414085cc918ac7ff548b Mon Sep 17 00:00:00 2001 From: Michael Brand Date: Wed, 19 Jun 2013 11:36:36 +0200 Subject: [PATCH] Babel: use case of reading entry properties as an ERT * testing/examples/babel.org: Add test entry for ERT. * testing/lisp/test-ob-exp.el(ob-exp/use-case-of-reading-entry-properties): Add expected source block results for ERT. --- testing/examples/babel.org | 77 + testing/lisp/test-ob-exp.el | 42 + 2 files changed, 119 insertions(+) diff --git a/testing/examples/babel.org b/testing/examples/babel.org index 15f9717..de1980e 100644 --- a/testing/examples/babel.org +++ b/testing/examples/babel.org @@ -359,3 +359,80 @@ Here is a call line with more than just the results exported. <> echo "1$i" #+END_SRC + +* use case of reading entry properties + :PROPERTIES: + :ID: cc5fbc20-bca5-437a-a7b8-2b4d7a03f820 + :END: + +If overriden by caller then use :var from header else use entry property. + +** section + :PROPERTIES: + :a:1 + :c:3 + :END: + +Note: Just export of a property can be done with a macro: {{{property(a)}}}. + +#+CALL: src_block_location_shell(dummy_name="sect call") +#+CALL: src_block_location_elisp[:session sect call]() +- sect inline call_src_block_location_shell(dummy_name="sect inline") +- sect inline call_src_block_location_elisp[:session sect inline]() + +*** subsection +:PROPERTIES: +:b:2 +:c:4 +:END: + +#+CALL: src_block_location_shell(dummy_name="sub0 call") +#+CALL: src_block_location_elisp[:session sub0 call]() +- sub0 inline call_src_block_location_shell(dummy_name="sub0 inline") +- sub0 inline call_src_block_location_elisp[:session sub0 inline]() + +#+CALL: src_block_location_shell(dummy_name="sub1 call", c=5, e=6) +#+CALL: src_block_location_elisp[:session sub1 call](c=5, e=6) +- sub1 inline call_src_block_location_shell(dummy_name="sub1 inline", c=5, e=6) +- sub1 inline call_src_block_location_elisp[:session sub1 inline](c=5, e=6) + + function definition + +#+NAME: src_block_location_shell +#+HEADER: :var dummy_name="workaround to get different result blocks" +#+HEADER: :var a=(or (org-entry-get org-babel-current-src-block-location "a" t) "0") +#+HEADER: :var b=(or (org-entry-get org-babel-current-src-block-location "b" t) "0") +#+HEADER: :var c=(or (org-entry-get org-babel-current-src-block-location "c" t) "0") +#+HEADER: :var d=(or (org-entry-get org-babel-current-src-block-location "d" t) "0") +#+HEADER: :var e=(or (org-entry-get org-babel-current-src-block-location "e" t) "0") +#+BEGIN_SRC sh :shebang #!/bin/sh :exports results :results verbatim + printf "shell a:$a, b:$b, c:$c, d:$d, e:$e" +#+END_SRC + +#+RESULTS: src_block_location_shell + +#+NAME: src_block_location_elisp +#+HEADER: :var a='nil +#+HEADER: :var b='nil +#+HEADER: :var c='nil +#+HEADER: :var d='nil +#+HEADER: :var e='nil +#+BEGIN_SRC emacs-lisp :exports results + (setq + a (or a (string-to-number +(or (org-entry-get org-babel-current-src-block-location "a" t) +"0"))) + b (or b (string-to-number +(or (org-entry-get org-babel-current-src-block-location "b" t) +"0"))) + c (or c (string-to-number +(or (org-entry-get org-babel-current-src-block-location "c" t) +"0"))) + d (or d (string-to-number +(or (org-entry-get org-babel-current-src-block-location "e" t) +"0"))) + e (or e (string-to-number +(or (org-entry-get org-babel-current-src-block-location "d" t) +"0" + (format "elisp a:%d, b:%d, c:%d, d:%d, e:%d" a b c d e) +#+END_SRC diff --git a/testing/lisp/test-ob-exp.el b/testing/lisp/test-ob-exp.el index abfe230..a930c99 100644 --- a/testing/lisp/test-ob-exp.el +++ b/testing/lisp/test-ob-exp.el @@ -216,6 +216,48 @@ Here is one at the end of a line. =2= (should-not (string-match (regexp-quote "<>") result)) (should-not (string-match (regexp-quote "i=\"10\"") result) +(ert-deftest ob-exp/use-case-of-reading-entry-properties () + (org-test-at-id "cc5fbc20-bca5-437a-a7b8-2b4d7a03f820" +(org-narrow-to-subtree) +(let* ((case-fold-search nil) + (result (org-test-with-expanded-babel-code (buffer-string))) + (sect "a:1, b:0, c:3, d:0, e:0") + (sub0 "a:1, b:2, c:4, d:0, e:0") + (sub1 "a:1, b:2, c:5, d:0, e:6") + (func sub0)) + ;; entry "section" + (should (string-match (concat "\"sect call\".*)\n: shell " sect "\n") + result)) + (should (string-match (concat "sect call\\](.*)\n: elisp " sect "\n") +
Re: [O] :session question -- and changes to #+Property: syntax
Hi Achim On Tue, Jun 18, 2013 at 10:41 PM, Achim Gratz wrote: > Hi Eric, > > while starting to write up a test document I've found some behaviour > when executing LOB calls that warrant discussion, I think: > > 1. The properties are evaluated at the site of the definition rather > than the site of the call. This is simply how org-babel-process-params > works, it jumps to the definition and then executes the source block > there (this may be in another file even). > > 2. The evaluation of header arguments assumes emacs-lisp as a language. I guess you do not mean the language of the source block, else see below for an example with shell. > > > These two combined make it somewhat difficult to use properties to > control the behaviour of LOB calls and understand what is happening and > why. A workaround is to beam the source to the place of call via noweb > syntax. The first point could perhaps be addressed in a cleaner way by > using org-babel-current-src-block-location when calling org-entry-get, > but I'm not sure yet if it is always correctly set. My intention is to ensure this with an ERT, see my patch here: http://lists.gnu.org/archive/html/emacs-orgmode/2013-06/msg00738.html > [...] Michael
Re: [O] Bug in export orgtbl / LaTeX
Am Dienstag, 18. Juni 2013, 22:12:03 schrieb Nicolas Goaziou: > Take 2. We can implement back :splice property. The others are much less > useful. > > (defun orgtbl-to-latex (table params) > "Convert the orgtbl-mode TABLE to LaTeX. > TABLE is a list, each entry either the symbol `hline' for > a horizontal separator line, or a list of fields for that line. > PARAMS is a property list of parameters that can influence the > conversion. Currently this function recognizes the following > parameters: > > :spliceWhen set to t, return only table body lines, don't wrap > them into a \"tabular\" environment. Default is nil." > (require 'ox-latex) > (let ((table-string (orgtbl-to-orgtbl table nil))) > (if (not (plist-get params :splice)) > (org-export-string-as table-string 'latex t '(:with-tables t)) > ;; If :splice is non-nil, we create a temporary back-end, > ;; `latex-tmp', derived from `latex', but with a transparent > ;; table translator. > (let ((org-export-registered-backends > org-export-registered-backends)) (org-export-define-derived-backend > 'latex-tmp 'latex > :translate-alist (list (cons 'table (lambda (e c i) c > (org-export-string-as table-string 'latex-tmp t '(:with-tables > t)) > > WDYT? WDIT? Let's be carefull, maybe I got it the wrong way: I put your "take 2" from "(defun ..." until "t))" into my .emacs (somewhere) and restarted Emacs. Result: If I C-c C-c on the orgtbl from my example, the output still is full of \begin{enumerate} \item installment \end{enumerate} So there is something wrong. But if I put your code into scratch and press C-M-x, change to the buffer with the *.tex-file and repeat C-c C-c on the orgtbl, it works properly. I can live with that way. So WDIT: thank you very much! Regards, Alexander
Re: [O] One more question on bibliographies in Org
Vincent Beffara ens-lyon.fr> writes: > The main question is: what would be a convenient way to store the > references in the .org file, to allow for easy editing and exporting ? What I have done so far is to use some bibtex blocks, which tangle to an external bib files. It is sometime useful to have the bibliography divided in separate sections inside the org file.
[O] org-mode as meta-system to create exams?!
Hi, I need a system which can deal with about 100-150 written exams/semester. I was wondering if org-mode can be used to do that. What I want: * Creating exams sheets (technical exams at university level, pictures, equations, large exercises with subitems) * Help for exam evaluation * Scoring system * Mark system * Creation of result sheets and diagrams * Creation of solution sheets I would be glad if I can create a little automation into this, to help me with the amount of exams. E.g. scoring could result in marking according to a translate table, Exam sheets should allow easy evaluation e.g. students fill answers in allocated spaces, there are places to write down scores, etc. Other details would be nice to have but not yet important. E.g. I like the idea that name and ID number of students are written on the top right corner of the sheet which gets wrapped (and stapled) thus, evaluation happens complete anonymous. Definition of an evaluation sheet, which precisely describes which results return how many scores, etc. Would love to hear how other use org-mode to deal with that task. Alternatively, if you use or would use another software please let me know. Thanks Torsten
Re: [O] org-mode as meta-system to create exams?!
Torsten Wagner writes: > * Creating exams sheets (technical exams at university level, pictures, > equations, large exercises with subitems) Yeah you can do it. Randomization can be done with some LaTeX package, or you could probably easily do it with Babel. > * Help for exam evaluation Tables or code. > * Scoring system > * Mark system Tables or code. > * Creation of result sheets and diagrams > * Creation of solution sheets Sure. > I would be glad if I can create a little automation into this, to help me > with the amount of exams. E.g. scoring could result in marking according to > a translate table, Exam sheets should allow easy evaluation e.g. students > fill answers in allocated spaces, there are places to write down scores, > etc. Sure; it can be done. > Other details would be nice to have but not yet important. E.g. I like the > idea that name and ID number of students are written on the top right > corner of the sheet which gets wrapped (and stapled) thus, evaluation > happens complete anonymous. Definition of an evaluation sheet, which > precisely describes which results return how many scores, etc. Possible as well. > Would love to hear how other use org-mode to deal with that task. > Alternatively, if you use or would use another software please let me know. In general you can do whatever you want with a combination of Org babel plus your favorite language, the spreadsheet (Emacs Cacl) and perhaps a custom exporter. –Rasmus -- Enough with the bla bla!
Re: [O] [PATCH 1/2] org-notify: Don't use obsolete flet and macrolet
Peter Münster writes: >> cl-lib was just introduced in Emacs 24.3. > > Does that mean, that the trunk should be modified later? It means you should implement a solution that doesn't make Org non-functional for Emacs 23 users. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Factory and User Sound Singles for Waldorf rackAttack: http://Synth.Stromeko.net/Downloads.html#WaldorfSounds
Re: [O] Go to heading using LISP
On Mon, Jun 10, 2013 at 11:14 PM, Alexander Wingård < alexander.wing...@gmail.com> wrote: > > Maybe some day I will learn some LISP and teach it to navigate the > hierarchical structure. > > I actually got curious and gave this a try and here's what I came up with: test.org: * a ** b *** h ** b *** q h ** c *** d Elisp: (defun goto-notes () (interactive) (find-file "~/test.org") (org-goto-subtree '("a" "b" "q" "h")) (org-show-context) (org-show-entry) (show-children)) (defun org-goto-subtree (path) (let ((level 1)) (org-element-map (org-element-parse-buffer 'headline) 'headline (lambda (x) (if (< (org-element-property :level x) level) (setq level (org-element-property :level x))) (if (and (= level (org-element-property :level x)) (string= (nth (- level 1) path) (org-element-property :raw-value x))) (progn (setq level (+ level 1)) (if (> level (list-length path)) (goto-char (org-element-property :begin x)) nil t))) https://gist.github.com/AlexanderWingard/5814843 My very first attempt at programming Elisp so any feedback is appreciated. Best regards Alexander
[O] [ANN] Edit emails in Org-mode
Hi List, it is now possible to edit your emails in (full!) Org-mode (assuming you write them in `message-mode' as Gnus users do). * Documentation ** Downloads You need two libraries for this (the optional third library `navi-mode' is not needed here, but in general very useful in combination with the other two libraries or Org-mode). - [[https://github.com/tj64/outshine][outshine.el]] - [[https://github.com/tj64/outorg][outorg.el]] Download them or clone the github repos and make sure Emacs finds them. ** Installation Put this in your '.emacs' file: #+begin_src emacs-lisp ;; If you want a different prefix key for outline-minor-mode, insert first: ;; (defvar outline-minor-mode-prefix "\C-c") or whatever. The prefix can only ;; be changed before outline (minor) mode is loaded. "\C-c" unfortunately ;; conflicts with other modes, e.g. ESS and picolisp-wiki-mode. (defvar outline-minor-mode-prefix "\M-#") (require 'outline) (require 'outshine) (add-hook 'outline-minor-mode-hook 'outshine-hook-function) (add-hook 'message-mode-hook 'outline-minor-mode) (require 'outorg) ;; optional (require 'navi) #+end_src Note that #+begin_src emacs-lisp (add-hook 'emacs-lisp-hook 'outline-minor-mode) #+end_src is very useful too, though not necessary in this case. In fact, `outline-minor-mode' extended by the library-trio /outline.el/, /outorg.el/ and /navi-mode.el/ should work in all kinds of Emacs major-modes (at least in theory) when files are structured 'the outshine way', i.e. with outcommented Org-mode headlines (e.g. "^;; [*]+ "). Emacs Lisp files with conventional headers ("^;;;+ ") are a special case, they work too. It has been tested with emacs-lisp-mode, picolisp-mode, R-mode, sql-mode, latex-mode and maybe others I'm not aware of). ** Usage There are only two commands involved: | Command| Keybinding| Comment| |+---+| | M-x outorg-edit-as-org | M-# M-# or M-# # | outline-prefix M-# | || C-c ' | outline-prefix C-c | | M-x outorg-copy-edits-and-exit | M-# | ---| Call `outorg-edit-as-org' in the message-buffer, and the text part of the unsent email if offered for editing in a temporary Org-mode buffer. Call `outorg-copy-edits-and-exit' when you are done with editing, and the content of the temporary edit buffer is copied into the message-mode buffer. The temporary edit buffer *outorg-edit-buffer* is saved in the /tmp directory when accidentally killed, so no edits can be lost. You can save the buffer to its backup file whenever you want with the usual 'C-x C-s'. *NOTE* `outorg-edit-as-org' normally acts on the subtree at point, but thats no problem for the use with `message-mode', except in one situation: When the message-mode buffer already contains body-text, and this text contains Org-mode style headlines ("^[*]+ "), then these headlines will be interpretated by outorg as subtrees during the buffer preparation phase, thus `outorg-edit-as-org' will act only on the first subtree. In this case, simply call `outorg-edit-as-org' with prefix, e.g. 'C-u M-# M-#', then the whole mail body will be offered for editing in Org-mode. ** Alternatives You can use `orgstruct-minor-mode' to make a subset of Org-mode's functionality available in `message-mode'. The extra-cost of using the combination of `outshine' and `outorg' instead is typing once 'M-# M-#' and once 'M-#', the extra-benefit is the *full* power of Org-mode at your fingertips when writing emails. ** Read more There is an article on [[http://orgmode.org/worg/org-tutorials/org-outside-org.html][Worg]] about the libraries described in this post. ** Example This email has be written in the *outorg-edit-buffer*, so I can do some stuff not necessarily associated with writing email. Lets export this mail to ASCII and attach the result below - without leaving this buffer of course (except for editing the source-block), just by doing 'C-c C-c' inside the block: #+begin_src emacs-lisp :results output replace (org-export-to-buffer 'ascii "email-transcode-buffer") (print (with-current-buffer "email-transcode-buffer" (let ((mail-as-ascii (buffer-substring-no-properties (point-min) (point-max (set-buffer-modified-p nil) (kill-buffer) mail-as-ascii))) #+end_src #+results: " _ 134 Thorsten Jolitz _ Table of Contents _ 1 --text follows this line-- 2 Documentation .. 2.1 Downloads .. 2.2 Installation .. 2.3 Usage .. 2.4 Alternatives .. 2.5 Read more .. 2.6 Example 1 --text follows this line-- Hi List, it is now possible to edit your emails in (full!) Org-mode (assuming you write them
Re: [O] [PATCH 1/2] org-notify: Don't use obsolete flet and macrolet
Achim Gratz writes: > Peter Münster writes: >>> cl-lib was just introduced in Emacs 24.3. >> >> Does that mean, that the trunk should be modified later? > > It means you should implement a solution that doesn't make Org > non-functional for Emacs 23 users. The easiest solution is to simply do nothing, until Org drops support for Emacs 24.2 and earlier. The 'cl' library will be shipped with Emacs for a long time. BTW, which Emacs versions does Org support? Is this documented anywhere? -David
[O] [ANN] Convert Org-mode file to Source-code file
Hi List, it is now possible to convert existing Org-mode files with source-blocks into machine-executable source-code files, using the following function from `outorg.el': #+begin_src emacs-lisp (defun outorg-convert-org-file-to-source-code (&optional mode infile outfile BATCH) "Convert an existing Org-mode file into an Outshine buffer. If MODE is non-nil, the Outshine buffer will be put in this major-mode, otherwise the major-mode of the language of the first source-code block in the Org-mode buffer will be used. If INFILE is non-nil, the specified Org-mode file will be visited and its buffer converted, otherwise the current buffer will be converted. If OUTFILE is non-nil, the converted Outshine buffer will be saved in this file. Its the user's responsability to make sure that OUTFILE's file-extension is suited for the major-mode of the Outshine buffer to be saved. When in doubt, consult variable `auto-mode-alist' for associations between file-extensions and major-modes. If BATCH is non-nil (and OUTFILE is non-nil, otherwise it makes no sense), the new Outshine file is saved and its buffer deleted."...) #+end_src Usage example: , | (outorg-convert-org-file-to-source-code |"emacs-lisp-mode" "~/junk/test.org" "~/junk/test.el" 'BATCH) ` I'm not sure about the general use case for this, but I do have my uses for it, so I announce it here because it might serve others too. PS This is *not* about tangling, try it out to see the (big) difference. -- cheers, Thorsten
[O] problem with agenda view?
i create this little org file:https://pastebin.sabayon.org/pastie/12827 and I try and do an agenda view showing todos, or showing one of the tags, and all I get is this: Global list of TODO items of type: ALL Available with `N r': (0)[ALL] What's wrong? -- -Kevin "The world belongs to those who cross many bridges in their imagination, before others see even a single bridge." - inspirational Chinese proverb
Re: [O] problem with agenda view?
kevinbanjo writes: > i create this little org file:https://pastebin.sabayon.org/pastie/12827 > You should have pasted the file into your mail: quicker for you, quicker for us. > and I try and do an agenda view showing todos, or showing one of the > tags, and all I get is this: > > Global list of TODO items of type: ALL > Available with `N r': (0)[ALL] > > What's wrong? The agenda is constructed from the files in org-agenda-files: you have to add the file to it. There are a few ways to do that, so you want to read the doc string of the variable: C-h v org-agenda-files RET -- Nick