Re: [O] latest org from Elpa error: Invalid function: org-babel-header-args-safe-fn
On Sat, Aug 8, 2015 at 8:54 AM, Ista Zahnwrote: > Unfortunately I now can't reproduce the problem, so I can't check if > my suggestion to byte compile ob-R.el works or not. For those still having this issue. I do confirm this solves the problem that occurred upon upgrading Org via ELPA on 64-bit MS Windows build of Emacs 24.5.1 maintained by Chris Zheng. I deleted and recompiled both ob-core.elc and ob-R.elc . -- Mikhail
[O] [babel] #+INCLUDE does not account for relative paths to images
I've noticed that if I include one Org file into another using #+INCLUDE, then I'm not getting a proper path to babel-generated figures at least while doing HTML export. I believe it is still an issue for non-babel images. I feel like it would be nice to export an updated relative path to included image file with a different base when exporting master document. Current implementation forces either to keep project Org files in the same folder or use more sophisticated relative paths like ../sibling-project/foo.png . Though I did not try the latter. -- Mikhail
Re: [O] [babel, ess] How can I make S-RET to be multi-session friendly?
Another issue I've noticed is that if I save a buffer, that was previously associated with R session, under different name in different folder, then that association is not getting reset and/or overridden by session property of Org buffer. Namely, I had dot R file that I saved in different folder as dot org one while wrapping code in babel blocks and adding session property. I did C-c C-c. I believe there is somewhere a check whether a buffer is associated or not but no check if it is associated with a proper buffer/session. Eric Schulte writes on Fri Aug 17 2012 at 09:29 : The `org-src-in-org-buffer' macro may be used from an edit buffer to run elisp inside the code block, in the org-mode buffer of the edit buffer. e.g., the following ;; -*- emacs-lisp -*- (org-src-in-org-buffer (message --%S (org-babel-get-src-block-info))) Where is org-src-in-org-buffer macro defined. Searching all dot el files in org folder does not show anything neither does C-h f show anything similar. (describe-function 'org-src-in-org-buffer) shows that org-src-in-org-buffer can be found in org-src.el (line 679 in my version). I guess it did not propagate to bzr yet :( I've checked with rev 109760. For some reason I had problems building git version on Windows a while ago and I didn't try since then. -- Mikhail
Re: [O] [babel, ess] How can I make S-RET to be multi-session friendly?
Bastien b...@gnu.org writes: I would say that after applying changes to my-ess-eval and to org-babel-edit-prep:R as suggested by Andrew, it looks like everything is working right for me. I'v been bold and I pushed the change Andrew suggested. Thanks for reporting this and for testing around -- and thanks to Andrew for the exploration and the fix! Though not related to Org, I noticed that ess-make-buffer-current calls (update-ess-process-name-list) thus making a call for it in my-ess-eval, probably, somewhat redundant, right? Another thing that somewhat bugs me is that if R process quits (or probably dies as well) when editing source code block in a separate buffer, the subsequent S-RET will silently execute a line in a wrong buffer/process. If there are no buffers with R process, it will create the default *R* named buffer. It might be exotic but I think it is an issue. Does it mean that there is a bug in ess-make-buffer-current function somewhere? Something, probably, re-associates a buffer to another process, does it? I think it might be relevant that code editing buffer local variable ess-local-process-name is non-nil when associated process quits. This results in first ess-make-buffer-current in my-ess-eval silently launching *R*. I'm not sure if it is too much to fix. Perhaps hitting C-c ' twice to re-start editing is a reasonable workaround. Eric Schulte eric.schu...@gmx.com writes: You can find the name of the original org-mode buffer by running the following snippet of elisp within the edit buffer. ;; -*- emacs-lisp -*- (marker-buffer org-edit-src-beg-marker) The `org-src-in-org-buffer' macro may be used from an edit buffer to run elisp inside the code block, in the org-mode buffer of the edit buffer. e.g., the following ;; -*- emacs-lisp -*- (org-src-in-org-buffer (message --%S (org-babel-get-src-block-info))) Where is org-src-in-org-buffer macro defined. Searching all dot el files in org folder does not show anything neither does C-h f show anything similar. -- Mikhail
Re: [O] [babel, ess] How can I make S-RET to be multi-session friendly?
Eric Schulte eric.schu...@gmx.com writes: Thanks for sending this along, unfortunately ob-R.el is currently without a core maintainer Quite a sad situation, many good modules lack maintainers :( , so I'm not sure who on list would have the expertise to review your submission. Although hopefully those experiencing the problem can at least check if it works for them. I'm not an expert but I gave it a shot. It seems that for me, the inferior ess process is not being properly associated with the src edit buffer. It is being set correctly by org-babel-R-associate-session, and then being set a second time incorrectly by org-babel-edit-prep:R. Commenting out line 5 in org-babel-edit-prep:R seems to fix this issue, although I'm honestly not sure if or what it breaks. Everything seems ok for me, but ymmv. Heres the change: #+begin_src emacs-lisp (defun org-babel-edit-prep:R (info) (let ((session (cdr (assoc :session (nth 2 info) (when (and session (string-match ^\\*\\(.+?\\)\\*$ session)) (save-match-data (org-babel-R-initiate-session session nil)) ;;(setq ess-local-process-name (match-string 1 session) ))) #+end_src Perhaps replacing the commented setq ess-local-process-name line with ess-switch-process could solve this problem? Could the process name be found programatically, perhaps using the regexp solution above. Is there any one having such issues, or who can weigh in on what exactly is happening here? Without making the above change, it is possible to manually attach an ess process to the current src buffer by using the command: C-c C-s (ess-switch-process) You'll have to specify the process name, rather than the buffer name, and the session must have already been started. I would say that after applying changes to my-ess-eval and to org-babel-edit-prep:R as suggested by Andrew, it looks like everything is working right for me. Once I hit C-c ' I see properly named buffer appear with new process. Then if I hit S-RET it asks me what session to use and since I have ido mode, it already highlights proper session name, so I just hit RET. Perhaps it worth recommending to use ido? Note that I do not have to enter process name. If I quite R, while editing code in a separate buffer, and hit S-RET it is executed in the wrong one without any question being asked :( I'm running somewhat recent bzr version of Emacs with default Org in it. -- Mikhail
Re: [O] [babel, ess] How can I make S-RET to be multi-session friendly?
Eric Schulte eric.schu...@gmx.com writes: There is a wonderful post[1] on how to make S-RET to do handy things in ESS mode. However I often find myself working on several Org documents from different folders. It is quite inconvenient to change a directory in =*R*= buffer each time I work on different document. Is there a neat way to somehow reuse Org mode property =session= that I set buffer wide? I'm not sure what you mean by reuse. All of the information for how to set header arguments in available at (info (org) Using header arguments) Here is the outline of what I have and what I'm doing. As I mentioned I set default :session header for R to *R*. In my file I have something like #+PROPERTY: session *Rreport* Whenever I C-c C-c on code block, I can see that *R* buffer was created instead of *Rreport* ! Now, if I edit my code block with C-c ' and hit S-RET on any line, it evaluates in *R* whereas I'd prefer it to be *Rreport* somehow. I understand that I'm trying to somewhat mix ob with plain ESS. Nevertheless I wonder if it is somehow possible. Also for some reason #+PROPERTY: session *Rsomename* does not override session name set in =org-babel-default-header-args:R= even after =C-c C-c= on it when I re-evaluate babel code block with =C-c C-c= on code block, while explicit block header =:session *Rsomename*= makes difference. Yes, the order of precedence is system-level buffer/subtree-level language-level code-block-level Then I'd say buffer level does NOT override system-level for some reason. I just re-built Emacs from bzr to make sure I'm running somewhat recent Org. Another weird thing is that when I tried to use Org from git (and not the stock one), Emacs freezes deadly on (org-clock-persistence-insinuate) unless I kill ntvdm.exe with Task Manager (I'm on Windows). But I guess it is a separate story. ,[ snippet from dot emacs ] | (setq org-babel-default-header-args:R | '((:results . output) (:session . *R*))) ` Given that (:session . *R*) will be used by default you could simply remove it from your custom setting for org-babel-default-header-args. This made a trick. Now indeed I have *Rreport* after C-c C-c on code block. However after C-c ' whenever I attempt to S-RET, yet another *R* is launched every time instead of evaluating a line. So the question perhaps is: How to alter [1] such that when I edit code block with C-c ' , S-RET executes lines in a proper session. I believe all information is in there, I just have no clue how would I extract it, e.g. to which main buffer that code editing buffer (I don't know the right name for it) belongs to, and what session header is set to in that buffer. If there is a way to fetch those, perhaps I'd be able to alter original set up in [1]. Footnotes: [1] http://www.kieranhealy.org/blog/archives/2009/10/12/make-shift-enter-do-a-lot-in-ess/ -- Mikhail
[O] [babel, ess] How can I make S-RET to be multi-session friendly?
Hello! There is a wonderful post[1] on how to make S-RET to do handy things in ESS mode. However I often find myself working on several Org documents from different folders. It is quite inconvenient to change a directory in =*R*= buffer each time I work on different document. Is there a neat way to somehow reuse Org mode property =session= that I set buffer wide? Also for some reason #+PROPERTY: session *Rsomename* does not override session name set in =org-babel-default-header-args:R= even after =C-c C-c= on it when I re-evaluate babel code block with =C-c C-c= on code block, while explicit block header =:session *Rsomename*= makes difference. ,[ snippet from dot emacs ] | (setq org-babel-default-header-args:R | '((:results . output) (:session . *R*))) ` I'm running Org-mode version 7.8.10 (release_7.8.10-658-g451191.dirty) Footnotes: [1] http://www.kieranhealy.org/blog/archives/2009/10/12/make-shift-enter-do-a-lot-in-ess/ -- Mikhail
Re: [O] How to integrate org-mode in a MS Windows-/Office-based environment?
M elwood...@web.de writes: So unfortunately I'll have to find a way to integrate as good as possible. (I had tried to use MS Outlook 2007 for managing tasks for some weeks but I was missing a lot of features I got used to from org-mode, so I installed org-mode. One example of helpful integration: if I send or get an e-mail which I want to follow-up on later, I want to track that in org-mode and I want to have a way to quickly find the original message in Outlook again (to reply or forward it or whatever), which can be done with hyperlinks. You can set up Gnus if Exchange server is available via IMAP otherwise see Q 3.10 [1]. With Gnus you can easily insert links right to your e-mail. Indeed the ability to bookmark an e-mail is something I would miss without Org mode. [1] http://gnus.org/manual/gnus_397.html#SEC446 I'm sure there are a lot more useful tricks which can help in daily work, e. g. a vba macro which copies the path to the currently open word or excel document into the clipboard or even directly opens org-capture to add some note or task which is linked to this document... You can use dired to navigate to your word document in the first place and make a link using dired. -- Mikhail
Re: [O] Org variables in LaTeX - how?
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Rainer M Krug Sent: Thursday, June 07, 2012 6:32 AM To: emacs-orgmode Subject: [O] Org variables in LaTeX - how? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi I must admit, I don't know the inner workings of LaTeX, so this might be impossible, but anyway: I have the following two variables: #+PROPERTY: var VER=89 #+PROPERTY: var+ STATE=up-to-date I create a file in one code block via sh, named FILE=./../nsa.$VER.$STATE.tar.gz Now I would likle to attach this file to the pdf: #+LATEX_HEADER:\\usepackage{attachfile2} #+BEGIN_LaTeX \textattachfile[print=false,color=0.5 0.5 0.5]{./../nsa.VER.STATE.tar.gz}{R source files} #+END_LaTeX How can I use the variables in a LaTeX block? Using the ove does obviously not work, but #+BEGIN_LaTeX \textattachfile[print=false,color=0.5 0.5 0.5]{./../nsa.98.up-to- date.tar.gz}{R source files} #+END_LaTeX does. So my question: Can I, and if yes how, use org variables in LaTeX code? You should generate latex code with let's say elisp (or some other language) fragment that will output :results latex Mikhail
Re: [O] python/babel inline images
-Original Message- From: henry atting [mailto:nsmp...@online.de] Sent: Thursday, June 07, 2012 3:43 AM To: Mikhail Titov Cc: 'henry atting'; emacs-orgmode@gnu.org Subject: Re: python/babel inline images The code itself works flawlessly. So the workaround which I already have used is to link to the resulting image. The only drawback with this solution is that after every evaluation I have to remove the empty `'Results:' You can use :results silent This is great! Actually this solves my problem which means: create a link to the file and set results to silent. This has an implication of inability to cache results in case you might want it. I personally would just leave empty #+RESULTS: block as is and I would place link manually two lines below it (leave 1 blank line so re-evaluation won't delete your link). but the heck with it, I can live with it happily till the end of my days. However I find that some inconsistency lies therein. Before python/matplotlib I used gnuplot with which babel had no problem of this type. Try using ... :file exp_csv.svg ... plot.savefig(file=sys.stdout) This does not compile, the compiler complains about missing arguments. I have to write it like this: plot.savefig(file.svg, format='svg') I never used that library but it makes sense:-) The only problem with this solution that you should make sure nothing else goes to stdout. I think it is a huge shortcoming. So, just to mention the current state of affairs (with a simple example): --8---cut here---start-8--- #+begin_src python :results output from pylab import * t = arange(0.0, 2.0, 0.01) s = sin(2*pi*t) plot(t, s) show() savefig(file.svg, format='svg') #+end_src --8---cut here---start-8--- The above code works. But if I set `:file' to `file.svg' with every evaluation the link to the file is placed after #+RESULTS: but the file itself is empty. As William LECHELLE pointed out that in this case file captures the output of the savefig() call which does not output anything to stdout. So it is expected. If the code is evaluated without `:file file.svg' the evaluation simply works and the file.svg appears in the working directory. I think this is the best way to proceed. M.
Re: [O] [babel] session initialization (was RE: python/babel inline images)
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Mikhail Titov Sent: Wednesday, June 06, 2012 6:06 PM To: 'Eric Schulte' Cc: emacs-orgmode@gnu.org Subject: Re: [O] [babel] session initialization (was RE: python/babel inline images) ... How would I reliably refer to the org doc buffer from where everything was called? The following works just fine in session initialization code for Matlab but not for Octave (file-name-directory (buffer-file-name (other-buffer))) At this point, (current-buffer) refers to the one with inferior process. So I ended up using the following in session initialization for inferior process to get a current folder of a document from where calculations initiated (file-name-directory (car (delq nil (mapcar #'buffer-file-name (buffer-list) It works. But I have a feeling that it is not a reliable method. Any suggestions? M.
Re: [O] [babel] session initialization (was RE: python/babel inline images)
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Eric Schulte Sent: Thursday, June 07, 2012 5:44 PM To: Mikhail Titov Cc: emacs-orgmode@gnu.org; 'Eric Schulte' Subject: Re: [O] [babel] session initialization (was RE: python/babel inline images) ... How would I reliably refer to the org doc buffer from where everything was called? The following works just fine in session initialization code for Matlab but not for Octave (file-name-directory (car (delq nil (mapcar #'buffer-file-name (buffer-list) It works. But I have a feeling that it is not a reliable method. Any suggestions? I would recommend using the `default-directory' variable. That should hold the value of the directory of the Org-mode file or the value of the :dir header argument if present. Huh... now it works... I remember I've tried before but for some reason it was nil.. maybe typo though I have AC. The only trick [1] is to use (file-truename default-directory) as Matlab does not like ~. Thanks! M. [1] http://stackoverflow.com/questions/291976/relative-path-to-absolute-path-in- elisp
Re: [O] [babel] session initialization (was RE: python/babel inline images)
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Mikhail Titov Sent: Thursday, June 07, 2012 6:03 PM To: 'Eric Schulte' Cc: emacs-orgmode@gnu.org Subject: Re: [O] [babel] session initialization (was RE: python/babel inline images) ... How would I reliably refer to the org doc buffer from where everything was called? The following works just fine in session initialization code for Matlab but not for Octave (file-name-directory (car (delq nil (mapcar #'buffer-file-name (buffer-list) It works. But I have a feeling that it is not a reliable method. Any suggestions? I would recommend using the `default-directory' variable. That should hold the value of the directory of the Org-mode file or the value of the :dir header argument if present. Huh... now it works... I remember I've tried before but for some reason it was nil.. maybe typo though I have AC. The only trick [1] is to use (file-truename default-directory) as Matlab does not like ~. Turns out this does not work for octave for some reason. default-directory points to my home folder. Also I'm getting ansi-color-process-output: Marker does not point anywhere for Octave. So I have to C-c a couple of times on the block for the first time. First evaluation just launches session but breaks because of that error. Second time (when session is up) C-c works just fine and dumps result. Non-session version of Octave works as expected. I wonder if it is something Windows-specific... I can see test on :session for Octave and Achim Gratz said it passed tests. The problem occurs to me with git version of ob-octave.el as well. So I'm confident it is not me who broke something during experiments :-) Any idea? Matlab works just fine (session)! I'm afraid I'll leave all the things as is for now. Maybe someone else can fix it later. M.
[O] [babel] session initialization (was RE: python/babel inline images)
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Eric Schulte Sent: Wednesday, June 06, 2012 12:20 AM To: Mikhail Titov Cc: emacs-orgmode@gnu.org; 'henry atting' Subject: Re: [O] python/babel inline images Mikhail Titov m...@gmx.us writes: -Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Eric Schulte Sent: Tuesday, June 05, 2012 9:57 AM To: henry atting Cc: emacs-orgmode@gnu.org Subject: Re: [O] python/babel inline images I'm not python expert, but the code block should be run in your current directory, e.g., the following outputs the current working path expected for me. #+begin_src sh pwd #+end_src If you want to explicitly pass the current directory to your code block as an argument, you could try something like the following #+begin_src python :var mydir=(file-name-directory (buffer-file-name)) return mydir #+end_src I've noticed some inconsistency between various languages in this aspect. For instance, ob-R starts session in proper working directory, while all looks like everything (?) else does not. Should not it be somewhat standardized? I think it make sense to always cd to org doc folder. Most languages should and (at least those I use regularly) do run in the directory of the containing Org-mode file. Which languages do not? I'm working on ob-octave.el which does not. So I'll fix it in this case. Which leads me to another question I was about to ask. How to comint commands in org-babel-XXX-initiate-session as session is not assigned yet? Right now I have something like the following in that function (comint-send-string (get-buffer-process (current-buffer)) set(0, 'defaultfigurevisible', 'off');\n) I do it there as it does not make sense to call for each block. I was about to write that ob-R does show stuff but I believe it was in earlier versions of ob-R.el or something as I've checked and indeed nothing appears on screen as code being wrapped in a device output block. Also IIRC ob-sh does not change directory though I tried it on Windows with cmd.exe . Worth mentioning that it tangles into dot sh instead of dot bat or dot cmd on that platform. It misses platform specific (defvar org-babel-tangle-lang-exts) (if (string-equal system-type windows-nt) (add-to-list 'org-babel-tangle-lang-exts '(sh . bat)) ) P.S. I feel like I'm hijacking the thread M.
Re: [O] python/babel inline images
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of henry atting Sent: Wednesday, June 06, 2012 10:19 AM To: emacs-orgmode@gnu.org Subject: Re: [O] python/babel inline images I don't think its a path problem. Indeed #+begin_src python :results output import os print(os.getcwd()) #+end_src Shows location of my org doc. The code itself works flawlessly. So the workaround which I already have used is to link to the resulting image. The only drawback with this solution is that after every evaluation I have to remove the empty `'Results:' You can use :results silent but the heck with it, I can live with it happily till the end of my days. However I find that some inconsistency lies therein. Before python/matplotlib I used gnuplot with which babel had no problem of this type. Try using ... :file exp_csv.svg ... plot.savefig(file=sys.stdout) #+begin_src python :results output :file zzz.xxx import os, sys print(os.getcwd(), file=sys.stdout) #+end_src #+RESULTS: [[file:zzz.xxx]] Meanwhile I've noticed that I can't return back from editing python code in a sub-editing buffer. C-c ' does not work and M-x org-edit-src-exit says This is not a sub-editing buffer, something is wrong.
Re: [O] python/babel inline images
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Eric Schulte Sent: Wednesday, June 06, 2012 2:25 PM To: Mikhail Titov Cc: emacs-orgmode@gnu.org; 'henry atting' Subject: Re: [O] python/babel inline images Meanwhile I've noticed that I can't return back from editing python code in a sub-editing buffer. C-c ' does not work and M-x org-edit-src-exit says This is not a sub-editing buffer, something is wrong. This works on my system, perhaps the problem is due to something in your configuration. Do you still notice this problem when launching emacs with the -Q option. Huh... -Q solves it. I'm loading CEDET early in dot emacs for matlab-emacs (as per manual) and it does something nasty that ruins normal behavior of C-c '. Bummer. Outdated eieio 1.3 shadowed to meet minimum version 1.4 Outdated semantic 2.0 shadowed to meet minimum version 2.1 Outdated srecode 1.0 shadowed to meet minimum version 1.1 Outdated ede 1.0 shadowed to meet minimum version 1.1 Outdated speedbar 1.0 shadowed to meet minimum version 1.0.4 Setting up CEDET packages...done M.
Re: [O] [babel] session initialization (was RE: python/babel inline images)
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Eric Schulte Sent: Wednesday, June 06, 2012 2:02 PM To: Mikhail Titov Cc: emacs-orgmode@gnu.org; 'henry atting'; 'Eric Schulte' Subject: Re: [O] [babel] session initialization (was RE: python/babel inline images) Right now I have something like the following in that function (comint-send-string (get-buffer-process (current-buffer)) set(0, 'defaultfigurevisible', 'off');\n) I do it there as it does not make sense to call for each block. I was about to write that ob-R does show stuff but I believe it was in earlier versions of ob-R.el or something as I've checked and indeed nothing appears on screen as code being wrapped in a device output block. I'm not aware of a way to run code on the start of a session. I do see how this could be a useful addition. So the fragment above does look legitimate to you? I just add (format cd('%s');\n (file-name-directory (buffer-file-name))) and problem solved? Well... for sessions. I don't know if it is common to use non-session based calculations... Also IIRC ob-sh does not change directory though I tried it on Windows with cmd.exe. Granted I only run on linux, but (on linux) ob-sh *does* run in the directory of the containing Org-mode file. Worth mentioning that it tangles into dot sh instead of dot bat or dot cmd on that platform. It misses platform specific (defvar org-babel-tangle-lang-exts) (if (string-equal system-type windows-nt) (add-to-list 'org-babel-tangle-lang-exts '(sh . bat)) ) OK, could you convert the above into a patch which we could apply to ob-sh? I think there should be more than that. I do sometimes use bash from msys on Win32 so I'd expect sh as a tangled file name extension in this case. I believe it can be accomplished as with matlab / octave by adding a new language cmd that will reuse most of sh. I'll see what I can do. M.
Re: [O] [babel] session initialization (was RE: python/babel inline images)
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Mikhail Titov Sent: Wednesday, June 06, 2012 2:42 PM To: 'Eric Schulte' Cc: emacs-orgmode@gnu.org Subject: Re: [O] [babel] session initialization (was RE: python/babel inline images) -Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Eric Schulte Sent: Wednesday, June 06, 2012 2:02 PM To: Mikhail Titov Cc: emacs-orgmode@gnu.org; 'henry atting'; 'Eric Schulte' Subject: Re: [O] [babel] session initialization (was RE: python/babel inline images) Right now I have something like the following in that function (comint-send-string (get-buffer-process (current-buffer)) set(0, 'defaultfigurevisible', 'off');\n) I do it there as it does not make sense to call for each block. I was about to write that ob-R does show stuff but I believe it was in earlier versions of ob-R.el or something as I've checked and indeed nothing appears on screen as code being wrapped in a device output block. I'm not aware of a way to run code on the start of a session. I do see how this could be a useful addition. So the fragment above does look legitimate to you? I just add (format cd('%s');\n (file-name-directory (buffer-file-name))) and problem solved? Well... for sessions. I don't know if it is common to use non-session based calculations... How would I reliably refer to the org doc buffer from where everything was called? The following works just fine in session initialization code for Matlab but not for Octave (file-name-directory (buffer-file-name (other-buffer))) At this point, (current-buffer) refers to the one with inferior process. M.
[O] [babel] Why #+name: is not a member of params?
Hello! I’d like to insert a comment into tangle output with a block name. I thought I could easily access it (like from org-babel-expand-body:XXX function) with (cdr (assq :name params)) But apparently it does not work. When I do C-c C-v C-v trying to expand body, I get nil as it is not there. Did I miss something? I want that so each block appears in individual Matlab code cell [1]. [1] http://www.mathworks.com/help/techdoc/matlab_env/brqxeeu-259.html Mikhail
Re: [O] [babel] Why #+name: is not a member of params?
-Original Message- From: Eric Schulte [mailto:eric.schu...@gmx.com] Sent: Tuesday, June 05, 2012 7:42 PM To: Mikhail Titov Cc: emacs-orgmode@gnu.org Subject: Re: [O] [babel] Why #+name: is not a member of params? Mikhail Titov m...@gmx.us writes: Hello! I’d like to insert a comment into tangle output with a block name. I thought I could easily access it (like from org-babel-expand-body:XXX function) with (cdr (assq :name params)) ... The code block name is not a member of params. Params only holds header arguments, not other meta data like the name. The code block name is stored in the `info' list which is active while the code block is being processed, so you could access it with something like the following, although which is relying on an implementation detail that is not part of the formal spec (i.e., cheating) and could change. #+name: foo #+begin_src emacs-lisp (nth 4 info) #+end_src #+RESULTS: foo : foo Thank you, Eric! Marvelous! It does what I want. I see its definition in ob.el . M.
Re: [O] python/babel inline images
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Eric Schulte Sent: Tuesday, June 05, 2012 9:57 AM To: henry atting Cc: emacs-orgmode@gnu.org Subject: Re: [O] python/babel inline images I'm not python expert, but the code block should be run in your current directory, e.g., the following outputs the current working path expected for me. #+begin_src sh pwd #+end_src If you want to explicitly pass the current directory to your code block as an argument, you could try something like the following #+begin_src python :var mydir=(file-name-directory (buffer-file-name)) return mydir #+end_src I've noticed some inconsistency between various languages in this aspect. For instance, ob-R starts session in proper working directory, while all looks like everything (?) else does not. Should not it be somewhat standardized? I think it make sense to always cd to org doc folder. M.
Re: [O] [babel, patch] ob-octave does not catch EOE from matlabShell on MS Windows
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Achim Gratz Sent: Monday, May 28, 2012 1:24 PM To: emacs-orgmode@gnu.org Subject: Re: [O] [babel, patch] ob-octave does not catch EOE from matlabShell on MS Windows Eric Schulte writes: Thanks for sending along the patch and the variable re-definition. If I understand correctly then the patch should be applied for any system, but the variable definition need only be applied on windows systems. Is that correct? The variable re-definition seems to be be needed for matlab-shell, I don't know if that would be restricted to Windows. Can anyone confirm that matlab/octave code blocks are still functional on a GNU/Linux machine after the above patch and redefinition have been applied? I do not use octave/matlab myself and can't verify this. The octave tests still pass on openSUSE with the patch applied along with all the other tests (except R, since I'm missing ESS). I wonder how it still passes the test... I think my patch unintentionally breaks octave. It probably should have been just org-babel-octave-eoe-output instead of (if matlabp org-babel-octave-eoe-output org-babel-octave-eoe-indicator) or other way around. I apologize for bringing it all over to the list as I'm not proficient in elisp yet. I feel like ob-octave needs an overhaul in general as it does not respect many header arguments like :width, :height, and graphics format (always png). Also it would be nice if it removed extra prompts left in results as does ob-R.el . I'll post improved patch once I feel it is ready. Eric, so for now, just hold on with the application of what I've sent. Mikhail
Re: [O] [babel, patch] ob-octave does not catch EOE from matlabShell on MS Windows
-Original Message- From: Eric Schulte [mailto:eric.schu...@gmx.com] Sent: Monday, May 28, 2012 10:57 AM To: Mikhail Titov Cc: emacs-orgmode@gnu.org Subject: Re: [O] [babel, patch] ob-octave does not catch EOE from matlabShell on MS Windows ... It looks like org-babel-octave-eoe-output and org-babel-octave-eoe- indicator were swapped around in org-babel-octave-evaluate-session . I have the following in dot emacs (setq org-babel-octave-eoe-output ans = org_babel_eoe ) For the sake of completeness I'm attaching the patch. Also one should override (setq org-babel-matlab-emacs-link-wrapper-method %s if ischar(ans), fid = fopen('%s', 'w'); fprintf(fid, '%%s\\n', ans); fclose(fid); else, save -ascii %s ans ; end delete('%s') ) as matlabShell does not like commands split across multiple lines. Thanks for sending along the patch and the variable re-definition. I was in the hurry and the second variable should have been (setq org-babel-octave-wrapper-method %s if ischar(ans), fid = fopen('%s', 'w'); fprintf(fid, '%%s\\n', ans); fclose(fid); else, dlmwrite('%s', ans, '\\t'); end) and not org-babel-matlab-emacs-link-wrapper-method . The only difference from what is already in there, is that it should be a single line (with ; delimiters). It might be a limitation of matlabShell. From what I understand EmacsLink is something outdated and not supported anymore as there is matlab-emacs mode. Also the patch was missing yet another change to use single quotes instead of double quotes when making default figures invisible. I'm attaching the patch I ended up using. If I understand correctly then the patch should be applied for any system, but the variable definition need only be applied on windows systems. Is that correct? Unfortunately I don't have Matlab installed on my home GNU/Linux computer, I'll see if I'm eligible and can get one. What bugs me though is that I can't use both octave and matlab as they use same variable (org-babel-octave-eoe-output) which should be set to different values. In org-babel-comint-with-output macro (ob-comint.el) it is used to check if shell/REPL is done with evaluation and ready for input. I wonder if it is possible to generalize org-babel-octave-eoe-output for both matlab and octave as the only difference is the bunch of newlines in Matlab output. One may write a regexp that matches both, however (regexp-quote ,eoe-indicator) in aforementioned macro confuses me. So it got to be a plain string. M. Can anyone confirm that matlab/octave code blocks are still functional on a GNU/Linux machine after the above patch and redefinition have been applied? I do not use octave/matlab myself and can't verify this. If they don't break anything I'm happy to apply these patches. Thanks, -- Eric Schulte http://cs.unm.edu/~eschulte ob-octave_matlab_updated.patch Description: Binary data
Re: [O] [babel] ob-octave does not catch EOE from matlabShell on MS Windows
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Mikhail Titov Sent: Thursday, May 24, 2012 4:31 PM To: emacs-orgmode@gnu.org Subject: Re: [O] [babel] ob-octave does not catch EOE from matlabShell on MS Windows ... I have a simple test block like #+begin_src matlab :session *MATLAB* a=2 #+end_src When I try to execute it with C-c C-c , emacs never returns unless I hit C- g. If I do M-x toggle-debug-on-quit RET I see that for some reason it keeps waiting for EOE. It looks like org-babel-octave-eoe-output and org-babel-octave-eoe-indicator were swapped around in org-babel-octave-evaluate-session . I have the following in dot emacs (setq org-babel-octave-eoe-output ans = org_babel_eoe ) M. ... Here is what I see in *MATLAB* buffer: 8-*MATLAB*--8- a=2 if ischar(ans), fid = fopen('c:/DOCUME~1/user/LOCALS~1/Temp/babel- 7560HUp/matlab-7560PPd', 'w'); fprintf(fid, '%s\n', ans); fclose(fid); else, dlmwrite('c:/DOCUME~1/user/LOCALS~1/Temp/babel-7560HUp/matlab-7560PPd', ans, '\t'); end 'org_babel_eoe' a = 2 ans = org_babel_eoe 8-*MATLAB*--8- I feel like it is about (defvar org-babel-octave-eoe-output ans = org_babel_eoe) as Matlab's return has newlines. I'm not sure so far how to make universal regex for re-search-forward in org-babel-comint-with-output . Mikhail
Re: [O] [babel, patch] ob-octave does not catch EOE from matlabShell on MS Windows
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Mikhail Titov Sent: Friday, May 25, 2012 11:31 AM To: emacs-orgmode@gnu.org Subject: Re: [O] [babel] ob-octave does not catch EOE from matlabShell on MS Windows ... I have a simple test block like #+begin_src matlab :session *MATLAB* a=2 #+end_src When I try to execute it with C-c C-c , emacs never returns unless I hit C- g. If I do M-x toggle-debug-on-quit RET I see that for some reason it keeps waiting for EOE. It looks like org-babel-octave-eoe-output and org-babel-octave-eoe-indicator were swapped around in org-babel-octave-evaluate-session . I have the following in dot emacs (setq org-babel-octave-eoe-output ans = org_babel_eoe ) For the sake of completeness I'm attaching the patch. Also one should override (setq org-babel-matlab-emacs-link-wrapper-method %s if ischar(ans), fid = fopen('%s', 'w'); fprintf(fid, '%%s\\n', ans); fclose(fid); else, save -ascii %s ans ; end delete('%s') ) as matlabShell does not like commands split across multiple lines. M. ob-octave_matlab.patch Description: Binary data
[O] [babel] ob-octave does not catch EOE from matlabShell on MS Windows
Hello! I was trying hard to set up Matlab R2011a to work with my Emacs 24.1.50.1 (org version is release_7.8.09-532-gb797c8.dirty) and finally I was able to use it from M-shell but not from orgmode yet. I've edited emacs wiki [1] to reflect somewhat working matlab-mode setup on win32. Namely I use [2] as matlab shell. I have a simple test block like #+begin_src matlab :session *MATLAB* a=2 #+end_src When I try to execute it with C-c C-c , emacs never returns unless I hit C-g. If I do M-x toggle-debug-on-quit RET I see that for some reason it keeps waiting for EOE. I'd appreciate any suggestion as what to try (other than Octave which has its own tricks on Win32). I'm lost. [1] http://www.emacswiki.org/emacs/MatlabMode#toc3 [2] http://www.cs.umb.edu/~ram/matlabShell/index.html -- Mikhail Here is what I see in *MATLAB* buffer: 8-*MATLAB*--8- a=2 if ischar(ans), fid = fopen('c:/DOCUME~1/user/LOCALS~1/Temp/babel-7560HUp/matlab-7560PPd', 'w'); fprintf(fid, '%s\n', ans); fclose(fid); else, dlmwrite('c:/DOCUME~1/user/LOCALS~1/Temp/babel-7560HUp/matlab-7560PPd', ans, '\t'); end 'org_babel_eoe' a = 2 ans = org_babel_eoe 8-*MATLAB*--8- 8-*Bactrace*--8- Debugger entered--Lisp error: (quit) accept-process-output(#process MATLAB) (while (progn (goto-char comint-last-input-end) (not (save-excursion (and (re-search-forward (regexp-quote (if matlabp org-babel-octave-eoe-indicator org-babel-octave-eoe-output)) nil t) (re-search-forward comint-prompt-regexp nil t) (accept-process-output (get-buffer-process (current-buffer (progn (goto-char (process-mark (get-buffer-process (current-buffer (let ((start (point)) (end (point-max))) (setq dangling-text (buffer-substring start end)) (delete-region start end)) (insert full-body) (comint-send-input nil t) (while (progn (goto-char comint-last-input-end) (not (save-excursion (and (re-search-forward (regexp-quote ...) nil t) (re-search-forward comint-prompt-regexp nil t) (accept-process-output (get-buffer-process (current-buffer (goto-char (process-mark (get-buffer-process (current-buffer (insert dangling-text)) (unwind-protect (progn (goto-char (process-mark (get-buffer-process (current-buffer (let ((start (point)) (end (point-max))) (setq dangling-text (buffer-substring start end)) (delete-region start end)) (insert full-body) (comint-send-input nil t) (while (progn (goto-char comint-last-input-end) (not (save-excursion (and (re-search-forward ... nil t) (re-search-forward comint-prompt-regexp nil t) (accept-process-output (get-buffer-process (current-buffer (goto-char (process-mark (get-buffer-process (current-buffer (insert dangling-text)) (remove-hook (quote comint-output-filter-functions) (quote my-filt))) (progn (fset (quote my-filt) (function* (lambda (text) (block my-filt (setq string-buffer (concat string-buffer text)) (add-hook (quote comint-output-filter-functions) (quote my-filt)) (unwind-protect (progn (goto-char (process-mark (get-buffer-process (current-buffer (let ((start (point)) (end (point-max))) (setq dangling-text (buffer-substring start end)) (delete-region start end)) (insert full-body) (comint-send-input nil t) (while (progn (goto-char comint-last-input-end) (not (save-excursion (and ... ... (accept-process-output (get-buffer-process (current-buffer (goto-char (process-mark (get-buffer-process (current-buffer (insert dangling-text)) (remove-hook (quote comint-output-filter-functions) (quote my-filt (unwind-protect (progn (fset (quote my-filt) (function* (lambda (text) (block my-filt (setq string-buffer (concat string-buffer text)) (add-hook (quote comint-output-filter-functions) (quote my-filt)) (unwind-protect (progn (goto-char (process-mark (get-buffer-process (current-buffer (let ((start (point)) (end (point-max))) (setq dangling-text (buffer-substring start end)) (delete-region start end)) (insert full-body) (comint-send-input nil t) (while (progn (goto-char comint-last-input-end) (not (save-excursion ...))) (accept-process-output (get-buffer-process (current-buffer (goto-char (process-mark (get-buffer-process (current-buffer (insert dangling-text)) (remove-hook (quote comint-output-filter-functions) (quote my-filt (if --cl-letf-bound-- (fset (quote my-filt) --cl-letf-save--) (fmakunbound (quote my-filt (let* ((--cl-letf-bound-- (fboundp (quote my-filt))) (--cl-letf-save-- (and --cl-letf-bound-- (symbol-function (quote my-filt) (unwind-protect (progn (fset (quote my-filt) (function* (lambda (text) (block my-filt (setq string-buffer ...) (add-hook (quote comint-output-filter-functions) (quote my-filt)) (unwind-protect (progn (goto-char (process-mark (get-buffer-process ...))) (let ((start ...) (end ...)) (setq dangling-text (buffer-substring start
Re: [O] [babel] ob-octave does not catch EOE from matlabShell on MS Windows
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Mikhail Titov Sent: Thursday, May 24, 2012 4:02 PM To: emacs-orgmode@gnu.org Subject: [O] [babel] ob-octave does not catch EOE from matlabShell on MS Windows ... I have a simple test block like #+begin_src matlab :session *MATLAB* a=2 #+end_src When I try to execute it with C-c C-c , emacs never returns unless I hit C-g. If I do M-x toggle-debug-on-quit RET I see that for some reason it keeps waiting for EOE. ... Here is what I see in *MATLAB* buffer: 8-*MATLAB*--8- a=2 if ischar(ans), fid = fopen('c:/DOCUME~1/user/LOCALS~1/Temp/babel- 7560HUp/matlab-7560PPd', 'w'); fprintf(fid, '%s\n', ans); fclose(fid); else, dlmwrite('c:/DOCUME~1/user/LOCALS~1/Temp/babel-7560HUp/matlab-7560PPd', ans, '\t'); end 'org_babel_eoe' a = 2 ans = org_babel_eoe 8-*MATLAB*--8- I feel like it is about (defvar org-babel-octave-eoe-output ans = org_babel_eoe) as Matlab's return has newlines. I'm not sure so far how to make universal regex for re-search-forward in org-babel-comint-with-output . Mikhail
Re: [O] Unable to Style RESULTS Blocks
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Thomas S. Dye Sent: Monday, May 21, 2012 12:58 PM To: Jeff Rush Cc: emacs-orgmode@gnu.org Subject: Re: [O] Unable to Style RESULTS Blocks Using org-babel, I cannot figure out how to make the export of the results of execution appear in LaTeX as a shaded box, like I see on so many of the org-mode websites. #+name: example #+BEGIN_SRC python -n :results output :exports both print Hello World #+END_SRC #+results: example : Hello World The results are exported as: \begin{verbatim} Hello World \end{verbatim} which lacks any shading/borders. The org-mode documentation at: http://orgmode.org/worg/org-tutorials/org-latex-export.html shows this example but the example expects the results to be wrapped in a 'results' environment instead of the 'verbatim' environment I'm seeing. #+LaTeX_HEADER: \usepackage{framed} #+LaTeX_HEADER: \usepackage{xcolor} #+LaTeX_HEADER: \definecolor{shadecolor}{gray}{.95} #+LaTeX_HEADER: \newenvironment{results}{\begin{shaded}}{\end{shaded}} I'm running org-mode 7.8.03 under Linux, and I've defined my own LaTeX document class to format the other parts of my document. I am new to LaTeX though. I just expected the formatting of source and results to be a well-solved problem w/good looking defaults in org-mode. -Jeff You can wrap a results block any way you like with the :wrap header argument, e.g., #+name: example #+BEGIN_SRC python -n :results output :exports both :wrap results print Hello World #+END_SRC #+RESULTS: example #+BEGIN_results Hello World #+END_results Or, #+name: example #+BEGIN_SRC python -n :results output :exports both :wrap foo print Hello World #+END_SRC #+RESULTS: example #+BEGIN_foo Hello World #+END_foo If you have loaded org-special-blocks, then #+LaTeX_HEADER: \usepackage{framed} #+LaTeX_HEADER: \usepackage{xcolor} #+LaTeX_HEADER: \definecolor{shadecolor}{gray}{.95} #+LaTeX_HEADER: \newenvironment{results}{\begin{shaded}}{\end{shaded}} #+LaTeX_HEADER: \newenvironment{foo}{\begin{framed}}{\end{framed}} Or even better, use LaTeX package minted [1]. Install all the stuff including pigments and add to you dot emacs the following (setq org-export-latex-listings 'minted) [1] http://code.google.com/p/minted/
Re: [O] How to get to work non-interactive publishing?
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Eric Schulte Sent: Saturday, May 19, 2012 5:39 PM To: Mikhail Titov Cc: emacs-orgmode@gnu.org Subject: Re: [O] How to get to work non-interactive publishing? I can publish project if I don’t use –-batch . So the following works just fine: emacs -nw --eval '(org-publish-project myproj)' However nothing happens if I try emacs --batch --eval '(org-publish- project myproj)' ... Using batch mode shouldn't be causing any problems with the export process, is it possible that something in your personal config is not compatible with batch-mode ... I really did not want to create a separate init file as I was quite happy with existing dot emacs. You are right. Something was in the way. After I created a separate file that loads only necessary stuff, it published fine. Happy it works, if you find the offending element of your persona configuration you could remove it and continue to use your personal config for batch publishing. So weird emacs did not give any error before that something is not quite right. Is there an option for emacs so that some module can say it can't work in a batch mode? I don't believe that there is an automated way to raise such warnings. You could do a binary search through your init. Part of my question was if there is an easy way to find it other than by dichotomy? I guess not :-) I mean what is the point to make a separate init file other than speed? Your main init file is used to customize Emacs for interactive editing, many (if not most) of these settings won't apply to batch evaluation. By separating your personal customization from the project init file used for publishing it becomes possible to distribute your project with the publication init file without sharing your personal configuration. That makes it clear. Another weird issue I experience when batch-publishing is that even with a separate init file, I get different htmlization of babel blocks. I mean if I load emacs -nw -Q -l myinit.el project_part.org and publish that with C-c C-e P , then I get nicely colored babel block in HTML starting like pre class=src src-R span style=color: #cd00cd;library/span(RODBC) However, if I do emacs -Q --batch -l myinit.el -f 'org-publish-all' then I get something like pre class=src src-Rspan style=font-weight: bold; text-decoration: underline;library/span(RODBC) It seems odd to me that same config results in different outputs when publishing interactively and in a batch mode. I would prefer colored output. What should I pay attention to? I have a feeling that something is not loaded which does in interactive mode, or vice versa. Mikhail
Re: [O] How to get to work non-interactive publishing?
-Original Message- From: Eric Schulte [mailto:eric.schu...@gmx.com] Sent: Monday, May 21, 2012 1:11 PM To: Mikhail Titov Cc: emacs-orgmode@gnu.org Subject: Re: [O] How to get to work non-interactive publishing? ... Another weird issue I experience when batch-publishing is that even with a separate init file, I get different htmlization of babel blocks. I mean if I load emacs -nw -Q -l myinit.el project_part.org and publish that with C-c C-e P , then I get nicely colored babel block in HTML starting like pre class=src src-R span style=color: #cd00cd;library/span(RODBC) However, if I do emacs -Q --batch -l myinit.el -f 'org-publish-all' then I get something like pre class=src src-Rspan style=font-weight: bold; text-decoration: underline;library/span(RODBC) It seems odd to me that same config results in different outputs when publishing interactively and in a batch mode. I would prefer colored output. What should I pay attention to? I have a feeling that something is not loaded which does in interactive mode, or vice versa. The library used to colorize source code relies on the actual Emacs colorization mechanisms, which aren't available in batch mode. The best solution in this case is to save your colorized CSS information into a .css file with `org-export-htmlize-generate-css', and then use that file in all of your exports by setting `org-export-htmlize-output-type' to 'css. This way your fontification will be consistent across batch or regular export. Thank you for the explanation! Also I just noticed [1]. For now, I can just use -nw and (kill-emacs) after publishing is done and deal with CSS fine tuning later. [1] http://stackoverflow.com/questions/3591337/emacs-htmlize-in-batch-mode M.
Re: [O] How to get to work non-interactive publishing?
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Mikhail Titov Sent: Monday, May 21, 2012 4:06 PM To: 'Eric Schulte' Cc: emacs-orgmode@gnu.org Subject: Re: [O] How to get to work non-interactive publishing? ... The library used to colorize source code relies on the actual Emacs colorization mechanisms, which aren't available in batch mode. The best solution in this case is to save your colorized CSS information into a .css file with `org-export-htmlize-generate-css', and then use that file in all of your exports by setting `org-export-htmlize-output-type' to 'css. This way your fontification will be consistent across batch or regular export. Thank you for the explanation! Also I just noticed [1]. For now, I can just use -nw and (kill-emacs) after publishing is done and deal with CSS fine tuning later. Did not read careful enough about crontab. I'll go CSS way. [1] http://stackoverflow.com/questions/3591337/emacs-htmlize-in-batch-mode M.
Re: [O] Unable to Style RESULTS Blocks
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Thomas S. Dye Sent: Monday, May 21, 2012 4:40 PM To: Mikhail Titov Cc: emacs-orgmode@gnu.org; 'Jeff Rush' Subject: Re: [O] Unable to Style RESULTS Blocks Or even better, use LaTeX package minted [1]. Install all the stuff including pigments and add to you dot emacs the following (setq org-export-latex-listings 'minted) [1] http://code.google.com/p/minted/ In my experience, minted marks up exported source code blocks. I haven't seen it do the same for results blocks, but would be interested to learn if this is possible and how to make it work. My apologies. After reading your reply, I've realized that I misread the question. I thought it was about the background in block source export result. M.
Re: [O] How to get to work non-interactive publishing?
On 05/18/2012 07:19 AM, Eric Schulte wrote: I can publish project if I don’t use –-batch . So the following works just fine: emacs -nw --eval '(org-publish-project myproj)' However nothing happens if I try emacs --batch --eval '(org-publish-project myproj)' Does anybody have an idea how to pin point the problem? It just returns almost instantaneously with no output to stderr. I do use ESS, and I have lots of R code some of which is intentionally non-cached. I’m running GNU Emacs 24.1.50.2 (revno: 108254) with default orgmode if it makes any difference. Using batch mode shouldn't be causing any problems with the export process, is it possible that something in your personal config is not compatible with batch-mode? I have a number of projects in which I export using a batch Emacs process (generally from a make file). My Makefile rules tend to look like the following. EMACS=emacs BATCH_EMACS=$(EMACS) --batch -Q -l init.el document.org ... document.tex: document.org init.el $(BATCH_EMACS) -f org-export-as-latex where init.el contains all of the init necessary for the particular project. For a complete working example see the replication materials at http://www.jstatsoft.org/v46/i03. I really did not want to create a separate init file as I was quite happy with existing dot emacs. You are right. Something was in the way. After I created a separate file that loads only necessary stuff, it published fine. So weird emacs did not give any error before that something is not quite right. Is there an option for emacs so that some module can say it can't work in a batch mode? I mean what is the point to make a separate init file other than speed? M.
Re: [O] [babel] java headless support is missing for most graphing languages
On 05/19/2012 02:51 AM, Bastien wrote: I’ve noticed that at least ditaa and plantuml fail to evaluate with babel. What version of Org are you using? Hello, Bastien! It is 7.8.09 from default emacs 24.1.50.2 (revno: 108254). I have no X11 server running. M.
Re: [O] [babel] java headless support is missing for most graphing languages
On 05/19/2012 05:41 PM, Eric Schulte wrote: I’ve noticed that at least ditaa and plantuml fail to evaluate with babel. What version of Org are you using? Hello, Bastien! It is 7.8.09 from default emacs 24.1.50.2 (revno: 108254). I have no X11 server running. If I understand correctly you were able to execute successfully after adjusting your ditaa header arguments. Is that correct? Hi Eric! Yes, it works for ditaa. However I was unable to do that for plantuml as it does not respect :java alist (?) element in a similar fashion. I had to edit ob-plantuml.el for that as it has hardcoded java -jar so no way to insert anything in-between. If so then I believe ob-ditaa should be left as is, given that it works for most cases out of the box, and that you were able to easily adjust it to work without an X server. I am confident that for all folks working with orgmode remotely using, let's say, SSH connection without X11 tunneling, blocks calling such java tools will fail. So I'd call it a bug. Either there should be a way to supply :java to other similar languages, or headless option should be set by default. M.
Re: [O] [babel] java headless support is missing for most graphing languages
On 05/19/2012 07:39 PM, Eric Schulte wrote: I am confident that for all folks working with orgmode remotely using, let's say, SSH connection without X11 tunneling, blocks calling such java tools will fail. So I'd call it a bug. Either there should be a way to supply :java to other similar languages, or headless option should be set by default. I just added a :java option to plantuml which may be used in the same manner as the :java option for ditaa. I'm not sure which other languages would benefit from such an option, but I agree that each java language should provide a way to pass command line options to the java executable. Thank you! I quickly checked, indeed it is only ob-java, ob-ditaa, and ob-plantuml that use java. plantuml was the only one that missed java command line options. Nevertheless I'd say it won't hurt to have headless option set by default. I don't insist :-) M.
[O] [babel] java headless support is missing for most graphing languages
Hello! I’ve noticed that at least ditaa and plantuml fail to evaluate with babel. While for ditaa I can override :java list item with something like (setq org-babel-default-header-args:ditaa '((:results . file) (:exports . results) (:java . -Dfile.encoding=UTF-8 -Djava.awt.headless=true))) However plantuml is handling differently. Curiously enough it runs just fine without stdin/stdout redirection from the command line. However if I tried to use input/output redirection like in ob-plantuml.el , it complains like the following: Exception in thread main java.lang.InternalError: Can't connect to window server - not enough permissions. I propose to add by default “-Djava.awt.headless=true” to all “language” handlers supported by org-babel. I think it won’t hurt and will make working from CLI more enjoyable out of box. Mikhail
[O] How to get to work non-interactive publishing?
Hello! I can publish project if I don’t use –-batch . So the following works just fine:emacs -nw --eval '(org-publish-project myproj)' However nothing happens if I try emacs --batch --eval '(org-publish-project myproj)' Does anybody have an idea how to pin point the problem? It just returns almost instantaneously with no output to stderr. I do use ESS, and I have lots of R code some of which is intentionally non-cached. I’m running GNU Emacs 24.1.50.2 (revno: 108254) with default orgmode if it makes any difference. Thank you, Mikhail
Re: [O] [beamer] What is the easiest way to inject latex code between block environments?
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Mikhail Titov Sent: Tuesday, April 17, 2012 11:46 PM To: John Hendy Cc: emacs-orgmode@gnu.org Subject: Re: [O] [beamer] What is the easiest way to inject latex code between block environments? I would like to explicitly define heights for columns that contain blocks to be able to use \vfill [1] in-between blocks. And here comes the problem. I kind of need to inject Here is the dirty hack if someone else is also making posters with orgmode beamerposter. Unfortunately I know AWK better than elisp so don't condemn me :-) It does a perfect job for me. I don't know if can be hooked to pipe through before writing TeX output. 8-- ---8- #!/usr/bin/awk -f # Post-process orgmode output before final call to pdflatex while using beamerposter BEGIN { end_block = 0 # 1 if previous line was \end{block} columns = 0 # 1 if probably \vbox will be needed, 2 if it is needed RS = \r\n # I'm on Windows height = .98\\textheight # FIXME } /^\\frametitle{.+}$/ { next}# frametitle removal from the only frame /^\\begin{columns}/ { columns = 1 } /^\\begin{column}/ columns { columns = 2 } /^%% .+/ columns == 2 { print \\vbox to height {%; columns = 0 } # we rely on orgmode comments :( /^\\end{block}$/ { end_block = 1 } /^\\begin{block}/ end_block { print \\vfill; end_block = 0 } /^\\end{column}$/ end_block { print }%; columns = 1; end_block = 0 } { print } 8-- ---8- Mikhail
[O] [beamer] What is the easiest way to inject latex code between block environments?
Hello! I would like to explicitly define heights for columns that contain blocks to be able to use \vfill [1] in-between blocks. And here comes the problem. I kind of need to inject #+latex: \vfill before new block ** block2 but after \end{block} was emitted, not before. Is there an easy way to approach that? [1] http://tex.stackexchange.com/questions/15244/why-does-vfill-not-work-inside-a-beamer-column Mikhail
Re: [O] [beamer] What is the easiest way to inject latex code between block environments?
On Apr 17, 2012, at 8:23 PM, John Hendy jw.he...@gmail.com wrote: On Tue, Apr 17, 2012 at 8:19 PM, John Hendy jw.he...@gmail.com wrote: On Tue, Apr 17, 2012 at 8:08 PM, Mikhail Titov m...@gmx.us wrote: Hello! I would like to explicitly define heights for columns that contain blocks to be able to use \vfill [1] in-between blocks. And here comes the problem. I kind of need to inject #+latex: \vfill before new block ** block2 but after \end{block} was emitted, not before. Is there an easy way to approach that? Everything in org-mode gets treated as belonging to the parent headline. I don't think there's an easy way to do this except by tweaking the .tex file after export and re-compiling via LaTeX directly. That is how I'm proceeding now as I don't have time to hack now:( I could be wrong, but I believe it's the same principle as why the answer to these questions is No: -- http://orgmode.org/worg/org-faq.html#closing-outline-sections I wonder if a special case can be made via some extra property and some changes to orgmode code (or with hooks?). It should be possible as I need just quite specific command and not arbitrary text embedded. In other words... everything is always in some headline and what you're trying to do is escape a headline to enter text in kind of a no man's land. Sorry to say, I don't think it's possible. Actually, I was picturing doing this in between /frames/, not blocks. That is how beamerposter is organized. Since you're in a frame, you can just write the LaTeX syntax directly inside of your frame headline? I was trying to escape to orgmode from plain latex not to return that far back ;) M
[O] [latex, beamerposter] Muticolumn poster with multicolumn blocks or BMCOL and B_columns coexistance, is it possible?
All: I realized I have a need for 2 columns in a block. However when I tried to use B_columns and B_column besides BMCOL that were alreasy in there, it failed to generate proper LaTeX source. Below is the trimmed down example that fails to work properly on 7.8.09 . Do I miss something? #-*- buffer-file-coding-system: utf-8; TeX-master: t -*- #+Title: Test for multicolumn blocks in multicolumn poster #+LaTeX_CLASS: beamer #LaTeX_CLASS_OPTIONS: [presentation] #+BEAMER_FRAME_LEVEL: 1 #+STARTUP: beamer #BEAMER_HEADER_EXTRA: \usetheme{I6dv} %mlt} #\usecolortheme{default} #+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra) #+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC #+OPTIONS: toc:nil #+latex_header: \usepackage[orientation=landscape,size=custom,width=182.88,height=101.6,scale=1.5]{beamerposter} #+LATEX_HEADER: \renewcommand\maketitle{} # http://blog.zindel.org/?p=99 #+latex_header: \def\newblock{\hskip .11em plus .33em minus .07em} # C-c C-x C-c for column view * Poster ** Left :BMCOL:B_ignoreheading: :PROPERTIES: :BEAMER_col: 0.32 :BEAMER_env: ignoreheading :END: *** 1 Left :B_block: :PROPERTIES: :BEAMER_env: block :END: Columns :B_columns: :PROPERTIES: :BEAMER_env: columns :END: * .5 :B_column: :PROPERTIES: :BEAMER_env: column :END: - intro left. Comment stuff above till including Columns to make it compilable * .4 :B_column: :PROPERTIES: :BEAMER_env: column :END: - intro right. Comment stuff above. ** Center :BMCOL:B_ignoreheading: :PROPERTIES: :BEAMER_col: 0.32 :BEAMER_env: ignoreheading :END: *** 2 Center:B_block: :PROPERTIES: :BEAMER_env: block :END: - Central block ** Right :BMCOL:B_ignoreheading: :PROPERTIES: :BEAMER_col: 0.32 :BEAMER_env: ignoreheading :END: *** 3 right block :B_block: :PROPERTIES: :BEAMER_env: block :END: - hello Mikhail
Re: [O] [beamerposter] How do I suppress frame title?
On 04/13/2012 12:04 AM, Bastien wrote: I’m trying to use orgmode with beamerposter LaTeX package [1] to make a poster. I’ve managed to remove toc and override \maketitle . However I can’t seem to find a way to suppress a title from the only high level section * Poster. I've tried to add :B_ignoreheading: via C-c C-b i with no success :( Unless I missed something, there is no option to suppress this frame title, sorry. I just found a quick workaround - to use * that is asterisk followed by a space. It still generates frame but does not insert any title. I feel like it might be even a bug. But it works since it is the only frame I have. I was trying to wrap frametitle ( subtitle) generation in org-beamer.el into conditional like below but I failed miserably at it. (if (not (equal (cdr (assoc BEAMER_env props)) ignoreheading)) (progn (cons T (if (string-match \\S- text) \n\\frametitle{%s} )) (cons S (if (string-match text) \n\\framesubtitle{%s} )) )) M.
Re: [O] [beamerposter] How do I suppress frame title?
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of suvayu ali Sent: Friday, April 13, 2012 3:52 AM To: Mikhail Titov Cc: Bastien; emacs-orgmode@gnu.org Subject: Re: [O] [beamerposter] How do I suppress frame title? I just found a quick workaround - to use * that is asterisk followed by a space. It still generates frame but does not insert any title. I feel like it might be even a bug. But it works since it is the only frame I have. I was trying to wrap frametitle ( subtitle) generation in org-beamer.el into conditional like below but I failed miserably at it. (if (not (equal (cdr (assoc BEAMER_env props)) ignoreheading)) (progn (cons T (if (string-match \\S- text) \n\\frametitle{%s} )) (cons S (if (string-match text) \n\\framesubtitle{%s} )) )) Your solution works, and I have used it before to get a backup slide marker saying just bakup slides in the centre before. Do you mean former or latter one? When I try to change org-beamer.el as described above, I get Invalid format operation %a since I do something badly wrong. I was trying to mess with this [1] code. I don't know elisp well enough. I guess I can't do it that way. [1] http://orgmode.org/w/?p=org-mode.git;a=blob;f=lisp/org-beamer.el;h=966db82debdf21bad0777372c06bc7cb84735cfb;hb=HEAD#l274 But I think there can be a cleaner solution with pre/post-process hooks. For an example of such a hook with LaTeX export, see: https://github.com/suvayu/.emacs.d/blob/master/org-mode-config.el#L234 Here I ignore headings for bibiliographies and appendices. I am afraid I don't quite follow your code. I think you deal with plain latex export while mine question deals with some beamer details. M.
[O] [beamerposter] How do I suppress frame title?
Hello! I’m trying to use orgmode with beamerposter LaTeX package [1] to make a poster. I’ve managed to remove toc and override \maketitle . However I can’t seem to find a way to suppress a title from the only high level section * Poster. I've tried to add :B_ignoreheading: via C-c C-b i with no success :( Is it possible? It is not a big deal just to remove frametitle from the final version but nevertheless. [1] http://www-i6.informatik.rwth-aachen.de/~dreuw/latexbeamerposter.php Mikhail
Re: [O] Links to Gnus articles don't export correctly
Jason: I just noticed that behavior. Take a look at [[http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-17-2-2][latex export tutorial]]. Just override defaults from org-gnus.el #+begin_src lisp (org-add-link-type gnus 'org-gnus-open) #+end_src -- Mikhail
Re: [O] Export all clocks or find last clock out. Is it possible?
-Original Message- From: Bernt Hansen [mailto:be...@norang.ca] Sent: Thursday, December 15, 2011 5:00 PM To: Mikhail Titov Cc: emacs-orgmode@gnu.org Subject: Re: [O] Export all clocks or find last clock out. Is it possible? I'm not sure what happened, but now I see only Log mode is on Log mode is off when I press `v c` in agenda :( Any ideas what is messed up? Is your agenda limited by tags or a restriction that has no log data? Just to let you know. Somehow I got wrong org-agenda-files (Saving emacs config does that?). Everything is working as expected after I removed corresponding line from dot emacs as I have proper one included from my customizations in myorg.el loaded earlier. Thanks again! M.
Re: [O] Export all clocks or find last clock out. Is it possible?
-Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode- bounces+mlt=gmx...@gnu.org] On Behalf Of Mikhail Titov Sent: Sunday, December 11, 2011 5:20 PM To: Bernt Hansen Cc: emacs-orgmode@gnu.org Subject: Re: [O] Export all clocks or find last clock out. Is it possible? You can view your clocked items in the agenda agenda view / show week view / / validate clocks / / / / / /\ C-c a a w v c Thanks a lot! I was able to rebuild agenda for the year and check clocks! Perhaps I missed details on agenda commands while I was reading manual. Just `v c` is what I was missing. I'm not sure what happened, but now I see only Log mode is on Log mode is off when I press `v c` in agenda :( Any ideas what is messed up? M.
Re: [O] Export all clocks or find last clock out. Is it possible?
On 12/11/2011 07:05 AM, Olaf Dietsche wrote: As already suggested by Puneeth `org-clock-goto' (with prefix: C-u C-c C-x C-j) lists the most recently used clocks and C-u C-c C-x C-j 1 jumps to the last clocked task. For some reason it also shows empty Recent Tasks list :( `org-clock-history-length' sets the number of tasks shown. (custom-set-variables '(org-clock-history-length 28)) I evaluated this expression. But it does not make any difference. Besides the org manual, Bernt Hansen has an excellent website http://doc.norang.ca/org-mode.html covering his workflow with orgmode. Look out for `org-clock-goto' in 1.5 Key Bindings and 15.19 Speed commands. I do have some of Bernt's commands in my dot emacs. As I said, while I'm working on a file, everything is nice: I can jump to most recent task with F11 even when it is clocked out. But not when I open an old file. Also I do have the following in dot emacs (setq org-clock-persist 'history) (org-clock-persistence-insinuate) But I feel like it is only for most recent file that has no clock out yet. I'm not consistent with org-mode and I use it for only one project for timing so far :( Most of the time I spend outside of emacs and I simply forget to clock a task or even start emacs sometimes. I feel like I'm on my own if I don't follow org-mode rules all the time and I want to back fill things I've done in the past. Mikhail
Re: [O] Export all clocks or find last clock out. Is it possible?
On 12/11/2011 04:25 PM, Bernt Hansen wrote: Mikhail Titov m...@gmx.us writes: Also how can I navigate to the last clock out? I know I can do some exercise with awk or perl, but perhaps there should be a better solution. I tried to google but I can't find anything :( I know I can do some exercise with awk or perl, but perhaps there should be a better solution. I tried to google but I can't find anything :( You can view your clocked items in the agenda agenda view / show week view / / validate clocks / / / / / /\ C-c a a w v c Thanks a lot! I was able to rebuild agenda for the year and check clocks! Perhaps I missed details on agenda commands while I was reading manual. Just `v c` is what I was missing. Can I see somehow see an agenda for previous month after I pressed `v m`? I had to switch to year view in my case. Mikhail
[O] Export all clocks or find last clock out. Is it possible?
Hello! I wonder if I can see all clocks in a table or export them somehow as csv or alike? Also how can I navigate to the last clock out? I know I can do some exercise with awk or perl, but perhaps there should be a better solution. I tried to google but I can't find anything :( -- Mikhail
Re: [O] Export all clocks or find last clock out. Is it possible?
On 12/11/2011 01:10 AM, Puneeth Chaganti wrote: On 12/11/11, Mikhail Titov m...@gmx.us wrote: Hello! I wonder if I can see all clocks in a table or export them somehow as csv or alike? Look at `org-clock-report' function [ http://orgmode.org/manual/The-clock-table.html ] This does not show all clocks. I've tried clock table with :timestamp. It shows task time and deadlines and alike but not all clock-in clock-out for a task. Also how can I navigate to the last clock out? `org-clock-goto' function can do this for you. Use `M-x org-clock-goto' (By default, it is bound to C-c C-x C-j) This results in No active or recent clock task. Generally it works find while I'm working on document. But if I open old document, it does not work for some reason :( I've tried both your suggestions before and that is why I'm asking here in the list. M.
Re: [O] Regression: Empty TODO lines
On 11/13/2011 05:30 AM, Carsten Dominik wrote: Hi Nicolas, commit dfcb6faef11a2439b56b18a6289803361d402130 (Provide more consistent regexps for headlines) makes the global TODO list fail on headlines with a TODO keyword but no text following: * TODO This one works * TODO This one fails (note, there is not even a space after TODO. While I agree that a TODO line with not text is not good, I think it should not break the TODO list view. I am attaching the backtrace. I have a related question. How do I escape TODO? I mean if I want to have a beamer frame named this way, how can I do that? Last time I ended up writing ** ToDo Mikhail
Re: [O] How to reuse page keywords for LaTeX with pdfkeywords and hyperref package?
Bastien bzg at altern.org writes: Hi Mikhail, Mikhail Titov mlt at gmx.us writes: In case someone else also wants page keywords to appear in latex export. Here is the link to original thread http://lists.gnu.org/archive/html/emacs-orgmode/2011-03/msg01429.html . There is a patch at the bottom that does that. It assumes that hyperred package is used and doesn't check that! Yes, hyperref is in ̀org-export-latex-default-packages-alist' and is available. I'm not sure if I'm doing it right as I don't know lisp and emacs much. I pushed a commit with a slightly adapted version of your patch. Please check it does the right thing for you. Yes! It does exactly what I've wanted and even adds application name to PDF. Sweet! Further improvements in this area: have a defcustom allowing the user to select what hyperref options he wants in the .tex output. Maybe you can improve your ELisp trying to provide a patch for this? I'm afraid I don't get it. I can see org-export-latex-hyperref-format in org-latex.el . Isn't it already in there? Mikhail
Re: [O] babel, beamer: Prevent apostrophe/single quote mangling, so examples can be reused from PDF
-Original Message- From: Eric Schulte [mailto:schulte.e...@gmail.com] Sent: Friday, November 11, 2011 8:21 PM To: Mikhail Titov Cc: emacs-orgmode@gnu.org Subject: Re: [O] babel, beamer: Prevent apostrophe/single quote mangling, so examples can be reused from PDF I have seen a similar issue in which code *executed* by R returns weird nasty quotes. The following works for me to remove these quotes before the confuse TeX. ;; Replace nasty single-quotes returned by R. (add-hook 'org-export-latex-final-hook (lambda () (replace-regexp ’ '))) Hope this helps -- Eric Probably it was another issue. I've double checked in another text editor that I'm getting correct apostrophes in tex output. I tried with or without your code in dot emacs (I restarted emacs). It is something in LaTeX or some package that triggers it:( I've came across this http://www.cs.sfu.ca/~ggbaker/reference/characters/#single . It says that for typewriter font LaTeX won't substitute apostrophe with closing single quote. However I thought that verbatim as produced by babel implies typewriter font. Mikhail
[O] Is LaTeX pdf export that uses pgfSweave possible?
Hello! First of all I’m not good at lisp as of now. I’d like to have an extra export option when I press C-c C-e that would create dotRnw file instead of dottex, pass it through pgfSweave in running R session. I have the following to use pgfSweave in R session: ---8---8--- (defun ess-swv-pgfweave () Run pgfSweave on the current .Rnw file. (interactive) (ess-execute library(pgfSweave)) (ess-swv-run-in-R pgfSweave)) (define-key noweb-minor-mode-map \M-ns 'ess-swv-pgfweave) (easy-menu-add-item noweb-minor-mode-menu '(Sweaving, Tangling, ...) [pgfSweave ess-swv-pgfweave t]) ---8---8--- So I thought I'd somehow hook up altogether as I like an idea of folding things while make Beamer slides, but same time I like neatness of pgfSweave... I don't know if there might be problems passing through constructs like stuff= stuff @ untouched into dotRnw file. I'm aware of babel for R but I can't use LaTeX in plots with it :( Mikhail
Re: [O] Table alignment
1. Rename .emacs to renamed.el 2. Start vanilla emacs 3. Open your renamed.el file 4. Select region of intereset 5. Evaluate region with M-x eval-region 6. See if it is still working 7. Go to 4 On 08/31/2011 12:46 AM, Vikas Rawal wrote: There is something in my .emacs that messes up table alignment in org. Have been struggling to find it. If I remove my .emacs, table alignment is fine. I have tried commenting parts of .emacs to identify the offending lines. But somehow I am missing it. A copy of my .emacs is at: http://dl.dropbox.com/u/10112644/dotemacs Will be grateful if somebody could help? Is there a way I can load my .emacs segment by segment and see when the problem appears? Vikas
Re: [O] How to reuse page keywords for LaTeX with pdfkeywords and hyperref package?
In case someone else also wants page keywords to appear in latex export. Here is the link to original thread http://lists.gnu.org/archive/html/emacs-orgmode/2011-03/msg01429.html . There is a patch at the bottom that does that. It assumes that hyperred package is used and doesn't check that! I'm not sure if I'm doing it right as I don't know lisp and emacs much. Mikhail From ee027f75db3df6b16ccb2e8f96916fe7274655f3 Mon Sep 17 00:00:00 2001 From: Mikhail Titov m...@gmx.us Date: Sat, 27 Aug 2011 11:59:06 -0500 Subject: [PATCH] Set keywords and subject fields in pdf --- lisp/org-latex.el | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 17626b5..4c35528 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1391,6 +1391,10 @@ OPT-PLIST is the options plist for current buffer. (let ((toc (plist-get opt-plist :table-of-contents)) (author (org-export-apply-macros-in-string (plist-get opt-plist :author))) +(description (org-export-apply-macros-in-string + (plist-get opt-plist :description))) +(keywords (org-export-apply-macros-in-string + (plist-get opt-plist :keywords))) (email (replace-regexp-in-string _ _ (org-export-apply-macros-in-string @@ -1428,6 +1432,15 @@ OPT-PLIST is the options plist for current buffer. (format-time-string (or (plist-get opt-plist :date) org-export-latex-date-format))) + ;; add pdf things + \\hypersetup{\n + ;; pdfinfo={\n + (format pdfkeywords={%s},\n + (org-export-latex-fontify-headline keywords)) + (format pdfsubject={%s}\n + (org-export-latex-fontify-headline description)) + ;; }\n + }\n ;; beginning of the document \n\\begin{document}\n\n ;; insert the title command -- 1.7.4.1
RE: [O] How to reuse page keywords for LaTeX with pdfkeywords and hyperref package?
Bastien: Thank you! I understand that it is not possible right now through simple settings. However hyperref is getting added to packages alist at some point. Is there a way to dereference org-export-page-keywords let's say in my custom LaTeX class definition in my dot emacs file or even in source code. Or is the problem in that that variable is not defined that time? Mikhail -Original Message- From: Bastien Guerry [mailto:bastiengue...@googlemail.com] On Behalf Of Bastien Sent: Tuesday, March 22, 2011 4:54 AM To: Mikhail Titov Cc: 'Org mailing list' Subject: Re: [O] How to reuse page keywords for LaTeX with pdfkeywords and hyperref package? Hi Mikhail, Mikhail Titov m...@gmx.us writes: I would like to be able to have same keywords for both HTML and PDF output. I was a bit surprised that it is not there yet. I’m not a lisp user:( Could someone suggest what needs to be done to use org-export-page-keywords to set the value of pdfkeywords option of hyperref LaTeX package? This is not possible right now. You can do it manually by removing hyperref from the `org-export-latex-default-packages-alist' variable, and by adding such a header in your org file: #+LATEX_HEADER: \usepackage[dvips, bookmarks, colorlinks=false, pdftitle={An example PDF file from LaTeX}, pdfauthor={Diego Santa Cruz}, pdfsubject={From LaTeX to PDF}, pdfkeywords={PDF, LaTeX, hyperlinks, hyperref}]{hyperref} But your request makes sense, I might implement it someday. Best, -- Bastien
[O] How to reuse page keywords for LaTeX with pdfkeywords and hyperref package?
Hello all! I would like to be able to have same keywords for both HTML and PDF output. I was a bit surprised that it is not there yet. I’m not a lisp user:( Could someone suggest what needs to be done to use org-export-page-keywords to set the value of pdfkeywords option of hyperref LaTeX package? Mikhail
RE: [O] broken latex export of footnote from a table cell?
Thank you, Nicholas! That explains everything. I wonder how I didn't come across the link you mentioned before. I should have tried that simply in LaTeX. Mikhail -Original Message- From: emacs-orgmode-bounces+mlt=gmx...@gnu.org [mailto:emacs-orgmode-bounces+mlt=gmx...@gnu.org] On Behalf Of Nick Dokos Sent: Saturday, March 12, 2011 1:32 AM To: Mikhail Titov Cc: nicholas.do...@hp.com; emacs-orgmode@gnu.org Subject: Re: [O] broken latex export of footnote from a table cell? Mikhail Titov m...@gmx.us wrote: Hello! This is my first message. I'm excited about org-mode! Thank you for = developing such a great tool! However, I found out that I can't have a footnote in a table cell. If I = export such document to LaTeX, I get misplaced footnote:( I'm running MS = Windows XP SP3 32 bit. -cut- #+Title: orgmode to latex epic fail, footnote in a table cell Works here [fn:: This is a good footnote]. Does it? #+LATEX: \begin{table}[h] | /org-version/ | /emacs-version/ | /Why can't I use bold here with */ | | |---+-+| | 7.5 | 23.2.1 | some text[fn:: Why am I here?] | #+TBLFM: $1=3D'(message org-version)::$2=3D'(message emacs-version) #+LATEX: \end{table} Some text here. -cut- Footnotes in tables are difficult. Even if you leave out org completely and just look at latex, things are far from simple. There is a FAQ and an answer on this topic here: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=footintab As you can see, things are not simple even if you write in latex. None of this is implemented in org. Best advice: don't use footnotes in tables. If you have to use them, add them in a post-export pass, possibly by formatting the table outside of org and including it from a separate file. HTH, Nick
[O] broken latex export of footnote from a table cell?
Hello! This is my first message. I'm excited about org-mode! Thank you for developing such a great tool! However, I found out that I can't have a footnote in a table cell. If I export such document to LaTeX, I get misplaced footnote:( I'm running MS Windows XP SP3 32 bit. -cut- #+Title: orgmode to latex epic fail, footnote in a table cell Works here [fn:: This is a good footnote]. Does it? #+LATEX: \begin{table}[h] | /org-version/ | /emacs-version/ | /Why can't I use bold here with */ | |---+-+| | 7.5 | 23.2.1 | some text[fn:: Why am I here?] | #+TBLFM: $1='(message org-version)::$2='(message emacs-version) #+LATEX: \end{table} Some text here. -cut- Mikhail