Re: [O] latex src block file output

2016-12-02 Thread Nicolas Goaziou
Hello,

Anthony Cowley  writes:

> When I hit C-c C-c on a latex src block with a :file header,
> I ultimately get an error from org-compile-file that the expected
> output file in a temp directory was not produced. However, the file is
> produced in the current directory.
>
> For instance, evaluating the src block in the following Org document,
>
> * A Little Diagram
>
> #+BEGIN_SRC latex :file diagram.pdf :packages '(("" "tikz")) :border 1em
> \usetikzlibrary{shapes,arrows}
> \begin{tikzpicture}[->, auto, node distance=3cm]
>   \node [draw] (A) {A};
>   \node [ellipse, draw, right of=A] (B) {B};
>   \path (A) edge node {message} (B);
> \end{tikzpicture}
> #+END_SRC
>
>
> Gives me the error,
>
> Debugger entered--Lisp error: (error "File 
> \"/var/folders/n6/0j2z684n2pq_0d5kphzzvjs8gn/T/babel-7327204x/latex-73272sec.pdf\"
>  wasn’t produced.  See \"*Org PDF LaTeX Output*\" for details")

I cannot reproduce it. What Org version are you using? What is the value
of `org-latex-pdf-process'?

Regards,

-- 
Nicolas Goaziou



[O] buffer local org-src-preserve-indentation not respected

2016-12-02 Thread David Dynerman
Dear list,

I'd like to report a bug. It seems that setting
org-src-preserve-indentation to true doesn't work if it's set buffer
local.

To reproduce, save the following as an org file:

#+BEGIN_SRC python :tangle preserve-indent.py
class Foo:
bar = 5
#+END_SRC

Here is some interstitial text!

#+BEGIN_SRC python :tangle preserve-indent.py
def __init__(self):
self.bar = 7
#+END_SRC

Then:

1) (setq org-src-preserve-indentation nil) and tangle the file. Open
preserve-indent.py and note that def __init__ has no leading whitespace,
which means python will not recognize it as a member of Foo

2) (setq org-src-preserve-indentation t) and tangle the file. Open
preserve-indent.py and note that now def __init__ is properly
indented. This is the expected behavior.

3) (setq org-src-perserve-indentation nil), then M-x
make-variable-buffer-local and set org-src-preserve-indentation to
t. Tangle the file and open preserve-indent.py. Note that def __init__
is back to being not-indented. The expected behavior is that the
indentation would be respected, as in #2.

David



[O] Include sections of org document in tangled files

2016-12-02 Thread David Dynerman
Dear list,

Is it possible to include sections of an org document while tangling.

I have in mind something like the following:

* Some section
<>
This is an introduction. We're going to write some code that implements (a 
finite version of) the formula

\[
f(x) = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \ldots + \frac{x^n}{n!} + \ldots
\]

Here's some background about the exponential function.

#+BEGIN_SRC python :tangle myfunction.py
from math import factorial

def f(x,n):
"""<>"""

y = 0
for i in range(n+1):
y = y + x**i/factorial(i)

return y
#+END_SRC

The idea would be that when I export this to HTML, I get a nice literate
programming math jax'd section introduction that explains what the
function is doing. Then, when I tangle to generate the python file, the
org section introduction would be included as the python docstring of
the function.

This would be really useful, because currently I find myself repeating
information when I use org for literate programming. First, I explain
what a python function is doing in the org file, but then I also want to
include a docstring in the tangled output that basically contains the
same information as the org file.

Thank you,
David




Re: [O] [bug] timed repeater shows up in wrong place

2016-12-02 Thread Samuel Wales
thank you.



Re: [O] [bug] timed repeater shows up in wrong place

2016-12-02 Thread cesar mena
Nicolas Goaziou  writes:

> Hello,
>
> cesar mena  writes:
>
>> hello guys,
>>
>> Samuel Wales  writes:
>>
>>> by the way there is a bug in org 9 where org-scheduled face is
>>> erroneously used instead of org-scheduled-previously.
>>
>> as pointed out by samuel, commit
>> 69ec6258b65a5d317f0dcb275ec2d5a90f72f191 introduced a bug where a
>> previously scheduled item in the agenda does not get the
>> org-scheduled-previously face.
>
> Fixed. Thank you.
>
> Regards,
>
> -- 
> Nicolas Goaziou

confirmed. thanks.

best,
-cm



Re: [O] [bug] timed repeater shows up in wrong place

2016-12-02 Thread Nicolas Goaziou
Hello,

cesar mena  writes:

> hello guys,
>
> Samuel Wales  writes:
>
>> by the way there is a bug in org 9 where org-scheduled face is
>> erroneously used instead of org-scheduled-previously.
>
> as pointed out by samuel, commit
> 69ec6258b65a5d317f0dcb275ec2d5a90f72f191 introduced a bug where a
> previously scheduled item in the agenda does not get the
> org-scheduled-previously face.

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] [bug] timed repeater shows up in wrong place

2016-12-02 Thread cesar mena
hello guys,

Samuel Wales  writes:

> by the way there is a bug in org 9 where org-scheduled face is
> erroneously used instead of org-scheduled-previously.

as pointed out by samuel, commit
69ec6258b65a5d317f0dcb275ec2d5a90f72f191 introduced a bug where a
previously scheduled item in the agenda does not get the
org-scheduled-previously face.

cheers,
-cm



Re: [O] org.texi edits, patch attached

2016-12-02 Thread Lambda Coder
On Sat, Nov 26, 2016 at 2:42 PM, Nicolas Goaziou 
wrote:

>
> Could you send an updated patch?
>
> Regards,
>
> --
> Nicolas Goaziou
>


See the attached patch file diff'd against maint. I've also attached a
separate file that has your comments and my responses. Hope they are
self-explanatory.

--Lambda Coder.


0001-doc-org-texi.patch.gz
Description: GNU Zip compressed data


20161123CommentsFromNicolas.txt.gz
Description: GNU Zip compressed data


Re: [O] passing entry property to a source code block?

2016-12-02 Thread Charles C. Berry

On Fri, 2 Dec 2016, Piter wrote:


Hi everybody.

I would like to get a property of org-mode entry and pass it as a string 
variable to a python source code.


Is it possible to do? I have been looking into attach screensshot code but 
since my elisp experience is very limited I can not figure  it out.


Any tips about it? may be I can use inline ellisp function in python source 
header?




That's about right:


# Refresh the `property' line with C-c C-c the first time you use it.

