[O] Error with org-mode-reftex-setup after upgrade

2014-05-16 Thread Loris Bennett
Hi,

I have just upgraded to version Org-mode version 8.2.6
(8.2.6-18-gaaae4a-elpaplus @ 
/home/loris/.emacs.d/elpa/org-plus-contrib-20140512/

From Thomas Dye's description of how to create an annotated bibliography
(http://orgmode.org/worg/exporters/anno-bib-template-worg.html) I'm
using:

,-
| (defun org-mode-reftex-setup ()
|   (interactive)
|   (load-library reftex)
|   (and (buffer-file-name)
|(file-exists-p (buffer-file-name))
|(reftex-parse-all)))
| 
| (add-hook 'org-mode-hook 'org-mode-reftex-setup)
`-

Following the update, this now seems to throw the error:

,
| Loading reftex...done
| File mode specification error: (wrong-type-argument sequencep dwim)
`

Any ideas?

Cheers,

Loris

-- 
This signature is currently under construction.




[O] Preview tikz in org-mode (reduce margins of produced images)

2014-05-16 Thread Leu Zhe
Hi, everyone!

I always use org-preview-latex-fragment command to preview the LaTeX code,
which is awesome.
It can effectively crop and suit the size of produced png to the content.

However, recently I start to preview some tikz code.
I can greatly produce the good results except one problem:
The preview can never reduce the spare margin of the produced images, which
left large blank space there. However, when I preview other LaTeX code
after deleting tikz preamble, everything is fine.

So is there anyone who has some idea to reduce the large margins?


Leu


Re: [O] [Latex Export] Influence placement of \maketitle command

2014-05-16 Thread Alexander Baier
On 2014-05-16 06:19 Nick Dokos wrote:
 Alexander Baier alexander.ba...@mailbox.org writes:

 On 2014-05-15 21:57 Eric S Fraga wrote:
 I put it under its own heading with an :ignoreheading: tag and use the
 filter that was posted on this list (today in fact):

 I can't find the filter you are referring to. I guess it is in the
 org-ref thread?  I did not follow that thread as org-ref seems to be
 a somewhat full-fledged solution including a lot of things I do not
 need.  I looked through the thread but wasn't lucky to find said
 filter.  Could you kindly post a link? (if that's not to much to ask)


 I don't have a link, but I have the following in an example file (which
 afaik still works fine):

This works like charm, thanks!

 Suvayu's filter to get rid of :ignoreheading: tagged headlines - used
 in bib.org
 #+BEGIN_SRC emacs-lisp :results silent
 (defun sa-ignore-headline (contents backend info)
   Ignore headlines with tag `ignoreheading'.
   (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii)
   (string-match \\`.*ignoreheading.*\n
 (downcase contents)))
 (replace-match  nil nil contents)))

 (add-to-list 'org-export-filter-headline-functions 'sa-ignore-headline)
 #+END_SRC

And thanks to Suvayu for providing this filter in the first place!

 Using #+include also largely resolves your original concern I think

This is also a good idea. But for now my document is small enough to
maintain it in a single org file.

Regards,
-- 
Alexander Baier



Re: [O] [PATCH] Empty inline tasks in latex export

2014-05-16 Thread Nicolas Goaziou
Hello,

R. Michael Weylandt michael.weyla...@gmail.com writes:

 If the body if the inline task is empty, org-latex-inlinetask writes
 nil in the exported document. This patch skips including contents (and
 the bar above it) if it's nil.

Thank you for reporting it and providing this patch. I applied
a slightly different version.


Regards,

-- 
Nicolas Goaziou



Re: [O] [Latex Export] Influence placement of \maketitle command

