Re: [O] working on cloud
Renato Pontefice writes: > I'm wondering: > In Linux (but in win too) the file must have a particular name (.emacs on > linux; init.el on windows) > and reside on a particular folder. You could get the standard init file to just load another file. Or you can specify the init file at invocation.
[O] tooltips
I was wondering if org-mode html generation has some automatic way of generating tooltips. Something along the lines that instead of generating a footnote, a footnote should generate a tooltip. The html would be something like this: hover me
Re: [O] Using babel to generate org syntax for export
On Jan 14, 2014 11:41 AM, "Eric Schulte" wrote: > Have you tried ":results raw" or ":results org", take a look at the > manual page on the results header argument. Missed that - thanks for the pointer. I looked pretty carefully at the page on "Evaluating code blocks," which says basically nothing about controlling the result format (and also doesn't link to the header argument that would explain it). "raw" is probably the one I need. Thanks again. hjh
[O] Adding a new column in the agenda view
Hi list, I'd like to add a new column to display some information about the scheduled item in the agenda. Take the following screenshot: https://www.dropbox.com/s/gkcnbjrivhvql46/orgmode.jpg I'd like to add a colum there that shows the closest parent with the :project: tag. Does org provide any APIs for that? Cheers, -- Marcelo.
[O] color header based on priority/tags rather than level
Is there way to set the color/face of a header line based on priority/tags rather than level? Maybe a way of setting a hook method that takes header line info and returns color/face info? I've found that I can use org-priority-face to color the priority cookie and I can use org-agenda-fontify-priorities to apply color to the agenda line, but I want to color the header line in the original buffer. FYI, Here is a link to old post on this, but it ended just with solution for agenda lines http://article.gmane.org/gmane.emacs.orgmode/17143/match=color+entire+header
Re: [O] Using babel to generate org syntax for export
James Harkins writes: > Hi, > > Got a question that's not easy to search online. > > I want to use an org table to define glossary entries for LaTeX. I have my > table[1], and I have a src block[2] that reads the table and produces the > right syntax[3]. This is already pretty helpful -- I can C-c C-c the source > block and manually copy/paste the generated syntax into the org file that I > will then export. > > But... I want babel to do that for me automatically. I'm almost there, but: > > The resulting string is put into a verbatim environment -- which is not > right for this case. I need the string to be inserted as if it were org > syntax ("#+LATEX_HEADER" and all) that I typed by hand, and then ox-latex > would process it like any other LaTeX header. > > I've tried both ":results value" and ": results output" but the verbatim > environment is always there. > Have you tried ":results raw" or ":results org", take a look at the manual page on the results header argument. Best, > > A quick glance at ob-core.el seems to indicate that this behavior is > hardcoded. That's... frustrating: spend 2-3 hours to get this far and then > find that babel says, "No, you can't do that, actually." > > So, I'm at the end of the energy I have left to test various approaches. > What's the best approach? I'm guessing, apply a filter to remove the > begin/end verbatim lines. But maybe there's a magic switch in babel? > > For reference: > > [1] input file, nearly minimal example > [2] actual result of C-c C-e l L (removing preamble) > [3] desired result > > hjh > > [1] > * UGens :noexport: > #+name: ugens01 > | Type | Term | Description | Arguments | > |--+--+-+-| > | Osc | SinOsc | Sinewave oscillator | freq, phase | > > #+name: makegloss > #+begin_src emacs-lisp :var tbl=ugens01 :exports results :results value > (let ((str "")) > (pop tbl) > (pop tbl) > (while tbl > (let ((item (car tbl))) > (pop item) > (setq str (concat str (format > "\\newglossaryentry{%s}{type=ugen,name={%s},description={%s. Inputs: > (%s)}}\n" > (car item) > (pop item) > (pop item) > (car item > (setq tbl (cdr tbl > str) > #+end_src > > * Test > #+call: makegloss > #+results: makegloss > > [2] > \section{Test} > \label{sec-1} > \begin{verbatim} > \newglossaryentry{SinOsc}{type=ugen,name={SinOsc},description={Sinewave > oscillator. Inputs: (freq, phase)}} > \end{verbatim} > > [3] > \section{Test} > \label{sec-1} > \newglossaryentry{SinOsc}{type=ugen,name={SinOsc},description={Sinewave > oscillator. Inputs: (freq, phase)}} > > -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D
[O] Using babel to generate org syntax for export
Hi, Got a question that's not easy to search online. I want to use an org table to define glossary entries for LaTeX. I have my table[1], and I have a src block[2] that reads the table and produces the right syntax[3]. This is already pretty helpful -- I can C-c C-c the source block and manually copy/paste the generated syntax into the org file that I will then export. But... I want babel to do that for me automatically. I'm almost there, but: The resulting string is put into a verbatim environment -- which is not right for this case. I need the string to be inserted as if it were org syntax ("#+LATEX_HEADER" and all) that I typed by hand, and then ox-latex would process it like any other LaTeX header. I've tried both ":results value" and ": results output" but the verbatim environment is always there. A quick glance at ob-core.el seems to indicate that this behavior is hardcoded. That's... frustrating: spend 2-3 hours to get this far and then find that babel says, "No, you can't do that, actually." So, I'm at the end of the energy I have left to test various approaches. What's the best approach? I'm guessing, apply a filter to remove the begin/end verbatim lines. But maybe there's a magic switch in babel? For reference: [1] input file, nearly minimal example [2] actual result of C-c C-e l L (removing preamble) [3] desired result hjh [1] * UGens :noexport: #+name: ugens01 | Type | Term | Description | Arguments | |--+--+-+-| | Osc | SinOsc | Sinewave oscillator | freq, phase | #+name: makegloss #+begin_src emacs-lisp :var tbl=ugens01 :exports results :results value (let ((str "")) (pop tbl) (pop tbl) (while tbl (let ((item (car tbl))) (pop item) (setq str (concat str (format "\\newglossaryentry{%s}{type=ugen,name={%s},description={%s. Inputs: (%s)}}\n" (car item) (pop item) (pop item) (car item (setq tbl (cdr tbl str) #+end_src * Test #+call: makegloss #+results: makegloss [2] \section{Test} \label{sec-1} \begin{verbatim} \newglossaryentry{SinOsc}{type=ugen,name={SinOsc},description={Sinewave oscillator. Inputs: (freq, phase)}} \end{verbatim} [3] \section{Test} \label{sec-1} \newglossaryentry{SinOsc}{type=ugen,name={SinOsc},description={Sinewave oscillator. Inputs: (freq, phase)}}
Re: [O] export from R to tables, possible correction to ob-doc-R.org
On Mon, Jan 13, 2014 at 8:09 PM, regcl wrote: > I was looking for an example of the export of R data frames into > tables in html, and the example in ... > > http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.org > > ... did not work for me. I am running ... > > GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.4) of 2013-09-26 > on trouble, modified by Debian > > Org-mode version 8.2.5c (release_8.2.5c @ > /home/regcl/.emacs.d/lisp/org-mode/lisp/) > > Here is the problematic code ... > > ### START SNIP ## START SNIP ## START SNIP ### > > : #+BEGIN_SRC R :results output org > : library(ascii) > : a <- runif(100) > : c <- "Quantiles of 100 random numbers" > : b <- ascii(quantile(a),header=T,include.colnames=T,caption=c) > : print(b,type="org") > : rm(a,b,c) > : #+END_SRC > : > : #+RESULTS: > : #+BEGIN_ORG > : #+CAPTION: Quantiles of 100 random numbers > : | 0% | 25% | 50% | 75% | 100% | > : |--+--+--+--+--| > : | 0.03 | 0.28 | 0.52 | 0.74 | 1.00 | > : #+END_ORG > > The output exported to HTML can be quite nice. > > #+RESULTS: > #+BEGIN_ORG > #+CAPTION: Quantiles of 100 random numbers > | 0% | 25% | 50% | 75% | 100% | > |--+--+--+--+--| > | 0.03 | 0.28 | 0.52 | 0.74 | 1.00 | > #+END_ORG > > ### END SNIP ## END SNIP ## END SNIP ### > > ... As you can see, this code is statically "rigged" to export in such > a way that it looks like it is working with R. When I try to make the > code live by removing the markup as shown below ... > > #+BEGIN_SRC R :results output org > library(ascii) > a <- runif(100) > c <- "Quantiles of 100 random numbers" > b <- ascii(quantile(a),header=T,include.colnames=T,caption=c) > print(b,type="org") > rm(a,b,c) > #+END_SRC > > The html produced by ... > > C-c C-e h h > > ... contains the fontified source code, but no table. > > ... C-c C-c on the code block produces these results ... > > #+RESULTS: > #+BEGIN_SRC org > ,#+CAPTION: Quantiles of 100 random numbers > | 0% | 25% | 50% | 75% | 100% | > |--+--+--+--+--| > | 0.02 | 0.30 | 0.49 | 0.70 | 0.99 | > #+END_SRC > > By trial and error, I discovered that if I change the header arguments > as shown below ... > > #+BEGIN_SRC R :results output raw :exports results > library(ascii) > a <- runif(100) > c <- "Quantiles of 100 random numbers" > b <- ascii(quantile(a),header=T,include.colnames=T,caption=c) > print(b,type="org") > rm(a,b,c) > #+END_SRC > > ... this produces a table in HTML that matches the table produced by > the static code. > > ... C-c C-c on this code block produces these results ... > > #+RESULTS: > #+CAPTION: Quantiles of 100 random numbers > | 0% | 25% | 50% | 75% | 100% | > |--+--+--+--+--| > | 0.03 | 0.25 | 0.57 | 0.79 | 0.99 | > > Can someone tell me if this is how it is supposed to work? > Yup. I think you stumbled on a "bug" (though probably just more of an oversight). I looked around a bit for the default babel header arguments and think this looks accurate: - http://orgmode.org/manual/System_002dwide-header-arguments.html#System_002dwide-header-arguments This, with nothing set for `:exports something`, the default is `:exports code`. What you did instead is correct -- you want to export results. I get the same behavior: code only with no value set, results with `:exports results` added. To "patch," that page, you would follow the procedure for contributing to Worg: - http://orgmode.org/worg/worg-git.html You submit a key to Bastien, clone Worg, edit the file, and push your changes. Best regards, John > > If so, how do I go about submiting a patch to ... > > http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.org > > Thanks, > regcl > >
Re: [O] export from R to tables, possible correction to ob-doc-R.org
Aloha regcl, regcl writes: > Can someone tell me if this is how it is supposed to work? Yes, this is how it should work. > If so, how do I go about submiting a patch to ... > > http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.org You should be able to edit the document directly. See http://orgmode.org/worg/worg-git.html#contribute-to-worg for the full instructions. Thanks for catching this. All the best, Tom -- Thomas S. Dye http://www.tsdye.com
[O] export from R to tables, possible correction to ob-doc-R.org
I was looking for an example of the export of R data frames into tables in html, and the example in ... http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.org ... did not work for me. I am running ... GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.4) of 2013-09-26 on trouble, modified by Debian Org-mode version 8.2.5c (release_8.2.5c @ /home/regcl/.emacs.d/lisp/org-mode/lisp/) Here is the problematic code ... ### START SNIP ## START SNIP ## START SNIP ### : #+BEGIN_SRC R :results output org : library(ascii) : a <- runif(100) : c <- "Quantiles of 100 random numbers" : b <- ascii(quantile(a),header=T,include.colnames=T,caption=c) : print(b,type="org") : rm(a,b,c) : #+END_SRC : : #+RESULTS: : #+BEGIN_ORG : #+CAPTION: Quantiles of 100 random numbers : | 0% | 25% | 50% | 75% | 100% | : |--+--+--+--+--| : | 0.03 | 0.28 | 0.52 | 0.74 | 1.00 | : #+END_ORG The output exported to HTML can be quite nice. #+RESULTS: #+BEGIN_ORG #+CAPTION: Quantiles of 100 random numbers | 0% | 25% | 50% | 75% | 100% | |--+--+--+--+--| | 0.03 | 0.28 | 0.52 | 0.74 | 1.00 | #+END_ORG ### END SNIP ## END SNIP ## END SNIP ### ... As you can see, this code is statically "rigged" to export in such a way that it looks like it is working with R. When I try to make the code live by removing the markup as shown below ... #+BEGIN_SRC R :results output org library(ascii) a <- runif(100) c <- "Quantiles of 100 random numbers" b <- ascii(quantile(a),header=T,include.colnames=T,caption=c) print(b,type="org") rm(a,b,c) #+END_SRC The html produced by ... C-c C-e h h ... contains the fontified source code, but no table. ... C-c C-c on the code block produces these results ... #+RESULTS: #+BEGIN_SRC org ,#+CAPTION: Quantiles of 100 random numbers | 0% | 25% | 50% | 75% | 100% | |--+--+--+--+--| | 0.02 | 0.30 | 0.49 | 0.70 | 0.99 | #+END_SRC By trial and error, I discovered that if I change the header arguments as shown below ... #+BEGIN_SRC R :results output raw :exports results library(ascii) a <- runif(100) c <- "Quantiles of 100 random numbers" b <- ascii(quantile(a),header=T,include.colnames=T,caption=c) print(b,type="org") rm(a,b,c) #+END_SRC ... this produces a table in HTML that matches the table produced by the static code. ... C-c C-c on this code block produces these results ... #+RESULTS: #+CAPTION: Quantiles of 100 random numbers | 0% | 25% | 50% | 75% | 100% | |--+--+--+--+--| | 0.03 | 0.25 | 0.57 | 0.79 | 0.99 | Can someone tell me if this is how it is supposed to work? If so, how do I go about submiting a patch to ... http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.org Thanks, regcl
Re: [O] Citations and references in ODT
Jambunathan, Thanks for posting your instructions and links again. I followed the instructions and am receiving the following error on export attempt: OpenDocument export failed: Symbol's function definition is void: org-element-cache-reset I also receive this error the first time that I try to open an org file. I can open the file if I try another time. Thanks, Aric -- ~O /\_, ###-\ |_ (*) / (*)
Re: [O] Org Export to ODT Problem Files - Latex Equations Work
Bastien writes: > can you give more details about your setup? I am using the mathtoweb function and so far so good. Here is what I have and what I understand of it, but I could be wrong about why it is working. The file has this header: #+OPTIONS: LaTeX:t I have this in my .emacs file: ;; to convert latex equations to mathml for ODT export ; uses mattoweb (http://www.mathtoweb.com/cgi-bin/mathtoweb_home.pl) (setq org-latex-to-mathml-convert-command "java -jar %j -unicode -force -df %o %I" org-latex-to-mathml-jar-file "~/.emacs.d/mathtoweb.jar") Now it just works after updating to Java 7. > This could well deserve a link to worg/org-hacks.org! Yes, some of those files are outdated and it has been somewhat challenging to find all the needed info in one place. Thanks, Aric -- ~O /\_, ###-\ |_ (*) / (*)
Re: [O] Org Export to ODT Problem Files
Jambunathan K writes: > 2. MathToWeb > >Pro: Uses MathML > >Con: MathToWeb is new kid on the block. May prove to be problematic >with more complex formulae. > >If ltx->mathml conversion is problematic for some equations, you can >create "ODF files" (OpenDocumentFormula files created with >LibreOffice Math) by hand and insert an Org link to them. Yes, this works very well for me. There is an issue with export of $\geq$ that the author is looking into. >> 4. Figure and table references are by section, sort of like old >> fashioned latex. For me, I am not writing a book or anything very long, just manuscripts. Thus, I would prefer just to label each figure in order and each table in order. I would therefore get Figure 1, Figure 2, etc and Table 1, Table 2, etc in the order of appearance in the text. There is no reference to section that way. Maybe this is something that can be set in my odt reference file for exporting? I have not yet investigated that. Thanks, Aric -- ~O /\_, ###-\ |_ (*) / (*)
Re: [O] Citations and references in ODT
Ken Mankoff writes: > 3) I put MathToWeb.jar in the unit test folder. However, if I run > "java -jar MathToWeb.jar" I get the following error. I have an email > in to the MathToWeb developer/maintainer about this > > $ java -jar mathtoweb.jar > Exception in thread "main" java.lang.UnsupportedClassVersionError: > mathtoweb/engine/MathToWeb : Unsupported major.minor version 51.0 I had the same issue and the author of mathtoweb quickly got back to me with it being an incompatibility with java 6. I installed OpenJDK7 on my machine and it worked just fine! Aric
Re: [O] Citations and references in ODT
> I have found this useful for converting latex export to doc[x] Thanks for that idea, I will give that a try as well. Thanks, Aric -- ~O /\_, ###-\ |_ (*) / (*)
Re: [O] Citations and references in ODT
Ken Mankoff writes: > I find the ODT export very useful. Working on another document imported > from LaTeX I have a lot of \citep{} and \citet{} in addition to \cite{}. Is > it possible for ox-jabref.el to support this even if it does not > distinguish between the T and P? On a similar note, would it be possible to add support for the markdown style of references? [@Authoryear; @anotherauthoryear] I have so many like this across files. Thanks, Aric
Re: [O] Bug: Export to Latex - Incorrect output for list items starting with left bracket [8.2.3c (8.2.3c-elpa @ /Users/jdegenhardt/.emacs.d/elpa/org-20131115/)]
Hello, ** Nicolas Goaziou [2014-01-13 17:51:05 +0100]: > Hello, > Jon Degenhardt writes: >> Export to Latex (org-latex-export-to-pdf) generates incorrect latex when >> list items start with a left square bracket. This occurs because the >> \item command interprets the left square bracket as the start of an >> argument list. An example: >> An item list: >> - abc def >> - [def] ghi >> - [jkl m n o] >> - pqr >> This produces the latex fragment: >> An item list: >> \begin{itemize} >> \item abc def >> \item [def] ghi >> \item [jkl m n o] >> \item pqr >> \end{itemize} >> The pdf output renders the second and third items incorrectly. If there >> is no right bracket to terminate the argument, then pdf generation may >> fail with message: >> >> org-latex-compile: PDF file ./example.pdf wasn't produced: Runaway >> argument > Thank you for the report. Would the following patch solves the problem? I didn't test this patch, and could interpret it wrong, but, IMHO, when exporting lists to LaTeX into itemize or enumerate environments the most suitable approach would be to insert '\item's as \item{} or \item\relax Both prevents LaTeX engine to read next character and interpret it in some special way (simple \item read next character and if it is [], then it assumes that this is an optional argument to the command). > Regards, --- WBR, Vladimir Lomov -- I had the rare misfortune of being one of the first people to try and implement a PL/1 compiler. -- T. Cheatham
Re: [O] Export tikz Figures Issue
Andreas Leha med.uni-goettingen.de> writes: > Works for me if I add ':results raw file'. Not sure, this is the > 'official' solution, though. That works beautifully, thank you very much! Aric
Re: [O] Sh-ALT-RightArrow behavior has changed to demote only first subheader when subheaders collapsed
Susan Cragin writes: > I noticed that the behavior of SHIFT-ALT-RightArrow has changed when the > subheadings are hidden. > Before all the subheadings changed at the same level. Now only the heading > immediately below it does. Just for the record: you need to use org-indent (with e.g. #+STARTUP: indent) to reproduce the bug. This is a *bad* bug. I'm on it but if someone wants to beat me please go ahead. -- Bastien
Re: [O] multi-line citation export issue
Ken Mankoff writes: > Wow. I was going point out that citing for both formats is cumbersome > and makes the document hard-to-read, but the MACRO solves this. I was > not aware of MACRO's. I guess this is both the beauty and pain of Org > and emacs, all this customization. And down the rabbit-hole I go, > because now I need to redefine my RefTeX shortcut so that it inserts > {{{cite(key)}}} instead of \cite{key}. Another possibility is using links as suggested by Tom S. Dye. These do not suffer from the newline problem you encountered. They do not format nicely, though, if you have complicated cite-constructions. Here's an example using biblatex syntax in LaTeX and a cite tag in HTML: (org-add-link-type "textcite" 'ramus/find-lit (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'odt) (format "%s" path)) ((eq format 'latex) (if (or (not desc) (equal 0 (search "cite:" desc))) (format "\\textcite{%s}" path) (format "\\textcite[%s][%s]{%s}" (cadr (split-string desc ";")) (car (split-string desc ";")) path)) where rasmus/find-lit opens the correct pdf from my local archive, if possible. You can add reftex support in a manner similar to the following: (with-eval-after-load 'org (defun org-mode-reftex-setup () ;; (load-library "reftex") (require 'reftex) (and (buffer-file-name) (file-exists-p (buffer-file-name)) ;; (reftex-parse-all) ) (make-local-variable 'reftex-cite-format) (setq reftex-cite-format 'org) (define-key org-mode-map (kbd "C-c )") 'reftex-citation)) (add-hook 'org-mode-hook 'org-mode-reftex-setup)) (with-eval-after-load 'reftex (add-to-list 'reftex-cite-format-builtin '(org "Org-mode citation" ((?m . "[[cite:%l]]") (?t . "[[textcite:%l]]") (?p . "[[parencite:%l]]") (?s . "[[citepos:%l]]") (?a . "[[citeauthor:%l]]") (?y . "[[citeyear:%l]]") (?l . "%l") –Rasmus -- Send from my Emacs
Re: [O] [poll] Fontify code in code blocks
Hello Bastien, Eric S Fraga wrote: > +1 for org-src-fontify-natively set to t by default. I've had this > turned on forever... I cannot imagine using org without it! I think this overall results of the poll is quite clear, no? Best regards, Seb -- Sebastien Vauban
Re: [O] [poll] Fontify code in code blocks
Sebastien et al., +1 for org-src-fontify-natively set to t by default. I've had this turned on forever... I cannot imagine using org without it! -- : Eric S Fraga (0xFFFCF67D), Emacs 24.3.1, Org release_8.2.4-322-gece429
Re: [O] Extract source code /with/ captions
Nick Dokos writes: > James Harkins writes: > >> ELEMENT: >> (((#("25% coin toss in SuperCollider" 0 30 (:parent #2) >> >> This is correct, and I also see that I can use (plist-get ... :value) >> to get the code string. >> >> Here, I'm hung up on some (large?) gaps in my elisp knowledge. I have >> no idea what #(...) signifies, or what functions I can use to get the >> string out of it. "#" Is not an especially useful search term in >> google, bing etc... >> >> Can anyone help with my next step? >> > > Not sure whether this will help but these are basically just strings > with text properties. See > > (info "(elisp) Text Properties in Strings") > I should have added: o You can use substring-no-properties on a string to just get the sequence of characters it consists of without its text properties[fn:1] --8<---cut here---start->8--- (setq s #("25% coin toss in SuperCollider" 0 30 (face bold))) (substring-no-properties s) ==> "25% coin toss in SuperCollider" --8<---cut here---end--->8--- o You can similarly use (buffer-substring-no-properties START END) if you want to extract a substring out of a buffer without its text properties. Footnotes: [fn:1] Note that I had to modify the properties a bit to make it into a string that the lisp reader could grok. When you print out the element, you get a shorthand representation of it: #("25% coin toss in SuperCollider" 0 30 (:parent #2)) indicating the parent, but #2 is not legal as far as the lisp reader is concerned - it is just a useful shorthand for humans; however when you map your function on what org-element-parse-buffer returns, calling substring-no-properties on it before you print it (or whatever else you want to do to it) will do the right thing (modulo bugs of course). Nick
Re: [O] Extract source code /with/ captions
[I sent a follow-up that has not shown up yet(?) but perhaps this is more useful in any case] James Harkins writes: > ELEMENT: > (((#("25% coin toss in SuperCollider" 0 30 (:parent #2) > > This is correct, and I also see that I can use (plist-get ... :value) > to get the code string. > > Here, I'm hung up on some (large?) gaps in my elisp knowledge. I have > no idea what #(...) signifies, or what functions I can use to get the > string out of it. "#" Is not an especially useful search term in > google, bing etc... > > Can anyone help with my next step? > Try: --8<---cut here---start->8--- (defun hjh-print-src-blocks () "Iterate src blocks from org-element and print them to *Messages*." (interactive) (let ((tree (org-element-parse-buffer))) (org-element-map tree 'src-block (lambda (element) (message "\n\n\nELEMENT:") (print (substring-no-properties (plist-get (car (cdr element)) :caption))) --8<---cut here---end--->8--- Nick
Re: [O] Extract source code /with/ captions
James Harkins writes: > ELEMENT: > (((#("25% coin toss in SuperCollider" 0 30 (:parent #2) > > This is correct, and I also see that I can use (plist-get ... :value) > to get the code string. > > Here, I'm hung up on some (large?) gaps in my elisp knowledge. I have > no idea what #(...) signifies, or what functions I can use to get the > string out of it. "#" Is not an especially useful search term in > google, bing etc... > > Can anyone help with my next step? > Not sure whether this will help but these are basically just strings with text properties. See (info "(elisp) Text Properties in Strings") > Also, big thanks to Nicolas for org-element. The fact that an elisp > novice can extract captions for source blocks in about half an hour of > tinkering is nothing short of criminally easy. Spectacular. > Oh, yes indeed! Nick
Re: [O] Show timegrid even if empty?
"Martin Beck" writes: > in a block agenda view, I also want to incorporate the time grid to see the > appointments of a day. > > I tried with this code: > > (agenda "" ((org-agenda-overriding-header "Calendar") (org-agenda-span (quote > day)) (org-agenda-entry-types (quote (:timestamp))) > (org-agenda-time-grid (quote ("t") > The org-agenda-time-grid setting looks wrong: maybe try (org-agenda-time-grid '((daily today nil) ;;; replaced require-timed with nil #("" 0 16 (org-heading t)) (800 1000 1200 1400 1600 1800 2000))) but I'm not sure where the code you show above lives. I just tried setting org-agenda-custom-commands like this: --8<---cut here---start->8--- (setq org-agenda-custom-commands '( ("A" "normal agenda but always time grid" agenda "" ((org-agenda-time-grid '((daily today nil) #("" 0 16 (org-heading t)) (800 1000 1200 1400 1600 1800 2000) )) --8<---cut here---end--->8--- and that seems to work. Nick
Re: [O] Bug: Export to Latex - Incorrect output for list items starting with left bracket [8.2.3c (8.2.3c-elpa @ /Users/jdegenhardt/.emacs.d/elpa/org-20131115/)]
Hello, Jon Degenhardt writes: > Export to Latex (org-latex-export-to-pdf) generates incorrect latex when > list items start with a left square bracket. This occurs because the > \item command interprets the left square bracket as the start of an > argument list. An example: > > An item list: > - abc def > - [def] ghi > - [jkl m n o] > - pqr > > This produces the latex fragment: > > An item list: > \begin{itemize} > \item abc def > \item [def] ghi > \item [jkl m n o] > \item pqr > \end{itemize} > > The pdf output renders the second and third items incorrectly. If there > is no right bracket to terminate the argument, then pdf generation may > fail with message: > > org-latex-compile: PDF file ./example.pdf wasn't produced: Runaway > argument Thank you for the report. Would the following patch solves the problem? Regards, -- Nicolas Goaziou >From 64a5290bd6b7b8d29e9b77ecc3fe7c29619e37e0 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 13 Jan 2014 17:48:19 +0100 Subject: [PATCH] ox-latex: Fix items starting with a square bracket * lisp/ox-latex.el (org-latex-headline, org-latex-item): Fix items starting with a square bracket Thanks to Jon Degenhardt for reporting it. --- lisp/ox-latex.el | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 8294938..f695dfc 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1374,7 +1374,12 @@ holding contextual information." (when (org-export-first-sibling-p headline info) (format "\\begin{%s}\n" (if numberedp 'enumerate 'itemize))) ;; Itemize headline - "\\item " full-text "\n" headline-label pre-blanks contents))) + "\\item " + (replace-regexp-in-string "\\`[ \t]*\\[" "{\\[}" full-text) + "\n" + headline-label + pre-blanks + contents))) ;; If headline is not the last sibling simply return ;; LOW-LEVEL-BODY. Otherwise, also close the list, before ;; any blank line. @@ -1565,7 +1570,12 @@ contextual information." (concat checkbox (org-export-data tag info))) (concat counter "\\item" (or tag (concat " " checkbox)) - (and contents (org-trim contents)) + (cond ((not contents) nil) + ((or tag + checkbox + (not (string-match "\\`[ \t]*\\[" contents))) + (org-trim contents)) + (t (replace-match "{[}" nil nil contents))) ;; If there are footnotes references in tag, be sure to ;; add their definition at the end of the item. This ;; workaround is necessary since "\footnote{}" command is -- 1.8.5.2
[O] How to include past deadlines and scheduled TODOs in an Agenda?
In a block agenda, I want to list all todos with a deadline up to the current day. I tried this block, but it only gives those that are due today, not before today: (agenda "" ((org-agenda-overriding-header "Critical Now") (org-agenda-entry-types (quote (:deadline :deadline*))) (org-agenda-sorting-strategy (quote (deadline-down priority-down))) (org-agenda-time-grid nil) (org-deadline-warning-days 0) (org-agenda-span (quote day Maybe there is an option in the background which filters out the older todos? HOw can I solve that? Kind regards Martin
[O] Show timegrid even if empty?
in a block agenda view, I also want to incorporate the time grid to see the appointments of a day. I tried with this code: (agenda "" ((org-agenda-overriding-header "Calendar") (org-agenda-span (quote day)) (org-agenda-entry-types (quote (:timestamp))) (org-agenda-time-grid (quote ("t") But there is no timegrid displayed, if no headlines match the agenda. How can I always show the timegrid? Kind regards Martin
Re: [O] email -> TODO items?
Nick Dokos writes: > Brett Viren writes: > >> Peter Davis writes: >> >>> I use half a dozen email clients, including mutt, which lets me easily >>> pipe a message to a script. >> >> The need to support multiple clients may rule out my suggestion but >> capturing a TODO or a note while visiting a GNUS message and thus >> preserving the link back to the article that spawned my task/idea is >> fantastically useful. >> >> In your pipe scheme maybe there is some way you can preserve this link >> back. >> Thanks, Brett. I've added Gnus to my repertoire, but I'm still just learning the ropes on that. My current breakdown is: GMail - GMail Web reader IMAP - Gnus, Thunderbird, dedicated Web mail app local MH folders - Mutt, MH > > There were a few discussions about mutt integration with org some years > back. In particular > > http://thread.gmane.org/gmane.emacs.orgmode/18950 > > describes an implementation (or maybe two) of a "mutt" link type. > > Searching the ML with "mutt links" will uncover a few more such discussions. aitor writes: > > If you are using mutt, check out this link: > > http://upsilon.cc/~zack/blog/posts/2010/02/integrating_Mutt_with_Org-mode/ > Thanks Nick and aitor. I'm looking into these mutt/org-mode integration efforts. Looks like what I want may already exist, or at least major pieces of it. Thanks all! -pd
Re: [O] No ODT export option
Hendrik Boom writes: > On Mon, 13 Jan 2014 15:07:30 +, Hendrik Boom wrote a message with > confusing typos > >> On Fri, 10 Jan 2014 11:32:55 -0500, Ista Zahn wrote: >> >>> Hi Ken, >>> >>> ODT export isn't enabled by default. You can enable it by putting >>> >>> (require 'ox-odt) >>> >>> in your config file and restart emacs. >>> >>> Best, >>> Ista >> >> I'm having this problem on Debian testing, but not on Debian stable. >> I have installed the org-mode package on both systems. >> >> Inserting (require 'ox-odt) at the end of my !/.emacs file gives me > ~/.emacs, not !/.emacs >> Warning (initialization): An error occurred while loading `/home/ >> hendrik/.emacs': >> >> File error: Cannot open load file, ox-odt >> >> To ensure normal operation, you should investigate and remove the cause >> of the error in your initialization file. Start Emacs with the >> `--debug-init' option to view a complete error backtrace. >> >> so it doesn't look as if it worked. >> >> For the record, there is a /usr/share/emacs/site-lisp/org-mode/ >> ox-odt.el file. >> >> Also, export to html works, presumably using the ox-html.el file in that >> same directory, and I don't have to say (require 'ox-odt). > Of course I meant not having to say (require 'ox-html). >> I'd presume >> that file is found by the same mechanism, so not finding ox-odt by >> default is a bit of a puzzle. >> >> The Debian testing system, which works, has similar files in teh same >> place, but their names start with org- instead of ox- That means it is using org-7.x, probably the org that came with whatever emacs package Debian distributes. If you are installing packages from Debian repos, that's probably the best that you can expect. If you (think you) are installing from the orgmode git repo, there is probably something wrong. Emacs provides tools to figure out where things are coming from: C-h f on a function name tells you which file the function came from, e.g. C-h f org-html-export-as-html RET , | org-html-export-as-html is an interactive Lisp function in | `ox-html.el'. | ... ` M-x locate-library RET ox-html RET tells you where emacs would load the ox-html library would be loaded from. There are more nuances and more tools but these should be enough to start with. Nick
Re: [O] Citations and references in ODT
Yes I just figured out I need the "." before the "?". It works now. I also made changes in both ox-odt.el and ox-jabref.el, everywhere that I found the \cite regex. Works well now. Thank you! -k. On Mon, Jan 13, 2014 at 1:31 AM, Nick Dokos wrote: > Ken Mankoff writes: > > > Hi, > > > > I find the ODT export very useful. Working on another document imported > from LaTeX I have a lot of \citep{} and \citet{} in addition to \cite{}. Is > it possible for ox-jabref.el to > > support this even if it does not distinguish between the T and P? > > > > I edited the line near the bottom with the regex and changed > > > > (value (∧ (string-match "cite{\\(.*?\\)}" latex-frag) > > > > to > > > > (value (∧ (string-match "cite?{\\(.*?\\)}" latex-frag) > > > > Try "cite[tp]?{\\(.*?\\)}" or "cite.?{\\(.*?\\)}"instead > (untested). > > > But it did not help. > > > >-k. > > > > -- > Nick > > >
Re: [O] No ODT export option
On Mon, 13 Jan 2014 15:07:30 +, Hendrik Boom wrote a message with confusing typos > On Fri, 10 Jan 2014 11:32:55 -0500, Ista Zahn wrote: > >> Hi Ken, >> >> ODT export isn't enabled by default. You can enable it by putting >> >> (require 'ox-odt) >> >> in your config file and restart emacs. >> >> Best, >> Ista > > I'm having this problem on Debian testing, but not on Debian stable. > I have installed the org-mode package on both systems. > > Inserting (require 'ox-odt) at the end of my !/.emacs file gives me ~/.emacs, not !/.emacs > Warning (initialization): An error occurred while loading `/home/ > hendrik/.emacs': > > File error: Cannot open load file, ox-odt > > To ensure normal operation, you should investigate and remove the cause > of the error in your initialization file. Start Emacs with the > `--debug-init' option to view a complete error backtrace. > > so it doesn't look as if it worked. > > For the record, there is a /usr/share/emacs/site-lisp/org-mode/ > ox-odt.el file. > > Also, export to html works, presumably using the ox-html.el file in that > same directory, and I don't have to say (require 'ox-odt). Of course I meant not having to say (require 'ox-html). > I'd presume > that file is found by the same mechanism, so not finding ox-odt by > default is a bit of a puzzle. > > The Debian testing system, which works, has similar files in teh same > place, but their names start with org- instead of ox-
Re: [O] multi-line citation export issue
Hi Nicolas et al., On Mon, 13 Jan 2014, Nicolas Goaziou wrote: Ken Mankoff writes: I am not familiar with export snippets, but I guess from that syntax that I will not be able to export with citations to ODT/DOC. Right now one org file exports well to both formats. You can also write the same for odt: @@odt:\cite{key}@@ So, in your buffer, it would become: @@latex:\cite{key}odt:\cite{key}@@ And you can avoid the implied repetition with a macro: #+MACRO: cite @@latex:\cite{$1}odt:\cite{$1}@@ and write in your document: {{{cite(key)}}} Note that you will need to escape commas (with backslashed) in key. This also works for your more complicated example : #+MACRO: cite2 @@latex:\cite[$1]{$2}odt:\cite[$1]{$2}@@ Wow. I was going point out that citing for both formats is cumbersome and makes the document hard-to-read, but the MACRO solves this. I was not aware of MACRO's. I guess this is both the beauty and pain of Org and emacs, all this customization. And down the rabbit-hole I go, because now I need to redefine my RefTeX shortcut so that it inserts {{{cite(key)}}} instead of \cite{key}. Unfortunately this is probably not something I have the skill to do right now. Perhaps I could get it for one citation, but the regex detect when inside an existing cite command and just insert the key, not the latex command wrapping it, is beyond my lisp skill and time. I'll just deal with no spaces inside \cite{a,b}. But thank you for teaching me about MACRO anyway. -k.
Re: [O] No ODT export option
On Fri, 10 Jan 2014 11:32:55 -0500, Ista Zahn wrote: > Hi Ken, > > ODT export isn't enabled by default. You can enable it by putting > > (require 'ox-odt) > > in your config file and restart emacs. > > Best, > Ista I'm having this problem on Debian testing, but not on Debian stable. I have installed the org-mode package on both systems. Inserting (require 'ox-odt) at the end of my !/.emacs file gives me Warning (initialization): An error occurred while loading `/home/ hendrik/.emacs': File error: Cannot open load file, ox-odt To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the `--debug-init' option to view a complete error backtrace. so it doesn't look as if it worked. For the record, there is a /usr/share/emacs/site-lisp/org-mode/ ox-odt.el file. Also, export to html works, presumably using the ox-html.el file in that same directory, and I don't have to say (require 'ox-odt). I'd preume that file is found by the same mechanism, so not finding ox-odt by default is a bit of a puzzle. The Debian testing system, which works, has similar files in teh same place, but their names start with org- instead of ox-
Re: [O] wide images in LaTex and HTML export
On Mon, Jan 13, 2014 at 2:27 AM, Peter Salazar wrote: > Has anyone had success recently working with wide images? I have source > documents and I'm trying to export to both LaTeX/PDF and HTML. > > Working from the manual, my image links look like this (the wide dimension > becomes height when rotated): > > #+ATTR_LATEX: :height 9in :options angle=90 :float t > [[file:./image-files/cash-flow-(monthly).jpg]] > > On the LaTeX/PDFs, the image is still coming out pretty small. Is there an > easy way to get it to suppress the page header and ignore the top margin so > I can get more room to work with? Here's some ideas on the LaTeX side; I don't use HTML nearly as much... Do you have anything setting margins in your header? I can't stand the default LaTeX margins, so every one of my article-style documents has the following header: #+latex_header: \usepackage[hmargin=2.5cm,vmargin=2.5cm]{geometry} You can also ditch the title/date with this line: #+BIND: org-latex-title-command "" Note that to use this, you need the following in your config (or at least to customize it to prompt the user if using #+bind is okay): (setq org-export-allow-bind-keywords t) Lastly, you can remove the footer (centered page number) with setting an empty pagestyle: \pagestyle{empty} Putting it all together, see what you think of this result (I get a pretty big image, with just the heading and the image). #+begin_src example #+options: toc:nil #+latex_header: \usepackage[hmargin=2.5cm,vmargin=2.5cm]{geometry} #+BIND: org-latex-title-command "" \pagestyle{empty} * test #+begin_center #+attr_latex: :width \textwidth [[./tux.png]] #+end_center #+end_src I downloaded this image as tux.png (same directory as the test file): http://post.putorius.net/images/originaltux.png Hope that helps a bit, John > > For HTML export, the image comes out wider than the screen on my MacBook > 13-inch. Has anyone had success using a lightbox-style plugin with org HTML > export? Ideally I wouldn't have to use image links with a "rel" tag, which > would break the LaTeX images. > > For HTML export, does anyone have a way to automatically turn all images > into lightbox-style image links that would expand to full screen on click? > (Or maybe even a jQuery way to expand images on click without even using > href links? But again, something that would do this to all images in the > document, ideally without the need to hand-tag each image.) > > Thanks!
Re: [O] File mode specification error: (error ":END: line missing at position 63362")
"Martin Beck" writes: > Hi, > > after startup of emacs I get an error message in my *Messages* Buffer, saying > > File mode specification error: (error ":END: line missing at position 63362") > > I had this several times already and it seems that in one of my org-mode > buffers, I have messed up somethign and accidently deleted a line. > The error message is created during startup when the buffers in the agenda > files list are loaded. > > However, I have many of them and it is difficult to track it down and find > the right one. > Is there a way to make the log file tell me, in which buffer this error was > produced? > Start emacs like this: emacs --debug-init -- Nick
[O] question about performance when having multiple todo blocks from the same org files ..
Hi. I have a complex agenda function as can be seen below. Beside an agenda call I do want to show todos separated in blocks, grouped by priority or tags. I want to show my prio A todos as one block before showing the rest of the todos sorted by prio. I was wondering if Org does run through all the org files again and again in order to collect the data wanted or if there is something like a cache is being filled when running through all buffers, collects all todos and then groups, sorts and is availble for printing out whats wanted. Thank you for a reply from someone who knows the internals. Rainer Org-mode version 8.2.2 (release_8.2.2-193-gf10166) ... ("01" "agenda - prio A,B todos - sorted prio up - today" ;; ( ;; show ONGOING todos first, but only if unscheduled, skip if scheduled (tags-todo "ONGOING" ((org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled)) (org-agenda-overriding-header "ONGOING todos: "))) (agenda "todays agenda" ( ;; (org-agenda-skip-function ;; (lambda nil ;; (org-agenda-skip-entry-if 'regexp ":ONGOING:"))) ;; (org-agenda-skip-entry-if 'regexp ":ONGOING:"))) (org-agenda-span 'day) (org-agenda-start-with-log-mode t) (org-agenda-start-with-clockreport-mode t) (org-agenda-overriding-header "Today's Agenda"))) (alltodo "!!! TODOs Prio A - skip ONGOING todos!!!" ( (org-agenda-skip-function (lambda nil (or (org-agenda-skip-entry-if (quote notregexp) "\\=.*\\[#A\\]") (org-agenda-skip-entry-if 'regexp ":ONGOING:") (org-agenda-skip-entry-if 'scheduled 'deadline (org-agenda-overriding-header "!!! TODOs prio A - skip ONGOING todos: !!!") )) (alltodo "todos Prio B til D - skip ONGOING todos" ( (org-agenda-skip-function (lambda nil (or (org-agenda-skip-entry-if (quote notregexp) "\\=.*\\[#B\\|#C\\|#D\\]") (org-agenda-skip-entry-if 'regexp ":ONGOING:") (org-agenda-skip-entry-if 'scheduled 'deadline (org-agenda-overriding-header "All todos prio B til D - skip ONGOING todos: ") )) ) ((org-agenda-sorting-strategy '(time-up priority-down todo-state-up ...
[O] File mode specification error: (error ":END: line missing at position 63362")
Hi, after startup of emacs I get an error message in my *Messages* Buffer, saying File mode specification error: (error ":END: line missing at position 63362") I had this several times already and it seems that in one of my org-mode buffers, I have messed up somethign and accidently deleted a line. The error message is created during startup when the buffers in the agenda files list are loaded. However, I have many of them and it is difficult to track it down and find the right one. Is there a way to make the log file tell me, in which buffer this error was produced? Kind regards Martin
Re: [O] working on cloud
Renato Pontefice writes: > How do you obtain that? C-h v user-init-file RET C-h v user-emacs-directory RET -- Bastien
[O] working on cloud
>I use for all emacs files git with server repository. Then on each >computer I'm using emacs with, I just clone that repository. The >positive side-effect of this is, that when you need to modify sources >for a particular computer, you just create new local branch. Then all >'common' init file tweaks can be done in master branch and it is very >easy to merge them into local one if needed >.d. Hi, I think this is (for me) the best way. But, I'm not skilled to GIT I'm wondering: In Linux (but in win too) the file must have a particular name (.emacs on linux; init.el on windows) and reside on a particular folder. How do you obtain that? Thank you Renato
Re: [O] multi-line citation export issue
Hello, Ken Mankoff writes: > I am not familiar with export snippets, but I guess from that syntax > that I will not be able to export with citations to ODT/DOC. Right now > one org file exports well to both formats. You can also write the same for odt: @@odt:\cite{key}@@ So, in your buffer, it would become: @@latex:\cite{key}odt:\cite{key}@@ And you can avoid the implied repetition with a macro: #+MACRO: cite @@latex:\cite{$1}odt:\cite{$1}@@ and write in your document: {{{cite(key)}}} Note that you will need to escape commas (with backslashed) in key. This also works for your more complicated example : #+MACRO: cite2 @@latex:\cite[$1]{$2}odt:\cite[$1]{$2}@@ > I will deal with multiple citations by not having spaces, and find > some other way (rewording?) to deal with the \cite[foo bar]{baz} > situation. And maybe someone more versed in org source can file this > as a bug, even if not a priority. This is not a bug. Parsing any LaTeX macro is way out of Org's league. Org conveniently support some simple macros, that's all. Regards, -- Nicolas Goaziou
[O] org-tag-alist and org-tag-persistent-alist
hello, i would appreciate help in understanding the difference between `org-tag-alist' and `org-tag-persistent-alist'. the docstrings suggest that the first defines "allowed" tags, while the second is for "always present" tags. the info seems to mention both only wrt completing tags for interactive insertion. they sure behave differently. i am keeping a lot of files in `org-agenda-files' --more than 100-- and i am using many tags. while harvesting tags to clean them up, for some reason i switched from the the persistent to the non persistent alist variable. as a result, `org-agenda-list' failed to terminate in ten minutes, as opposed to the usual 2 seconds. going back to the persistent alist variable fixes the problem. this looks strange also because there is a `org-tag-alist-for-agenda'. i am not sure whether this warrants submitting a bug. my unfounded guess is that `org-tag-alist' is there to pave the way for a facility to keep tags growth in check --by signaling where one used non allowed tags, for instance. by the way, that would be very nice. another somewhat baseless guess is that `org-global-tags-completion-table' might be causing the problem, as it uses two nested mapcar over agenda files and `org-tag-alist'. thanks, giovanni
Re: [O] Selecting Date Causes Complete Lockup of Emacs
On 13/01/14 00:05, Bastien wrote: Hi Ian, Ian Barton writes: Place the point in the Date column and type C-c !. Now select a date in the calendar. I chose a date in the past few days, but don't know if this is relevant. Emacs locks up completely, no back trace and the only way out is kill -9. I can't reproduce this with a more recent Emacs. Maybe you can use gdb: ~$ gdb emacs [then "run" in the prompt] and report what's going on to the Emacs developers. Thanks Bastien. However, gdb doesn't help as my Emacs doesn't have debugging symbols. I'll try compiling Emacs with the debugging symbols and see what happens. Ian.
[O] wide images in LaTex and HTML export
Has anyone had success recently working with wide images? I have source documents and I'm trying to export to both LaTeX/PDF and HTML. Working from the manual, my image links look like this (the wide dimension becomes height when rotated): #+ATTR_LATEX: :height 9in :options angle=90 :float t [[file:./image-files/cash-flow-(monthly).jpg]] On the LaTeX/PDFs, the image is still coming out pretty small. Is there an easy way to get it to suppress the page header and ignore the top margin so I can get more room to work with? For HTML export, the image comes out wider than the screen on my MacBook 13-inch. Has anyone had success using a lightbox-style plugin with org HTML export? Ideally I wouldn't have to use image links with a "rel" tag, which would break the LaTeX images. For HTML export, does anyone have a way to automatically turn all images into lightbox-style image links that would expand to full screen on click? (Or maybe even a jQuery way to expand images on click without even using href links? But again, something that would do this to all images in the document, ideally without the need to hand-tag each image.) Thanks!