#+PROPERTY: my-string "Hello everyone!"

#+header: :var ms=(org-entry-get (point) "my-string" t)
#+BEGIN_SRC python :results output
print ms
#+END_SRC

#+RESULTS:
: "Hello everyone!"

HTH,

Chuck

p.s. do not forget to




Re: [O] latex export: can I add an optional argument to an item?

2016-12-02 Thread Eric S Fraga
On Friday,  2 Dec 2016 at 10:35, Alan Schmitt wrote:
> Thank you for the suggestion. With macros that makes for a quite elegant
> solution.

You're welcome.  And, yes, with macros, many LaTeX aspects can be
incorporated easily without making everything look a mess.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.1-83-g305ff7


signature.asc
Description: PGP signature


[O] Installation of org-mode from org repository

2016-12-02 Thread Shawn Way
Using elpa, I've installed org-mode, org-20161118 which has given me the log 
file below.  I removed and installed this because the following error occurs:

Warning (initialization): An error occurred while loading 
'c:/Users/sway/AppData/Roaming/.emacs':

Invalid function: org-babel-header-args-safe-fn

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the '--debug-init' option to view a complete error backtrace.


When I do the backtrace, the following is produced.

Debugger entered--Lisp error: (invalid-function org-babel-header-args-safe-fn)
  org-babel-header-args-safe-fn((:cache :colnames :comments :exports :epilogue 
:hlines :noeval :noweb :noweb-ref :noweb-sep :padline :prologue :rownames :sep 
:session :tangle :wrap (:eval "never" "query") (:results lambda (str) (not 
(string-match "file" str))) :width :height :bg :units :pointsize :antialias 
:quality :compression :res :type :family :title :fonts :version :paper 
:encoding :pagecentre :colormodel :useDingbats :horizontal))
  
