Re: [O] resize multiple image within a row or paragraph
Any thought on this? ~Alban. On Thursday, September 18, 2014 5:14 PM, alban bernard wrote: Hi Folks, My wife and I use the marvelous org-mode to design a complete set of student courses. These courses are first written in org-mode then exported to html to ease distribution to students (and save some paper). We wonder what is the correct way to resize multiple images those links are within a single paragraph: "This is a phrase with [[./image1.png]] and [[./image2.png]] inline images." With the following, the only first image is resized (as expected): #+ATTR_HTML: :width 50% This is a phrase with [[./image1.png]] and [[./image2.png]] inline images. The tutorial about caption in a row shows what is possible while working only with images http://orgmode.org/worg/org-tutorials/images-and-xhtml-export.html#sec-5-2: #+HTML_HEAD: #+HTML_HEAD: #+HTML_HEAD: #+CAPTION: #+ATTR_HTML: :width 10% [[./image1.png]] #+CAPTION: #+ATTR_HTML: :width 10% [[./image2.png]] Here, image1 and image2 are displayed and resized in a single row. But we don't know how to mix text within this block so that all is displayed as a single paragraph with resized images. I tested all of this with the following version combos: Debian Jessie/Emacs 24.3.1/Orgmode 8.2.5h-1 (debian) Debian Jessie/Emacs 24.3.1/Orgmode latest git Thanks for any hint that could help. ~Alban. PS: the "Show the source" button of http://orgmode.org/worg/org-tutorials/images-and-xhtml-export.html redirects to: http://orgmode.org/worg/org-tutorials/images-and-xorg.html-export.org.html rather than: http://orgmode.org/worg/org-tutorials/images-and-xhtml-export.org.html
Re: [O] CV in orgmode for export to pdf (and html?)
Hi Rainer, You can see mine https://github.com/xgarrido/org-resume that uses org-mode to produce a LaTeX->PDF (see attached file) file as well as an HTML version. Hope it gives you some ideas. Cheers, Xavier Le 19/09/2014 11:18, Rainer M Krug a écrit : Hi I am looking for examples / templates for CVs written using org, as I decided to ose org for my CV. I fund this oldish conversation http://lists.gnu.org/archive/html/emacs-orgmode/2012-04/msg00096.html and these two templates for using org to write a CV: https://github.com/punchagan/resume https://github.com/fasheng/fsh-orgmode-latex-cv as well this CV without .org file http://adamsonj.ninth.su/cv.html Also, there does not seem to be anything on worg. - Can somebody give any further info on org and CVs? - How do you do it (I don't assume you write your CVs in Word?), or are you using LaTeX directly? - Any other examples and templates online? If I get enough, I will compile a summary for worg, but I need examples and information. Thanks, Rainer resume.pdf Description: Adobe PDF document
Re: [O] [RFC] [PATCH] [babel] read description lists as lists of lists
Hello, Aaron Ecay writes: > The attached patch makes babel read description lists as lists of the > following format: (("term" "description") ...). The present default is > to simply read in the text of each list item, yielding: > ("term :: description" ...). Thank you. > Of course, it’s possible to interconvert between the two formats, but I > think the greater structure of this proposal makes things easier for > babel authors. (Another way of thinking of the proposal is that it > treats description lists like two-column tables.) > > What do people think? The problem I see here is that you're introducing yet another internal representation for lists (along with element's and org-list-parse-list's). Worse, it can only be discovered when reading the docstring of a Babel internal function and will only benefit to Babel. If this new internal representation is better than current one, by all means, improve `org-list-parse-list', and document it in (info "(org) Radio lists") This is more work, but, IMO, it is also the only sane way to proceed. > +THE result is a list of strings \(the list items), unless the You only need to escape parenthesis at the beginning of a line. > + (mapcar (lambda (el) > + (let ((s (split-string el " :: "))) > + (list (nth 0 s) (mapconcat #'identity (cdr s) " :: " This is really awkward. You can use a regexp to extract the tag. Regards, -- Nicolas Goaziou
Re: [O] [PATCH] Add support for :dbhost, :dbuser and :database parameters for poastgresql in ob-sql.el
Hello, Thomas S. Dye writes : If you'd like to contribute other patches, then you'll want to sign the FSF papers following the instructions here: http://orgmode.org/worg/org-contribute.html#sec-2 This process will probably take some weeks to complete. I completed the copyright assignment procedure, so I come back to propose my changes. To avoid you browsing your mails to find the first message, I summarize again the changes in this mail, and attach the patch to it. This patch adds support for :dbhost, :dbuser and :database parameters for SQL code blocks that uses postgresql engine. This allows to abstract postgresql login details instead of sending parameters in a psql-specific format using :cmdline argument. I am still at your service for any comment on the code. Regards, Steven Rémot >From 6ad99759a16c8b6f9decfb8ea90c84e7a1c18fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven=20R=C3=A9mot?= Date: Fri, 8 Aug 2014 21:49:44 +0200 Subject: [PATCH] ob-sql.el: Enhance postgresql support * lisp/ob-sql.el: Add support for :dbhost, :dbuser and :database parameters in sql code blocks for postgresql engine. Before this patch, it was necessary to use :cmdline parameter to specify host, user and database different the the default ones. Now, this can be done using parameters that are independents of the engine used. This is not trivial (and not recommended) to pass password as a command line argument to psql, so :dbpassword is not supported. --- lisp/ob-sql.el | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el index 7b85df8..9fe9da2 100644 --- a/lisp/ob-sql.el +++ b/lisp/ob-sql.el @@ -87,6 +87,15 @@ (when password (concat "-p" password)) (when database (concat "-D" database)) +(defun dbstring-postgresql (host user database) + "Make PostgreSQL command line ards for database connection. +Pass nil to omit that arg." + (combine-and-quote-strings + (remq nil + (list (when host (concat "-h" host)) + (when user (concat "-U" user)) + (when database (concat "-d" database)) + (defun org-babel-execute:sql (body params) "Execute a block of Sql code with Babel. This function is called by `org-babel-execute-src-block'." @@ -123,8 +132,9 @@ This function is called by `org-babel-execute-src-block'." (org-babel-process-file-name in-file) (org-babel-process-file-name out-file))) ('postgresql (format - "psql --set=\"ON_ERROR_STOP=1\" %s -A -P footer=off -F \"\t\" -f %s -o %s %s" + "psql --set=\"ON_ERROR_STOP=1\" %s -A -P footer=off -F \"\t\" %s -f %s -o %s %s" (if colnames-p "" "-t") + (dbstring-postgresql dbhost dbuser database) (org-babel-process-file-name in-file) (org-babel-process-file-name out-file) (or cmdline ""))) -- 1.9.1
Re: [O] resize multiple image within a row or paragraph
Hello, alban bernard writes: > My wife and I use the marvelous org-mode to design a complete set > of student courses. These courses are first written in org-mode then > exported to html to ease distribution to students (and save some paper). > > We wonder what is the correct way to resize multiple images those links > are within a single paragraph: > > "This is a phrase with [[./image1.png]] and [[./image2.png]] inline images." > > With the following, the only first image is resized (as expected): > > #+ATTR_HTML: :width 50% > This is a phrase with [[./image1.png]] and [[./image2.png]] inline images. > > The tutorial about caption in a row shows what is possible while working > only with > images > http://orgmode.org/worg/org-tutorials/images-and-xhtml-export.html#sec-5-2: > > #+HTML_HEAD: > #+HTML_HEAD: > #+HTML_HEAD: > > #+CAPTION: > #+ATTR_HTML: :width 10% > [[./image1.png]] > #+CAPTION: > #+ATTR_HTML: :width 10% > [[./image2.png]] > > Here, image1 and image2 are displayed and resized in a single row. > But we don't know how to mix text within this block so that all is > displayed as a single paragraph with resized images. This is not possible out of the box. You might use some Babel code to generate the needed HTML but I guess it wouldn't be particularly easy. Nevertheless, there's a solution. `html' back-end can redefine what a paragraph is, instead of following Org's own definition. More explicitly, an HTML paragraph can be defined as a cluster of elements not separated by any blank line and containing at least an Org paragraph. Hence: #+attr_html: :width 10% [[./img1.png]] Paragraph #+attr_html: :width 10% [[./img2.png]] consists of two paragraphs in Org, but would be seen as a single paragraph by HTML, and exported as such. Implementation is simple using pseudo-elements. `latex' back-ends does it already for tables and math snippets. However, I'm no HTML specialist, so there may be drawbacks I cannot foresee. Regards, -- Nicolas Goaziou
Re: [O] [PATCH] Add support for :dbhost, :dbuser and :database parameters for poastgresql in ob-sql.el
Hello, Steven Rémot writes: > This patch adds support for :dbhost, :dbuser and :database parameters > for SQL code blocks that uses postgresql engine. This allows to > abstract postgresql login details instead of sending parameters in > a psql-specific format using :cmdline argument. Thanks for your patch. Some comments below. > * lisp/ob-sql.el: Add support for :dbhost, :dbuser and :database > parameters in sql code blocks for postgresql engine. It should be * lisp/ob-sql.el (dbstring-postgresql): New function (org-babel-execute:sql): Use new function. > +(defun dbstring-postgresql (host user database) > + "Make PostgreSQL command line ards for database connection. args > +Pass nil to omit that arg." > + (combine-and-quote-strings > + (remq nil > + (list (when host (concat "-h" host)) > +(when user (concat "-U" user)) > +(when database (concat "-d" database)) > + This is not related to your patch, but while you're at it, use `delq' instead of `remq' (nitpick) and `dbstring-postgresql' needs to be renamed `org-babel-sql-dbstring-postgresql' or some such. Regards, -- Nicolas Goaziou
Re: [O] [PATCH][mini] bulk-mark-regexp and -toggle also with time grid
Hello, marcowahls...@gmail.com writes: >> (org-agenda-bulk-mark-all) >> >> Mark all entries for future agenda bulk action. > >> Currently this is not true if there is a time grid in the agenda buffer. >> >> Please consider to apply the attached patch. > > I forgot one line in the previous patch. Please consider the new > patch only. Thank you. Would you mind providing a proper commit message (don't forget the TINYCHANGE at the end) and send it again using git format-patch? Regards, -- Nicolas Goaziou
[O] simple expense tracking with org
Hello there, I thought to share a little elisp thingy that I wrote to track my expenses with org. I use the org's capture mechanism to add expense items to some files and the following code only searches through all these files and creates summaries of all found expenses. It is possible to search by date, tags etc. You can have a look here: https://github.com/eikek/org-expenses Regards, Eike -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E
Re: [O] simple expense tracking with org
Could you give a few snippets of examples -- what the org files with tags look like, what the result looks like? I'm interested because I also use Org to do my budgeting and finances. Eike writes: > Hello there, > > I thought to share a little elisp thingy that I wrote to track my > expenses with org. I use the org's capture mechanism to add expense > items to some files and the following code only searches through all > these files and creates summaries of all found expenses. It is possible > to search by date, tags etc. > > You can have a look here: https://github.com/eikek/org-expenses > > > Regards, > Eike > > -- > gpg: AD7AC35E > finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E
Re: [O] [PATCH] Add support for :dbhost, :dbuser and :database parameters for poastgresql in ob-sql.el
Thank you for your comments. I attached the fixed patch below. On 09/20/2014 14:16, Nicolas Goaziou wrote: This is not related to your patch, but while you're at it, use `delq' instead of `remq' (nitpick) and `dbstring-postgresql' needs to be renamed `org-babel-sql-dbstring-postgresql' or some such. I used mysql parameters handling code as a template for writing my patch, so it suffered from the same problems. I added a second patch that renames `dbstring-mysql' to `org-babel-sql-dbstring-mysql' and that uses `delq' instead of `remq' in its implementation. I did some basic tests to ensure I didn't break anything. Regards, Steven Rémot >From b4584bddcc66046836c4029ab992bd8b8ed347ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven=20R=C3=A9mot?= Date: Sat, 20 Sep 2014 15:02:36 +0200 Subject: [PATCH 1/2] ob-sql.el: Enhance postgresql support * lisp/ob-sql.el (org-babel-sql-dbstring-postgresql): New function (org-babel-execute:sql): Use new function. Before this patch, it was necessary to use :cmdline parameter to specify host, user and database different the the default ones. Now, this can be done using parameters that are independents of the engine used. This is not trivial (and not recommended) to pass password as a command line argument to psql, so :dbpassword is not supported. --- lisp/ob-sql.el | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el index 7b85df8..292d5dd 100644 --- a/lisp/ob-sql.el +++ b/lisp/ob-sql.el @@ -87,6 +87,15 @@ (when password (concat "-p" password)) (when database (concat "-D" database)) +(defun org-babel-sql-dbstring-postgresql (host user database) + "Make PostgreSQL command line args for database connection. +Pass nil to omit that arg." + (combine-and-quote-strings + (delq nil + (list (when host (concat "-h" host)) + (when user (concat "-U" user)) + (when database (concat "-d" database)) + (defun org-babel-execute:sql (body params) "Execute a block of Sql code with Babel. This function is called by `org-babel-execute-src-block'." @@ -123,8 +132,9 @@ This function is called by `org-babel-execute-src-block'." (org-babel-process-file-name in-file) (org-babel-process-file-name out-file))) ('postgresql (format - "psql --set=\"ON_ERROR_STOP=1\" %s -A -P footer=off -F \"\t\" -f %s -o %s %s" + "psql --set=\"ON_ERROR_STOP=1\" %s -A -P footer=off -F \"\t\" %s -f %s -o %s %s" (if colnames-p "" "-t") + (org-babel-sql-dbstring-postgresql dbhost dbuser database) (org-babel-process-file-name in-file) (org-babel-process-file-name out-file) (or cmdline ""))) -- 1.9.1 >From 4cd3b02de74c74980ca0b99f7faa228f96792a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven=20R=C3=A9mot?= Date: Sat, 20 Sep 2014 15:09:29 +0200 Subject: [PATCH 2/2] ob-sql.el: Clean mysql parameters generation * lisp/ob-sql.el (dbstring-mysql): Rename function and tweak a bit its implementation (org-babel-execute:sql): Use new function name Prefix `dbstring-mysql' function with the namespace "org-babel-sql" to avoid name collisions. Also replace the call to `remq' by `delq' because it is a bit more efficient, and also to be consistent with `org-babel-sql-dbstring-postgresql'. --- lisp/ob-sql.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el index 292d5dd..493b3dc 100644 --- a/lisp/ob-sql.el +++ b/lisp/ob-sql.el @@ -78,10 +78,10 @@ (org-babel-sql-expand-vars body (mapcar #'cdr (org-babel-get-header params :var -(defun dbstring-mysql (host user password database) +(defun org-babel-sql-dbstring-mysql (host user password database) "Make MySQL cmd line args for database connection. Pass nil to omit that arg." (combine-and-quote-strings - (remq nil + (delq nil (list (when host (concat "-h" host)) (when user (concat "-u" user)) (when password (concat "-p" password)) @@ -126,7 +126,7 @@ This function is called by `org-babel-execute-src-block'." (org-babel-process-file-name in-file) (org-babel-process-file-name out-file))) ('mysql (format "mysql %s %s %s < %s > %s" -(dbstring-mysql dbhost dbuser dbpassword database) +(org-babel-sql-dbstring-mysql dbhost dbuser dbpassword database) (if colnames-p "" "-N") (or cmdline "") (org-babel-process-file-name in-file) -- 1.9.1
Re: [O] simple expense tracking with org
torys.ander...@gmail.com (Tory S. Anderson) writes: > Could you give a few snippets of examples -- what the org files with > tags look like, what the result looks like? I'm interested because I > also use Org to do my budgeting and finances. You two know about ledger-cli, emacs ledger-mode, and ob-ledger.el, don't you? > Eike writes: > >> Hello there, >> >> I thought to share a little elisp thingy that I wrote to track my >> expenses with org. I use the org's capture mechanism to add expense >> items to some files and the following code only searches through all >> these files and creates summaries of all found expenses. It is possible >> to search by date, tags etc. >> >> You can have a look here: https://github.com/eikek/org-expenses >> >> >> Regards, >> Eike >> >> -- >> gpg: AD7AC35E >> finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E > > -- cheers, Thorsten
Re: [O] simple expense tracking with org
Sure. An "expense item" is a headline with a property drawer that has a property where the key is some currency code (other headlines are ignored). Then tags can be applied to this headline. A category is either specified via CATEGORY property or the parent headline is used (if present). The org files may look like this * some headline that is a category by default ** expense item 1 :atag: :PROPERTIES: :CHF: 25.00 :date: [2014-09-20] :END: ** expense item 2 :anothertag: :PROPERTIES: :CHF: 21.00 :date: [2014-09-20] :CATEGORY: :END: The "expense view" gives a summary of these items and the items itself as a org table (there also is a screenshot https://github.com/eikek/org-expenses/blob/master/screenshot.png): #+TITLE: Expenses [2014-08-01 Fr] - [2014-08-31 So] #+STARTUP: showeverything Search: ~(:date "2014-08")~ Showing *7* items * Overview ** Summary | Curr. |sum |max | min | count | avg | |---+++---+---+---| | CHF | 532.98 | 349.99 | 10.00 | 6 | 88.83 | | EUR | 15.99 | 15.99 | 15.99 | 1 | 15.99 | ** Categories | |sum |max | min | count |avg | |---+++---+---+| | Bücher CHF| 49.99 | 39.99 | 10.00 | 2 | 25.00 | | Bücher EUR| 15.99 | 15.99 | 15.99 | 1 | 15.99 | | Sonstiges CHF | 426.49 | 349.99 | 20.00 | 3 | 142.16 | | Work CHF | 56.50 | 56.50 | 56.50 | 1 | 56.50 | ** Monthly | |sum |max | min | count | avg | |-+++---+---+---| | 2014/08 CHF | 532.98 | 349.99 | 10.00 | 6 | 88.83 | | 2014/08 EUR | 15.99 | 15.99 | 15.99 | 1 | 15.99 | * Items | :item | :category | :date | :CHF | :EUR | |---+---+-++---| | Buch1 | Bücher| [2014-08-31 So] || 15.99 | | Cellphone | Sonstiges | [2014-08-30 Sa] | 349.99 | | | Pizza | Sonstiges | [2014-08-29 Fr] | 20.00 | | | Buch2 | Bücher| [2014-08-26 Di] | 10.00 | | | Cablecom | Sonstiges | [2014-08-25 Mo] | 56.50 | | | Cablecom | Work | [2014-08-25 Mo] | 56.50 | | | Buch2 | Bücher| [2014-08-01 Fr] | 39.99 | | It's just counting and summing the items, nothing more. It's not doing accounting or anythingmore complicated, if you had this in mind. Regard, Eike Tory S. Anderson writes: > Could you give a few snippets of examples -- what the org files with tags > look like, what the result looks like? I'm interested because I also use Org > to do my budgeting and finances. > > Eike writes: > >> Hello there, >> >> I thought to share a little elisp thingy that I wrote to track my >> expenses with org. I use the org's capture mechanism to add expense >> items to some files and the following code only searches through all >> these files and creates summaries of all found expenses. It is possible >> to search by date, tags etc. >> >> You can have a look here: https://github.com/eikek/org-expenses >> >> >> Regards, >> Eike >> >> -- >> gpg: AD7AC35E >> finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E
Re: [O] simple expense tracking with org
Thorsten Jolitz wrote: torys.ander...@gmail.com (Tory S. Anderson) writes: Could you give a few snippets of examples -- what the org files with tags look like, what the result looks like? I'm interested because I also use Org to do my budgeting and finances. You two know about ledger-cli, emacs ledger-mode, and ob-ledger.el, don't you? Eike writes: Hello there, I thought to share a little elisp thingy that I wrote to track my expenses with org. I use the org's capture mechanism to add expense items to some files and the following code only searches through all these files and creates summaries of all found expenses. It is possible to search by date, tags etc. You can have a look here: https://github.com/eikek/org-expenses Regards, Eike -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E I have found that ledger and Sacha Chua's org-capture-template, modified to my needs, does a great job keeping trackn of my day of day to expenses, amongst other things, Emacs: Recording ledger entries with org-capture-templates Charlie Millar --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com
Re: [O] Changed behaviours of LaTeX exporter in version 8.0+
Hi Richard, I do really appreciate your taking time to further explain the use of CUSTOM_ID. Now I can understand why this CUSTOM_ID-based solution is better and, in some cases as in your example, needed. With version 7.x, what I did was to reference sections in main texts (not in embedded LaTeX blocks) using 'C-c l' on a sections header and 'C-c C-l' in a part referring to it (i.e., no manual setting & typing involved). Fortunately, for most journal & conference papers in my area (i.e., up to ~15 pages), there is virtually no chance that more than one sections have the same title at the same level; note that "*Numerical Examples" and "**Numerical Examples" are different. This may be the case for a thesis as well, much longer though. Except for the said case of embedded LaTeX blocks, therefore, the use of CUSTOM_ID with manual labelling is something I want to avoid if possible. By the way, as said, [[*Foo][Section Foo]] does not produce the link in LaTeX export any longer; version 8.x generates just "\texttt{Section Foo}" unlike version 7.x. But I do agree that new export engines are more flexible and powerful (e.g., filters) and will see whether and how all these compatibility issues will be addressed; otherwise, I would have to update tens of papers based on version 7.x org-mode, which is my major platform/format for academic publications and teaching materials. Again, many thanks for your sharing valuable experience and great insight on these! Joseph On Fri, Sep 19, 2014 at 11:49 PM, Richard Lawrence < richard.lawre...@berkeley.edu> wrote: > Hi Joseph, > > "Kyeong Soo (Joseph) Kim" writes: > > > Great thanks for your answering my two questions, especially sharing your > > experience for cross-referencing in LaTeX export. > > > > Though your suggestion for cross-referencing is an excellent workaround, > I > > wonder whether there is any benefit using org-mode in writing papers in > > this case; for instance, manual setting of CUSTOM_ID would be a hassle, > > considering that it can be easily & automatically done in LaTeX with > > AUCTeX/RefTeX's label function. > > Don't you need to make sure that your sections have a consistent label > in order to refer to them? > > At any rate, one of the reasons I use this solution is that I want to be > able to easily use plain LaTeX at points where I discover that I can't > make Org do everything I want. One of the cases I was worried about, > for example, is having a section reference inside an embedded LaTeX > block. If you don't know the label ahead of time, you can't use a raw > \ref command inside #+BEGIN_LATEX...#+END_LATEX. So I like being able > to set the labels via CUSTOM_ID on an as-needed basis. (I don't do it > for every section.) > > You might be able to get away with less; it looks to me like the > [[*Foo][Section Foo]] still produces a link to a headline in LaTeX > output. Does that not work for you? > > > I still don't know why the new export engine has brought so many > > compatibility issues in its behavior. It seems that I'd better go > > back to the prior version (7.X) in order to focus on my research. > > The new export engine was a complete re-write, and came with an attempt > to define and standardize Org syntax. Some of the incompatibilities are > due to that standardization: the old LaTeX and HTML exporters might > treat some text differently, for example, or not deal with some corner > case, so in writing a new export engine, it was necessary to define the > correct behavior. Other incompatibilities are just bugs that come with > any new piece of software; the exporter is under heavy development and > those are constantly getting fixed. > > The new exporter really is a *lot* better, and in my experience it is > worth the effort to upgrade. I found myself bumping into the > limitations of the pre-8.0 exporter very frequently. If you don't, you > can wait, but I think you'll find the new exporter a lot easier to work > with and to get help with. > > Best, > Richard > > OpenPGP Key ID: CF6FA646 > Fingerprint: 9969 43E1 CF6F A646 > > (See http://www.ocf.berkeley.edu/~rwl/encryption.html for more > information.) >
Re: [O] [patch, ox] Unnumbered headlines
Hi, I'm happy to finally be able to send an updated version of this patch that touches most backends in lisp/, but not the manual. I have been moving over the summer etc. You now specify unnumbered headlines with properties. I think this is better since being unnumbered it's a pretty permanent state. It's pretty hard to discover though, other than by looking at the output. So this works as expected: * Some headline :PROPERTIES: :UNNUMBERED: t :END: There's no :NUMBERED property and :UNNUMBERED is hardcoded. I introduce a new function `org-export-get-headline-id` which returns the first non-nil from the following list. There's a caveat: CUSTOM_ID is ensured to be unique! Did I open the famous can of worm? 1. The CUSTOM_ID property. 2. A relative level number if the headline is numbered. 3. The ID property 4. A new generated unique ID. Anyhow, `org-export-get-headline-id' ensures that we can refer to unnumbered headlines, which was not possible before. Of course, in LaTeX such ref to a \section* will be nonsense, so we could introduce a \pageref here. I'm unsure about whether this conflicts `org-latex-custom-id-as-label' which I had never seen until today (also notes on this in patch). I have updated backends in lisp/, but I'm at most(!) an "expert" on LaTeX. However, I have tested all backends to the best of my ability. Please feel free to test and let me know about any discrepancies! Cheers, Rasmus PS: Not knowing or caring much about md, the links generated by it to headlines seem wrong. Referring to headline 1 it only prints "1". Should it be something like "[LABEL](1)"? -- This is the kind of tedious nonsense up with which I will not put >From fb44a552a151025513b645527498325febb6118f Mon Sep 17 00:00:00 2001 From: Rasmus Date: Fri, 8 Aug 2014 14:53:01 +0200 Subject: [PATCH] ox: Support unnumbered headlines via property. * ox.el (org-export--collect-headline-numbering): Return nil if unnumbered headline. (org-export-get-headline-id): New defun that returns a unique ID to a headline. (org-export-numbered-headline-p): Also tests for unnumbered headline. * ox-odt.el (org-odt-headline, org-odt-link, org-odt-link--infer-description): Support unnumbered headline. * ox-md.el (org-md-headline, org-md-link): Support unnumbered headlines. * ox-latex.el (org-latex-headline, org.latex-link): Support unnumbered headlines. * ox-html.el (org-html-headline, org-html-link): Support unnumbered headlines. * ox-ascii.el (org-ascii-link): Support ununbered headlines. Headlines can now be specified as unnumbered by assigning the property :UNUMBERED. --- lisp/ox-ascii.el | 7 +-- lisp/ox-html.el | 22 -- lisp/ox-latex.el | 22 ++ lisp/ox-md.el| 25 + lisp/ox-odt.el | 32 ++-- lisp/ox.el | 44 6 files changed, 82 insertions(+), 70 deletions(-) diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el index 047b74e..8a5ad89 100644 --- a/lisp/ox-ascii.el +++ b/lisp/ox-ascii.el @@ -1511,9 +1511,12 @@ INFO is a plist holding contextual information." (let ((number (org-export-get-ordinal destination info nil 'org-ascii--has-caption-p))) - (when number + (if number (if (atom number) (number-to-string number) - (mapconcat 'number-to-string number "." + (mapconcat 'number-to-string number ".")) + ;; unnumbered headline + (when (equal 'headline (org-element-type destination)) + (format "[%s]" (org-export-data (org-export-get-alt-title destination info) info) (t (if (not (org-string-nw-p desc)) (format "[%s]" raw-link) (concat (format "[%s]" desc) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 1d424cc..94cee20 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2321,7 +2321,7 @@ holding contextual information." (unless (org-element-property :footnote-section-p headline) (let* ((numberedp (org-export-numbered-headline-p headline info)) (numbers (org-export-get-headline-number headline info)) - (section-number (mapconcat #'number-to-string numbers "-")) + (section-number (when numbers (mapconcat #'number-to-string numbers "-"))) (level (+ (org-export-get-relative-level headline info) (1- (plist-get info :html-toplevel-hlevel (todo (and (plist-get info :with-todo-keywords) @@ -2338,9 +2338,9 @@ holding contextual information." (contents (or contents "")) (ids (delq nil (list (org-element-property :CUSTOM_ID headline) -(concat "sec-" section-number) +(when section-number (concat "sec-" section-number)) (org-element-property :ID headline - (preferred-id (car ids)) + (preferred-id (org-export-get-headline-id headline info)) (extr
Re: [O] Lack of availability
I'm sorry to hear you've been going through hard times, and have sent a donation through the Support Org button on the orgmode website as a token of appreciation for all the good work you've done. Please feel free to use my contribution for personal expenses, not just Org-related stuff. You've spent so much time and effort taking care of this community, it's time for us to help you! If there's anything else that could make your life better, please feel free to reach out. Sacha Chua - sachachua.com - Mobile: +1-416-823-2669 On Sep 17, 2014 2:03 AM, "Bastien" wrote: > Dear all, > > I'm sorry for my current lack of availability. I wanted > to hack back since late august but I was not able to. > > I'm going through hard times since the summer and I need > to focus on securing a basic environment for my daily life. > > I hope I can sort this out soon enough. > > I'm thankful to everyone who actively contribute with bug > fixes, questions and answers. It's great to see this. > > All best, > > -- > Bastien > > >
Re: [O] header arguments, inheritance, and noweb expansion Was: «Macro» expansion in source blocks; code-sharing between blocks
Andreas Kiermeier gmail.com> writes: > > On 19 September 2014 20:29, Rainer M Krug krugs.de> wrote:> [ snip ] > > The alternative mentioned by Chuck Berry is the xtable function (in R) > (https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00519.html). > I just tried it and am happy to share that it does created the whole > output in one go, i.e. it does exactly what I need, including table > float, caption and label. Now I just got to sort out how to created the > tables without the use of tabular ... > I suggested xtable because that is what I often use. But thinking a bit more, I decided to look at tables::tabular() and at Hmisc::latex(), which I think is what you used at first. And it turns out that latex() has args for caption, label, where, and loads of other things. See its help page. So, it looks like you have the control you need and the ability to use latex( tabular(...), caption = <...>, label = <...>, ...) to good effect. HTH, Chuck
[O] error exporting with reference to table in another file
Hi all, I have this ina n org-file: #+NAME: anatase-tio2-elisp #+BEGIN_SRC emacs-lisp :var data=supporting-information.org:TiO2-data (remove-if-not (lambda (x) (string= "anatase" (nth 1 x))) data) #+END_SRC #+RESULTS: anatase-tio2-elisp | TiO$_2$ | anatase | LDA| -2802.73 | 33.62 | 187.4 | | TiO$_2$ | anatase | AM05 | -2741.12 | 34.33 | 178.26 | | TiO$_2$ | anatase | PBEsol | -2763.61 | 34.25 | 178.71 | | TiO$_2$ | anatase | PBE| -2781.16 | 35.13 | 171.42 | The code works fine, but when I try to export to a pdf or html I get errors like: org-babel-exp processing... [2 times] org-babel-ref-resolve: Reference 'TiO2-data' not found in this buffer Here is my org-version: Org-mode version 8.2.7c (8.2.7c-25-g1faeb4-elpa @ /Users/jkitchin/Dropbox/kitchingroup/jmax/elpa/org-20140811/) Any thoughts on what is causing this? Thanks, -- --- John Kitchin http://kitchingroup.cheme.cmu.edu
[O] [PATCH] Fix to determine a bulk-markable line
* lisp/org-agenda.el (org-agenda-bulk-mark, org-agenda-bulk-mark-regexp, org-agenda-bulk-toggle-all): This fixes e.g. org-agenda-bulk-mark-all when time-grid is shown. TINYCHANGE --- lisp/org-agenda.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index dbc9861..1bec8dc 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -9680,7 +9680,7 @@ This is a command that has to be installed in `calendar-mode-map'." (overlay-put ov 'type 'org-marked-entry-overlay)) (end-of-line 1) (or (ignore-errors - (goto-char (next-single-property-change (point) 'txt))) + (goto-char (next-single-property-change (point) 'org-hd-marker))) (beginning-of-line 2)) (while (and (get-char-property (point) 'invisible) (not (eobp))) (beginning-of-line 2)) @@ -9698,7 +9698,7 @@ This is a command that has to be installed in `calendar-mode-map'." (let ((entries-marked 0) txt-at-point) (save-excursion (goto-char (point-min)) - (goto-char (next-single-property-change (point) 'txt)) + (goto-char (next-single-property-change (point) 'org-hd-marker)) (while (and (re-search-forward regexp nil t) (setq txt-at-point (get-text-property (point) 'txt))) (when (string-match regexp txt-at-point) @@ -9734,7 +9734,7 @@ This is a command that has to be installed in `calendar-mode-map'." (save-excursion (goto-char (point-min)) (while (ignore-errors -(goto-char (next-single-property-change (point) 'txt))) +(goto-char (next-single-property-change (point) 'org-hd-marker))) (org-agenda-bulk-toggle (defun org-agenda-bulk-toggle () -- 2.1.0
Re: [O] [patch, ox] Unnumbered headlines
Thanks very much for working on this, Rasmus. I'll try to test it out over the next couple of days. It really will make book production much nicer! Cheers, Alan On 21/09/14 02:02, Rasmus wrote: Hi, I'm happy to finally be able to send an updated version of this patch that touches most backends in lisp/, but not the manual. I have been moving over the summer etc. You now specify unnumbered headlines with properties. I think this is better since being unnumbered it's a pretty permanent state. It's pretty hard to discover though, other than by looking at the output. So this works as expected: * Some headline :PROPERTIES: :UNNUMBERED: t :END: There's no :NUMBERED property and :UNNUMBERED is hardcoded. I introduce a new function `org-export-get-headline-id` which returns the first non-nil from the following list. There's a caveat: CUSTOM_ID is ensured to be unique! Did I open the famous can of worm? 1. The CUSTOM_ID property. 2. A relative level number if the headline is numbered. 3. The ID property 4. A new generated unique ID. Anyhow, `org-export-get-headline-id' ensures that we can refer to unnumbered headlines, which was not possible before. Of course, in LaTeX such ref to a \section* will be nonsense, so we could introduce a \pageref here. I'm unsure about whether this conflicts `org-latex-custom-id-as-label' which I had never seen until today (also notes on this in patch). I have updated backends in lisp/, but I'm at most(!) an "expert" on LaTeX. However, I have tested all backends to the best of my ability. Please feel free to test and let me know about any discrepancies! Cheers, Rasmus PS: Not knowing or caring much about md, the links generated by it to headlines seem wrong. Referring to headline 1 it only prints "1". Should it be something like "[LABEL](1)"? -- Alan L Tyreehttp://www2.austlii.edu.au/~alan Tel: 04 2748 6206 sip:typh...@iptel.org
Re: [O] [PATCH][mini] bulk-mark-regexp and -toggle also with time grid
Hi Nicolas, >>> Mark all entries for future agenda bulk action. >>> Currently this is not true if there is a time grid in the agenda buffer. >>> >>> Please consider to apply the attached patch. >> ... > > Would you mind providing a proper commit message (don't forget the > TINYCHANGE at the end) and send it again using git format-patch? I did my very best. See the respective post. It's actually been my first git format-patch. Hopefully it's useful for the integration. Best regards, Marco -- http://www.wahlzone.de PGP: 0x0A3AE6F2
[O] [patch] Question on resolving links?
Hi, I would like to use #+INCLUDE keywords for inputting headlines from other files. Line-numbers are too volatile and I'm not willing to split up my file. The attached patch does not, but I am not very happy about the elegance of the implementation and it relies on a mix of org.el functions and ox functions. Basically, the patch tries to interpret keywords like this: #+INCLUDE: "~/file.org::*foo" Is there not a function to interpret a link-string, say "~/file.org::*foo", particularly with ox? The closes thing I found was `org-element-parse-secondary-string` on [[~/file.org::*foo]] which gives me the correct element. Normally, `org-export-resolve-fuzzy-link' should then help me out, but in `org-export-expand-include-keyword' I don't have info! Also, `org-link-search' didn't seem to work across files. Am I missing something obvious or is there a function I can study to better understand how to resolve links? Thanks, Rasmus -- In theory, practice and theory are the same. In practice they are not >From f8dadcc363e4ad3fc102d1cbf200b6ff8344184d Mon Sep 17 00:00:00 2001 From: Rasmus Date: Sat, 20 Sep 2014 22:22:15 +0200 Subject: [PATCH 2/2] ox: Allow headline links with #+INCLUDE * ox.el (org-export-expand-include-keyword): Resolve headline links. Accept keywords like "#+INCLUDE: file1.org::head1". head1 must be a CUSTOM_ID or resolvable by `org-link-search'. --- lisp/ox.el | 55 +-- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/lisp/ox.el b/lisp/ox.el index 55c02eb..bdcdc71 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -3322,19 +3322,46 @@ paths." ;; Extract arguments from keyword's value. (let* ((value (org-element-property :value element)) (ind (org-get-indentation)) + headline-id (file (and (string-match "^\\(\".+?\"\\|\\S-+\\)\\(?:\\s-+\\|$\\)" value) - (prog1 (expand-file-name -(org-remove-double-quotes - (match-string 1 value)) -dir) - (setq value (replace-match "" nil nil value) + (let ((matched (save-match-data + (org-split-string (match-string 1 value) "::" + (setq headline-id (car-safe (cdr-safe matched))) + (prog1 (expand-file-name + (org-remove-double-quotes + (car matched)) + dir) +(setq value (replace-match "" nil nil value)) (lines - (and (string-match - ":lines +\"\\(\\(?:[0-9]+\\)?-\\(?:[0-9]+\\)?\\)\"" - value) - (prog1 (match-string 1 value) - (setq value (replace-match "" nil nil value) + ;; (or + ;; (and (string-match ":headline" value) + ;; (error "#+INCLUDE can only have :lines /or/ :headline")) + (prog1 + (if (string-match + ":lines +\"\\(\\(?:[0-9]+\\)?-\\(?:[0-9]+\\)?\\)\"" + value) + (if headline-id + (error "You have specified a headline and :lines in #+INCLUDE.") + (match-string 1 value) + (setq value (replace-match "" nil nil value))) + (save-window-excursion + (find-file file) + (let* ((data (org-element-parse-buffer)) + (headline + (or ;; FIXME: there *must* be a better way to do this + (org-element-map data 'headline + (lambda (head) (when (equal headline-id + (org-element-property :CUSTOM_ID head)) + head)) + nil 'first-match) + (and (org-link-search headline-id) (org-element-at-point) + (when (equal 'headline (org-element-type headline)) + (mapconcat 'number-to-string + (list + (line-number-at-pos (org-element-property :begin headline)) + (line-number-at-pos (org-element-property :end headline))) + "-"))) (env (cond ((string-match "\\" value) 'literal) ((string-match "\\
Re: [O] [PATCH] Fix to determine a bulk-markable line
Hello, marcowahls...@gmail.com writes: > * lisp/org-agenda.el (org-agenda-bulk-mark, > org-agenda-bulk-mark-regexp, org-agenda-bulk-toggle-all): This fixes > e.g. org-agenda-bulk-mark-all when time-grid is shown. Applied. Thank you. Regards, -- Nicolas Goaziou
Re: [O] [PATCH] Add support for :dbhost, :dbuser and :database parameters for poastgresql in ob-sql.el
Steven Rémot writes: > Thank you for your comments. I attached the fixed patch below. Applied. Thank you. Regards, -- Nicolas Goaziou
Re: [O] [patch] Question on resolving links?
Hello, Rasmus writes: > I would like to use #+INCLUDE keywords for inputting headlines from > other files. Line-numbers are too volatile and I'm not willing to > split up my file. I think these specifications need to be refined. Should it only include the headline and its section, or the whole tree starting at the headline? > The attached patch does not, but I am not very happy about the > elegance of the implementation and it relies on a mix of org.el > functions and ox functions. Basically, the patch tries to interpret > keywords like this: > > #+INCLUDE: "~/file.org::*foo" > > Is there not a function to interpret a link-string, say > "~/file.org::*foo", particularly with ox? You cannot do this with ox, as include keywords are expanded before the export process actually begins. > The closes thing I found was `org-element-parse-secondary-string` on > [[~/file.org::*foo]] which gives me the correct element. Normally, > `org-export-resolve-fuzzy-link' should then help me out, but in > `org-export-expand-include-keyword' I don't have info! Also, > `org-link-search' didn't seem to work across files. I think `org-open-link-from-string' is what you want: (org-open-link-from-string "[[~/file.org::*foo]]") Regards, -- Nicolas Goaziou
Re: [O] [patch] Question on resolving links?
Hi Nicolas, Nicolas Goaziou writes: > Rasmus writes: > >> I would like to use #+INCLUDE keywords for inputting headlines from >> other files. Line-numbers are too volatile and I'm not willing to >> split up my file. > > I think these specifications need to be refined. If you are saying that INCLUDE needs to be updated I agree. I was thinking of using normal links with some sort of ATTR, but since there's not a global ATTR, it's not obvious how to do it. Perhaps INCLUDE with support for normal links would be enough? I which direction do you think I should put my effort? [Of course I want it to be part of ox] > Should it only include > the headline and its section, or the whole tree starting at the headline? I think it should include the target headline. That way I can to "* preliminary model" (which is good for overview) in my notes.org and use something more interesting in final.org. Another reason for this is that then in "notes.org" I would also have a headline with all of the advantages that entails (moving. not losing it etc.). When your "stapling together" together files, you'll include more than just a heading. . . Are there cases where it makes sense to include the heading, *when only importing one heading*? >> The attached patch does not, but I am not very happy about the >> elegance of the implementation and it relies on a mix of org.el >> functions and ox functions. Basically, the patch tries to interpret >> keywords like this: >> >> #+INCLUDE: "~/file.org::*foo" >> >> Is there not a function to interpret a link-string, say >> "~/file.org::*foo", particularly with ox? > > You cannot do this with ox, as include keywords are expanded before the > export process actually begins. OK. Good to know, and somewhat what I expected. >> The closes thing I found was `org-element-parse-secondary-string` on >> [[~/file.org::*foo]] which gives me the correct element. Normally, >> `org-export-resolve-fuzzy-link' should then help me out, but in >> `org-export-expand-include-keyword' I don't have info! Also, >> `org-link-search' didn't seem to work across files. > > I think `org-open-link-from-string' is what you want: > > (org-open-link-from-string "[[~/file.org::*foo]]") Right! I did not know that one, but it's definitely what I was looking for. Cool! —Rasmus -- Enough with the bla bla!
[O] project definition issue
Hi. I'm trying to write a simple definition of project: (setq org-stuck-projects '("PROJECT" ("NEXT") nil nil)) This means that everything with a tag :PROJECT: without NEXT task is stuck. But my stuck project is not shown in the list if it is a nested project and it has a todo state. * unstuck 1 -- because has next:test:PROJECT: ** NEXT next in 1 ** this stuck project _without_ todo state is shown in the list :PROJECT: *** TODO whatever 1 * unstuck 2:test:PROJECT: ** NEXT next in 2 ** TODO stuck project is not shown :PROJECT: *** TODO whatever 2 Next actions: Test: NEXT next in 1 :test:: Test: NEXT next in 2 :test:: Stuck projects: Test: this stuck project _without_ todo state is shown in the list :test::PROJECT: And what is interesting: when I’m trying to copy the whole line above, it actually copies two lines: Test: this stuck project _without_ todo state is shown in the list :test::PROJECT: Test: TODO stuck project is not shown :test::PROJECT: I tried, but I didn’t find out why it works this way. Could you help me?
[O] filter for src-block export question
I have noticed that when code blocks have input variables, e.g. #+tblname: tbl-data | x | y | |---+---| | 1 | 1 | | 2 | 4 | | 3 | 9 | #+BEGIN_SRC python :var data=tbl-data print data #+END_SRC #+RESULTS: : [[1, 1], [2, 4], [3, 9]] When I export this, the codeblock shows no indication of what "data" is, or where it came from. I had hoped to develop a filter that would allow me to put something like: language=python parameters: :var data=tbl-data in front of the block for an html export. I tried following the example here: http://orgmode.org/manual/Advanced-configuration.html at the end, by defining a derived mode. However, it does not appear that the information is kept in the parse tree. (src-block (:language python :switches nil :parameters nil :begin 536 :end 578 :number-lines nil :preserve-indent t :retain-labels t :use-labels t :label-fmt nil :hiddenp nil :value print data :post-blank 2 :post-affiliated 536 :parent #4)) although if I look at the element at point, it seems to be there: (src-block (:language python :switches nil :parameters :var data=tbl-data :begin 536 :end 629 :number-lines nil :preserve-indent t :retain-labels t :use-labels t :label-fmt nil :hiddenp nil :value print data (princ (org-element-at-point)) I am not sure why the :end values are not the same though. Here is what I was trying to use: #+BEGIN_SRC emacs-lisp (defun my-src-block (src-block contents info) (message "start-block\n\n%s\n\nend-block" info) (concat "" (format "[language: %s]" (org-element-property :language src-block)) (format "\nparameters: %s" (org-element-property :parameters src-block)) "" (org-export-format-code-default src-block info))) (org-export-define-derived-backend 'my-html 'html :translate-alist '((src-block . my-src-block))) (org-export-to-file 'my-html "custom-src-table-export.html") (browse-url "custom-src-table-export.html") #+END_SRC There are two issues with this block: 1. All parameters are listed as nil 2. the code is not syntax highlighted in html at all. Any suggestions on how to achieve this? I also want to insert tablenames, and if the src-block is named to put the name above the block (for extra gravy, a hyperlink from :var to the source ;). thanks, -- --- John Kitchin http://kitchingroup.cheme.cmu.edu
Re: [O] [PATCH] ob-ruby.el fix for :session parameter
Oleh writes: > #+RESULTS: > : > : 3 Well, that would still be an empty line too many. But aside from that, what I'm actually getting with a recent Emacs and inf-ruby is: #+RESULTS: : : irb(main):003:0> irb(main):004:0> irb(main):005:0> 3 So either comint-mode has developed some problem in the meantime or there is some other configuration missing for this to work. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada
[O] [patch, ox] #+INCLUDE resolves links
Hi, This patch allows INCLUDE to have intuitive links as resolved by `org-link'-search'. A couple of examples: #+INCLUDE: file.org::#custom_id :noheadline :lines "3-" #+INCLUDE: file.org::*headline :lines "-10" :noheading tries to get rid of the first headline, and immediately subsequent drawer and property-drawer, if present. :noheading is only interpret when a headline argument is present. :lines is interpreted relatively, if coupled with a headline link. I should work for other types of links as well though it could be limited to headlines only. Perhaps it would even make sense to let it take a no-file argument to locate things within the same buffer. This would be useful for including, say, tables in babel/code-appendices. What do you think? —Rasmus -- Hooray! >From 727b20f454cb4f1582874f1b35d5e5f53ec44f79 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Sat, 20 Sep 2014 22:22:15 +0200 Subject: [PATCH] ox: Allow links with #+INCLUDE-keyword * ox.el (org-export--prepare-file-contents, org-export-expand-include-keyword): Handle links and add option no-heading. --- lisp/ox.el | 64 ++ 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/lisp/ox.el b/lisp/ox.el index f01f951..e78743a 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -3321,13 +3321,23 @@ paths." ;; Extract arguments from keyword's value. (let* ((value (org-element-property :value element)) (ind (org-get-indentation)) + headline (file (and (string-match "^\\(\".+?\"\\|\\S-+\\)\\(?:\\s-+\\|$\\)" value) - (prog1 (expand-file-name -(org-remove-double-quotes - (match-string 1 value)) -dir) - (setq value (replace-match "" nil nil value) + (let ((matched (save-match-data + (org-split-string (match-string 1 value) "::" + (setq headline (car-safe (cdr-safe matched))) + (prog1 (expand-file-name + (org-remove-double-quotes + (car matched)) + dir) +(setq value (replace-match "" nil nil value)) + + (no-headline + (and (string-match + ":\\(no-?headline[[:space:]]*\\(?:'t\\|true\\|yes\\)?\\)" value) + (prog1 t + (setq value (replace-match "" nil nil value) (lines (and (string-match ":lines +\"\\(\\(?:[0-9]+\\)?-\\(?:[0-9]+\\)?\\)\"" @@ -3370,18 +3380,18 @@ paths." (insert (let ((ind-str (make-string ind ? )) (arg-str (if (stringp src-args) - (format " %s" src-args) -"")) +(format " %s" src-args) + "")) (contents (org-escape-code-in-string - (org-export--prepare-file-contents file lines + (org-export--prepare-file-contents file headline no-headline lines (format "%s#+BEGIN_%s%s\n%s%s#+END_%s\n" ind-str block arg-str contents ind-str block ((stringp block) (insert (let ((ind-str (make-string ind ? )) (contents - (org-export--prepare-file-contents file lines))) + (org-export--prepare-file-contents file headline no-headline lines))) (format "%s#+BEGIN_%s\n%s%s#+END_%s\n" ind-str block contents ind-str block (t @@ -3390,7 +3400,7 @@ paths." (let ((org-inhibit-startup t)) (org-mode)) (insert (org-export--prepare-file-contents - file lines ind minlevel + file headline no-headline lines ind minlevel (or (gethash file file-prefix) (puthash file (incf current-prefix) file-prefix (org-export-expand-include-keyword @@ -3398,7 +3408,7 @@ paths." (file-name-directory file)) (buffer-string) -(defun org-export--prepare-file-contents (file &optional lines ind minlevel id) +(defun org-export--prepare-file-contents (file &optional headline no-headline lines ind minlevel id) "Prepare the contents of FILE for inclusion and return them as a string. When optional argument LINES is a string specifying a range of @@ -3420,6 +3430,20 @@ This is useful to avoid conflicts when more than one Org file with footnotes is included in a document." (with-temp-buffer (insert-file-contents file) +(org-mode) +(when headline + (org-link-search headline) + (narrow-to-region + (org-element-property + (if no-headline :contents-begin :begin) (org-element-at-point)) + (org-element-property :end (org-element-at-point))) + ;; get rid of drawers and properties + (when no-headline + (let ((element (org-element-at-point))) + (while (member (org-element-type element) '(drawer property-drawer)) + (delete-region (org-element-property :begin element) + (org-element-property :end element)) + (setq element (org-element-at-point)) (when lines (let* ((lines (split-string lines "-")) (lbeg (string-to-number (car lines))) @@ -3492,15 +3516,15 @@ with footnotes is included in a document." ((org-string-match-p "\\`[0-9]+\\'" label) (insert (
[O] [ANN] Outshine 2.0 (kind of Org-Minor-Mode)
[This was posted on the Emacs Help Mailing List too] Hi List, I just released Outshine 2.0 (i.e. outshine.el, outorg.el and navi-mode.el): * Changes Main changes are: - New Org-Minor-Mode functionality :: outshine headers have become more intelligent, they know about todos, priorities, tags, properties, timestamps, deadlines, schedules etc now, and you can call quite a few of Org commands directly in an Outshine buffer now. You can now add a headline directly in e.g. an Emacs Lisp or R Buffer, add planning information, clock-in and -out when programming the headline's functions, and compare your estimated efforts with the actual efforts. - Faster and more reliable Outorg Conversion :: outorgs conversion functions have been rewritten and tested, they seem to produce no unwanted side-effects whatsoever anymore and are really fast, even for pretty big buffers. - New Outshine Agenda :: you can call an Org Agenda on your Outshine files now, showing planning information from Outshine agenda-files that might have different major-modes. This is currently read-only, the next step will be to make it read/write, and then finally enable a joint Agenda for Outshine and Org. - New Org-Minor-Mode commands for navi-mode :: all `outshine-use-outorg' commands have been added to navi-mode too, with the original Org-mode keybindings. Thus you can now e.g. do 'C-c C-d' directly on a headline in the *Navi* buffer to add a deadline. - New LaTeX support :: I added a few outshine convenience-functions and navi keyword-searches for LaTeX-mode. - New outorg-export library :: Jonathan Leech-Pepin wrote a pretty cool library for syncing Outshine files with its export ([[https://github.com/jleechpe/outorg-export][outorg-export]]), it enables #+begin_quote Automated exporting of sections of source files to any format org can export to. #+end_quote - New conversion tests for outorg :: I developed a 7 steps conversion tests to test for undesired side-effects of the conversion between programming-modes and org-mode: 1. Convert buffer from state A [BEFORE] to state B (e.g. change major-mode, uncomment comments, wrap source-code in code-blocks ...) 1. Call some buffer-modifying command in state B 2. Save resulting undo-buffer-tree 3. Reconvert buffer from state B to state A 4. Repeat (1) - convert from A -> B 5. Undo the changes stored in saved undo-buffer-tree 6. Repeat (4) - reconvert from B -> A [AFTER] After 4 conversions in total (2 in each direction), there should be no DIFFS between buffer-state A [BEFORE] and buffer-state A [AFTER] if the conversion itself has no (undesired) side-effects. - New comment-sections :: I improved/rewrote the comment-sections of all three Outshine libraries. Thanks to everybody who provided issue reports, feature requests, patches or even whole libraries! * Appendix ** outshine-use-outorg commands: #+BEGIN_SRC emacs-lisp ; Use Outorg for calling Org (defun outshine-deadline (&optional arg) (defun outshine-export-dispatch (&optional arg) (defun outshine-insert-link () (defun outshine-open-at-point (&optional whole-buffer-p arg reference-buffer) (defun outshine-set-tags-command () (defun outshine-schedule (&optional arg) (defun outshine-todo (&optional arg) (defun outshine-time-stamp-inactive (&optional arg) (defun outshine-priority () (defun outshine-time-stamp (&optional arg) (defun outshine-toggle-fixed-width () (defun outshine-toggle-comment () (defun outshine-sort-entries (&optional arg) (defun outshine-previous-block () (defun outshine-next-block () (defun outshine-insert-last-stored-link () (defun outshine-toggle-checkbox (&optional arg) (defun outshine-clock-in () (defun outshine-clock-goto () (defun outshine-next-link () (defun outshine-clock-out () (defun outshine-previous-link () (defun outshine-clock-cancel () (defun outshine-clock-report (&optional arg) (defun outshine-timer-pause-or-continue (&optional arg) (defun outshine-timer-item () (defun outshine-timer () (defun outshine-timer-start () (defun outshine-timer-cancel-timer () (defun outshine-timer-set-timer () (defun outshine-agenda-set-restriction-lock (&optional arg) (defun outshine-agenda-remove-restriction-lock (&optional include-org-p) (defun outshine-inc-effort () (defun outshine-set-property-and-value () (defun outshine-toggle-archive-tag () (defun outshine-insert-drawer () (defun outshine-set-effort (&optional arg) (defun outshine-footnote-action (&optional special) (defun outshine-set-property () #+END_SRC ** Outshine Speed Commands #+BEGIN_ASCII User-defined Speed commands === Built-in Speed commands === Outline Navigation -- n (outshine-speed-move-safe (quote outline-next-visible-heading)) p (outshine-s
[O] Roman numerals in ordered lists
How can I use roman numerals in ordered lists in an org document? I need them in html and latex exports. Vikas
Re: [O] header arguments, inheritance, and noweb expansion Was: «Macro» expansion in source blocks; code-sharing between blocks
Thanks Chuck, I thought the same, especially since I found the tabular() function by looking at Hmisc and rms documentation (both packages by Frank Harrell). But as it turns out the latex method for objects of class tabular is defined in the table package and it has a much more limited set of options. The upside is that I found the additional functions margin.table and addmargins (I knew about prop.table) which are going to make my life easier with R's tables. Cheers, Andreas -- Dr Andreas Kiermeier | Director Statistical Process Improvement Consulting and Training Pty Ltd Mbl: +61 (4)23 028 565 | Email: andreas.kierme...@gmail.com Australia On 21 September 2014 01:36, Charles Berry wrote: > Andreas Kiermeier gmail.com> writes: > > > > > On 19 September 2014 20:29, Rainer M Krug krugs.de> wrote:> > > [ snip ] > > > > > The alternative mentioned by Chuck Berry is the xtable function (in R) > > (https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00519.html > ). > > I just tried it and am happy to share that it does created the whole > > output in one go, i.e. it does exactly what I need, including table > > float, caption and label. Now I just got to sort out how to created the > > tables without the use of tabular ... > > > > I suggested xtable because that is what I often use. > > But thinking a bit more, I decided to look at tables::tabular() and > at Hmisc::latex(), which I think is what you used at first. > > And it turns out that latex() has args for caption, label, where, and > loads of other things. See its help page. So, it looks like you have the > control you need and the ability to use > > latex( tabular(...), caption = <...>, label = <...>, ...) > > to good effect. > > HTH, > > Chuck > > >
Re: [O] Lack of availability
Aloha Bastien, Take care of yourself! We'll be here when you get back. All the best, Tom Bastien writes: > Dear all, > > I'm sorry for my current lack of availability. I wanted > to hack back since late august but I was not able to. > > I'm going through hard times since the summer and I need > to focus on securing a basic environment for my daily life. > > I hope I can sort this out soon enough. > > I'm thankful to everyone who actively contribute with bug > fixes, questions and answers. It's great to see this. > > All best, -- Thomas S. Dye http://www.tsdye.com