2014-05-16 Thread Eric S Fraga
On Thursday, 15 May 2014 at 22:41, Alexander Baier wrote:
 On 2014-05-15 21:57 Eric S Fraga wrote:
 I put it under its own heading with an :ignoreheading: tag and use the
 filter that was posted on this list (today in fact):

 I can't find the filter you are referring to. I guess it is in the
 org-ref thread?  I did not follow that thread as org-ref seems to be
 a somewhat full-fledged solution including a lot of things I do not
 need.  I looked through the thread but wasn't lucky to find said
 filter.  Could you kindly post a link? (if that's not to much to ask)

 Thanks,

It was not in that thread and the email was tangentially about ignored
headlines.  I think it had to with beamer columns and generating
articles.  I'm offline currently so cannot check.

In any case, this is what I use:

  (defun esf/remove-lines-with-ignore-heading-tag (backend)
(message Deleting lines with ignore heading tag)
(while (search-forward-regexp ^\\*+.*[ 
\t]+[a-ZA-Z0-9:]*:ignoreheading:[a-ZA-Z0-9:]*$ (point-max) t)
  (cond
   ((eq backend 'latex) (replace-match #+latex: % \\ ))
   ((eq backend 'html) (replace-match #+html: !-- \\ -- ))
   (t (replace-match )
  (add-hook 'org-export-before-processing-hook 
'esf/remove-lines-with-ignore-heading-tag)

HTH,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.1, Org release_8.2.6-937-g60502a



Re: [O] Centering graphics in LaTeX export

2014-05-16 Thread Nicolas Goaziou


Hello,

Francesco Pizzolante
fpz-djc/ipccudyqhejpep6iedvlejwur...@public.gmane.org writes:

 Here's a small patch that enables centering graphics in LaTeX exports
 (as it already exists for tables).

Thanks for this. A few, minor, comments follow.

 +(defcustom org-latex-images-centered t
 +  When non-nil, images are exported in a center environment.
 +  :group 'org-export-latex
 +  :type 'boolean)

You need to add

  :version 24.5
  :package-version '(Org . 8.3)

since this is a new variable.

(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))

I suggest to move the CENTERP binding above the previous comments.

 + path
 +(if centerp \\par}\n )
 +))

No parens alone on a line, please.

You also need to update manual and document the feature.

Eventually, could you provide a proper commit message and send an
updated patch?


Regards,

-- 
Nicolas Goaziou




Re: [O] [Latex Export] Influence placement of \maketitle command

2014-05-16 Thread Alexander Baier
On 2014-05-16 09:15 Eric S Fraga wrote:
 On Thursday, 15 May 2014 at 22:41, Alexander Baier wrote:
 On 2014-05-15 21:57 Eric S Fraga wrote:
 I put it under its own heading with an :ignoreheading: tag and use the
 filter that was posted on this list (today in fact):

 I can't find the filter you are referring to. I guess it is in the
 org-ref thread?  I did not follow that thread as org-ref seems to be
 a somewhat full-fledged solution including a lot of things I do not
 need.  I looked through the thread but wasn't lucky to find said
 filter.  Could you kindly post a link? (if that's not to much to ask)

 Thanks,

 It was not in that thread and the email was tangentially about ignored
 headlines.  I think it had to with beamer columns and generating
 articles.  I'm offline currently so cannot check.

Ah, well, neither did I follow that one.

 In any case, this is what I use:

   (defun esf/remove-lines-with-ignore-heading-tag (backend)
 (message Deleting lines with ignore heading tag)
 (while (search-forward-regexp ^\\*+.*[ 
 \t]+[a-ZA-Z0-9:]*:ignoreheading:[a-ZA-Z0-9:]*$ (point-max) t)
   (cond
((eq backend 'latex) (replace-match #+latex: % \\ ))
((eq backend 'html) (replace-match #+html: !-- \\ -- ))
(t (replace-match )
   (add-hook 'org-export-before-processing-hook 
 'esf/remove-lines-with-ignore-heading-tag)

 HTH,
 eric

Thank you for digging this up!  I, however, already applied Suvayu's
solution suggested by Nick that uses a headline filter.  I see that
your filter inserts the original headline in comments into the source
document, which might be very helpful, in case you are using this for
more than just two latex commands.

Regards,
-- 
Alexander Baier



[O] org-mode fontification error with newest git

2014-05-16 Thread Rainer M Krug
Hi

I get an org-mode fontification error for R when using the newest org
From git.

I have set

  (setq org-src-fontify-natively t)

Unfortunately, I do not manage to get a backtrace.

Cheers,

Rainer

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgpihv_lYW0Hs.pgp
Description: PGP signature


[O] solved: org-mode fontification error with newest git

2014-05-16 Thread Rainer M Krug
Sorry for the noise - working.

Was caused by inconsistent compilation of org and ess.

Cheers,

Rainer

Rainer M Krug rai...@krugs.de writes:

 Hi

 I get an org-mode fontification error for R when using the newest org
 From git.

 I have set

   (setq org-src-fontify-natively t)

 Unfortunately, I do not manage to get a backtrace.

 Cheers,

 Rainer

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgpHTXkUgcxJq.pgp
Description: PGP signature


Re: [O] [PATCH] Empty inline tasks in latex export

2014-05-16 Thread Michael Weylandt
On May 16, 2014, at 4:39, Nicolas Goaziou n.goaz...@gmail.com wrote:

 Hello,
 
 R. Michael Weylandt michael.weyla...@gmail.com writes:
 
 If the body if the inline task is empty, org-latex-inlinetask writes
 nil in the exported document. This patch skips including contents (and
 the bar above it) if it's nil.
 
 Thank you for reporting it and providing this patch. I applied
 a slightly different version.

Great,
Thanks for this

Michael



[O] Bug: Archive subtree with parent structure [7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/)]

2014-05-16 Thread Florian Lindner
This is not a bug report but a wishlist item.

org-archive-subtree archives a subtree.

* A
** AA
*** AAA 
** AB
*** ABA

Archiving AA will remove the subtree from the original file and create
it like that in archive target:

* AA
** AAA 

What I want (wish for) is to create it like that in the archive target:

* A
** AA
*** AAA

If I also archive AB after that, it gets inserted in the structure which
is now identical to the structure we started with.

Use case: I tend to archive small pieces of a project's subtree long
before I'm ready to archive the entire project. This way I build (want
to build) an archived mirror of the project's subtree bit by bit.

Thanks a lot to the org-mode developers.



Emacs  : GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.7)
 of 2014-01-28 on var-lib-archbuild-extra-x86_64-juergen
Package: Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ 
/usr/share/emacs/24.3/lisp/org/)




[O] Playwriitng with org?

2014-05-16 Thread Rustom Mody
Earlier I used to use troff and wrote play/drama-like pieces using that
eg http://www.the-magus.in/Publications/ewd.pdf

Later we switched to latex and using play.sty. Here is an example:
http://www.the-magus.in/Publications/DotingOnTheDot.pdf

I would now like to stay in org as much as possible and use latex as the
backend — using maybe play.sty but there seem to be alternatives like
dramatist.sty.

Is this possible/easy/worthwhile?

Thanks
Rusi


Re: [O] Playwriitng with org?

2014-05-16 Thread Igor Sosa Mayor
Rustom Mody rustompm...@gmail.com writes:

 Earlier I used to use troff and wrote play/drama-like pieces using
 that
 eg http://www.the-magus.in/Publications/ewd.pdf

 Later we switched to latex and using play.sty. Here is an example:
 http://www.the-magus.in/Publications/DotingOnTheDot.pdf

 I would now like to stay in org as much as possible and use latex as
 the backend — using maybe play.sty but there seem to be alternatives
 like dramatist.sty.

 Is this possible/easy/worthwhile?

Honestly I have no idea. But just in case you are not aware of it, there
is a mode for screenwriters:

https://www.youtube.com/watch?v=3DrUzXjJ9G1B4

(and severeal others here: http://www.emacswiki.org/emacs/ScreenPlay)




Re: [O] Preview tikz in org-mode (reduce margins of produced images)

2014-05-16 Thread Nick Dokos
Leu Zhe lzhe...@gmail.com writes:

 Hi, everyone!

 I always use org-preview-latex-fragment command to preview the LaTeX
 code, which is awesome.  It can effectively crop and suit the size of
 produced png to the content.

 However, recently I start to preview some tikz code.   I can greatly
 produce the good results except one problem: The preview can never
 reduce the spare margin of the produced images, which left large blank
 space there. However, when I preview other LaTeX code after deleting
 tikz preamble, everything is fine.

 So is there anyone who has some idea to reduce the large margins?


It helps if you provide a small example: otherwise, even if one is
willing to take a stab at it, one has to create one from scratch. Given
that just about all of us have limited time, that reduces the
probability that you will get an answer.

Nick




Re: [O] [babel][PATCHES] ob-R patches for review

2014-05-16 Thread Charles C. Berry

On Fri, 16 May 2014, Rainer M Krug wrote:


Sorry for coming back to your suggestions so late, but I did some
thinking about the approach. Comments inline below.


No problem. I am about to leave town and my email for a couple of weeks,
so I might not be able to reply to further correspondence till June.

Comments inline below.

Chuck


Charles C. Berry ccbe...@ucsd.edu writes:


On Mon, 12 May 2014, Rainer M Krug wrote:


Eric Schulte schulte.e...@gmail.com writes:



[...]

[Rainer writes]

My idea is to have all R code in one directory and to let ESS load it
upon initialization of ESS (which is a dependency of running R from org
anyway, if I am not mistaken).



[Chuck]

Not quite. You can run R src blocks without (require 'ess) if they require
no session. (I do not claim that anyone actually runs R src blocks who
lacks a working ESS installation, just saying...)



[Rainer again]

Hm - would it then be possible to add ESS as a requirement for running R
code, as it is already mentioned on [1] as a requirement?


I'd be surprised if it would have any impact on users. Who uses R and
org-mode without ESS? But as you say it is listed as a requirement.

[...]



I am now leaning towards the following approach:

New behavior (environment):
1) Define the R code in emacs variables, i.e. customizable in emacs.
2) Define a function to load the code into an R environment - not customizable.

## upon creation of the R session (i.e. only once for each R session)


Maybe wait till the first variable transfer is called, if it ever is.



3) use the load function to load the code from the emacs variables into
an R environment called org:functions
4) load all .R files in the directory ~/.orgFunctions/ into
org:functions. This will mean that when functions of the same name as
loaded earlier will be overwritten, i.e. the functions are customizable
by R code only.

## before variable transfer at each execution of a code block


Only if there is a variable transfer, of course.



5) source all .R files in the directory RWorkingDirectory/.orgFunctions/
i.e. they are not loaded into a specific environment. Reasoning: further
customization possible, kind of an R package light approach.

6) use the load functions (as defied initially in (4), (3) or in () from
to load the variables. If they are loaded into an environment or not
depends on the definition of the functions.

Concerning old versus new behavior, I would actually suggest to put this
into the R functions: one could add an argument variablesInEnvironment
which would, if set, be the name of the environment, i.e. default value
org:variables, if NULL it would load into .GlobalEnv, i.e. the old
behaviour. In org, one could have a variable
org-babel-R-variable-transfer-type (or whatever the proper name should
be) and to make it user configurable:

- null :: old behaviour
- org:variables (default) :: variables into environment called
org:variables
- other string :: name of the environment to be used

As stated earlier, as I think that name clashes are more unlikely with
the new approach, I would suggest to make org:variables the default.



The above sounds good.

If you do not wish to implement the `org-babel-R-assign-elisp-function' 
variable approach I suggested, I'll make it a TINYCHANGE when I return in 
June. It will not impact on what you propose. However, if your 
implementation makes it possible for arbitrary elisp variables to be 
handled in R - I might not bother.


[...]



True - but I like the simplicity of being able to customize the
behavior of org-babel-R by writing an R function without having to thin
about elisp. But maybe there is a way of doing both...



noweb will do it. Quote the chunk like this:

#+BEGIN_SRC emacs-lisp :noweb yes :tangle elisp-R.el
   (setq rlines 
r-code)
#+END_SRC


I must admit, I have never used macros and noweb expansion...

If you could give me your opinions on this approach, I would look into
implementing it.


It is just a labor saving suggestion for you -- it would not show up
in the final elisp. Put all your elisp and R code in src blocks in a
*.org file. You can edit and format the R code in R src blocks and
likewise the elisp. A src block like the one above will import the R
into elisp as a string. You only tangle the elisp. So the benefit is
you have ease of editting R and writing unit tests for it for R code
that appears in elisp.

IMO, noweb is a good way to mix languages in org-mode. I use the R 
`inline' package to write C functions that R can call. R needs the code as 
strings. I write the C code in C src blocks then assign it in as an R 
character string in an R src block. I can write an R wrapper and unit test 
for each little snippet of C code, then when it all looks good join up the 
snippets by putting multiple noweb references on successive lines.






Footnotes:
[1]  http://orgmode.org/worg/org-contrib/babel/languages.html


[...]




[O] FILE special property?

2014-05-16 Thread Boyan Penkov
Hello,

I’m looking to set up a search string using the FILE special property, but 
cannot get the syntax right.  This is as part of setting up org-stuck-projects.

If the file is in ~/todos/myTodos.org, and I want all the entries with heading 
1, will 

(setq org-stuck-projects
  ‘(“+FILE=~/todos/myTodos.org+LEVEL=1 (NEXT TODO) nil ”))

work, or am I missing quotes there?

Thanks!

--
Boyan Penkov
www.boyanpenkov.com




Re: [O] FILE special property?

2014-05-16 Thread Alexander Baier
On 2014-05-16 22:12 Boyan Penkov wrote:
 (setq org-stuck-projects
   ‘(“+FILE=~/todos/myTodos.org+LEVEL=1 (NEXT TODO) nil ”))

I have never used this feature, but this first element look odd to
me. I would try this: “+FILE=\~/todos/myTodos.org\+LEVEL=1.

HTH,
-- 
Alexander Baier



Re: [O] Export to iCalendar only not DONE, scheduled tasks?

2014-05-16 Thread Chris Poole
That's very helpful, thanks — I'll get experimenting.


Cheers,
Chris


[O] LaTeX cross references

2014-05-16 Thread Alan L Tyree

G'day,

My org manuscript has cross references like this: see 
[[id:4c473c51-b484-4a29-8fe7-118d8084a6f8][Limitations Acts]]


Exporting to LaTeX currently gives me:  see 
\hyperref[sec-4-3]{Limitations Acts}


What I would like is: \ref{sec-4-3} since I am trying to end up with a 
Word file for an editor that will be (ultimately) a printed book.


I'm sure this is a simple variable somewhere, but I'm frustrated trying 
to find it.


Any help appreciated.

Cheers,
Alan

--
Alan L Tyreehttp://www2.austlii.edu.au/~alan
Tel:  04 2748 6206  sip:typh...@iptel.org




Re: [O] LaTeX cross references

2014-05-16 Thread Alan L Tyree


On 17/05/14 11:26, Aaron Ecay wrote:

Hi Alan,

2014ko maiatzak 16an, Alan L Tyree-ek idatzi zuen:

G'day,

My org manuscript has cross references like this: see
[[id:4c473c51-b484-4a29-8fe7-118d8084a6f8][Limitations Acts]]

Exporting to LaTeX currently gives me:  see
\hyperref[sec-4-3]{Limitations Acts}

What I would like is: \ref{sec-4-3} since I am trying to end up with a
Word file for an editor that will be (ultimately) a printed book.

I'm sure this is a simple variable somewhere, but I'm frustrated trying
to find it.

I think you have two choices.  The first is to remove the description
from the link, leaving just:

[[id:4c473c51-b484-4a29-8fe7-118d8084a6f8]]

Sadly, this is not very informative to look at.

The other is to use an export filter like the following to convert the
exporter’s output to the desired format:

#+BEGIN_SRC emacs-lisp
   (defun awe-org-latex-filter-section-links (string backend plist)
   (if (and (org-export-derived-backend-p backend 'latex)
(string-match hyperref\\[\\(sec-.*?\\)\\] string))
   (let ((end-space (if (string-match-p  \\' string)   )))
 (concat (format \\ref{%s} (match-string 1 string))
 end-space))
 string))
   (add-to-list 'org-export-filter-link-functions 
#'awe-org-latex-filter-section-links)
#+END_SRC

Hope this helps,

Hi Aaron,
I'm adding the reply to the list.

It helps immensely. I'll give the filter a try later this weekend. 
Thanks for your help!


Alan



--
Aaron Ecay


--
Alan L Tyreehttp://www2.austlii.edu.au/~alan
Tel:  04 2748 6206  sip:typh...@iptel.org




Re: [O] FILE special property?

2014-05-16 Thread Boyan Penkov
Thanks for your help, Alex.

The backslashes do get the string to evaluate correctly (now the value of 
org-stuck-projects is indeed set to what you’d think it would be set to, where 
the first element is a string), but this does not yield the right output — C-c 
# still yields no output, and I do know there are projects I define as 
unfinished in the relevant file.

When I crop out the +FILE=… part of the string, I get the output I’m expecting, 
so I’m pretty sure my problem is with the syntax of the FILE selector.

Thanks!
--
Boyan Penkov
www.boyanpenkov.com

On May 16, 2014, at 5:10 PM, Alexander Baier alexander.ba...@mailbox.org 
wrote:

 On 2014-05-16 22:12 Boyan Penkov wrote:
 (setq org-stuck-projects
  ‘(“+FILE=~/todos/myTodos.org+LEVEL=1 (NEXT TODO) nil ”))
 
 I have never used this feature, but this first element look odd to
 me. I would try this: “+FILE=\~/todos/myTodos.org\+LEVEL=1.
 
 HTH,
 -- 
 Alexander Baier



Re: [O] FILE special property?

2014-05-16 Thread Nick Dokos
Boyan Penkov boyan.pen...@gmail.com writes:

 Thanks for your help, Alex.

 The backslashes do get the string to evaluate correctly (now the value of 
 org-stuck-projects is indeed set to what you’d think it would be set to, 
 where the first element is a
 string), but this does not yield the right output — C-c # still yields no 
 output, and I do know there are projects I define as unfinished in the 
 relevant file.

 When I crop out the +FILE=… part of the string, I get the output I’m 
 expecting, so I’m pretty sure my problem is with the syntax of the FILE 
 selector.


~ is bash syntax. Try replacing it with the full path of your home
directory.

 Thanks!
 --
 Boyan Penkov
 www.boyanpenkov.com

 On May 16, 2014, at 5:10 PM, Alexander Baier alexander.ba...@mailbox.org 
 wrote:

 On 2014-05-16 22:12 Boyan Penkov wrote:

 (setq org-stuck-projects
  ‘(“+FILE=~/todos/myTodos.org+LEVEL=1 (NEXT TODO) nil ”))

 I have never used this feature, but this first element look odd to
 me. I would try this: “+FILE=\~/todos/myTodos.org\+LEVEL=1.

 HTH,
 --
 Alexander Baier


-- 
Nick




Re: [O] Preview tikz in org-mode (reduce margins of produced images)

2014-05-16 Thread Leu Zhe
Hi ndokos,

Thanks for you advice.
I added a attachment which matches my problem.

Best regards!


test.org
Description: Binary data