byte-code("\301\302\303\304!#\210\305\306\307\310\311DD\312\313\314\315\316\317\320&
\207" [ob-R-safe-header-args put org-babel-default-header-args:R 
safe-local-variable org-babel-header-args-safe-fn custom-declare-variable 
org-babel-R-command funcall function #[0 "\300\207" ["R --slave --no-save"] 1 
"R --slave --no-save"] "Name of command to use for executing R code." :group 
org-babel :version "24.1" :type string] 10)
  require(ob-R)
  org-babel-do-load-languages(org-babel-load-languages ((latex . t) (maxima . 
t) (emacs-lisp . t) (calc . t) (R . t)))
  eval-buffer(# nil "c:/Users/sway/AppData/Roaming/.emacs" nil 
t)  ; Reading at buffer position 26705
  load-with-code-conversion("c:/Users/sway/AppData/Roaming/.emacs" 
"c:/Users/sway/AppData/Roaming/.emacs" t t)
  load("~/.emacs" t t)
  #[0 "\205\266

This is making the following code unable to work:

#+BEGIN_SRC R :session *R*
2+2
#+END_SRC

Also, when I hit C-c `, I go to the table editor, not the source code editor.

Below is a dump of the installation of Org-20161118


The compile log:



Leaving directory 'c:/Users/sway/AppData/Roaming/.emacs.d/elpa/org-20161118'


Compiling file c:/Users/sway/AppData/Roaming/.emacs.d/elpa/org-20161118/ob-C.el 
at Fri Dec  2 09:00:20 2016
Entering directory 'c:/Users/sway/AppData/Roaming/.emacs.d/elpa/org-20161118/'

In end of data:
ob-C.el:448:1:Warning: the function 'org-babel--get-vars' is not known to be
defined.


Compiling file c:/Users/sway/AppData/Roaming/.emacs.d/elpa/org-20161118/ob-J.el 
at Fri Dec  2 09:00:20 2016


Compiling file c:/Users/sway/AppData/Roaming/.emacs.d/elpa/org-20161118/ob-R.el 
at Fri Dec  2 09:00:20 2016
ob-R.el:70:11:Warning: reference to free variable 'org-babel-safe-header-args'
ob-R.el:408:1:Warning: Unused lexical variable 'raw'

In end of data:
ob-R.el:470:1:Warning: the following functions are not known to be defined:
org-babel-header-args-safe-fn, org-babel-graphical-output-file,
org-babel--get-vars


Compiling file 
c:/Users/sway/AppData/Roaming/.emacs.d/elpa/org-20161118/ob-abc.el at Fri Dec  
2 09:00:20 2016

In end of data:
ob-abc.el:93:1:Warning: the function 'org-babel--get-vars' is not known to be
defined.


Compiling file 
c:/Users/sway/AppData/Roaming/.emacs.d/elpa/org-20161118/ob-asymptote.el at Fri 
Dec  2 09:00:20 2016

In end of data:
ob-asymptote.el:140:1:Warning: the function 'org-babel--get-vars' is not known
to be defined.


Compiling file 
c:/Users/sway/AppData/Roaming/.emacs.d/elpa/org-20161118/ob-awk.el at Fri Dec  
2 09:00:20 2016

In end of data:
ob-awk.el:112:1:Warning: the function 'org-babel--get-vars' is not known to be
defined.


Compiling file 
c:/Users/sway/AppData/Roaming/.emacs.d/elpa/org-20161118/ob-calc.el at Fri Dec  
2 09:00:20 2016

In end of data:
ob-calc.el:111:1:Warning: the function 'org-babel--get-vars' is not known to
be defined.


Compiling file 
c:/Users/sway/AppData/Roaming/.emacs.d/elpa/org-20161118/ob-clojure.el at Fri 
Dec  2 09:00:20 2016

In end of data:
ob-clojure.el:119:1:Warning: the function 'org-babel--get-vars' is not known
to be defined.


Compiling file 
c:/Users/sway/AppData/Roaming/.emacs.d/elpa/org-20161118/ob-comint.el at Fri 
Dec  2 09:00:20 2016


Compiling file 
c:/Users/sway/AppData/Roaming/.emacs.d/elpa/org-20161118/ob-coq.el at Fri Dec  
2 09:00:21 2016


Compiling file 
c:/Users/sway/AppData/Roaming/.emacs.d/elpa/org-20161118/ob-core.el at Fri Dec  
2 09:00:21 2016

In org-babel-check-confirm-evaluate:
ob-core.el:221:8:Warning: function org-babel-check-confirm-evaluate used to
take 1+ arguments, now takes 1
ob-core.el:221:8:Warning: macro 'org-babel-check-confirm-evaluate' being
redefined as a function
ob-core.el:248:1:Warning: Unused lexical variable 'block-name'
ob-core.el:248:1:Warning: Unused lexical variable 

Re: [O] capitalization of titles in org-ref

2016-12-02 Thread John Kitchin
That happens because of the function org-ref-title-case-article in the
variable org-ref-clean-bibtex-entry-hook.

Just set org-ref-clean-bibtex-entry-hook to have what you want in it in
your init files to prevent the title casing from occurring.

John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Fri, Dec 2, 2016 at 9:20 AM, Georg W. Otto  wrote:

> Hi,
>
> I am not completely sure if the problem is caused by org-ref or
> somwehere else in the process, but here it is:
>
> When importing a paper by doi using
>
> doi-utils-add-bibtex-entry-from-doi
>
> the title is capitalized. I want to switch off this behaviour, leaving
> the paper title in its original capitalization state. Any idea how I can
> do this?
>
> Cheers,
>
> Georg
>
>
>


[O] capitalization of titles in org-ref

2016-12-02 Thread Georg W. Otto
Hi,

I am not completely sure if the problem is caused by org-ref or
somwehere else in the process, but here it is:

When importing a paper by doi using

doi-utils-add-bibtex-entry-from-doi

the title is capitalized. I want to switch off this behaviour, leaving
the paper title in its original capitalization state. Any idea how I can
do this?

Cheers,

Georg




Re: [O] fuzzy matching of parameters

2016-12-02 Thread John Kitchin
I would not do that if I were you. The fuzzy match might inadvertently
send feed back to the wrong student. I would fall back to some manual
attachment if you do not find an exact match, e.g. using helm or ivy to
select the files for attachment, perhaps sorted and matched using their
fuzzy algorithms. 



Matt Price writes:

> I have just done something I'm very excited about.  Given a directory name
> (the variable ~assignment~ in this case) and a list of student info, search
> through the directory for files whose names contain the student names, and
> attach those to newly created subtrees.
>
> Before now, manually attaching those files has been a real pain, so it's
> great to have this automated! However, sometimes the name I have on file
> doesn't quite match the submitted name. In particular, my Chinese students
> usually have an English first name that we use in class, and a
> transliterated Chinese personal name that is used in official documents
> (like my class list).  I would like to first try to match the whole name,
> and if that fails, attempt some kind of "fuzzy" match of the name. I'm not
> sure the best way to go about it.
>
> Any suggestions? Here is, I think, the relevant section of code (I can post
> the wider context if that would be helpful). Thanks!
>
> Matt
>
> (mapcar (lambda (stu)
>   (let ((name (car stu))
> (email (cdr stu))
> )
> (insert (format "\n** %s" name))
> (org-todo 'todo)
> (org-set-property "MAIL_TO" email)
> (org-set-property "MAIL_SUBJECT"
>   (format "Comments on %s
> Assignment (%s)"
>
> (mwp-org-get-parent-headline) name ))
> ;; try to attach files, if possible
> (condition-case nil
> (let* (( afiles (directory-files
> assignment  nil name)))
>   (if afiles
>   (dolist (f afiles)
> (org-attach-attach (concat
> (file-name-directory (buffer-file-name)) assignment "/" f) ))
> (message "No files match name of %s"
> name)))
>   (error (message "Unable to attach file
> belonging to student")))
> (save-excursion
>   (org-mark-subtree)
>   (org-cycle nil))
> )) students)


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] Latex code blocks HTML export still broken

2016-12-02 Thread Éric Würbel

Le 01/12/2016 à 16:53 CET, Nick Dokos  a dit:

> Éric Würbel  writes:
>
>> When trying to export to html with C-c C-e h h, org complains :
>>
>> org-compile-file: File "/tmp/babel-2370po9/latex-237073Q.pdf" wasn't
>> produced.  See "*Org PDF LaTeX Output*" for details
>>
>
> What does that buffer show?
>
>> In fact the file is produced, but directly in
>> /tmp/latex-237073Q.pdf. (no babel-2370po9 subdir).
>>
>
> Are you sure that's not left over from some previous experiments?

Sorry, This was the reason. Your remark reminds me an emacs-lisp tweak I
introduced for org8.3 export process, and it seem I have to revise it.

It works now. 

Thank you for pointing me on this problem
-- 
Éric Würbel
http://eric.wurbel.perso.luminy.univ-amu.fr/
Enseignement: IUT R, directeur des études 1A
Recherche: LSIS, UMR7296 http://www.lsis.org/



[O] passing entry property to a source code block?

2016-12-02 Thread Piter

Hi everybody.

I would like to get a property of org-mode entry and pass it as a string 
variable to a python source code.


Is it possible to do? I have been looking into attach screensshot code 
but since my elisp experience is very limited I can not figure  it out.


Any tips about it? may be I can use inline ellisp function in python 
source header?


Thanks.

Petro






Re: [O] latex export: can I add an optional argument to an item?

2016-12-02 Thread Alan Schmitt
Hi Eric,

On 2016-12-02 09:52, Eric S Fraga  writes:

> I know you've had some answers but if you want exactly what you
> specified in LaTeX, the following will do it:
>
> * intro
> This is a list
> - @@latex:[\(\checkmark\)]@@ and so on
> - normal item

Thank you for the suggestion. With macros that makes for a quite elegant
solution.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2016-10: 401.57, 2015-10: 398.29


signature.asc
Description: PGP signature


Re: [O] latex export: can I add an optional argument to an item?

2016-12-02 Thread Eric S Fraga
On Thursday,  1 Dec 2016 at 09:04, Alan Schmitt wrote:
> Hello,
>
> I would like to generate the following latex export:
>
> \begin{itemize}
> \item[\Checkmark] foo
> \end{itemize}
>
> I tried both
>
> -[\Checkmark]
>
> and
>
> - [\Checkmark]
>
> but neither works.
>
> Is this possible with org-mode?

I know you've had some answers but if you want exactly what you
specified in LaTeX, the following will do it:

--8<---cut here---start->8---
* intro
This is a list
- @@latex:[\(\checkmark\)]@@ and so on
- normal item
--8<---cut here---end--->8---


(I don't have Checkmark defined so used checkmark instead)

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.1-83-g305ff7


signature.asc
Description: PGP signature


Re: [O] latex export: can I add an optional argument to an item?

2016-12-02 Thread Alan Schmitt
Hello Richard,

On 2016-12-01 11:36, Richard Lawrence  writes:

>> I would like to generate the following latex export:
>>
>> \begin{itemize}
>> \item[\Checkmark] foo
>> \end{itemize}
>
> It's not exactly pretty, but you can use a description list while
> resetting it to the itemize environment, like:
>
> #+ATTR_LATEX: :environment itemize  
>   - \Checkmark :: foo
>
> That produces:
>
> \begin{itemize}
> \item[{\Checkmark}] foo
> \end{itemize}
>
> At least, that works for me (I have not yet upgraded to Org 9.0;
> so I don't know if this will continue to work, though I don't know of
> any reason why it shouldn't). 

It works great (on current org), thanks a lot!

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2016-10: 401.57, 2015-10: 398.29


signature.asc
Description: PGP signature