Re: [O] [PATCH] Improve org-table-convert-region in order to use any string as separator
Hi Nicolas, However `org-table-convert-region' already supports regexp as a parameter in development version, so your patch is not needed. OK, great. Thank you. Do you know when this will be merged into maint and/or accessible via elpa (I'm used to use the stable version from elpa or the maint branch)? Regards, Francesco
[O] [org-babel] Problem using result of code block with eval no
Hi, I have an issue when I want to use the result of a code block which I executed manually (C-c C-v C-e) and then marked with ':eval no'. Here's what happen when I evaluate the following ECM with C-c C-v C-b: - the Result1 code block uses the table1 result as input and returns the expected output; - the Result2 code block which should use the table2 result as input, gets nil instead -- which seems wrong. Any help is welcome. Best regards, Francesco --8---cut here---start-8--- * Table1 #+name: table1 #+begin_src emacs-lisp (setq my-table (quote ((0 first) (1 second) (A third #+end_src #+results: table1 | 0 | first | | 1 | second | | A | third | * Result1 #+header: :var data=table1 #+begin_src emacs-lisp data #+end_src #+results: | 0 | first | | 1 | second | | A | third | * Table2 #+name: table2 #+begin_src emacs-lisp :eval no (setq my-table (quote ((0 first) (1 second) (A third #+end_src #+results: table2 | 0 | first | | 1 | second | | A | third | * Result2 #+header: :var data=table2 #+begin_src emacs-lisp data #+end_src #+results: : nil --8---cut here---end---8---
[O] [PATCH] Improve org-table-convert-region in order to use any string as separator
Hi, European CSV files may use semi-colon as separator. As it was missing in `org-table-convert-region', I improved it in order to define any string as separator. Best regards, Francesco From: Francesco Pizzolante f...@missioncriticalit.com Date: Tue, 7 Apr 2015 11:53:45 +0200 Subject: [PATCH] Improve org-table-convert-region in order to use any string as separator * org-table.el (org-table-convert-region): Improve `org-table-convert-region' in order to use any string as separator. Remove useless line of code. --- lisp/org-table.el | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/org-table.el b/lisp/org-table.el index 30a66c9..985a877 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -1,6 +1,6 @@ ;;; org-table.el --- The table editor for Org-mode -;; Copyright (C) 2004-2014 Free Software Foundation, Inc. +;; Copyright (C) 2004-2015 Free Software Foundation, Inc. ;; Author: Carsten Dominik carsten at orgmode dot org ;; Keywords: outlines, hypermedia, calendar, wp @@ -548,6 +548,7 @@ following values: '(4) Use the comma as a field separator '(16)Use a TAB as field separator integer When a number, use that many spaces as field separator +string When a string, use that string as field separator nil When nil, the command tries to be smart and figure out the separator in the following way: - when each line contains a TAB, assume TAB-separated material @@ -585,15 +586,17 @@ nil When nil, the command tries to be smart and figure out the ((looking-at [ \t]*,) (replace-match | )) (t (beginning-of-line 2 (setq re (cond - ((equal separator '(4)) ^\\|\?[ \t]*,[ \t]*\?) ((equal separator '(16)) ^\\|\t) ((integerp separator) (if ( separator 1) (user-error Number of spaces in separator must be = 1) (format ^ *\\| *\t *\\| \\{%d,\\} separator))) +((stringp separator) + (format ^\\|%s separator)) (t (error This should not happen - (while (re-search-forward re end t) - (replace-match | t t))) + (let (case-fold-search) +(while (re-search-forward re end t) + (replace-match | t t (goto-char beg) (org-table-align))) -- 2.1.4
Re: [O] [BUG] S-tab shows sub-headlines of archived headlines when org-inlinetask is loaded
Hi Nicolas, Fixed in 03e81f0d240271d072fd155d41e59b6b353abaa9. Thank you. I just tested it and it works great. Thanks a lot! Regards, Francesco
Re: [O] [BUG] S-tab shows sub-headlines of archived headlines when org-inlinetask is loaded
Hi, I would like to bump up this thread. I'm still having this issue while using the latest ELPA version of org-plus-contrib. Thanks for your help. Regards, Francesco Hi, Under normal cirscumstances, S-tab does not show up sub-headlines of archived headlines. When 'org-inlinetask' is loaded, the behavior of S-tab changes and it shows up sub-headlines of archived headlines (which is not what we expect). Here's an ECM in order to easily reproduce the issue: #+TITLE: ECM S-TAB * Problem When org-inlinetask is loaded, S-TAB displays the sublevels of ARCHIVE'd tasks! * Example * DONE This task is DONE, but well archived :ARCHIVE: ** Subpoint A (BUG IF YOU SEE ME!) ** Subpoint B (BUG IF YOU SEE ME!) * DONE This task is DONE, but not archived ** Subpoint A ** Subpoint B Thanks for your help. Regards, Francesco
Re: [O] [bug] Alignment bug in clock tables
Hi Stormking, Sorry for my very late reply: I thank you very much for your workaround which enables me to have well aligned clock tables. I also take the opportunity to bump up this thread. I think you correctly spotted the exact cause of our issue. Here's what you say in a previous message: I'm having this problem, too. The code that aligns the clocktable seems to count the \emsp entity as five characters. But with pretty entities turned on, it's displayed as only one character. To make it short: the alignment code counts \emsp as 5 chars, while it is displayed as one. I recall the small screencast here: http://screencast.com/t/qpmxDV8R543G Anyone to fix this in the code? Thanks. Regards, Francesco
Re: [O] Exporting columnviews
Hi Nicolas, Rasmus ras...@gmx.us writes: Nicolas Goaziou m...@nicolasgoaziou.fr writes: I introduced \nbsp at some point, but there were complaints from users not prettifying entities. So I guess \star is not an option either. Don't worry I use \nbsp sometimes! For what reason do people not want to use entities? Speed? Because it breaks table alignement and looks ugly if, e.g., \nbsp doesn't appear as . I think the issue is the opposite: the table is not aligned if \nbsp appears as space (as explained by Stormking in a different thread): ┌ http://article.gmane.org/gmane.emacs.orgmode/91379 | │ The code that aligns the clocktable seems to count the \emsp entity as │ five characters. But with pretty entities turned on, it's displayed as │ only one character. └ Any idea how to fix it? Thanks, Francesco PS Here's a small screencast where you can see the alignment issue: http://screencast.com/t/qpmxDV8R543G
Re: [O] [bug] Alignment bug in clock tables
Hi Joost, I reported this on September 2nd too. Hitting C-c C-c inside the table fixes the formatting. Also moving to a position inside the table and doing: M-x org-table-align fixes the formatting. Hence I tried to create a new formatter function in order to re-align after writing the table: (defun my-formatter( ipos tables params ) (progn (org-clocktable-write-default ipos tables params) (forward-line 2) (org-table-align) ) ) and install this as the formatter, but it didn't help. If it would have helped, I could have fixed the default table-writer by adding (org-table-align). Anyone an idea? On my side, I tried another *workaround*: I call (org-table-align) in a before-save-hook. This way, all tables are correctly aligned when I save. I simply call: (org-table-map-tables 'org-table-align t) But this only works when you save and thus only for file buffers (and you can still see the misalignment when you create/update the dynamic blocks). Currently I have no solution for agenda buffers when displaying clock tables. Any hint to fix this is welcome. Regards, Francesco
[O] [bug] Alignment bug in clock tables
Hi, I'm having an alignment issue in clock tables, both in the agenda and in dynamic blocks. By default, \emsp is displayed in clock tables for level 2 (or above) to indent headings. To avoid that, I set the variable `org-pretty-entities' to t, and in this case the alignment of the table is broken when you regenerate it. I currently see no solution if I want correct alignment in clock tables without seeing \emsp. Any idea how to achieve that? Here's a small screen capture that shows the issue: http://screencast.com/t/qpmxDV8R543G Thanks. Francesco
Re: [O] [BUG] Entries from Org code blocks appear in agenda
Hi Nicolas, I noticed that entries from Org code blocks are erroneously displayed in the agenda. Here's a very simple Org example in order to reproduce it (my-simple-test.org): * Test #+BEGIN_SRC org ,SCHEDULED: 2014-09-04 Thu 10:00 #+END_SRC This is a known bug that would require to use the parser in org-agenda.el for a proper fix. Meanwhile, I wrote a workaround. Would you mind testing it (note: it applies on maint, probably not on master without conflicts). Thanks for the patch. I just applied and tested it on org-plus-contrib-20140908 from Elpa but the workaround does not work as I can still see the erroneous headings appearing in the agenda. Regards, Francesco
[O] Disabling figure numbers
Hi, Currently, with the latest Elpa version, when exporting Org buffers to HTML generates figure numbers for images having a caption. How can I disable this behavior in order to get images with captions but without figure numbers? Thanks a lot. Regards, Francesco
[O] [BUG] Entries from Org code blocks appear in agenda
Hi, I noticed that entries from Org code blocks are erroneously displayed in the agenda. Here's a very simple Org example in order to reproduce it (my-simple-test.org): --8---cut here---start-8--- * Test #+BEGIN_SRC org ,SCHEDULED: 2014-09-04 Thu 10:00 #+END_SRC --8---cut here---end---8--- The minimal Emacs configuration used to reproduce the issue is (my-simple-test.el): --8---cut here---start-8--- (setq org-agenda-files '(~/my-simple-test.org)) --8---cut here---end---8--- And Emacs (my version is 24.3.1) is started with the following command: --8---cut here---start-8--- emacs -Q -l my-simple-test.el --8---cut here---end---8--- If you run M-x org-agenda a, you can see that the Test entry appears in today's agenda, which is, of course, wrong (see issue here: http://screencast.com/t/0bhud8qPxxj). Regards, Francesco
[O] [BUG] S-tab shows sub-headlines of archived headlines when org-inlinetask is loaded
Hi, Under normal cirscumstances, S-tab does not show up sub-headlines of archived headlines. When 'org-inlinetask' is loaded, the behavior of S-tab changes and it shows up sub-headlines of archived headlines (which is not what we expect). Here's an ECM in order to easily reproduce the issue: --8---cut here---start-8--- #+TITLE: ECM S-TAB * Problem When org-inlinetask is loaded, S-TAB displays the sublevels of ARCHIVE'd tasks! * Example * DONE This task is DONE, but well archived :ARCHIVE: ** Subpoint A (BUG IF YOU SEE ME!) ** Subpoint B (BUG IF YOU SEE ME!) * DONE This task is DONE, but not archived ** Subpoint A ** Subpoint B --8---cut here---end---8--- Thanks for your help. Regards, Francesco
Re: [O] Fontification of org code block not printed
Hi Bastien, This is the fault of Org. I fixed this in master by removing `org-block-background'. This is radical but I think this is really better: http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=f8b42e8 Sebastien, let's think about another way of getting a color for the background, if that's really needed. I have to say that I'm surprised about the way this issue has been fixed. Let me tell you why. 1) The fix 'simply' removes a useful Org functionality, which I use for 3 years now, without providing any alternative. 2) The first approach would have been to try to fix the issue instead of completely removing the functionality which, as I already said, is present since a long time. 3) A possible workaround, without completely removing org-block-background, would have been to add a variable in order for people to activate (or de-activate) it and use it (or avoid the issue). 4) To conclude, according to Stefan Monnier (see his answser from 2014-07-29 11:38), the issue is due to a bug in ps-def.el and not in Org: It's a problem in the ps-def.el code which handles the `face' property in a naive way: it fails to merge the various active face properties (from the various overlays and the text-property). Could you, then, put org-block-background back and let the fix be done in Emacs and not in Org? Thanks a lot. Regards, Francesco
[O] Centering graphics in LaTeX export
Hi, Here's a small patch that enables centering graphics in LaTeX exports (as it already exists for tables). Currently, the only way to center images is by adding a caption (which is not always needed) or by adding #+begin_center / #+end_center around images (but it must be done for every image as we cannot define a default behavior for centering images). Thanks to this patch: - an image can be centered by adding the ':center t' attribute in a '#+ATTR_LATEX' directive (as for tables); - default centering of images can be achieved by setting the 'org-latex-images-centered' variable to t. Could you please apply this patch? Thanks. Best regards, Francesco Pizzolante --- C:\Users\fpz\Documents\home\.emacs.d\elpa\org-plus-contrib-20140512\ox-latex.el 2014-05-15 17:09:08.0 +0200 +++ C:\Users\fpz\Documents\home\.emacs.d\elpa\org-plus-contrib-20140505 - Copy\ox-latex.el 2014-05-15 17:11:25.0 +0200 @@ -401,12 +401,17 @@ Default option for images. :group 'org-export-latex :version 24.4 :package-version '(Org . 8.0) :type 'string) +(defcustom org-latex-images-centered t + When non-nil, images are exported in a center environment. + :group 'org-export-latex + :type 'boolean) + (defcustom org-latex-image-default-width .9\\linewidth Default width for images. This value will not be used if a height is provided. :group 'org-export-latex :version 24.4 :package-version '(Org . 8.0) @@ -1710,12 +1715,15 @@ ((eq float 'figure) (format [%s] org-latex-default-figure-position)) (t (comment-include (if (plist-get attr :comment-include) % )) ;; It is possible to specify width and height in the ;; ATTR_LATEX line, and also via default variables. +(centerp (if (plist-member attr :center) + (plist-get attr :center) + org-latex-images-centered)) (width (cond ((plist-get attr :width)) ((plist-get attr :height) ) ((eq float 'wrap) 0.48\\textwidth) (t org-latex-image-default-width))) (height (cond ((plist-get attr :height)) ((or (plist-get attr :width) @@ -1749,18 +1757,21 @@ ;; - include the image with \includegraphics. (when (org-string-nw-p width) (setq options (concat options ,width= width))) (when (org-string-nw-p height) (setq options (concat options ,height= height))) (setq image-code - (format \\includegraphics%s{%s} + (format %s\\includegraphics%s{%s}%s +(if centerp {\\centering\n ) (cond ((not (org-string-nw-p options)) ) ((= (aref options 0) ?,) (format [%s](substring options 1))) (t (format [%s] options))) - path)) + path +(if centerp \\par}\n ) +)) (when (equal filetype svg) (setq image-code (replace-regexp-in-string ^includegraphics \\includesvg image-code nil t)) (setq image-code (replace-regexp-in-string \\.svg}
[O] Issue when using cache property set to yes
Hi, I'm having issues using the cache property set to yes. The problem is the following (please see http://screencast.com/t/8sIMfL0YHAj): I've added a few directives (center, width, caption) in order to customize the output of my R code block. As soon as I change my code block and execute it, everything that was between the code block and the 'results' line gets lost (losing all customizations and breaking the centering). Thanks a lot for your help. Regards, Francesco
Re: [O] [PATCH] Add catch-up all LaTeX errors
Hi Marcin, This is rather a workaround, but don't use Adobe Reader, use any other PDF viewer instead. (IIRC, there's also a workaround that makes Adobe Reader behave correctly, i.e. not lock the pdf file, but I can't find it now. See here, for example: http://stackoverflow.com/questions/4910029/possible-to-make-adobe-reader-not-hold-a-file-lock-on-windows) (I, for one, did welcome our new Linux overlords more than a decade ago, and don't experience that problem at all, using first xpdf, and now evince.;)) Thanks for your reply and your suggestion. I already use SumatraPDF (as suggested in your link) since a long time now to avoid this locking problem and it works very well. I'm taking this locking issue as an example to show that some errors are not catched up when we export to LaTeX. Best Regards, Francesco
Re: [O] [PATCH] Add catch-up all LaTeX errors
Hi Nicolas, IOW, it cannot tell the difference between a successful export and an export failure with an already existing PDFFILE. This is not true as this code checks for the `errors' variable in all cases. With an already existing PDFFILE, you will end up with this message: 'Process completed with errors: ...'. If file.pdf exists before the export, you will always get Process completed, even if the current export was a total failure (e.g., no file produced). IIUC, you're really looking after a way to know if a pdf file was really produced. Reporting Process completed with errors : [unknown error] will certainly not help on this you because some errors are not fatal (i.e., they are skipped and the pdf file is still produced). From my point of view, the issue comes from the fact that the `errors' variable is not correctly filled in with errors from the LaTeX log file. [...] While the wikibooks reference (http://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings) tells that to be sure to catch *all* errors, we have to check for any line beginning with '!'. I agree, but this is not sufficient, see below. Then, in the case where the `errors' variable would effectively contain any error from the log file, the code you mention above would work in any case. That's why I started with this patch (*and it works*): It depends on what you define as working. We're talking about two different things. I think a better error system should report: 1. a PDF file not produced (or updated), 2. a PDF file produced with errors, 3. a PDF file produced with warnings (maybe), 4. a PDF file produced cleanly. 4 already works. Your patch improves 2, but 1 is still wrong. OK, I understand your point: the whole process has to be reviewed and improved. But, at least, my patch (or something similar) goes in the right direction providing a better catching of errors from the log file. Isn't it? Could we at least apply this patch (or a better one) that fixes this single precise issue (catching all errors from the log file)? Thanks for your help. Regards, Francesco
Re: [O] [PATCH] Add catch-up all LaTeX errors
Hi Charles, First, I have subsequent messages in this thread and the discussion. Should Nick's observation, that IOW, it cannot tell the difference between a successful export and an export failure with an already existing PDF also include the qualification that the existing PDF file is also opened at the time of the second export? I base this on Francesco's example above and the following. I usually export a subtree to LaTeX as PDF file and open. If I make small corrections to the subtree and export again, AND forget to close the PDF file that is already opened from the earlier export, Org reports a successful export; however, the revised exported PDF does not exist. (Also I use EXPORT_FILE_NAME: in PROPERTIES as the top of the subtree.) If I remember to close the first exported PDF, the revised subtree exports OK. I'm just curious, does the problem exist iff the pdf, that is to be replaced, is opened? You're observing the exact same issue I have. As you can see, in my initial email, I wrote: As an example, if you open the target PDF file with Adobe Reader and, in the meantime, you export your Org file again to PDF, you'll see that Org will tell you it's OK (Process Completed) while, if you look at the *Org PDF LaTeX Output* buffer, you'll see an error such as: ! I can't write on file `toto.pdf'. [...] To answer your question: yes, the problem exists iff the pdf, that is to be replaced, is opened in Adobe Reader. In this particular case, the problem comes from the fact that we do not catch *all* errors from the log file. Thanks a lot for your remarks. Regards, Francesco
Re: [O] [PATCH] Add catch-up all LaTeX errors
Hi, May I bump up this thread? Thanks for your help. Regards, Francesco Francesco Pizzolante wrote: Hi, This is not a definitive patch. It's just a first step in getting a better one. The issue is the fact that, when exporting to PDF, in some cases, Org tells that the export has been done successfully while the PDF file has not been produced! As an example, if you open the target PDF file with Adobe Reader and, in the meantime, you export your Org file again to PDF, you'll see that Org will tell you it's OK (Process Completed) while, if you look at the *Org PDF LaTeX Output* buffer, you'll see an error such as: ! I can't write on file `toto.pdf'. [...] The problem comes from the fact that Org just checks for a couple of error messages (defined in org-latex-known-errors) and report it's OK if it doesn't find those messages: (defcustom org-latex-known-errors '((Reference.*?undefined . [undefined reference]) (Citation.*?undefined . [undefined citation]) (Undefined control sequence . [undefined control sequence]) (^! LaTeX.*?Error . [LaTeX error]) (^! Package.*?Error . [package error]) (Runaway argument . Runaway argument)) [...] In order to be sure to check for ALL errors, we should check for any line beginning with '!' (http://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings). That's the idea of this patch. Though, the issue with this patch is that some error can match 2 messages, and you get the following display: Process completed with errors: [LaTeX error] [Unknown error] To this issue, I see 2 solutions: 1. Either catch all errors with a single regexp (and remove all other regexps): (defcustom org-latex-known-errors '((^!.* . LaTeX error)) [...] 2. Stop on the first error found and report it. In all cases, it would be much better to be able to report the error line such as: Process completed with errors: [! I can't write on file `toto.pdf'.] Can someone do this or help me to achieve it? Best regards, Francesco --- lisp/ox-latex.el |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 9262ded..2cffe38 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -862,7 +862,8 @@ logfiles to remove, set `org-latex-logfiles-extensions'. (Undefined control sequence . [undefined control sequence]) (^! LaTeX.*?Error . [LaTeX error]) (^! Package.*?Error . [package error]) -(Runaway argument . Runaway argument)) +(Runaway argument . Runaway argument) +(^!.* . [Unknown error])) Alist of regular expressions and associated messages for the user. The regular expressions are used to find possible errors in the log of a latex-run. -- 1.7.9
Re: [O] [PATCH] Add catch-up all LaTeX errors
Hi Nicolas, Thanks for your answer. As an example, if you open the target PDF file with Adobe Reader and, in the meantime, you export your Org file again to PDF, you'll see that Org will tell you it's OK (Process Completed) while, if you look at the *Org PDF LaTeX Output* buffer, you'll see an error such as: ! I can't write on file `toto.pdf'. [...] The problem comes from the fact that Org just checks for a couple of error messages (defined in org-latex-known-errors) and report it's OK if it doesn't find those messages: Errors are not related to your problem. Actually, ox-latex.el uses a rather weak check to know if process was successful or not: (if (not (file-exists-p pdffile)) (error (concat (format PDF file %s wasn't produced pdffile) (when errors (concat : errors ... (message (concat Process completed (if (not errors) . (concat with errors: errors) IOW, it cannot tell the difference between a successful export and an export failure with an already existing PDFFILE. This is not true as this code checks for the `errors' variable in all cases. With an already existing PDFFILE, you will end up with this message: 'Process completed with errors: ...'. From my point of view, the issue comes from the fact that the `errors' variable is not correctly filled in with errors from the LaTeX log file. As you can see in the following code, we do not catch error lines starting with '!' but *only* those starting with '! LaTeX...' and '! Package...': --8---cut here---start-8--- (defcustom org-latex-known-errors '((Reference.*?undefined . [undefined reference]) (Citation.*?undefined . [undefined citation]) (Undefined control sequence . [undefined control sequence]) (^! LaTeX.*?Error . [LaTeX error]) (^! Package.*?Error . [package error]) (Runaway argument . Runaway argument)) [...] --8---cut here---end---8--- While the wikibooks reference (http://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings) tells that to be sure to catch *all* errors, we have to check for any line beginning with '!'. Then, in the case where the `errors' variable would effectively contain any error from the log file, the code you mention above would work in any case. That's why I started with this patch (*and it works*): --- lisp/ox-latex.el |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 9262ded..2cffe38 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -862,7 +862,8 @@ logfiles to remove, set `org-latex-logfiles-extensions'. (Undefined control sequence . [undefined control sequence]) (^! LaTeX.*?Error . [LaTeX error]) (^! Package.*?Error . [package error]) -(Runaway argument . Runaway argument)) +(Runaway argument . Runaway argument) +(^!.* . [Unknown error])) Alist of regular expressions and associated messages for the user. The regular expressions are used to find possible errors in the log of a latex-run. -- 1.7.9 The only issue is that the error reporting is not really helpfull (as my current patch only reports 'Unknown error' for any other error). Any suggestion is welcome. Best regards, Francesco
Re: [O] [bug] Wrong scrolling with org-agenda-toto in agenda views
Hi Bastien, Sorry for my late reply. The view should not scroll at all but only modify the selected task. I remember fixing this bug a while ago and cannot reproduce it with Org from master. What is the version of Org you use? Indeed, you're right. I didn't notice that my minimal test was using an old version of Org. Now, with a recent version of Org, my minimal test works well. Anyway, I still have this issue with my full setup... it should then come from somewhere else. I need some more time to locate the faulty spot. Thanks a lot for your help. Regards, Francesco
[O] [bug] Wrong scrolling with org-agenda-toto in agenda views
Hi, I noticed that when I'm using org-agenda-todo (C-c C-t or via the speed command) on a task in an agenda view, the view scrolls up to the selected task (see the following screencast: http://screencast.com/t/ml5aK0Saw). The view should not scroll at all but only modify the selected task. Thanks, Francesco
Re: [O] Missing patch from Eric Schulte from 2013-10-09
Hi Achim, The maint branch contains the release (8.2.4 for your example) plus those patches that are purely bugfixes (i.e. do not alter, remove or introduce features). In your example, eight such patches had accumulated, placing you at commit f1b933: release_8.2.4-8-gf1b9339. The master branch includes everything on maint plus any patches that alter, remove or introduce features. That amounted to 350 commits past the 8.2.4 release at the merge into master (d55f06), including those eight from maint: release_8.2.4-350-gd55f063. Thanks a lot for these clear explanations. If I understand well, to find patches from the master branch in the maint branch, I'll need to wait until the next major release, i.e. release 8.3. Am I right? Regards, Francesco
Re: [O] Missing patch from Eric Schulte from 2013-10-09
Hi Bastien, I noticed that I miss the following patch from Eric Schulte (from 2 months ago): http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=15847336c39e7219e1c51c55d487f99956a06e34 I have Org-mode version 8.2.4 (8.2.4-8-gf1b933-elpaplus @ c:/Users/fpz/Documents/home/.emacs.d/elpa/org-plus-contrib-20131216/) taken from elpa. When I download the current stable release of Org-mode (version 8.2.4 from http://orgmode.org/) I see that this patch is missing too (the org-babel-tangle-use-relative-file-links variable is missing). Any chance to get this patch in elpa (without having to clone the git master branch)? The patch is in the master branch only, your best move is to clone org-mode and follow that branch -- or wait until we make another major release. Thanks for your answer. I understand, but I find it weird that a same version number (like 8.2.4) gives different functionalities/fixes/patches according to the git branch you take the sources from. If I clone the master branch, I'll have version 8.2.4 with every patch. While if I download a version (or take it from elpa), I will also have version 8.2.4 --- but coming from the maint branch and thus with certain patches (not all). Shouldn't the maintenance branch keep the same version number until a new release is made (i.e. until the master branch is fully merged into the maint branch)? Maybe I'm wrong on certain points... any help on this is welcome. Best regards, Francesco
[O] Missing patch from Eric Schulte from 2013-10-09
Hi, I noticed that I miss the following patch from Eric Schulte (from 2 months ago): http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=15847336c39e7219e1c51c55d487f99956a06e34 I have Org-mode version 8.2.4 (8.2.4-8-gf1b933-elpaplus @ c:/Users/fpz/Documents/home/.emacs.d/elpa/org-plus-contrib-20131216/) taken from elpa. When I download the current stable release of Org-mode (version 8.2.4 from http://orgmode.org/) I see that this patch is missing too (the org-babel-tangle-use-relative-file-links variable is missing). Any chance to get this patch in elpa (without having to clone the git master branch)? Thanks a lot for your help, Francesco
[O] Missing contrib packages
Hi, I have Org-mode version 8.2.4 (8.2.4-8-gf1b933-elpaplus @ c:/Users/fpz/Documents/home/.emacs.d/elpa/org-plus-contrib-20131216/). I notice that I miss several packages like htmlize (important) and org-effectiveness. My questions are: - why, in the org-plus-contrib from elpa, I miss these packages (present in the master branch)? - why, in the release version 8.2.4 downloaded from http://orgmode.org/, I have htmlize but not org-effectiveness? Thanks a lot, Francesco
[O] [PATCH] Add catch-up all LaTeX errors
Hi, This is not a definitive patch. It's just a first step in getting a better one. The issue is the fact that, when exporting to PDF, in some cases, Org tells that the export has been done successfully while the PDF file has not been produced! As an example, if you open the target PDF file with Adobe Reader and, in the meantime, you export your Org file again to PDF, you'll see that Org will tell you it's OK (Process Completed) while, if you look at the *Org PDF LaTeX Output* buffer, you'll see an error such as: --8---cut here---start-8--- ! I can't write on file `toto.pdf'. [...] --8---cut here---end---8--- The problem comes from the fact that Org just checks for a couple of error messages (defined in org-latex-known-errors) and report it's OK if it doesn't find those messages: --8---cut here---start-8--- (defcustom org-latex-known-errors '((Reference.*?undefined . [undefined reference]) (Citation.*?undefined . [undefined citation]) (Undefined control sequence . [undefined control sequence]) (^! LaTeX.*?Error . [LaTeX error]) (^! Package.*?Error . [package error]) (Runaway argument . Runaway argument)) [...] --8---cut here---end---8--- In order to be sure to check for ALL errors, we should check for any line beginning with '!' (http://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings). That's the idea of this patch. Though, the issue with this patch is that some error can match 2 messages, and you get the following display: --8---cut here---start-8--- Process completed with errors: [LaTeX error] [Unknown error] --8---cut here---end---8--- To this issue, I see 2 solutions: 1. Either catch all errors with a single regexp (and remove all other regexps): --8---cut here---start-8--- (defcustom org-latex-known-errors '((^!.* . LaTeX error)) [...] --8---cut here---end---8--- 2. Stop on the first error found and report it. In all cases, it would be much better to be able to report the error line such as: --8---cut here---start-8--- Process completed with errors: [! I can't write on file `toto.pdf'.] --8---cut here---end---8--- Can someone do this or help me to achieve it? Best regards, Francesco --- lisp/ox-latex.el |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 9262ded..2cffe38 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -862,7 +862,8 @@ logfiles to remove, set `org-latex-logfiles-extensions'. (Undefined control sequence . [undefined control sequence]) (^! LaTeX.*?Error . [LaTeX error]) (^! Package.*?Error . [package error]) -(Runaway argument . Runaway argument)) +(Runaway argument . Runaway argument) +(^!.* . [Unknown error])) Alist of regular expressions and associated messages for the user. The regular expressions are used to find possible errors in the log of a latex-run. -- 1.7.9
Re: [O] ATTR_LATEX not being applied on dynamic blocks
Hello Nicolas, Nicolas Goaziou wrote: Francesco Pizzolante f...@missioncriticalit.com writes: But if I try what you suggest and move the #+ATTR_LATEX line inside the dynamic block (after the #+BEGIN: clocktable and just before the generated table), then this line gets lost as soon as the dynamic block is regenerated, which is not what I expect. Then some attribute could be added to dynamic block arguments in order to re-create the ATTR_LATEX keyword each time. IIRC we did that for #+CAPTION some months ago. It shouldn't be difficult to do it for this one. I've seen, indeed (thanks!), that there was a :header option, which you can use to add free text in front of the dynamic table. --8---cut here---start-8--- #+BEGIN: clocktable :maxlevel 2 :scope (clock-file.org) :block 2013-08 :fileskip0 t :lang en :header #+ATTR_LaTeX: :environment longtabu :align lXrr\n #+ATTR_LaTeX: :environment longtabu :align lXrr | File | Headline| Time | | |+-++--| || ALL Total time | 1:44 | | |+-++--| | clock-file.org | File time | *1:44* | | || Projet management | 1:44 | | || \__ Writing reports || 1:44 | #+END: Though, doing so, there is no CAPTION anymore... I could add it in the header, but then I loose the auto-generated (and useful) stuff in the caption itself: #+CAPTION: Clock summary at [2013-09-04 Wed 14:22], for August 2013. --8---cut here---end---8--- ^ ^^^ useful very useful Maybe adding a :header should not strip the autogenerated caption? With Org 7, having the #+ATTR_LATEX line just before the #+BEGIN: clocktable line applies the attributes to the inner table of the dynamic block and the #+ATTR_LATEX line is not lost each time I regenerate the dynamic block. This is not possible anymore. OK. Regards, Francesco
Re: [O] [PATCH] Add support for `ltablex'
Hi Nicolas, What are its advantages over longtabu environment, which is already supported? There is a lot of table related packages, I'm not sure we want to support them all. I wasn't aware about the tabu package and its tabu and longtabu environments. I'll try to use it and see if I can get what I want. One nice thing about ltablex is that you don't need to use different environments for short or long tables: you still use the well known tabularx environment in any case. For now, please ignore my patch unless I come up with issues using the tabu package. Thanks a lot for your answer. Regards, Francesco
[O] ATTR_LATEX not being applied on dynamic blocks
Hi, I have an issue with ATTR_LATEX attributes not being applied to the clocktable dynamic block. This issue is similar to the one exposed by Sebastien in his post [1], so I took his ECM and modified it a little bit. Here's it is: --8---cut here---start-8--- #+LATEX_HEADER: \usepackage{tabularx} * Tasks Some tasks with CLOCK lines. ** Design *** TODO Do this :LOGBOOK: CLOCK: [2013-06-19 Wed 09:00]--[2013-06-19 Wed 10:11] = 1:11 :END: :PROPERTIES: :Effort: 2:00 :END: ** Develop *** TODO Do that :LOGBOOK: CLOCK: [2013-06-19 Wed 10:00]--[2013-06-19 Wed 12:22] = 2:22 CLOCK: [2013-06-20 Thu 10:01]--[2013-06-20 Thu 12:35] = 2:34 :END: * Reporting ** Summary #+ATTR_LATEX: :environment tabularx :width \linewidth :align Xrrr #+BEGIN: clocktable :maxlevel 4 :scope file :block 2013-06 :lang en :narrow 80! :indent t Clock summary at [2013-09-03 Tue 17:16], for June 2013. | Headline| Time | | | |-+--+--+--| | Total time | 6:07 | | | |-+--+--+--| | Tasks | 6:07 | | | | \__ Design | | 1:11 | | | \_ TODO Do this | | | 1:11 | | \__ Develop | | 4:56 | | | \_ TODO Do that | | | 4:56 | #+END: --8---cut here---end---8--- This issue is a regression compared to Org 7 as this example works perfectly with Org 7 (with this tiny change): --8---cut here---start-8--- #+ATTR_LATEX: tabularx width=\linewidth align=Xrrr --8---cut here---end---8--- Any help is welcome. Regards, Francesco [1] http://lists.gnu.org/archive/html/emacs-orgmode/2013-07/msg00089.html
[O] [PATCH] Add support for `ltablex'
Hello, Please find here a patch to support the tabularx table environment when used in conjunction with the ltablex LaTeX package. ltablex combines the advantages of longtable and tabularx packages: it enables splitting of table across pages, and have fixed-width tables with auto-adjusted columns. Like longtable, it does not require a float table environment around. I added a ltablex environment name which will be exported as a tabularx LaTeX environment without a table float environment (this is the exact same behavior as for longtable). Usage is the same as tabularx (except that you use ltablex as :environment name in the ATTR_LATEX specification): - you need to specify a :width attribute, and - an :align attribute. In this case, like for longtable, the :float attribute is also ignored. Best regards, Francesco * ox-latex.el (org-latex--org-table): Add support for `ltablex'. From: Francesco Pizzolante f...@missioncriticalit.com Date: Tue, 3 Sep 2013 16:44:24 +0200 Subject: [PATCH] Add support for `ltablex' --- lisp/ox-latex.el | 17 - 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index e66c717..6af3acf 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2350,7 +2350,7 @@ This function assumes TABLE has `org' as its `:type' property and org-latex-default-table-environment)) ;; If table is a float, determine environment: table, table* ;; or sidewaystable. -(float-env (unless (member table-env '(longtable longtabu)) +(float-env (unless (member table-env '(longtable longtabu ltablex)) (let ((float (plist-get attr :float))) (cond ((and (not float) (plist-member attr :float)) nil) @@ -2401,6 +2401,21 @@ This function assumes TABLE has `org' as its `:type' property and (concat caption \n)) \\end{longtabu}\n (and fontsize }))) + ;; Ltablex (Tabularx without float). + ((equal ltablex table-env) + (concat (and fontsize (concat { fontsize)) + (format \\begin{tabularx}{%s}{%s}\n + width + alignment) + (and org-latex-table-caption-above + (org-string-nw-p caption) + (concat caption \n)) + contents + (and (not org-latex-table-caption-above) + (org-string-nw-p caption) + (concat caption \n)) + \\end{tabularx}\n + (and fontsize }))) ;; Others. (t (concat (cond (float-env -- 1.7.9
Re: [O] Indentation of code blocks within lists
Hi Nicolas, I also cannot reproduce OP's problem. It may be related to `org-src-preserve-indentation' value. Thanks for your answer. I checked the `org-src-preserve-indentation' variable and saw that it was non `nil'. Setting this variable to `nil' fixes the demonstrated issue. But, even then, I still have an indentation problem. In the following example (with `org-src-preserve-indentation' set to `nil'): - in the first headline, I have a code block in a list which is correctly exported ignoring the spaces due to the indentation of the Org list; - in the second headline, I have the same source code but it is split in several code blocks in order to better document it. The last 2 blocks are not correctly exported as *all spaces before the code* (even those I manually added) are ignored. --8---cut here---start-8--- * First situation My list: - Example which works #+begin_src emacs-lisp (if complex-condition then-block else-block) #+end_src * Second situation My list: - Example which does not work anymore #+begin_src emacs-lisp (if complex-condition #+end_src The then block does this: #+begin_src emacs-lisp then-block #+end_src The else-block does that: #+begin_src emacs-lisp else-block) #+end_src --8---cut here---end---8--- I think that only the spaces due to the Org indentation (here the number of spaces before the `#' which delimits the source block, hence 2 spaces) should be ignored. IOW, just the margin should be removed, and the margin is (IMO) defined as the spaces from column 0 up to the `#' character. Thanks for your help. Regards, Francesco
Re: [O] Indentation of code blocks within lists
Hi, May I bump up this thread? Thanks, Francesco Francesco Pizzolante wrote: Hi All, I'd like to let you know about issues I'm having while trying to put source code blocks within lists. Here's my example and how I indent it: * First situation - My first bullet We need to do this: #+begin_src emacs-lisp (message this is a string) (defun x() Doc... (interactive) (message hello)) #+end_src - My second bullet #+begin_src emacs-lisp test #+end_src #+results: : test - Sub-point of second bullet We need to do this as well: #+begin_src emacs-lisp (sort) #+end_src This way if indenting code blocks has the following advantages: - it looks nice; - thanks to the indentation, you directly know at which list level the code block belongs to; - you can easily use Emacs commands (like `C-x TAB') on regions or Org promote/demote commands on items or subtrees to edit and reorganize your text: relative indentation is preserved in all cases. But, I have 2 issues with it: - when using `C-c '' (`org-edit-special'), I see spaces before my code, while I would expect to see my code starting at column 0 in the edit buffer (the reference column for the margin being, here, the column with the '#' from '#+begin_src'; - when exporting, the spaces from column 0 to the start of my code are also exported, while I would again expect these spaces to be ignored for the export. The only way I found to fix these issues is to edit my text like this (and make any code to start in column 0): - My first bullet We need to do this: #+begin_src emacs-lisp (message this is a string) (defun x() Doc... (interactive) (message hello)) #+end_src - My second bullet #+begin_src emacs-lisp test #+end_src #+results: : test - Sub-point of second bullet We need to do this as well: #+begin_src emacs-lisp (sort) #+end_src But: - as you can see, the text does not look anymore as nice as in the previous example; - I'm no longer able to edit and reorganize the text using Emacs `C-x TAB' command. That command becomes forbidden as it can't correctly respect the indentation requirements: + starting at column 0 for code; + relative for list items (depending on their depth); - even Org promote/demote commands are buggy in this case: as a simple example, when I try to promote (with M-Shift-Left) the last point Sub-point of second bullet I get an error (indent-line-to: Wrong type argument: wholenump, -2 ) and the following half-baked result: - Sub-point of second bullet We need to do this: #+begin_src emacs-lisp (sort) #+end_src The #+end_src line got misaligned. So, my question is the following: is there a way to edit my text as shown in the first example and edit/export it ignoring the margin spaces? Any help is welcome. Thanks a lot, Francesco
[O] Indentation of code blocks within lists
Hi All, I'd like to let you know about issues I'm having while trying to put source code blocks within lists. Here's my example and how I indent it: --8---cut here---start-8--- * First situation - My first bullet We need to do this: #+begin_src emacs-lisp (message this is a string) (defun x() Doc... (interactive) (message hello)) #+end_src - My second bullet #+begin_src emacs-lisp test #+end_src #+results: : test - Sub-point of second bullet We need to do this as well: #+begin_src emacs-lisp (sort) #+end_src --8---cut here---end---8--- This way if indenting code blocks has the following advantages: - it looks nice; - thanks to the indentation, you directly know at which list level the code block belongs to; - you can easily use Emacs commands (like `C-x TAB') on regions or Org promote/demote commands on items or subtrees to edit and reorganize your text: relative indentation is preserved in all cases. But, I have 2 issues with it: - when using `C-c '' (`org-edit-special'), I see spaces before my code, while I would expect to see my code starting at column 0 in the edit buffer (the reference column for the margin being, here, the column with the '#' from '#+begin_src'; - when exporting, the spaces from column 0 to the start of my code are also exported, while I would again expect these spaces to be ignored for the export. The only way I found to fix these issues is to edit my text like this (and make any code to start in column 0): --8---cut here---start-8--- - My first bullet We need to do this: #+begin_src emacs-lisp (message this is a string) (defun x() Doc... (interactive) (message hello)) #+end_src - My second bullet #+begin_src emacs-lisp test #+end_src #+results: : test - Sub-point of second bullet We need to do this as well: #+begin_src emacs-lisp (sort) #+end_src --8---cut here---end---8--- But: - as you can see, the text does not look anymore as nice as in the previous example; - I'm no longer able to edit and reorganize the text using Emacs `C-x TAB' command. That command becomes forbidden as it can't correctly respect the indentation requirements: + starting at column 0 for code; + relative for list items (depending on their depth); - even Org promote/demote commands are buggy in this case: as a simple example, when I try to promote (with M-Shift-Left) the last point Sub-point of second bullet I get an error (indent-line-to: Wrong type argument: wholenump, -2 ) and the following half-baked result: --8---cut here---start-8--- - Sub-point of second bullet We need to do this: #+begin_src emacs-lisp (sort) #+end_src --8---cut here---end---8--- The #+end_src line got misaligned. So, my question is the following: is there a way to edit my text as shown in the first example and edit/export it ignoring the margin spaces? Any help is welcome. Thanks a lot, Francesco
[O] [PATCH] Normalize the construction of outline-container DIV ID
Hi, I found that, when exporting to HTML, outline-container IDs are not always built the same way: - if the headline has an Org ID it is build using that ID: outline-container-ID; - if the headline does not have an Org ID, then the outline-container DIV will use the headline number instead (outline-container-X) while the ID of the inner headline is sec-X. I propose a patch to always build the outline-container DIV ID the same way by using the inner headline ID (when exporting to HTML). Regards, Francesco From 0e84e6ce8b808f15b0b84cc575b6d9eeb9e374b4 Mon Sep 17 00:00:00 2001 From: Francesco Pizzolante f...@missioncriticalit.com Date: Tue, 9 Apr 2013 13:38:19 +0200 Subject: [PATCH] Normalize the construction of outline-container DIV ID * ox-html.el (org-html-headline): Normalize the construction of outline-container DIVs by always using the inner headline ID. TINYCHANGE --- lisp/ox-html.el |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 39b0ec9..fe7b822 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2194,7 +2194,7 @@ holding contextual information. div) (format outline-container-%s (or (org-element-property :CUSTOM_ID headline) - section-number)) + (concat sec- section-number))) (concat (format outline-%d level1) (and extra-class ) extra-class) (format \nh%d id=\%s\%s%s/h%d\n -- 1.7.9
[O] Visibility cycling applied on several windows
Hi, If you have 2 windows opened with the same Org buffer, when you use a visibility cycling command (TAB, S-TAB, etc.), it changes the visibility in both windows, while you would expect the visibility being changed only in the active windows (not in both windows). Is there a way to restrict the visibility cycling only to the active window? Thanks a lot for your help. Regards, Francesco
Re: [O] Visibility cycling applied on several windows
Hi Christopher and Thorsten, Thanks for your replies. Christopher Schmidt wrote: Thorsten Jolitz tjol...@gmail.com writes: maybe this is what you need (untested): http://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html No, an indirect buffer shares its parent's text properties. It's true: the indirect buffer shares its parent's text properties. But, the visibility cycling is applied only in the active window: either in the main buffer or in the indirect buffer but not in both windows at the same time. So, it works as expected to me. Thanks for the trick! But this trick seems like a workaround to me : using visibility cycling in one window should not affect another window, isn't it? Thanks for your help. Francesco
[O] [PATCH] Avoid modification hooks in org-clock-sum
Hello, This patch avoid modification hooks to be run in org-clock-sum by using org-unmodified (instead of simply saving and restoring buffer-modified-p). On my system, this speeds up the creation of clock reports. I should have indented the code but I didn't in order to respect the less-than-20-lines change (I have no copyright assignment to the FSF yet). Regards, Francesco From b328fadfbc76143ab86286f8a9939fa2c49ba186 Mon Sep 17 00:00:00 2001 From: Francesco Pizzolante f...@missioncriticalit.com Date: Wed, 30 Jan 2013 17:21:42 +0100 Subject: [PATCH] Avoid Protect org-clock-sum using org-unmodified * org-clock.el (org-clock-sum): Avoid modification hooks in org-clock-sum TINYCHANGE --- lisp/org-clock.el |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 7bd5b5a..945fcd0 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1675,8 +1675,8 @@ each headline in the time range with point at the headline. Headlines for which HEADLINE-FILTER returns nil are excluded from the clock summation. PROPNAME lets you set a custom text property instead of :org-clock-minutes. (interactive) - (let* ((bmp (buffer-modified-p)) -(re (concat ^\\(\\*+\\)[ \t]\\|^[ \t]* + (org-unmodified +(let* ((re (concat ^\\(\\*+\\)[ \t]\\|^[ \t]* org-clock-string [ \t]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=[ \t]+\\([0-9]+\\):\\([0-9]+\\)\\))) (lmax 30) @@ -1753,8 +1753,7 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes. (setq t1 0) (loop for l from level to (1- lmax) do (aset ltimes l 0))) - (setq org-clock-file-total-minutes (aref ltimes 0))) -(set-buffer-modified-p bmp))) + (setq org-clock-file-total-minutes (aref ltimes 0)) (defun org-clock-sum-current-item (optional tstart) Return time, clocked on current item in total. -- 1.7.9
[O] [PATCH] Protect org-agenda-prepare-buffers with org-unmodified
Hello, This patch protects changes done in org-agenda-prepare-buffers with org-unmodified instead of saving/restoring buffer-modified-p. This avoids modification hooks to run. Regards, Francesco From 6ce481a40a64510d67708ca63d27bdb434ee3e5a Mon Sep 17 00:00:00 2001 From: Francesco Pizzolante f...@missioncriticalit.com Date: Thu, 31 Jan 2013 16:35:31 +0100 Subject: [PATCH] Protect org-agenda-prepare-buffers with org-unmodified * org.el (org-agenda-prepare-buffers): stable TINYCHANGE --- lisp/org.el |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index ca751a7..a578371 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -17008,7 +17008,7 @@ When a buffer is unmodified, it is just killed. When modified, it is saved (inhibit-read-only t) (org-inhibit-startup org-agenda-inhibit-startup) (rea (concat : org-archive-tag :)) - bmp file re) + file re) (save-excursion (save-restriction (while (setq file (pop files)) @@ -17018,7 +17018,7 @@ When a buffer is unmodified, it is just killed. When modified, it is saved (org-check-agenda-file file) (set-buffer (org-get-agenda-file-buffer file))) (widen) - (setq bmp (buffer-modified-p)) + (org-unmodified (org-refresh-category-properties) (org-refresh-properties org-effort-property 'org-effort) (org-refresh-properties APPT_WARNTIME 'org-appt-warntime) @@ -17045,8 +17045,7 @@ When a buffer is unmodified, it is just killed. When modified, it is saved org-comment-string)) (while (re-search-forward re nil t) (add-text-properties -(match-beginning 0) (org-end-of-subtree t) pc))) - (set-buffer-modified-p bmp) +(match-beginning 0) (org-end-of-subtree t) pc (setq org-todo-keywords-for-agenda (org-uniquify org-todo-keywords-for-agenda)) (setq org-todo-keyword-alist-for-agenda -- 1.7.9
Re: [O] [PATCH] Avoid all modification hooks in org-unmodified
Hi Bastien, This is great. It's not only more efficient but also more consistent. Thanks a lot for joining the agenda optimization gang with such a contribution! I applied your patch, with a tiny change in the ChangeLog. Thanks for your message and for having applied the patch. I'm happy that it effectively helps. I've also noticed several other spots where org-unmodified should be used instead of simply saving and restoring buffer-modified-p. I will submit another tiny patch in order for you to see. Regards, Francesco
Re: [O] [PATCH] Avoid modification hooks in org-clock-sum
Hi Bastien, Applied, thanks. Thanks to you. Please let me know if you want to assign your copyright for further patches -- the limit is cumulative over patches. I just introduced a request to the FSF. Regards, Francesco
[O] [PATCH] Avoid all modification hooks in org-unmodified
Hello, I've changed org-unmodified in order to avoid all modification hooks to be called (not only before-change-functions and after-change-functions, but also first-change-hook). I've used inhibit-modification-hooks as described here: http://www.gnu.org/software/emacs/manual/html_node/elisp/Change-Hooks.html In my case, this positively impacts the loading of the agenda. Regards, Francesco From 173526db9d9b925e9eb568a725647e4065f0e27c Mon Sep 17 00:00:00 2001 From: Francesco Pizzolante f...@missioncriticalit.com Date: Wed, 30 Jan 2013 16:09:22 +0100 Subject: [PATCH] Avoid all modification hooks in org-unmodified * org-macs.el (org-unmodified): Avoid all modification hooks in org-unmodified TINYCHANGE --- lisp/org-macs.el |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index a44bdbe..ceee306 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -93,7 +93,7 @@ Also, do not record undo information. `(set-buffer-modified-p (prog1 (buffer-modified-p) (let ((buffer-undo-list t) - before-change-functions after-change-functions) + (inhibit-modification-hooks t)) ,@body (def-edebug-spec org-unmodified (body)) -- 1.7.9
Re: [O] flyspell and code blocks
Hi, Jambunathan K wrote: Julian Burgos jul...@hafro.is writes: It is possible to make flyspell to ignore (i.e. do not spell check) the text within code blocks (I mean blocks of texts separated by #+begin_src and #+end src)? I did my homework but could not find a good answer. See http://lists.gnu.org/archive/html/help-gnu-emacs/2012-02/msg00162.html which links to the following bug report http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10804 I'm not sure whether this issue has been fixed or not. But, while I was testing Jambunathan's following code: ╭ │ (defadvice org-mode-flyspell-verify │ (after my-org-mode-flyspell-verify activate) │ Don't spell check src blocks. │ (setq ad-return-value │ (and ad-return-value │(not (org-in-src-block-p)) │(not (member 'org-block-begin-line (text-properties-at (point │(not (member 'org-block-end-line (text-properties-at (point))) ╰ I found that it only works when setting the org-src-fontify-natively variable: ╭ │(setq org-src-fontify-natively t) ╰ I hope this helps. An even better solution would be to use flyspell-prog-mode (to spellcheck comments and strings in source code) within the Org source blocks. Any idea how to achieve this? Thanks, Francesco
[O] Why does export of images to LaTeX requires either org-special-blocks or org-jsinfo?
Hi, I have noticed that the correct export of images in LaTeX requires one of these 2 packages: org-special-blocks or org-jsinfo. While I cannot see any relation between these packages and the export of images in LaTeX, if none of these 2 packages is loaded then images are exported as \href instead of \includegraphics, in other words, as links instead of images. Here's the code I used to check this: ╭ │ (setq org-modules nil) │ ;;(require 'org-special-blocks) │ ;;(require 'org-jsinfo) ╰ Please let me know if you have any explanation to this behaviour. Thanks a lot. Regards, Francesco
Re: [O] Why does export of images to LaTeX requires either org-special-blocks or org-jsinfo?
Hi Achim, Both of these will load org-html, either directly or indirectly. With that the default definition for org-export-html-inline-images comes into existence, which despite the name is also used for other exporters. Thanks a lot for the explanation. Is there a plan to make this variable independent of the html backend? Regards, Francesco
Re: [O] Issue when jumping from agenda view to clock line
Hi, Here's a small example. #+begin_src org * My tasks ** First task :LOGBOOK: CLOCK: [2012-10-22 Mon 13:00]--[2012-10-22 Mon 14:30] = 1:00 CLOCK: [2012-10-23 Tue 13:00]--[2012-10-23 Tue 14:30] = 1:00 CLOCK: [2012-10-24 Wed 13:00]--[2012-10-24 Wed 14:30] = 1:00 :END: #+end_src In the agenda view (C-c a a) for Wed 24, enable the check view (v c), then press ENTER on the log line for First task, you jump to the corresponding heading (First task) but it positions the cursor just after the :LOGBOOK: keyword and the drawer remains closed. Just to let you know that I found the issue... It was coming from the following code I was using (taken from Worg: http://orgmode.org/worg/org-configs/org-hooks.html): ╭ │ ;; get a compact view during follow mode in the agenda │ (defun my-compact-follow () │ Make the view compact, then show the necessary minimum. │ (ignore-errors │ (save-excursion │ (while (org-up-heading-safe)) │ (hide-subtree))) │ (let ((org-show-siblings nil) │ (org-show-hierarchy-above t)) │ (org-reveal)) │ (save-excursion │ (org-back-to-heading t) │ (show-children))) │ │(add-hook 'org-agenda-after-show-hook 'my-compact-follow) ╰ But I don't understand the cause of it. Thanks, Francesco
[O] Issue when jumping from agenda view to clock line
Hi, I'm having an issue when jumping from the C-c a a / v c view (check log view in the agenda view) to a clock line. Here's a small example. #+begin_src org * My tasks ** First task :LOGBOOK: CLOCK: [2012-10-22 Mon 13:00]--[2012-10-22 Mon 14:30] = 1:00 CLOCK: [2012-10-23 Tue 13:00]--[2012-10-23 Tue 14:30] = 1:00 CLOCK: [2012-10-24 Wed 13:00]--[2012-10-24 Wed 14:30] = 1:00 :END: #+end_src In the agenda view (C-c a a) for Wed 24, enable the check view (v c), then press ENTER on the log line for First task, you jump to the corresponding heading (First task) but it positions the cursor just after the :LOGBOOK: keyword and the drawer remains closed. The previous and correct behaviour was to jump to the corresponding line (in the example, the third clock line) in the opened drawer. I'm using org-mode version 7.9.2 (release_7.9.2-53-g93040f). Thanks for your help. Francesco
[O] Defining a new emphasis
Hi, I'm trying to define a new emphasis that would work like org-code (=) except that it would export to \textsf instead of \texttt in LaTeX. I tried several combinations using org-emphasis-alist and org-export-latex-emphasis-alist, but I must admit that I'm lost amongst all parameters controlling how the emphasis is processed: - org-emphasis-alist defines a 'verbatim' optional parameter - org-export-latex-emphasis-alist defines a protected (t/nil) parameter - special format string like \\verb or \\protectedtexttt may also be used Here are tests I've made (using the option ^:nil) with this reference string =look_at:my~ti ny\reference^string=: | verbatim | protected | format string | Resulting LaTeX code | Comment | |--+---+---+---+-| | no | nil | \\textsf{%s} | look\_{}at:my\~{}ti ny\reference\^{}string| OK except for the backslash | | no | t | \\textsf{%s} | look_at:my~ti ny\reference^string | NOT OK | | yes | nil | \\textsf{%s} | look_at:my~ti ny\reference^string | NOT OK | | yes | t | \\textsf{%s} | look_at:my~ti ny\reference^string | NOT OK | | yes | nil | \\protectedtexttt | look\_at:my\textasciitilde\{}ti ny\textbackslash\{}reference\textasciicircum\{}string | NOT OK | | yes | t | \\protectedtexttt | look\_at:my\textasciitilde{}ti ny\textbackslash{}reference\textasciicircum{}string| OK | I would like to get the exact same output as == gives (no interpretation of the chars I write) except that I'd like to use \textsf instead of \texttt but I can't find the right combination for the parameters (verbatim, protected) to achieve this goal. Any help or comment is welcome. Thanks a lot. Francesco
Re: [O] Defining a new emphasis
Hi Nicolas, I'm trying to define a new emphasis Please don't. We're in the process of hard-coding emphasis markers. OK. Understood. that would work like org-code (=) except that it would export to \textsf instead of \texttt in LaTeX. If that's related to export, you can tweak the export of verbatim (=text=) output. For example, in the new exporter (if you use development Org, you can (require 'org-export) and just call M-x org-export-dispatch), it just means to change \texttt into \textsf through verbatim filters (list of function applied to the output of each verbatim object). It's a way to have the last words over export engine. Here is the code: #+begin_src emacs-lisp (defun my-latex-verbatim-filter (text backend info) In `e-latex' backend, change \texttt\ into \textsf\. ;; No change for other backends. (if (not (eq backend 'e-latex)) text (replace-regexp-in-string \\`texttt textsf text))) (add-to-list 'org-export-filter-verbatim-functions 'my-latex-verbatim-filter) #+end_src If you call `org-export-dispatch' on a buffer containing: =look_at:my~ti ny\reference^string= you will get: \textsf{look\_at:my\textasciitilde{}ti ny\textbackslash{}reference\textasciicircum{}string} My goal is, in fact, to keep the default behavior of the '=' marker and redefine the behavior of the '~' marker. I'd like '~' to behave exactly the same way = does but using \textsf instead of \texttt. Is it possible? Thanks, Francesco
Re: [O] [PATCH] Separate file time from its tasks times
Hi Bastien, I'd like to give my opinion on this subject. The original display of the clock table with the default values for both options is consistent. Putting the File time in a different column would require putting the Total time in yet another column, which IMO makes the clock table to large. First of all, I agree with you on the fact that the current way of presenting the table is clear enough, at least if you keep bold formatting for file times. If I understand well, Sebastien's problem is due to the fact that he has to remove the bold formatting in order to be able to make references to this table's cells (in order to use its content value in a formula). Removing bold formatting makes things unclear as you end up with 3 levels on the same column (grand total, file totals and first level heading totals). In this case, I agree with Sebastien and I would prefer to split the first column into 2, keeping the grand total and file totals on the first column. So, in my opinion, I see 2 solutions (which are not exclusive): 1) Be able to use a cell's content value in a formula even if a special formatting is used in that cell; if there's already a way to achieve this today, please tell us... 2) Follow Sebastien's idea in order for one to choose how to display the first 3 levels (grand total, file times and first level heading totals): in either 1 or 2 or 3 columns. The default being 1 column, corresponding to the current behavior. Hope this helps. Thanks, Francesco
[O] Filter agenda view to subtree
Hi, I would like to be able to filter the agenda view according to an Org file or a subtree. Currently, the only way to do that is: 1. change buffer, 2. go the desired one, 3. go to the desired subtree, 4. generate the agenda view restricted to the current subtree (C-c C-x ). It would be good to have the ability (with a key binding) to filter directly from the agenda view, selecting the subtree à la refile (having completion for the files and subtrees). And then, be able to reset the filter to the full view. Is there a way to achieve this or does this corresponds to a new feature in the agenda view? Thanks for your help. Francesco
[O] LaTeX export of headings to lists
Hi, When exporting headings to LaTeX lists, I can see extra vertical blank spaces if the headings directly starts with a sub-heading or a list. It does not happen if you have text in your heading (before the sub-heading or the list). Here's my ECM: --8---cut here---start-8--- #+OPTIONS: H:2 num:t toc:nil * Level 1 ** Level 2 *** Level 3 A - A1 - A2 - A3 B - B1 - B2 - B3 --8---cut here---end---8--- When exporting this example to LaTeX, you can see that there's extra space between: - Level 3 and A - A and A1 - B and B1 This happens beacause the LaTeX export adds and extra line break (\\) after each \item in addition to the newline (\n). I thus propose the following patch which fixes the problem: --8---cut here---start-8--- index 764a48d..706bb4a 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1234,7 +1234,7 @@ numbered sections and lower levels as unnumbered sections. (delete-region (point-at-bol 0) (point)) (insert (format \\begin{%s}\n (symbol-name org-export-latex-low-levels -(insert (format \n\\item %s\n%s%% +(insert (format \n\\item %s\n%s%% heading (if label (format \\label{%s} label) ))) (insert (org-export-latex-content content)) --8---cut here---end---8--- If you don't see any problem with this fix, could you apply it? Thanks a lot, Francesco Pizzolante
[O] HTML export Resizing an activated inline image
Hi, When you want to resize an inline image, you have to write something like the following: --8---cut here---start-8--- #+ATTR_HTML: width=50% [[./images/toto.png]] --8---cut here---end---8--- This generates the following HTML code: --8---cut here---start-8--- img src=./images/toto.png width=50% alt=./images/toto.png / --8---cut here---end---8--- Now, I would like my image to be activated and the link should point to the image itself. So, I'm trying the following: --8---cut here---start-8--- #+ATTR_HTML: width=50% [[./images/toto.png][file:./images/toto.png]] --8---cut here---end---8--- But this adds the width to the anchor and not to the image: --8---cut here---start-8--- a href=./images/toto.png width=50%img src=./images/toto.png//a --8---cut here---end---8--- Any idea on the way to the get the following HTML code from Org? --8---cut here---start-8--- a href=./images/toto.pngimg src=./images/toto.png width=50% //a --8---cut here---end---8--- Thanks for your help. Francesco
Re: [O] Bug when publishing images
Hi David, There's still a little problem though when adding a caption: --8---cut here---start-8--- #+CAPTION: toto [[file:toto.png]] --8---cut here---end---8--- Indeed. I overlooked a stray p tag. This one is fixed by now. Again, thanks a lot for the fix: it's perfect at the level of the image now. There's still a small problem with the caption being escaped (I thought it would disappear with your previous fix, that's why I didn't add it to my example, so here it is now). This should be fix now. Indeed, it is. Thanks a lot. Francesco
[O] HTML export Bold and italic links
Hi, Exporting the following links: --8---cut here---start-8--- Exporting a [[http://www.google.com][*bold link*]]. Exporting a *[[http://www.google.com][bold link]]*. Exporting an [[http://www.google.com][/italic link/]]. Exporting an /[[http://www.google.com][italic link]]/. --8---cut here---end---8--- Gives the following HTML code: --8---cut here---start-8--- p Exporting a a href=http://www.google.com;bbold link/b/a. Exporting a *a href=http://www.google.com;bold link/a*. /p p Exporting a a href=http://www.google.com;ibold link/i/a. Exporting a /a href=http://www.google.com;bold link/a/. /p --8---cut here---end---8--- I Would expect the following code: --8---cut here---start-8--- p Exporting a a href=http://www.google.com;bbold link/b/a. Exporting a ba href=http://www.google.com;bold link/a/b. /p p Exporting a a href=http://www.google.com;ibold link/i/a. Exporting a ia href=http://www.google.com;bold link/a/i. /p --8---cut here---end---8--- As you can see, the first option (setting the bold and italic symbols *into* the link) works, while the second one (setting the bold and italic symbols *outside* the links) does not work. I think both options should work. At least the second one was working last week. Thanks. Francesco
Re: [O] Bug when publishing images
Hi David, There's still a little problem though when adding a caption: --8---cut here---start-8--- #+CAPTION: toto [[file:toto.png]] --8---cut here---end---8--- Indeed. I overlooked a stray p tag. This one is fixed by now. Again, thanks a lot for the fix: it's perfect at the level of the image now. There's still a small problem with the caption being escaped (I thought it would disappear with your previous fix, that's why I didn't add it to my example, so here it is now). If I have this: --8---cut here---start-8--- #+CAPTION: toto\trade [[file:toto.png]] --8---cut here---end---8--- It is exported to: --8---cut here---start-8--- div class=figure pimg src=toto.png alt=toto.png //p ptotoamp;trade;/p /div --8---cut here---end---8--- While I would expect (and it was like that before): --8---cut here---start-8--- div class=figure pimg src=toto.png alt=toto.png //p ptototrade;/p /div --8---cut here---end---8--- Thanks. Regards, Francesco
Re: [O] Bug when publishing images
Hi David, At Mon, 14 Mar 2011 10:09:37 +0100, Francesco Pizzolante wrote: Since this morning, I have problems exporting (inline) images. ... Could someone fix this as soon as possible? The joys of bleeding edget. Should be fixed by now. Thanks for the fix. It works better now. There's still a little problem though when adding a caption: --8---cut here---start-8--- #+CAPTION: toto [[file:toto.png]] --8---cut here---end---8--- This exports to the following HTML code: --8---cut here---start-8--- div class=figure lt;pgt;img src=toto.png alt=toto.png //p ptoto/p /div --8---cut here---end---8--- Regards, Francesco
[O] Bug when publishing images
Hi, Since this morning, I have problems exporting (inline) images. Here's an example. Such content in my Org buffer: --8---cut here---start-8--- [[file:toto.png]] --8---cut here---end---8--- is exported to this HTML code: --8---cut here---start-8--- lt;img src=toto.png alt=toto.png /gt; --8---cut here---end---8--- where the first and last and are escaped. Could someone fix this as soon as possible? Thanks a lot, Francesco Pizzolante
Re: [O] Bug when publishing images
Bastien, Since this morning, I have problems exporting (inline) images. Here's an example. Such content in my Org buffer: [[file:toto.png]] is exported to this HTML code: lt;img src=toto.png alt=toto.png /gt; Yes, this is a problem with last commit. Simply do this: ~$ git checkout HEAD~1 and wait till that problem is fixed. Thanks a lot. Francesco
[Orgmode] [babel] References to variable block names
Hi, I'm trying to maintain my employees CVs in a single Org file using Babel (see example hereunder). For this, I created several level-1 headings, one for each employee. Then, I have my main CV block (cv source block, see last Composed CV heading) containing the layout of the CVs. This block is called for each employee, in order to tangle a LaTeX file with the correct information. Though, currently, I'm not able to use variables *in noweb references* (see my employee variable in cv(employee=XXX). Could someone tell me how to have a generic solution, in this way or another? Any other ideas regarding this are welcome! Thanks a lot, Francesco --8---cut here---start-8--- * Alex #+srcname: cv-alex #+begin_src latex :noweb yes :tangle alex.tex cv(v-firstname=Alex,v-familyname=Pizzo,v-jobtitle=Project Manager,employee=alex) #+end_src ** Profile #+srcname: profile-alex #+begin_src latex Software engineering expert. #+end_src ** Experience #+srcname: experience-alex #+begin_src latex \cventry{2007--2010}{Project Manager}{MyProject}{MyCompany}{}{} \cventry{2005--2007}{Project Manager}{MyProject2}{MyCompany2}{}{} #+end_src * Albert #+srcname: cv-albert #+begin_src latex :noweb yes :tangle albert.tex cv(v-firstname=Albert,v-familyname=Pizza,employee=albert) #+end_src ** Profile #+srcname: profile-albert #+begin_src latex Software engineering expert. #+end_src ** Experience #+srcname: experience-albert #+begin_src latex \cventry{2009--2010}{Developer}{MyProject}{MyCompany}{}{} \cventry{2008--2009}{Developer}{MyProject2}{MyCompany2}{}{} #+end_src * Composed CV:noexport: #+srcname: cv #+begin_src latex :noweb yes :var v-jobtitle=Software Engineer \documentclass{mycvclass} \usepackage[utf8x]{inputenc} \firstname{v-firstname} \familyname{v-familyname} \jobtitle{v-jobtitle} \begin{document} \section{Profile} profile-employee \section{Experience} experience-employee \end{document} #+end_src --8---cut here---end---8--- ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Project management Dynamic block per tag + [Babel]
Hi Matt, Another option is to use a babel block and org-map-entries to spit out a simple list of tasks for each person: --8---cut here---start-8--- #+source: tasklist #+begin_src emacs-lisp :var person=me (let (tasklist) (org-map-entries (lambda () (add-to-list 'tasklist (concat - (nth 4 (org-heading-components) (concat person /!TODO) 'agenda) (mapconcat 'identity tasklist \n)) #+end_src #+call: tasklist(person=Jenny) --8---cut here---end---8--- Add this to an org file, replace Jenny with the appropriate name, and type C-c C-c to spit out a list (of all TODO items tagged with the relevant name) that looks like this: --8---cut here---start-8--- #+results: tasklist(person=Jenny) #+begin_example - Call George - Call Archie - Estimate cost of widgets --8---cut here---end---8--- Thanks a lot for your great help. I've played a little with the code you've sent and here's what I end up with: --8---cut here---start-8--- #+source: tasklist #+begin_src emacs-lisp :var person=FPZ :results raw (setq org-agenda-files (list (buffer-file-name))) (let (tasklist) (add-to-list 'tasklist |c||| t) (org-map-entries (lambda () (let ((priority (nth 3 (org-heading-components (add-to-list 'tasklist (concat | * (nth 2 (org-heading-components)) * |/[# (char-to-string (if priority priority ?B)) ]/ | [[ (nth 4 (org-heading-components)) ]]|) t))) (concat person /!TODO|STARTED|WAIT) 'agenda) (mapconcat 'identity tasklist \n)) #+end_src --8---cut here---end---8--- This enables to get a table with a task per row. For each task, I get the TODO keywork, the priority and a link to the corresponding section in my Org buffer. Here'a an example from one of my document: --8---cut here---start-8--- #+results: tasklist | c || | | *WAIT*| /[#C]/ | [[See if we have to filter the processes against something else]]| | *WAIT*| /[#C]/ | [[See if we have to filter the products against something else than the branch]] | | *STARTED* | /[#A]/ | [[Display static party questions block]] | | *WAIT*| /[#C]/ | [[Analyse the risk management screen]] | --8---cut here---end---8--- This is really great as each person can now have a quick overview of their tasks and they just jave to click to get the details of the tasks! The next step for me, would be to be able to sort this table against priorities for instance. If you think about a simple way of doing this, please let me know. Regards, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Export to LaTeX bug
Hi, Please ignore this thread. This problem was coming from a bug in my .emacs file. *I* was doing weird things with the org-export-latex-packages-alist variable: (add-to-list 'org-export-latex-packages-alist '((T1 fontenc) ( fixltx2e) ( graphicx) ( longtable) ( float) ( wrapfig) ( soul) ( t1enc) ( textcomp) ( marvosym) ( wasysym) ( latexsym) ( amssymb) ( hyperref) (\\tolerance=1000)) t) I'm sorry for the inconvenience. Regards, Francesco Exporting to LaTeX generates a weird a usepackage line (with fixltx2e). Here's a simple example: --8---cut here---start-8--- #+TITLE: Test export LaTeX * This is a simple test --8---cut here---end---8--- Look at the 4th line of the resulting export: --8---cut here---start-8--- % Created 2010-12-09 Thu 17:04 \documentclass[11pt]{article} \usepackage[utf8x]{inputenc} \usepackage[(T1 fontenc)]{( fixltx2e)} \usepackage{listings} \usepackage{xcolor} \providecommand{\alert}[1]{\textbf{#1}} \begin{document} \title{Test export \LaTeX{}} \author{Francesco Pizzolante} \date{09 December 2010} \maketitle \setcounter{tocdepth}{3} \tableofcontents \vspace*{1cm} \section{This is a simple test} \label{sec-1} \end{document} --8---cut here---end---8--- Thanks, F. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Embedding the style when exporting to HTML
Hi, I'm still in the process of managing a project with Org while trying to evangelize my colleagues to Org. The goal is to share documents in the simplest possible way. What I'm trying to do is to have my style be embedded (inline) to my exported HTML file. Today, it can done by customizing org-export-html-style or add my whole style in my Org buffer with the #+STYLE directive. This has the following disadvantages: - I have to share my .emacs file with my customizations in order for other people be able to export the Org file as required. Thus if someone has another configuration file, it will not work; - The style itself (the CSS) is not easily testable and not separate from the data (it is included in my Org file or in my .emacs). It would be good to specify a file for the style in the Org buffer itself and have an option telling Org if the style has to be embedded (or inline) to the exported HTML or not. Having this option has the following advantages: - my exported file is self-contained and is easily shareable; - anybody can export the Org file and will get the desired result (even with a different Emacs config); - the CSS itself is easily testable and maintainable by different guys and can even be a different project. What do you think? Is it possible to achieve this with the current version of Org? Any suggestion is welcome. Regards, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Embedding the style when exporting to HTML
Hi Christian, The following would make the exported HTML link to an external stylesheet. #+STYLE: link rel=stylesheet type=text/css href=my_style.css/ But that 's not what you're after? You want the stylesheet to be /outside/ (linked from) your Org file, but /embedded in/ the exported HTML? Did I get that right? Indeed. That would be the ideal solution for me: it would bring all the advantages I'm looking for: - separate files for developing separately the style and the content; - anybody could export the file as no special Emacs configuration is needed; - the exported file would be self-contained. Do you think about one way of doing this? Thanks, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Project management Dynamic block per tag + [Babel]
Hi Matt, Thanks a lor for you answer. I preferred your second suggestion as I can add it directly to my Org buffer: --8---cut here---start-8--- #+source: tasklist #+begin_src emacs-lisp :var person=me (let (tasklist) (org-map-entries (lambda () (add-to-list 'tasklist (concat - (nth 4 (org-heading-components) (concat person /!TODO) 'agenda) (mapconcat 'identity tasklist \n)) #+end_src #+call: tasklist(person=Jenny) --8---cut here---end---8--- Add this to an org file, replace Jenny with the appropriate name, and type C-c C-c to spit out a list (of all TODO items tagged with the relevant name) that looks like this: --8---cut here---start-8--- #+results: tasklist(person=Jenny) #+begin_example - Call George - Call Archie - Estimate cost of widgets --8---cut here---end---8--- Currently you code returns todo items with the todo keyword TODO only. What do I have to change in order to get all todo items with selected todo keyword? As an example, I'd like to keep in the lists the todo items with TODO and STARTED but not the ones marked as DONE, WAIT or NEW. Thanks again for your help. Regards, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Export to LaTeX bug
Hi, Exporting to LaTeX generates a weird a usepackage line (with fixltx2e). Here's a simple example: --8---cut here---start-8--- #+TITLE: Test export LaTeX * This is a simple test --8---cut here---end---8--- Look at the 4th line of the resulting export: --8---cut here---start-8--- % Created 2010-12-09 Thu 17:04 \documentclass[11pt]{article} \usepackage[utf8x]{inputenc} \usepackage[(T1 fontenc)]{( fixltx2e)} \usepackage{listings} \usepackage{xcolor} \providecommand{\alert}[1]{\textbf{#1}} \begin{document} \title{Test export \LaTeX{}} \author{Francesco Pizzolante} \date{09 December 2010} \maketitle \setcounter{tocdepth}{3} \tableofcontents \vspace*{1cm} \section{This is a simple test} \label{sec-1} \end{document} --8---cut here---end---8--- Thanks, F. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] [Babel] LaTeX code not exported
Hi, LaTeX code blocks are ignored when exporting to HTML or PDF. The following Org example: --8---cut here---start-8--- #+TITLE: Test export LaTeX #+BABEL: :exports code #+begin_src latex \documentclass{article} #+end_src --8---cut here---end---8--- Gives the following HTML result: --8---cut here---start-8--- body div id=content h1 class=titleTest export LaTeX/h1 div id=table-of-contents h2Table of Contents/h2 div id=text-table-of-contents ul lia href=#sec-11 This is a simple test/a/li /ul /div /div div id=outline-container-1 class=outline-2 h2 id=sec-1span class=section-number-21/span This is a simple test/h2 div class=outline-text-2 id=text-1 /div /div div id=postamble p class=author Author: Francesco Pizzolante /p p class=date Date: 2010-12-09 17:41:54 /p /div /div /body --8---cut here---end---8--- Is this a bug? Do I miss an option somewhere? Any help is welcome. Regards, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Project management Dynamic block per tag + [Babel]
Hi, I'm using Org to manage a project. I need to output a tasks list for every of my colleagues, person per person. I'm currently using tags to assing people to tasks (even if I'm not completely convinced that this is the right way to go). What I would like is to generate a dynamic block for each person with all tasks assigned to that person. This means, list all headings with a given tag. Could someone tell me how to do that? I tried using Babel to output a custom report where I will be able to (not yet done) easily filter by tag. But I'm already blocked with such a code: --8---cut here---start-8--- #+begin_src emacs-lisp :results output (with-output-to-string (org-agenda nil a)) #+end_src --8---cut here---end---8--- It does not produce any output. Any idea? Thanks, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Exporting BEAMER_HEADER_EXTRA
Hi, I have noticed a small problem with the export of the #+BEAMER_HEADER_EXTRA content (containing, as described in the documentation, the \usetheme{MyTheme} command). As of now, it is generated just before the \begin{document} command and after the export of \title{}, \author{} and \date{} commands. This means that if any of these commands (title, author, date) are customized/overridden in the theme, we don't get the customizations as they are called before the \usetheme{} command. Thus, the #+BEAMER_HEADER_EXTRA content should be exported before the export of \title{}, \author{} and \date{} command; hence, the right order would be: - \documentclass{} - block =def-packages= - block =packages= - block =LATEX_EXTRA= - block =LATEX_BEAMER_EXTRA= NEW position (instead of after \title...) - \title{}, \author{}, \date{} A simple workaround is to use #+LATEX_HEADER instead of #+BEAMER_HEADER_EXTRA to call the \usetheme{} command. Thanks, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Exporting customized align attribute to LaTeX
Hi, Exporting a customized align attribute for a table produces a wrong result. Here's an example where I'm customizing the S column type (coming from the siunitx package): I want to add the EUR symbol after each value in the specified column. --8---cut here---start-8--- * TEST #+ATTR_LATEX: align=lS{{\,\si{\EUR}}} | A | 12584.35 | | BB | 123456.67 | | CCC | 987654.32 | --8---cut here---end---8--- When exporting to LaTeX, I get the following result: --8---cut here---start-8--- \section{TEST} \label{sec-1} \begin{center} \begin{tabular}{lS{{\} A 12584.35 \\ BB 123456.67 \\ CCC987654.32 \\ \end{tabular} \end{center} --8---cut here---end---8--- I should get the following for the begin{tabular} line: --8---cut here---start-8--- \begin{tabular}{lS{{\,\si{\EUR} --8---cut here---end---8--- Is there a way to achieve this? Thanks, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: Nick Dokos: Re: [Orgmode] Problem exporting to LaTeX/PDF from command line
Hi Nick, Thanks a lot for having made those tests and sorry for my late reply. I didn't have time to go the direction you suggest: I will to check my load-path and I'll let you know. Thanks again. Francesco Nick Dokos wrote: Talking to myself again... From:Nick Dokos nicholas.do...@hp.com Subject: Re: [Orgmode] Problem exporting to LaTeX/PDF from command line To: nicholas.do...@hp.com Date:Tue, 20 Apr 2010 11:46:41 -0400 Nick Dokos nicholas.do...@hp.com wrote: Nick Dokos nicholas.do...@hp.com wrote: Francesco Pizzolante f...@missioncriticalit.com wrote: Hi, I forgot to mention that, of course, when I do the same operation within Emacs, using the C-c C-e l, the file is exported without problem. Any idea? I tried a little debugging on this, but I didn't get very far before I ran out of time. The re-search-forward for #+LaTeX_CLASS_OPTIONS in org-export-latex-set-initial-vars fails and it looks to me like a rather subtle problem: the temp file buffer looks empty. Whether that's the fault of the with-temp-file-buffer macro or something else, I'm not sure. Still not sure what is going on, but this modified org-interaction.el file (it loads the necessary org-XXX.el files explicitly - be sure to change the load-path appropriately) seems to work for me. I have not tried to load org-XXX.elc files to see whether that works or not. Nick --- (add-to-list 'load-path /home/nick/src/emacs/org/org-mode/lisp) ... I think that's the problem: picking up org from the *right* place works. Picking it up from whatever is built-in with your emacs does not. So just fix the load-path before you (require 'org) and all shall be well (famous last words...) Nick -- ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Problem exporting to LaTeX/PDF from command line
Hi, I forgot to mention that, of course, when I do the same operation within Emacs, using the C-c C-e l, the file is exported without problem. Any idea? Thanks, Francesco Francesco Pizzolante wrote: Hi, I'm trying to write a shell script in order to convert/export Org files to LaTeX/PDF from the command line (org2tex/org2pdf). The whole process works well, except that it seems that some bits of the exportation are not executed. Here's an example of what I do. I'm using the org-interaction.el file from Blorgit: (require 'org) (require 'cl) (setq font-lock-mode t) (defun refresh-then-find-file (file) Find file ensuring that the latest changes on disk are represented in the file. (let (file-buf) (while (setq file-buf (get-file-buffer file)) (kill-buffer file-buf)) (find-file file))) (defmacro with-temp-filebuffer (file rest body) Open FILE into a temporary buffer execute BODY there like `progn', then kill the FILE buffer returning the result of evaluating BODY. (let ((temp-result (make-symbol temp-result)) (temp-file (make-symbol temp-file))) `(let (,temp-result ,temp-file) (refresh-then-find-file ,file) (setf ,temp-file (current-buffer)) (setf ,temp-result (progn ,@body)) (kill-buffer ,temp-file) ,temp-result))) ;; (defvar org-interaction-prefix .exported_) (defvar org-interaction-prefix ) (defun org-file-to-html (file-path) Open up an org file, publish it to html, and then return the html as a string. (let* ((file-name (file-name-nondirectory file-path)) (file-dir (file-name-directory file-path)) (html-path (expand-file-name (concat org-interaction-prefix file-name) file-dir))) (if (and (file-exists-p html-path) ( 0 (time-to-seconds (time-subtract (nth 5 (file-attributes html-path)) (nth 5 (file-attributes file-path)) html-path (with-temp-filebuffer file-path (org-mode) (save-window-excursion (org-export-as-html-to-buffer nil) (write-file html-path) (kill-buffer (current-buffer))) (defun org-file-to-latex (file-path) Open up an org file, publish it to latex, and then return the latex as a string. (let* ((file-name (file-name-nondirectory file-path)) (file-dir (file-name-directory file-path)) (latex-path (expand-file-name (concat org-interaction-prefix file-name .tex) file-dir))) (if (and (file-exists-p latex-path) ( 0 (time-to-seconds (time-subtract (nth 5 (file-attributes latex-path)) (nth 5 (file-attributes file-path)) latex-path (with-temp-filebuffer file-path (org-mode) (save-window-excursion (org-export-as-latex-to-buffer nil) (write-file latex-path) (kill-buffer (current-buffer))) (defun org-file-to-pdf (file-path) Open up an org file and export it as pdf. (let* ((file-name (file-name-sans-extension file-path)) (file-dir (file-name-directory file-path)) (org-tmp-path (make-temp-file org-file-to-pdf-)) (pdf-tmp-path (concat org-tmp-path .pdf)) (tex-tmp-path (concat org-tmp-path .tex)) (pdf-path (expand-file-name (concat org-interaction-prefix file-name .pdf) file-dir))) (if (and (file-exists-p pdf-path) ( 0 (time-to-seconds (time-subtract (nth 5 (file-attributes pdf-path)) (nth 5 (file-attributes file-path)) pdf-path (with-temp-filebuffer file-path (write-file org-tmp-path) (org-mode) (save-window-excursion (org-export-as-pdf nil) (rename-file pdf-tmp-path pdf-path t) (delete-file org-tmp-path) ;; (delete-file tex-tmp-path) (kill-buffer (current-buffer))) ;; customization ;; (setq org-export-blocks-witheld '(hidden comment)) ;; Start the server ;; (server-start) ;; save the emacsclient server socket location ;; (with-temp-file /tmp/emacsclient-socket-dir ;; (insert server-socket-dir)) Here's the file I'm trying to convert (test.org): #+TITLE: Features report #+AUTHOR:Francesco Pizzolante #+EMAIL: f...@missioncriticalit.com #+DATE: 2010-04-19 #+DESCRIPTION: #+KEYWORDS: #+LANGUAGE: en_US #+LaTeX_CLASS_OPTIONS: [a4paper] * First test ** tatatata On the command line, I run the following command: emacs --batch -l org-interaction.el --eval (org-file-to-latex \~/test.org\) My observation is that the #+LATEX_CLASS_OPTIONS are not taken into account. I can add any option there, I always see the default one (11pt). It is really strange because if I add a #+LATEX_CLASS directive, this one is well taken into account and I get
Re: [Orgmode] Exporting non utf8 org documents
Hi Carsten, I'm sorry for my very very late reply on this topic, but I'm just observing problem with this. you can remove the code I sent you again, and instead grab the latest git release. Then you can also do (setq org-export-latex-inputenc-alist '((utf8 . utf8x))) to get utf8x instead of utf8. I still get the utf8 encoding even if, as you said, I set this: --8---cut here---start-8--- (setq org-export-latex-inputenc-alist '((utf8 . utf8x))) --8---cut here---end---8--- So, we get the following code: --8---cut here---start-8--- (defun org-export-latex-fix-inputenc () Set the codingsystem in inputenc to what the buffer is. (let* ((cs buffer-file-coding-system) (opt (or (ignore-errors (latexenc-coding-system-to-inputenc cs)) utf8))) (when opt ;; Translate if that is requested (setq opt (or (cdr (assoc opt org-export-latex-inputenc-alist)) opt)) ;; find the \usepackage statement and replace the option (goto-char (point-min)) (while (re-search-forward usepackage\\[\\(AUTO\\)\\]{inputenc} nil t) (goto-char (match-beginning 1)) (delete-region (match-beginning 1) (match-end 1)) (insert opt)) (and buffer-file-name (save-buffer) --8---cut here---end---8--- If I print the opt variable (message opt), I can see that its value is correctly set to utf8x. But, the re-search-forward command always fails. In effect, if I change the last argument from t to nil, I get the following error: --8---cut here---start-8--- while: Search failed: usepackage\\[\\(AUTO\\)\\]{inputenc} --8---cut here---end---8--- I'm using an almost empty Org buffer with no option at all, so it generates a simple article document class. I would like to give you more input, but I don't know how to better debug this. If you have any idea, please let me know. Thanks a lot, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] LaTeX export Avoid \newline command after timestampsX-Draft-From: (nnimap+mc:INBOX.sncb)
Hi, Thanks for your remarks. thanks for this. The reason why I put this is is to make sure that text after that line will start in a new line, and now flow into the scheduled/deadline line. For example: *** DONE My Task :Be: SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-05 Fri this should start a new line but does not with your patch Do you disagree that this is the right thing to do? Do you know a method to achieve the same result without generating extra white space? We could simply insert a blank line (e.g. \n\n), couldn't we? This would let LaTeX start a new paragraph if there's no space between scheduled/deadline line and do no harm if there is, because LaTeX doesn't care about multiple newlines. Yes, we could, but what I tries was to *not* start a new paragraph... Why not? From my point of view, the timestamps are more technical information and the text you have after is the real text regarding the heading, so why not put them on separate paragraphs? After a few more tests, I think that David's suggestion is the best one: having a simple blank line after the timestamps in the generated LaTex code. This way, if we have some text in the heading, LaTex will simply start a new paragraph and we will have the correct spacing. If don't have text in the heading, LaTeX will simply ignore the blank line and will format the next heading according to the document class chosen. The problem with the actual implementation is that it forces a newline in all cases (both if you have text in the heading or not) which does not respect the document class formatting that you've chosen. What do you think? Thanks a lot, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] LaTeX export Avoid \newline command after timestampsX-Draft-From: (nnimap+mc:INBOX.sncb)
Hi David, David Maus wrote: Took me a while to realize the problem with current implementation: If you already have a blank line between scheduled/deadline line and the content the newline forces extra spacing between scheduled/deadline and the following paragraph. I'm sorry if I wasn't clear enough. This cleary /is/ problem. Maybe we should catch these two cases (patch attached): , | (unless (and (looking-at .*\n[ \t]*\n) (looking-at .*newline[ \t]*$)) ` Insert \newline only if there is no paragraph separator. As far as I can see the LaTeX code is already rendered when `org-export-latex-keywords' is called so this should work out. I tried your patch, but I still get extra \newline commands in the generated LaTeX. Let's go back to examples, I think it will be easier to understand my problem. 1) Heading with no text --8---cut here---start-8--- ** STARTED First SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-19 Fri --8---cut here---end---8--- Gives the following: --8---cut here---start-8--- \subsection{\textbf{STARTED} First} \label{sec-1.1} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-19 Fri}\newline --8---cut here---end---8--- Which gives me an extra vertical space between this heading and the next one. While I would expect this (with or without the extra blank line in this case, as there's no text after): --8---cut here---start-8--- \subsection{\textbf{STARTED} First} \label{sec-1.1} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-19 Fri} --8---cut here---end---8--- 2) Heading with text and no blank line between heading and text --8---cut here---start-8--- ** STARTED Second SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-19 Fri This task is split among all services and communication between the entities. --8---cut here---end---8--- This gives the following: --8---cut here---start-8--- \subsection{\textbf{STARTED} Second} \label{sec-1.2} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-19 Fri}\newline\newline This task is split among all services and communication between the entities. --8---cut here---end---8--- I also get an extra vertical space between the timestamps and the text which is on a new paragraph. Instead, I was expecting this: --8---cut here---start-8--- \subsection{\textbf{STARTED} Second} \label{sec-1.2} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-19 Fri} This task is split among all services and communication between the entities. --8---cut here---end---8--- 3) Heading with text and blank line between heading and text --8---cut here---start-8--- ** DONE Third DEADLINE: 2010-03-26 Fri This task is split among all services and communication between the entities. Second paragraph. fdqsfdq --8---cut here---end---8--- This gives the following: --8---cut here---start-8--- \subsection{\textbf{DONE} Third} \label{sec-1.3} \texttt{DEADLINE:} \textit{2010-03-26 Fri}\newline This task is split among all services and communication between the entities. Second paragraph. fdqsfdq --8---cut here---end---8--- In this case, again, I get an extra vertical space between the timestamps and the text which is also in a new paragraph. Instead, I would simply expect this: --8---cut here---start-8--- \subsection{\textbf{DONE} Third} \label{sec-1.3} \texttt{DEADLINE:} \textit{2010-03-26 Fri} This task is split among all services and communication between the entities. Second paragraph. fdqsfdq --8---cut here---end---8--- As you can see from these 3 examples, it is safer to always generate blank lines only instead of \newline commands. Sorry for the length of this message. I hope, the problem is clearer now. Please let me know what you think. Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] LaTeX export Avoid \newline command after timestampsX-Draft-From: (nnimap+mc:INBOX.sncb)
Hi, When exporting an Org buffer to latex, I can see that Org generates an extra \newline command just after exporting the timestamps to the heading. An example. This Org stuff: --8---cut here---start-8--- *** DONE My Task :Be: SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-05 Fri :LOGBOOK: - State STARTEDfrom TODO [2010-03-02 Tue 09:30] - State DONE from STARTED[2010-03-02 Tue 10:00] CLOCK: [2010-03-02 Tue 09:30]--[2010-03-02 Tue 10:00] = 0:30 - PWA. :END: :PROPERTIES: :Effort: 4:00 :END: --8---cut here---end---8--- Is exported to latex this way: --8---cut here---start-8--- \subsubsection{\textbf{DONE} My Task \textbf{:Be:}} \label{sec-2.2.2} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-05 Fri}\newline --8---cut here---end---8--- At the end of the timestamps line, you can see the extra \newline command. This \newline command should be removed as it adds extra vertical space which does not respect the document class definition used for the document. In order to do that, I made the following change to org-latex.el and it works for me, but I'm not sure my change is completely safe: --8---cut here---start-8--- index 03216a8..88bd8c3 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1511,7 +1511,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER. (beginning-of-line 1) (unless (looking-at .*newline[ \t]*$) (end-of-line 1) - (insert \\newline) + (defun org-export-latex-fixed-width (opt) When OPT is non-nil convert fixed-width sections to LaTeX. --8---cut here---end---8--- Is this the right thing to do to avoid this extra \newline command? Thanks, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Exporting non utf8 org documents
Hi Carsten, here is a possible solution: Please get the latest git version of org-mode. Then put the following code into .emacs: (defun my-org-export-latex-fix-inputenc () Set the codingsystem in inputenc to what the buffer is. (let* ((cs buffer-file-coding-system) (opt (latexenc-coding-system-to-inputenc cs))) (when opt (goto-char (point-min)) (while (re-search-forward usepackage\\[\\(.*?\\)\\] {inputenc} nil t) (goto-char (match-beginning 1)) (delete-region (match-beginning 1) (match-end 1)) (insert opt)) (save-buffer (eval-after-load org-latex '(add-hook 'org-export-latex-after-save-hook 'my-org-export-latex-fix-inputenc)) Let me know how it goes. Thanks for your solution. I've tested with both latin1 and utf8 Org buffers and I get the correct encoding passed to LaTeX in both cases. Regarding the utf8 encoding, I had a remark in my first message, which was: In addition, Org should use the `utf8x' option (instead of `utf8') which enables to handle unbreakable spaces (useful in french). Could you change that too? Thanks a lot, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [babel] Idiomatic handling of quotes
Hi Thomas, In the example below, note that the R representation of the directory listing escapes the quotes in the original and encloses it all in a second set of quotes, e.g. \theta-1.csv\. This must come up a lot. Is there an idiomatic way to change \theta-1.csv\ to theta-1.csv so that it could be assigned to x and the following statement would yield a valid path? afile - paste(r/,x,sep=) I'm aware the answer might be R code, but it is to tightly tied to org- babel I figure it makes sense to ask the question here. I already sent an email related to double quotes in result tables. See the email hereunder. In order to get a result table without the double quotes for all texts, I use the patch enclosed in my email and add the :results noquotes header parameter. In your example, I would get the following result: --8---cut here---start-8--- #+srcname: thetas() #+begin_src shell :results noquotes cd r ls theta* #+end_src #+results: thetas | theta-1.csv | | theta-2.csv | --8---cut here---end---8--- Is this what you need? Here's the email I sent a few days ago. It contains the patch I use to remove the double quotes when I need it: - From: Francesco Pizzolante f...@missioncriticalit.com Subject: [Orgmode] [babel] double quotes in tables To: mailing-list-org-mode emacs-orgmode@gnu.org Date: Mon, 14 Dec 2009 17:18:30 +0100 Hi, Often, I find useful that babel could generate result tables without the double quotes () enclosing all the text values in the cells. In order to do that, I added a 'noquotes` option to the :results header argument. Here's my patch. As I'm not an elisp expert, please tell me if there's a better/safer way to do that or maybe that it already exists an option to do that... --8---cut here---start-8--- diff --git a/contrib/babel/lisp/org-babel.el b/contrib/babel/lisp/org-babel.el index 4c9bff5..13c8237 100644 --- a/contrib/babel/lisp/org-babel.el +++ b/contrib/babel/lisp/org-babel.el @@ -706,6 +706,9 @@ code the results are extracted in the syntax of the source code of the language being evaluated and are added inside of a #+BEGIN_SRC block with the source-code language set appropriately. + (setq outputformat %S) + (if (member noquotes result-params) + (setq outputformat %s)) (if (stringp result) (progn (setq result (org-babel-clean-text-properties result)) @@ -739,7 +742,7 @@ code the results are extracted in the syntax of the source (if (and (listp (car result)) (listp (cdr (car result result (list result)) -'(:fmt (lambda (cell) (format %S cell \n)) +'(:fmt (lambda (cell) (format outputformat cell \n)) (forward-line -1) (org-cycle)) ((member file result-params) (insert result)) @@ -827,7 +830,8 @@ parameters when merging lists. (let ((results-exclusive-groups '((file vector table scalar raw org html latex code pp) (replace silent) - (output value))) + (output value) + (noquotes))) (exports-exclusive-groups '((code results both none))) params results exports tangle cache vars var ref) --8---cut here---end---8--- Thanks, Francesco - Regards, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] [babel] double quotes in tables
Hi, Often, I find useful that babel could generate result tables without the double quotes () enclosing all the text values in the cells. In order to do that, I added a 'noquotes` option to the :results header argument. Here's my patch. As I'm not an elisp expert, please tell me if there's a better/safer way to do that or maybe that it already exists an option to do that... --8---cut here---start-8--- diff --git a/contrib/babel/lisp/org-babel.el b/contrib/babel/lisp/org-babel.el index 4c9bff5..13c8237 100644 --- a/contrib/babel/lisp/org-babel.el +++ b/contrib/babel/lisp/org-babel.el @@ -706,6 +706,9 @@ code the results are extracted in the syntax of the source code of the language being evaluated and are added inside of a #+BEGIN_SRC block with the source-code language set appropriately. + (setq outputformat %S) + (if (member noquotes result-params) + (setq outputformat %s)) (if (stringp result) (progn (setq result (org-babel-clean-text-properties result)) @@ -739,7 +742,7 @@ code the results are extracted in the syntax of the source (if (and (listp (car result)) (listp (cdr (car result result (list result)) -'(:fmt (lambda (cell) (format %S cell \n)) +'(:fmt (lambda (cell) (format outputformat cell \n)) (forward-line -1) (org-cycle)) ((member file result-params) (insert result)) @@ -827,7 +830,8 @@ parameters when merging lists. (let ((results-exclusive-groups '((file vector table scalar raw org html latex code pp) (replace silent) - (output value))) + (output value) + (noquotes))) (exports-exclusive-groups '((code results both none))) params results exports tangle cache vars var ref) --8---cut here---end---8--- Thanks, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] [babel] Executing source block which includes another block
Hi, Here's a small example where I'm interested both in tangling source blocks and executing sources blocks in my org buffer: --8---cut here---start-8--- * Test ** Common part #+srcname: common #+begin_src sh :exports none :results silent VAR=ThisIsATest #+end_src ** My shell script #+srcname: script #+begin_src sh :exports results :tangle my-script common date echo $VAR #+end_src --8---cut here---end---8--- When I tangle the script block, I correctly get the following my-script.sh file: --8---cut here---start-8--- #!/usr/bin/env sh # generated by org-babel-tangle # [[id:a0232b32-0b2c-4105-94ae-8c0f1ca67101][script]] VAR=ThisIsATest date echo $VAR # script ends here --8---cut here---end---8--- When I try to execute (C-cC-c) the same script block I get the following result: --8---cut here---start-8--- #+results: script | sh: | line | 6: | syntax | error | near | unexpected | token | `newline' | | sh: | line | 6: | `common' | | || | | --8---cut here---end---8--- The included common block should also be executed when executing the script block. Is there another way of doing? Thanks, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Exporting non utf8 org documents
Hi, I have colleagues who are writing Org documents with latin-1 encoding and when I export these documents to LaTeX I run into problems, because Org assumes utf8. Here's a little example: --8---cut here---start-8--- #+LATEX_CLASS: article * Ceci est un test Voici un petit texte rédigé en français. * COMMENT Setup # This is for the sake of Emacs. # Local Variables: # coding: iso-latin-1 # End: --8---cut here---end---8--- The exportation to LaTeX gives the following result: --8---cut here---start-8--- % Created 2009-12-08 mar. 17:10 \documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{graphicx} \usepackage{longtable} \usepackage{float} \usepackage{wrapfig} \usepackage{soul} \usepackage{amssymb} \usepackage{hyperref} \usepackage{xcolor} \usepackage{listings} \title{org-french} \author{Francesco Pizzolante} \date{08 décembre 2009} \begin{document} \maketitle \setcounter{tocdepth}{3} \tableofcontents \vspace*{1cm} \section{Ceci est un test} \label{sec-1} Voici un petit texte rédigé en français. \end{document} --8---cut here---end---8--- When compiling, due to the \usepackage[utf8]{inputenc} directive, I get this error: ERROR: Package utf8x Error: MalformedUTF-8sequence. In order to fix this issue, I see the following solutions: - Would it be possible for Org to automatically get the coding system of the buffer and then generate the correct option for the inputenc package? or - Would it be possible to have a variable like #+CODING-SYSTEM: iso-latin-1 which would be used to generate the correct option for the inputenc package? Any other proposition or idea is welcome. In addition, Org should use the `utf8x' option (instead of `utf8') which enables to handle unbreakable spaces (useful in french). Thanks. Regards, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Blorgit SVN integration
Hi Eric, Thanks for the patch. I got it working and pushed up the change to the blorgit git repository. That's cool! Thanks for that! Now all we need is an interface for reviewing/reverting previous commits, and individual username/passwords and blorgit will be a full fledged wiki! :) I was about to tell you the exact same things... :-) F. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH] sha1 hash of latex fragments to avoid regeneration
Eric, Would it be possible to switch from using org-exp-blocks to using org-babel? If so then you could use org-babel's caching which does *not* affect the exported file name, but rather saves a sha1 key as (mostly) hidden text in the org-mode buffer. so for example #+BEGIN_ditaa procedure.png +-+ | Example | | | | +-+ | | | | | | | | | | +-+ | +-+ #+END_ditaa would be written as #+begin_src ditaa :file procedure.png :cache :exports results +-+ | Example | | | | +-+ | | | | | | | | | | +-+ | +-+ #+end_src and pressing C-cC-c on the block (or exporting) would result in the insertion of a link to the resulting image into the org-mode buffer behind a results line as follows -- only in org most of the hash is hidden. #+results[bdffac60833c9f925a52bd6617dace39832b7dda]: [[file:procedure.png]] I don't see any problem in using org-babel. The only issues I see with this solution are the following: - when you export, no #+results line is added to the org-mode buffer; - you, thus, have to do the C-cC-c at least once in your block to generate the #+results line; - when you export (to LaTeX or PDF), the image is always re-computed (no caching mechanism is used), while doing C-cC-c, the caching is used. Can you confirm these points? My problem with your proposed solution is that it entails storing information *outside* of the org-mode buffer -- which granted we are already doing although in a less dramatic way. The creation of external files whose sole purpose is to save a hash in their filename strikes me as wasteful/messy. I agree with your point. I was simply trying to reuse what has been done for the caching of images in org. The org-babel solution is more elegant. Thanks, F. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: File modification date
Hi, DATE was implemented exactly to specify a fixed date. You can get the modification date with {{{modification-time(%Y-%m-%d)}}} and the current date with {{{date(%Y-%m-%d)}}} These will be expanded upon export. So you can, in fact, do #+DATE: {{{modification-time(%Y-%m-%d)}}} The problem is that the author does not see anymore the last modification date, then, except in the PDF output. And, in fact, if that Org file is put under VC, you can have two people printing (exporting) the exact same document and it would still have a different date. That's because, by default, the original modification date is not kept on the file system when checking out a file from Subversion (my current VC system). To do so, one need to set to his =.subversion/config=: #+BEGIN_SRC sh # keep the modification time from the repository, for Makefiles, etc. use-commit-times = yes #+END_SRC So, I find it would be good for the author to see the real last modification date (which, moreover, can be different from the copy date of the file in your file system). In the same line of thinking, it would be good to keep trace of the real creation date too and, as you suggest it, by completely separating these dates from the file system dates. What matters here are the dates corresponding to the content of the file, not the file itself. And those dates could be exported to the PDF as well (or other types of exportations). In order to clarify my point of view, I see 3 important dates to keep: 1) The creation date: It could be defined with #+CREATED: 2009-12-01 09:36 or #+CREATION_DATE: 2009-12-01 09:36 and, when exporting to LaTeX, it would be exported to \pdfinfo{/CreationDate (D:200912010936)}. It will then appear in the PDF properties of the exported document as Created: 2009/12/01 09:36:00. This date is defined once and never updated. It can even be added automatically by the C-c C-e t command when creating a new buffer. 2) The modification date: It could be defined with #+MODIFIED: 2009-12-07 16:45 or #+MODIFICATION_DATE: 2009-12-07 16:45 and, when exporting to LaTeX, it could be exported to \pdfinfo{/ModDate (D:200912071645)}. It will then appear in the PDF properties of the exported document as Modified: 2009/12/07 16:45:31. This is the date that you will see updated each time that you change and save your org buffer. It could be done automatically with org-mode. 3) The last date is the date you want to display in your document (in effect, the one that is exported as \date(XXX) in LaTeX). This date could be the last modification date (in this case, you would not need to specify it) or give it a fixed value (in this case, you specify it as it works now: #+DATE: 2009-12-09). With these dates, a document would contain all the information regarding it's life cycle independently of the file system. And, in addition, the information would be propagated in the exported documents. What do you all think? Regards Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Blorgit SVN integration
Hi Eric, One little question: is it possible to add a comment field when editing a file through the web interface and use that comment as the log when checking in the file in the repository? That behavior is not currently part of blorgit, but it shouldn't be hard to add. See lines 241 through 247 of blorgit.rb which are responsible for rendering the edit page. It shouldn't be hard to add a comment field, and then later access that field when committing to SVN/GIT. I've added a text input in the UI: --8---cut here---start-8--- diff --git a/blorgit.rb b/blorgit.rb index 93bea47..c7e4a92 100644 --- a/blorgit.rb +++ b/blorgit.rb @@ -245,6 +245,8 @@ __END__ %form{ :action = path_for(@blog), :method = :post, :id = :comment_form } %textarea{ :id = :body, :name = :body, :rows = 28, :cols = 82 }= @blog.body %br + Change log: + %input{ :id = :change_log, :name = :change_log, :type = :text } %input{ :id = :submit, :name = :edit, :value = :update, :type = :submit } %a{ :href = path_for(@blog) } Cancel --8---cut here---end---8--- But then, I have absolutely no idea on how to access that value when committing. It should be something like this: --8---cut here---start-8--- diff --git a/backend/blog.rb b/backend/blog.rb index 827ec05..555f12c 100644 --- a/backend/blog.rb +++ b/backend/blog.rb @@ -26,7 +26,7 @@ class Blog ActiveFile::Base index: index def after_savee Dir.chdir(Blog.base_directory) do -%x{svn add #{self.path} svn ci -m #{self.path} updated through the web interface #{self.path}} +%x{svn add #{self.path} svn ci -m #{self.path} updated through the web interface: #{self.change_log} #{sel endt: true end end --8---cut here---end---8--- I tried adding an instance method in base.rb but didn't manage to make it work. A little help would be welcome. Thanks a lot, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH] sha1 hash of latex fragments to avoid regeneration
Could not find ditaa.jar at %s org-ditaa-jar- path))) (setq body (if (string-match ^\\([^:\\|:[^ ]\\) body) @@ -229,9 +235,21 @@ passed to the ditaa utility as command line arguments. \n))) (cond ((or htmlp latexp docbookp) - (with-temp-file data-file (insert body)) - (message (concat java -jar org-ditaa-jar-path args data-file out-file)) - (shell-command (concat java -jar org-ditaa-jar-path args data-file out-file)) + (unless (file-exists-p out-file) +(mapc ;; remove old hashed versions of this file + (lambda (file) + (when (and (string-match (concat (regexp-quote (car out- file-parts)) +_\\([[:alnum:]]+\\)\ \. +(regexp-quote (cdr out- file-parts))) +file) + (= (length (match-string 1 out-file)) 40)) + (delete-file (expand-file-name file +(file-name-directory out-file) + (directory-files (or (file-name-directory out-file) + default-directory))) +(with-temp-file data-file (insert body)) +(message (concat java -jar org-ditaa-jar-path args data-file out-file)) +(shell-command (concat java -jar org-ditaa-jar-path args data-file out-file))) (format \n[[file:%s]]\n out-file)) (t (concat \n#+BEGIN_EXAMPLE\n @@ -259,14 +277,32 @@ digraph data_relationships { } #+end_dot (message dot-formatting...) - (let ((out-file (if headers (car headers))) - (args (if (cdr headers) (mapconcat 'identity (cdr headers) ))) - (data-file (make-temp-file org-ditaa))) + (let* ((args (if (cdr headers) (mapconcat 'identity (cdr headers) ))) + (data-file (make-temp-file org-ditaa)) + (hash (sha1 (prin1-to-string (list body args + (raw-out-file (if headers (car headers))) + (out-file-parts (if (string-match \\(.+\\)\\.\\([^\\.]+\\) $ raw-out-file) + (cons (match-string 1 raw-out-file) + (match-string 2 raw-out-file)) + (cons raw-out-file png))) + (out-file (concat (car out-file-parts) _ hash . (cdr out-file-parts (cond ((or htmlp latexp docbookp) - (with-temp-file data-file (insert body)) - (message (concat dot data-file args -o out-file)) - (shell-command (concat dot data-file args -o out- file)) + (unless (file-exists-p out-file) +(mapc ;; remove old hashed versions of this file + (lambda (file) + (when (and (string-match (concat (regexp-quote (car out- file-parts)) +_\\([[:alnum:]]+\\)\ \. +(regexp-quote (cdr out- file-parts))) +file) + (= (length (match-string 1 out-file)) 40)) + (delete-file (expand-file-name file +(file-name-directory out-file) + (directory-files (or (file-name-directory out-file) + default-directory))) +(with-temp-file data-file (insert body)) +(message (concat dot data-file args -o out- file)) +(shell-command (concat dot data-file args -o out- file))) (format \n[[file:%s]]\n out-file)) (t (concat \n#+BEGIN_EXAMPLE\n -- 1.6.4.73.gc144 - Carsten - Carsten ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode -- Francesco Pizzolante - f...@missioncriticalit.com M i s s i o n C r i t i c a l I T Phone ... +32 2-757.10.15 Fax . +32 2-759.27.60 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Blorgit Issue with setf
Hi, After having updated orgmode and blorgit to their latest versions, I kept getting the following error: *ERROR*: Symbol's function definition is void: setf This error was preventing the creation of any html/latex/pdf files. After applying this patch, everything is back to normal: --8---cut here---start-8--- diff --git a/elisp/org-interaction.el b/elisp/org-interaction.el index 5b4868b..6f87971 100644 --- a/elisp/org-interaction.el +++ b/elisp/org-interaction.el @@ -1,4 +1,5 @@ (require 'org) +(require 'cl) --8---cut here---end---8--- Maybe cl is no longer loaded by other packages? Thanks, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Blorgit Issue with setf
Hi, After having updated orgmode and blorgit to their latest versions, I kept getting the following error: *ERROR*: Symbol's function definition is void: setf This error was preventing the creation of any html/latex/pdf files. After applying this patch, everything is back to normal: --8---cut here---start-8--- diff --git a/elisp/org-interaction.el b/elisp/org-interaction.el index 5b4868b..6f87971 100644 --- a/elisp/org-interaction.el +++ b/elisp/org-interaction.el @@ -1,4 +1,5 @@ (require 'org) +(require 'cl) --8---cut here---end---8--- Maybe cl is no longer loaded by other packages? Thanks, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Blorgit Adding PDF export
Eric, Also, rather than using a shell script, would it be possible to use the built in `org-export-as-pdf' function. This may obviate the need for a shell script at all. In this case you probably wouldn't need to remove the leading . in the file names, and if you did, it could be done in elisp right around export with the `rename-file' function. Regarding the addition of an extra link in order to get the PDF export, I took your remarks into account and here's what I finally went to. First, add the .pdf link to the page: --8---cut here---start-8--- diff --git a/blorgit.rb b/blorgit.rb index 077b5d9..93bea47 100644 --- a/blorgit.rb +++ b/blorgit.rb @@ -197,6 +197,8 @@ __END__ %a{ :href = path_for(@blog, :format = 'org'), :title = 'download as org-mode' } .org %li %a{ :href = path_for(@blog, :format = 'tex'), :title = 'download as LaTeX' } .tex + %li +%a{ :href = path_for(@blog, :format = 'pdf'), :title = 'download as PDF' } .pdf #title_separator @@ sidebar --8---cut here---end---8--- In acts_as_org.rb, call a org-file-to-pdf emacs function: --8---cut here---start-8--- diff --git a/lib/acts_as_org.rb b/lib/acts_as_org.rb index 458741d..8e027fc 100644 --- a/lib/acts_as_org.rb +++ b/lib/acts_as_org.rb @@ -80,6 +80,24 @@ PREAMBLE l_path = self.latex_path(path) File.exist?(l_path) and File.mtime(l_path) File.mtime(path) end + +def pdf_path(path) + File.join(File.dirname(path), +ActiveFile::Acts::Org::EXP_PREFIX + File.basename(path) + .pdf) +end + +def to_pdf(path, options = {}) + p_path = self.pdf_path(path) + options = {:postamble = false}.merge(options) + self.emacs_run((org-file-to-pdf \#{path}\)) unless self.clean_pdf?(path) + return nil unless File.exist?(p_path) + html = File.read(p_path) +end + +def clean_pdf?(path) + p_path = self.pdf_path(path) + File.exist?(p_path) and File.mtime(p_path) File.mtime(path) +end end module InstanceMethods @@ -107,6 +125,19 @@ PREAMBLE self.class.to_latex(self.full_path, options) end alias :to_tex :to_latex + +def pdf_path + self.class.pdf_path(self.full_path) +end + +def clean_pdf? + self.class.clean_pdf?(self.full_path) +end + +def to_pdf(options = {}) + self.class.to_pdf(self.full_path, options) +end + end end end --8---cut here---end---8--- In org-interaction.el, added the org-file-to-pdf function: --8---cut here---start-8--- diff --git a/elisp/org-interaction.el b/elisp/org-interaction.el index 2311156..9b0d695 100644 --- a/elisp/org-interaction.el +++ b/elisp/org-interaction.el @@ -24,6 +24,7 @@ evaluating BODY. ,temp-result))) (defvar org-interaction-prefix .exported_) +(defvar tmp-prefix exported_) (defun org-file-to-html (file-path) Open up an org file, publish it to html, and then return the @@ -65,6 +66,31 @@ latex as a string. (write-file latex-path) (kill-buffer (current-buffer))) +(defun org-file-to-pdf (file-path) + Open up an org file and export it as pdf. + (let* ((file-name (file-name-nondirectory file-path)) +(file-dir (file-name-directory file-path)) +(org-tmp-path (expand-file-name (concat tmp-prefix file-name .org) /tmp/)) +(pdf-tmp-path (expand-file-name (concat tmp-prefix file-name .pdf) /tmp/)) +(tex-tmp-path (expand-file-name (concat tmp-prefix file-name .tex) /tmp/)) +(pdf-path (expand-file-name (concat org-interaction-prefix file-name .pdf) file-dir))) +(if (and (file-exists-p pdf-path) +( 0 (time-to-seconds + (time-subtract + (nth 5 (file-attributes pdf-path)) + (nth 5 (file-attributes file-path)) + pdf-path + (with-temp-filebuffer + file-path + (write-file org-tmp-path) + (org-mode) + (save-window-excursion +(org-export-as-pdf nil) +(rename-file pdf-tmp-path pdf-path) +(delete-file org-tmp-path) +(delete-file tex-tmp-path) +(kill-buffer (current-buffer))) + ;; customization (setq org-export-blocks-witheld '(hidden comment)) --8---cut here---end---8--- Note that I use the /tmp folder to store temporary files without the leading dot (the export do PDF does not work with a leading dot). What do you think? Thanks for your feedback. Regards, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org
[Orgmode] org-export-as-pdf Removing log files
Hi, When removing log files, the org-export-as-pdf function should also delete the .idx files: --8---cut here---start-8--- diff --git a/lisp/org-latex.el b/lisp/org-latex.el index ad45a21..17e038c 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -720,7 +720,7 @@ when PUB-DIR is set, use this as the publishing directory. (error PDF file was not produced) (set-window-configuration wconfig) (when org-export-pdf-remove-logfiles - (dolist (ext '(aux log out toc)) + (dolist (ext '(aux idx log out toc)) (setq file (concat base . ext)) (and (file-exists-p file) (delete-file file (message Exporting to PDF...done) --8---cut here---end---8--- Regards, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] org-export-as-pdf Deleting the pdf file
Hi, When working with LaTeX files (and now with org files as well), we are used to open the resulting PDF files with Sumatra PDF viewer. It is very handy because it does not lock the file (like Adobe Reader) and thus enables us to recompile it while it is still open. It is then refreshed automatically at the end of the compilation. While using the org-export-as-pdf function, we are not able to get the same behavior as the function deletes the pdf file before the compilation. The deletion fails because the pdf file is opened in the viewer. Would it be possible to avoid deleting the pdf file before compilation? --8---cut here---start-8--- diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 5aa6409..6e1356d 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -698,7 +698,6 @@ when PUB-DIR is set, use this as the publishing directory. (re-search-forward bibliography{ nil t cmd) (with-current-buffer outbuf (erase-buffer)) -(and (file-exists-p pdffile) (delete-file pdffile)) (message Processing LaTeX file...) (if (and cmds (symbolp cmds)) (funcall cmds file) --8---cut here---end---8--- Thanks, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Blorgit Adding PDF export
Eric, First off this looks great. Thanks. Rather than explicitly using the /tmp directory i would recommend using the `make-temp-file' function, which should work across a wider range of systems. Additionally if you need to get the directory from a path, or combine a file-name and a directory name into a path I'd recommend the `expand-file-name' and `file-name-directory' functions respectively. With those change I would love to include this new feature into the main blorgit repository. I tried to take your remarks into account as much as possible. I only changed org-interaction.el. Here's the diff: --8---cut here---start-8--- diff --git a/elisp/org-interaction.el b/elisp/org-interaction.el index 2311156..9b785e2 100644 --- a/elisp/org-interaction.el +++ b/elisp/org-interaction.el @@ -65,6 +65,31 @@ latex as a string. (write-file latex-path) (kill-buffer (current-buffer))) +(defun org-file-to-pdf (file-path) + Open up an org file and export it as pdf. + (let* ((file-name (file-name-nondirectory file-path)) +(file-dir (file-name-directory file-path)) +(org-tmp-path (make-temp-file org-file-to-pdf-)) +(pdf-tmp-path (concat org-tmp-path .pdf)) +(tex-tmp-path (concat org-tmp-path .tex)) +(pdf-path (expand-file-name (concat org-interaction-prefix file-name .pdf) file-dir))) +(if (and (file-exists-p pdf-path) +( 0 (time-to-seconds + (time-subtract + (nth 5 (file-attributes pdf-path)) + (nth 5 (file-attributes file-path)) + pdf-path + (with-temp-filebuffer + file-path + (write-file org-tmp-path) + (org-mode) + (save-window-excursion +(org-export-as-pdf nil) +(rename-file pdf-tmp-path pdf-path t) +(delete-file org-tmp-path) +(delete-file tex-tmp-path) +(kill-buffer (current-buffer))) + ;; customization (setq org-export-blocks-witheld '(hidden comment)) --8---cut here---end---8--- Is this better? Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] LaTeX export of section links
Hi, I have a few questions about links to sections. I've read that it is better to user IDs and CUSTOM_IDs to links to section... Here's a small example with 4 cases: --8---cut here---start-8--- * First :PROPERTIES: :CUSTOM_ID: heading-a :END: Hello Toto! * Second # heading-b Hello Tata! * Third #+CUSTOM_ID: heading-c Hello Titi! * Fourth #+ID: heading-d Hello Tete! [[heading-a]] [[heading-b]] [[heading-c]] [[heading-d]] --8---cut here---end---8--- Which give the following LaTeX code: --8---cut here---start-8--- \section{First} \label{sec-1} \label{heading-a} Hello Toto! \section{Second} \label{sec-2} \label{heading-b} Hello Tata! \section{Third} \label{sec-3} Hello Titi! \section{Fourth} \label{sec-4} Hello Tete! \hyperref[sec-1]{heading-a} \hyperref[sec-2]{heading-b} \hyperref[sec-3]{heading-c} \hyperref[sec-4]{heading-d} --8---cut here---end---8--- The first and second cases both generate labels which are not used in LaTeX. The third and fourth cases are very elegant as they use only aliases (which are dropped from the LaTeX code). My questions are: - what's the difference between using ID and CUSTOM_ID? - the cases Third and Fourth are the more elegant from my point of view. Is this the right way of doing? - what's the difference between cases First and Second (I mean between using PROPERTIES and # X)? - in the documentation (section 4.2), we talk about CUSTOM_ID property does it mean that we should use it as in case 1? Thanks. Francesco ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Bug in LaTeX export of multiple footnote references
Hi, Exporting multiple references to the same footnote to LaTeX lead to a wrong generated code. The following example: --8---cut here---start-8--- * Title This is my text[fn:1:This is my footnote.]. And another one[fn:1]. --8---cut here---end---8--- Will produce the following LaTeX code: --8---cut here---start-8--- \section{Title} \label{sec-1} This is my text\footnote{This is my footnote. }. And another one\$$^{1}$\$. --8---cut here---end---8--- The correct code should be: --8---cut here---start-8--- \section{Title} \label{sec-1} This is my text\footnote{This is my footnote. }. And another one$^{1}$. --8---cut here---end---8--- Regards, Francesco ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] LaTeX export of section links
Hi Carsten, --8---cut here---start-8--- * First :PROPERTIES: :CUSTOM_ID: heading-a :END: Hello Toto! * Second # heading-b Hello Tata! * Third #+CUSTOM_ID: heading-c Hello Titi! * Fourth #+ID: heading-d Hello Tete! [[heading-a]] [[heading-b]] [[heading-c]] [[heading-d]] --8---cut here---end---8--- Which give the following LaTeX code: --8---cut here---start-8--- \section{First} \label{sec-1} \label{heading-a} Hello Toto! \section{Second} \label{sec-2} \label{heading-b} Hello Tata! \section{Third} \label{sec-3} Hello Titi! \section{Fourth} \label{sec-4} Hello Tete! \hyperref[sec-1]{heading-a} \hyperref[sec-2]{heading-b} \hyperref[sec-3]{heading-c} \hyperref[sec-4]{heading-d} --8---cut here---end---8--- The third and fourth cases are very elegant as they use only aliases (which are dropped from the LaTeX code). Third and forth are non-existent syntax in Org, these lines are just treated as comments and are removed during export. OK. But the information in these 2 comments is correctly used to replace the alias (heading-c and heading-d) with the label generated by org during the export. See the last 2 references in my example: these references are correct. They thus have been correctly processed from heading-c and heading-d to sec-3 and sec-4... these comments are thus not simply removed... right? In the case of the :CUSTOM_ID: property, the property is also used to convert the alias to the label (heading-a to sec-1) but additionally an extra label (heading-a) is created and not used. That's why, when creating references to sections I found the #+CUSTOM_ID very elegant... But apparently I don't have to use such syntax... I wanted to know the recommended way of doing references... Thanks a lot for your help. Francesco ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Blorgit SVN integration
Hi Eric, First of all, I thank you very much for your useful tips. Thanks to you, I think I've made a step forward. Here's how. 1) Is it possible to integrate Blorgit with SVN instead of git? If yes, how can I do it? Yes, it should be possible to use any version control backend, the only command that will not work with svn is the option to automatically commit any edits to the git repository, however changing this command should be straightforward. You should just have to make a change in backend/blog.rb line 15. This is what I've added to blog.rb: --8---cut here---start-8--- diff --git a/backend/blog.rb b/backend/blog.rb index 0f43728..827ec05 100644 --- a/backend/blog.rb +++ b/backend/blog.rb @@ -17,6 +17,20 @@ class Blog ActiveFile::Base end end + # if the svn_commit option is set then add a hook to automatically + # commit any changes from the web interface to svn. + if $global_config[:config]['svn_commit'] +puts adding svn commit hooks Blog.after_save + +add_hooks(:save) + +def after_save + Dir.chdir(Blog.base_directory) do +%x{svn add #{self.path} svn ci -m #{self.path} updated through the web interface #{self.path}} + end +end + end + def self.files(path) base = (File.directory?(self.expand(path)) ? self.expand(path) : File.dirname(self.expand(path))) self.entries(path). --8---cut here---end---8--- You simply need to add the svn_commit: true options to the blorgit.yml config file and make your blogs directory a SVN working copy for this to work. I do a svn add (in case this is a new file) followed by an svn commit. This works very well. One little question: is it possible to add a comment field when editing a file through the web interface and use that comment as the log when checking in the file in the repository? 2) If I have comments in an org file, as soon as I edit the file through the web interface, the comments disappear (they're still present as * COMMENT lines in the org file though, but no longer displayed in the browser). Hmm, not sure about that, are you sure that you are creating the comment outline headings exactly how they are created when blorgit adds them through the web interface? Well, the comments were added by the web interface itself (the org file was completely edited by the web interface) and were correctly displayed as soon as you add them. But then, they disappeared once you edited the page. When looking at the org file, the comments were still there but no longer displayed through the web interface. But, this issue went away from the moment I created a brand new blogs folder. I cannot reproduce it. I don't have any more details about this for the moment. I will come back to you with more details if needed. Thanks for your help. 3) I would like to add a .pdf link (next to edit .org .tex) in order to download the PDF coming from the compilation (pdflatex) of the .tex file. Is it possible? Yes, this should certainly be possible (and please let me know if you succeed and I would like to add that change to the main repo). See line 70 in backend/acts_as_org/lib/acts_as_org.rb, it should be fairly straight forward to create a to_pdf command similar to the to_tex command defined therein. Here's what I did for this. First I added the .pdf link: --8---cut here---start-8--- diff --git a/blorgit.rb b/blorgit.rb index 077b5d9..93bea47 100644 --- a/blorgit.rb +++ b/blorgit.rb @@ -197,6 +197,8 @@ __END__ %a{ :href = path_for(@blog, :format = 'org'), :title = 'download as org-mode' } .org %li %a{ :href = path_for(@blog, :format = 'tex'), :title = 'download as LaTeX' } .tex + %li +%a{ :href = path_for(@blog, :format = 'pdf'), :title = 'download as PDF' } .pdf #title_separator @@ sidebar : --8---cut here---end---8--- I had to remove the first dot in the exported filenames as pdflatex doesn't like it: --8---cut here---start-8--- diff --git a/Rakefile b/Rakefile index 7c6d202..129b952 100644 --- a/Rakefile +++ b/Rakefile @@ -13,7 +13,7 @@ end Dir[File.join(File.dirname(__FILE__), themes, *, *.rake)].each { |ext| load ext } # handle exported files -def all_exported(dir) Dir.chdir($blogs){ Dir['**/.exported_*'].each{ |path| yield(path) } } end +def all_exported(dir) Dir.chdir($blogs){ Dir['**/exported_*'].each{ |path| yield(path) } } end namespace :exported do desc list all temporary exported files task :list do diff --git a/elisp/org-interaction.el b/elisp/org-interaction.el index 2311156..78373df 100644 --- a/elisp/org-interaction.el +++ b/elisp/org-interaction.el @@ -23,7 +23,7 @@ evaluating BODY. (kill-buffer ,temp-file) ,temp-result))) -(defvar org-interaction-prefix .exported_) +(defvar org-interaction-prefix
[Orgmode] Blorgit SVN integration
Hi, I've started playing with Blorgit and it really looks very promising... I have a few questions: 1) Is it possible to integrate Blorgit with SVN instead of git? If yes, how can I do it? 2) If I have comments in an org file, as soon as I edit the file through the web interface, the comments disappear (they're still present as * COMMENT lines in the org file though, but no longer displayed in the browser). 3) I would like to add a .pdf link (next to edit .org .tex) in order to download the PDF coming from the compilation (pdflatex) of the .tex file. Is it possible? 4) Is it possible to add a button in order to create a new file directly from the web interface? Many thanks in advance for your help! F. ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] LaTeX export of tables
Hi, Can I give this thread a bump? Francesco Pizzolante wrote: Hi, When exporting tables to LaTeX, I think it would be good to have the following options to be able to define: - the table environment to be used: now we have the option to have tabular and longtable, but I could also use array, tabular*, tabularx, tabulary, etc. The general rule is: \begin{TABLEENV}{WIDTH}[VPOS]{COLS} ROWS \end{TABLEENV} TABLEENV can be any of tabular, array, tabular*, tabularx, etc., depending on the type of table I want. Some types of table need a WIDTH to be specified; in this case, I would add a WIDTH option. An extra vertical position VPOS option can also be added to some types of table. The COLS parameter already receives the value from the align org attribute. The following options #+ATTR_LATEX: tabularx width=\textwidth align=lX vpos=tb would generate the following LaTeX code: \begin{tabularx}{\textwidth}[tb]{lX} ROWS \end{tabularx} - the rule to be used as hline (similar option as in #+ORGTBL: :hline=\\midrule): #+ATTR_LATEX: hline=midrule or #+ATTR_LATEX: hline=\\midrule - define the top and bottom rules: #+ATTR_LATEX: toprule=\\toprule bottomrule=\\bottomrule Does it make sense? Would it be possible to have these new options in a future orgmode release? I really am eager to use orgmode in order to generate all my LaTeX documents. But, as of now, the LaTeX export of tables offers only limited flexibility. My proposal is simply to add a few org attributes (type of the table, toprule, bottomrule, hline, vpos) in order to get an improved flexibility when generating LaTeX tables. Can someone take care of my request? Thanks a lot, Francesco ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: LaTeX export of images
Hi Carsten, Sorry for my late reply on this subject. OK, I have now modified image placement in LaTeX. 1. Image in text [[./img/x.png]] 2. Floating image with caption and modified size and placement #+CAPTION: My caption #+ATTR_LATEX: placement=[H] width=0.6\textwidth [[./img/x.png]] 3. Wrapping text around the image #+ATTR_LaTeX: wrap #+ATTR_HTML: align=left [[./img/x.png]] 4. Wrapping text around the image with modified size and wrapfigure placement #+ATTR_LaTeX: wrap width=0.38\textwidth placement={r}{0.4\textwidth #+ATTR_HTML: align=right width=250 [[./img/x.png]] Even if there is a caption, wrap will work and force the image to be non-floating with text wrapped around. Comments? I did not test the wrap option yet, but the rest is perfect (images in text, placements, width, captions, labels). I still miss one single option: float in order to force the centered figure environment if if no caption/label is present. I would add something like #+ATTR_LATEX: float or #+ATTR_LATEX: float=t Is this feasible? Thanks a lot! Francesco ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode