Re: Feedback on Emacs-Jupyter

2022-01-05 Thread David Dynerman
Dear Nathaniel,

Let me echo others’ comments by saying how much I appreciate your work on 
emacs-jupyter. I use the package daily in my work and it’s been really 
fantastic. Thank you very, very much for your huge efforts and time investment 
in creating and maintaining this package.

emacs-jupyter has proved so useful that I’ve been collecting a list of 
suggested improvements - I was actually intending on trying to contribute some 
of these myself, but I think it would be good to discuss first with you and 
other users of emacs-jupyter (is there an emacs-jupyter mailing list or 
preferred venue?). For now I’ll just share what I think would be the biggest 
improvement for my use case.

I use emacs-jupyter to connect from my laptop to remote jupyter kernels and 
notebook servers running on powerful machines provided by my employer. I work 
in a notebook locally on my laptop, but execute code blocks remotely. I specify 
a single remote jupyter notebook server+kernel to connect to in a #+PROPERTY 
line at the top of my org file which globally sets header-args for 
jupyter-python to include the correct :session argument.

For me, the biggest improvements would be addressing some pain points with 
disconnecting/reconnecting to the jupyter notebook server or kernel. I don’t 
have technical suggestions yet on how these could be addressed, so I’ll just 
describe the user experience side of things.

1) Reconnecting to the notebook server after disconnecting. Commonly I’ll work 
in my notebook, then take a break and close my laptop or disconnect from my 
work VPN. When I re-open my laptop/reconnect to VPN it seems like the 
connections to the remote notebook server are in a bad state (this may be a 
tramp thing, also). Currently my work around is to kill the associated emacs 
jupyter REPL buffer, then navigate to one of the source blocks in the notebook 
and run org-babel-pop-to-session which has the side-effect of re-connecting to 
the jupyter notebook server and recreating the jupyter REPL buffer. 

The main downside to this workaround is that the scroll back history of the 
REPL buffer is lost, since the buffer was killed. It would be great to be able 
to re-establish the connection to the REPL without discarding the buffer.

2) Getting results from a running block after disconnecting/reconnecting. 
Currently it’s difficult to manage long-running code blocks using emacs-jupyter 
if I disconnect from the remote server while the code block is running. The 
work around in #1 above to re-connect to a remote kernel doesn’t work if the 
kernel is still executing a block. If the kernel has completed executing the 
block, then the results are not populated back into the notebook (the execution 
UUID populated when the code block began executing remains).

I don’t know much about jupyter, but I saw some jupyter logs about buffered 
messages. Perhaps jupyter buffers output when a remote client disconnects? If 
so, maybe this buffered output could be replayed in a notebook when the emacs 
jupyter REPL connection is re-established?

3) Similarly, improving feedback from a long-running block would be very 
helpful. Currently you can use print statements in a long running block to 
report progress, but these are lost after disconnecting (maybe they are 
buffered on the jupyter server side and could be replayed on reconnect?). 
Further, I don’t know if this is feasible, but it would be amazing to have 
support for progress bars for long-running tasks (e.g., have a tqdm progress 
bar render in the org notebook).

Thanks again for the wonderful package - I hope we can talk a bit more about 
some of these friction points. I’d be happy to give a crack at contributing a 
PR, if that would be welcome.

Thank you,
David

> On Jan 4, 2022, at 15:24, Nathaniel Nicandro  
> wrote:
> 
> 
> Hello all,
> 
> I'm the maintainer of the emacs-jupyter project
> (https://github.com/nnicandro/emacs-jupyter) which essentially
> integrates Jupyter kernels (https://jupyter.org) with Org mode source
> blocks.
> 
> I wanted to make an introduction to the Org community.  So...hello!  And
> thanks for promoting the project on https://orgmode.org/features.html.
> 
> I believe a lot of users of the project use it mainly for the Org
> integration.  I thought it would be a good idea to get some feedback
> from the community on how their experience using emacs-jupyter has been.
> I'm getting back into active maintenance of the project and am looking
> for feedback to get a better idea of what the future of the project
> could look like.  What features of standard Org source blocks do you
> find Jupyter source blocks are lacking?  What potential features do you
> think would be useful for Jupyter source blocks to support, given the
> capabilities of Jupyter?  What would it mean to see Emacs-Jupyter and
> Org more integrated?  Of course, any other thoughts are welcome.
> 
> -- 
> Nathaniel
> 




Specifying shells for remote ob-shell sessions?

2021-06-24 Thread David Dynerman
Dear Org Mode Friends,

I’m having some trouble getting the shell I want to run on remote hosts in 
session ob-shell blocks - it seems that no matter what shell I specify, session 
blocks will always run /bin/sh. I’m not sure if this is an org or tramp 
configuration issue on my end, or a bug in org.

I’m pasting a snippet that reproduces the behavior in emacs -Q below. Does 
anyone have an inkling if this is a bug, or, alternatively, suggestions for how 
I can run remote ob-shell sessions with the shell of my choice?

Thank you,
David

#+BEGIN_SRC emacs-lisp  

  (require 'ob-shell)   

  (emacs-version)   

#+END_SRC   


#+RESULTS:
: GNU Emacs 27.2 (build 1, x86_64-apple-darwin17.7.0, Carbon Version 158 AppKit 
1561.6) 
:  of 2021-05-20


#+BEGIN_SRC emacs-lisp  

  (org-version) 

#+END_SRC   


#+RESULTS:
: 9.4.4 


#+BEGIN_SRC zsh :dir /ssh:remote-host:/home/ubuntu  
 
echo $0
#+END_SRC   


#+RESULTS:
: zsh   


#+BEGIN_SRC zsh :dir /ssh:remote-host:/home/ubuntu :session foobar  
 
echo $0
#+END_SRC   


#+RESULTS:
|   |
| $ /bin/sh |


[O] Bug: Cannot tangle bash source blocks [9.0 (release_9.0-237-gccf2b9 @ /usr/local/share/emacs/site-lisp/org/)]

2017-01-02 Thread David Dynerman
I cannot tangle a bash source block (via ob-shell) that contains
variables. To reproduce, enter this into an org file:

#+BEGIN_SRC bash :var HELLO="world" :tangle
echo $HELLO
#+END_SRC

Then C-c C-v t RET

This error is reported:

org-babel-tangle-single-block: Wrong number of arguments: (2 . 4)

No tangled output is produced. I can reproduce this in emacs -Q loading
a current version of org (237-gccf2b9) by executing the following first:

(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/org")
(require 'org)
(require 'ob-shell)

This bug doesn't seem to apply to 8.2.10, since that version used ob-sh.

Emacs  : GNU Emacs 25.1.1 (x86_64-apple-darwin15.6.0, Carbon Version 157 AppKit 
1404.47)
 of 2016-11-24
Package: Org mode version 9.0 (release_9.0-237-gccf2b9 @ 
/usr/local/share/emacs/site-lisp/org/)

current state:
==
(setq
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-activate
  org-babel-speed-command-activate)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-shell-link-function 'yes-or-no-p
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-show-block-all append
local]
   5]
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-babel-show-result-all
append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-link-parameters '(("id" :follow org-id-open)
   ("rmail" :follow org-rmail-open :store
org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
   ("irc" :follow org-irc-visit :store org-irc-store-link)
   ("info" :follow org-info-open :export org-info-export
:store org-info-store-link)
   ("gnus" :follow org-gnus-open :store
org-gnus-store-link)
   ("docview" :follow org-docview-open :export
org-docview-export :store org-docview-store-link)
   ("bibtex" :follow org-bibtex-open :store
org-bibtex-store-link)
   ("bbdb" :follow org-bbdb-open :export org-bbdb-export
:complete org-bbdb-complete-link :store
org-bbdb-store-link)
   ("w3m" :store org-w3m-store-link) ("file+sys")
   ("file+emacs") ("doi" :follow org--open-doi-link)
   ("elisp" :follow org--open-elisp-link)
   ("file" :complete org-file-complete-link)
   ("ftp" :follow
(lambda (path) (browse-url (concat "ftp:" path
   ("help" :follow org--open-help-link)
   ("http" :follow
(lambda (path) (browse-url (concat "http:" path
   ("https" :follow
(lambda (path) (browse-url (concat "https:" path
   ("mailto" :follow
(lambda (path) (browse-url (concat "mailto:; path
   ("message" :follow
(lambda (path) (browse-url (concat "message:" path
   ("news" :follow
(lambda (path) (browse-url (concat "news:; path
   ("shell" :follow org--open-shell-link))
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )




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

2016-12-11 Thread David Dynerman
Dear Nicolas,

Nicolas Goaziou  writes:

> Fixed (hopefully) this time. Thank you for the feedback.

It's working wonderfully now - thank you very much.

David



[O] bug#25132: 26.0.50; emacs hangs when loading org file with python source blocks

2016-12-07 Thread David Dynerman
Dear Glenn + bug-gnu-emacs,

Did you try the steps to reproduce? Indeed Clément was right! The bug also 
reliably reproduces also with org 8.2.10, if you additionally set 
org-src-fontify-natively to t.

Please let me know if you need any more information for the bug report,
David

Clément Pit--Claudel <clement@gmail.com> writes:

> On 2016-12-07 21:08, Glenn Morris wrote:
>> David Dynerman wrote:
>>> The bug does NOT occur with org 8.2.10.
>> 
>> Since that's the version included with Emacs, I'm confused as to why
>> you've been encouraged to report this to bug-gnu-emacs.
>
> I can reproduce the issue in emacs -Q on master; hence my suggestion to 
> report it here.  Glenn, can you try running the following after downloading 
> the attached file?
>
>emacs -Q --eval '(setq debug-on-signal t org-src-fontify-natively t)' 
> test.org 
>
> It hangs reproducibly for me.  No idea why the OP can't reproduce it (David, 
> are you sure it doesn't occur with org 8.2.10? Could it be that 
> org-src-fontify-natively isn't enabled by default in 8.2.10?)
>
> Clément.





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

2016-12-07 Thread David Dynerman
Dear Nicolas,

Nicolas Goaziou  writes:

> Fixed. Thank you.

Thank you very much.

I just tried, and I still encounter this buf on the current git code. 
Reproduction is the same as before:

#+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

If I globally set org-src-preserve-indentation to t, then tangle, the output 
file has the correct specified indentation with the second block. If I make 
org-src-preserve-indentation buffer local and set it to t, then the second 
block is tanlged without any leading indentation.

Perhaps the tangling code doesn't see the buffer local setting of 
org-src-preserve-indentation from the buffer being tangled?

Thank you very much for all your hard work,
David




Re: [O] Include sections of org document in tangled files

2016-12-07 Thread David Dynerman
Dear Chuck,

Your suggestion worked fantastically - I got it working and am very excited.

Now, the next step is figuring out how to handle typesetting math in single way 
between org and python docstrings. Math in Python docstrings is usually done by 
RestructuredText markdown, e.g.:

:math:`f(x) = x^2`

while the org code should just be, for example,

\[
f(x) = x^2
\]

So the goal would be have noweb not only include a documentation block in the 
python code, but also call a translation function that identifies LaTeX 
fragments in the org source and converts them to ReST markdown.

That's a separate project though, for now your suggestion is really cool!

Thanks a lot,
David

"Charles C. Berry"  writes:

> #+NAME: doc
> #+BEGIN_SRC org :exports results :results replace
>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.
>
> #+END_SRC
>
> #+header: :noweb (unless org-export-current-backend "yes")
> #+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.
>
> Right. The above does that.
>
> You need `org' as a babel language. Eval'ing `(require 'ob-org)' is good 
> enough for just trying to export this, but customizing 
> `org-babel-load-languages' to include `org' is better if you use this 
> regularly.
>
>
>> Then, when I tangle to generate the python file, the
>> org section introduction would be included as the python docstring of
>> the function.
>>
>
> And it does that.
>
> ---
>
> There is an issue you might want to address if you use this approach. 
> First, the first triple quotes must not be on the same line as the 
> included src block reference. That is because """>""" will 
> prepend the quotes to every line in `src-blk-ref'.
>
> If you do not want the newlines between the quotes and the docstring, I 
> think there is a post-tangle hook you can use to clean the tangled version 
> by removing those newlines.
>
> Also, you can use an export filter to remove the quotes and the noweb 
> reference for a cleaner looking exported doc.
>
> Note that you need to use a unique name for each src-block.
>
> HTH,
>



Re: [O] Emacs hangs while loading org file with python blocks

2016-12-07 Thread David Dynerman
Dear Alan & Clément,

Thanks for trying to reproduce - it's good to know it's not only happening to 
me.

I've just sent the bug report upstream to bug-gnu-emacs.

David

Alan Schmitt <alan.schm...@polytechnique.org> writes:

> Hello David,
>
> On 2016-12-06 17:41, David Dynerman <emperord...@block-party.net> writes:
>
>> I've now managed to extract a minimal org file that reproduces the hang:
>
> I can confirm it hangs emacs: it even hanged gnus as it was trying to
> display your email.
>
> Best,
>
> Alan
>
> -- 
> OpenPGP Key ID : 040D0A3B4ED2E5C7
> Monthly Athmospheric CO₂, Mauna Loa Obs. 2016-10: 401.57, 2015-10: 398.29



[O] Emacs hangs while loading org file with python blocks

2016-12-06 Thread David Dynerman
Dear list,

For several months I've been encountering a frustrating bug. My emacs hangs 
while initially loading an org file with ~3000 lines and around two dozen 
python blocks. If I press C-g during the lockup, emacs wakes up and the file is 
loaded. The hang does not re-occur after happening on initial load - the bug 
will reoccur only if I restart emacs and load the file again. The hang seems to 
be related to fontifying the python blocks: after I abort with C-g, some blocks 
will be unfontified. 

I previously emailed the list about this bug (Wed, 17 Aug 2016, subject 'Emacs 
hangs while loading .org file'), but didn't have an easy way to reproduce the 
problem.

I've now managed to extract a minimal org file that reproduces the hang:

#+BEGIN_SRC python
  """"""
#+END_SRC
#+BEGIN_SRC python
  class x:  
  def x(self):
  """
  """
  pass
#+END_SRC

To reproduce:

1) Save above as bug.org
2) Open a fresh emacs process, and C-x f bug.org 
3) Observe emacs is unresponsive. I've let it run as long as 30 mins without 
any change. 

I am able to reproduce with emacs -Q, only executing the following in *scratch*:

(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/org") ;; org from git 
installed here
(require 'org)

This is with the latest org code from git (release_9.0-132-gd65aa3). The bug 
does NOT occur with org 8.2.10. I've been encountering this bug for several 
months, but unfortunately I don't remember exactly when I first saw it.

I'm running GNU Emacs 25.1.1 (x86_64-apple-darwin15.6.0, Carbon Version 157 
AppKit 1404.47) of 2016-11-24.

I'm mystified as to what's going on here. It seems that removing any of the 
python code in the example above causes the bug to disappear, but I have no 
clue what the problem might be.

I've attached a profiler report captured during the hang. Here is the relevant 
part:

   - org-src-font-lock-fontify-block17419  46%
- org-font-lock-ensure  17240  45%
 - #   17240  45%
  - font-lock-default-fontify-buffer17240  45%
   - font-lock-fontify-region   17240  45%
- font-lock-default-fontify-region  17240  45%
 - font-lock-fontify-syntactically-region  17240  
45%
  - python-font-lock-syntactic-face-function  17240 
 45%
   - python-info-docstring-p17240  45%
- python-nav-backward-sexp  17240  45%
 - python-nav-forward-sexp  17240  45%
  - python-nav--forward-sexp17240  45%
   - python-info-end-of-block-p  17240  45%
- python-info-end-of-statement-p  17240  45%
 - python-nav-end-of-statement  15444  41%
syntax-ppss  8641  22%

It looks like emacs is getting stuck navigating the python blocks during 
fontification. The last org-mode call appears to be (org-font-lock-ensure).

If anyone has any suggestions on how to fix this, I'd be very interested to 
hearthem - I'm working with larger and larger org files containing python code, 
so I'm encountering this bug frequently.

Thank you very much,
David



fontify-bug-profile
Description: Binary data


[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




[O] Emacs hangs while loading .org file

2016-08-17 Thread David Dynerman
Dear list,

I have a fairly large org-file [1] (~2k lines) containing a substantial
amount of code in #+BEGIN_SRC/#+END_SRC blocks. The code is mostly
python, with one or two C blocks.

Recently emacs has started to hang when loading the file for the first
time. I saved a profiling report [2] where I loaded the file, let emacs
sit unresponsive for about 5 minutes, then typed C-g.

The report seems to indicate that fontifying python blocks is the
problem - 90% of time is spent in python-nav-end-of-statement.

Has anyone experienced something like this with large org files
containing python code? The file contains a good chunk of scratch code
which may contain python errors - is it possible that some syntactically
bad python code is causing the fontification to run amok?

If anyone has suggestions for finding the culprit, I'd be very happy to
hear.

Thank you,
David

[1] https://www.math.berkeley.edu/~dynerman/angular_xcorr.org
[2] https://www.math.berkeley.edu/~dynerman/slow-org-load



[O] org-ref: customizing bibtex key names generated by doi-utils

2016-06-23 Thread David Dynerman
Hi all,

I'm interested in exporting HTML from an org document that contains references 
managed by org-ref.

I'm running into the following problem. I have a reference that doi-utils added 
with a very long bibtex key:

@article{saldin09_struc_isolat_biomol_obtain_from ...

When exporting to html, org-ref uses this bibtex key as the link text in every 
citation. This quickly becomes unreadable, especially if you cite the above 
paper several times in a paragraph.

Does anyone know how easy it would be to customize the bibtex keys generated by 
doi-utils, for instance  by doi-add-bibtex-entry? For instance, if the above 
key were just the first author and year, it'd be

@article{Saladin2009

which would be much more readable after HTML export. I took a 30 mins look at 
the relevant doi-utils functions but couldn't piece out a reasonable way to 
make the change.

I guess another solution would be to modify HTML export to change citation link 
text, but that seems like the wrong place to make this change.

Any advice is appreciated!
David




[O] Bug: Write file while editing babel code block doesn't work as expected [8.3.4 (release_8.3.4-778-g8127b3 @ /usr/local/share/emacs/site-lisp/org/)]

2016-05-10 Thread David Dynerman
When visiting an org-babel code block in a dedicated window (C-c ' in
the block), I would like to manually save the buffer to a file by calling
write-file (C-x C-w) 

However, this doesn't work - it prompts you for a filename, as expected,
but no matter what filename you enter it always just re-saves the .org
file that contains the babel block you are editing.

Is this expected? If it's not possible to have this functionality, some
kind of error message would be helpful.

Emacs  : GNU Emacs 25.1.50.1 (x86_64-apple-darwin15.4.0, NS appkit-1404.46 
Version 10.11.4 (Build 15E65))
 of 2016-03-24
Package: Org-mode version 8.3.4 (release_8.3.4-778-g8127b3 @ 
/usr/local/share/emacs/site-lisp/org/)



Re: [O] org-latex-classes removed?

2015-05-23 Thread David Dynerman
Please disregard - just a silly mistake on my end: forgot (require
'ox-latex).

Thank you,
David

David Dynerman writes:

 Hello,

 In the master I'm currently seeing that org-latex-classes is
 undefined. Is this intended? Has this functionality been replaced by
 something else? I didn't see anything in a quick search of the mailing
 list archives.

 Running emacs -q, in *scratch* I evaluate:

 (add-to-list 'load-path /usr/share/site-lisp/org)
 (load-library org)
 (require 'org)
 (add-to-list 'org-latex-classes '(book-no-parts 
 \\documentclass[11pt]{book}
 (\\chapter{%s} . \\chapter*{%s})
 (\\section{%s} . \\section*{%s})
 (\\subsection{%s} . \\subsection*{%s})
 (\\subsubsection{%s} . 
 \\subsubsection*{%s})))

 Result:

 if: Symbol's value as variable is void: org-latex-classes

 This is on OS X using a emacsformacosx.com build:

 GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 
 2015-04-10 on builder10-9.porkrind.org

 Org-mode version 8.3beta (release_8.3beta-1159-g71641b @ 
 /usr/share/site-lisp/org/)

 ProductName:  Mac OS X
 ProductVersion:   10.10.3
 BuildVersion: 14D136

 Thank you,
 David




[O] org-latex-classes removed?

2015-05-23 Thread David Dynerman
Hello,

In the master I'm currently seeing that org-latex-classes is
undefined. Is this intended? Has this functionality been replaced by
something else? I didn't see anything in a quick search of the mailing
list archives.

Running emacs -q, in *scratch* I evaluate:

(add-to-list 'load-path /usr/share/site-lisp/org)
(load-library org)
(require 'org)
(add-to-list 'org-latex-classes '(book-no-parts \\documentclass[11pt]{book}
(\\chapter{%s} . \\chapter*{%s})
(\\section{%s} . \\section*{%s})
(\\subsection{%s} . \\subsection*{%s})
(\\subsubsection{%s} . 
\\subsubsection*{%s})))

Result:

if: Symbol's value as variable is void: org-latex-classes

This is on OS X using a emacsformacosx.com build:

GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 
2015-04-10 on builder10-9.porkrind.org

Org-mode version 8.3beta (release_8.3beta-1159-g71641b @ 
/usr/share/site-lisp/org/)

ProductName:Mac OS X
ProductVersion: 10.10.3
BuildVersion:   14D136

Thank you,
David


signature.asc
Description: PGP signature


[O] Conditional .gitignore for org-mode files

2015-04-26 Thread David Dynerman
Hi all,

Sorry in advance, this might be more of a git question than an org-mode
question, but I thought someone on this list might know the answer.

Is it possible to conditionally gitignore certain files based on files
that are being tracked?

What I'd like is something like the following gitignore logic:

if filename.org is tracked by git:
   ignore filename.tex, filename.html

If this isn't possible, does anyone have any nice setups for ignoring
exported versions of org-mode files?

Thanks,
David



   


signature.asc
Description: PGP signature


Re: [O] ox-latex and small caps links

2015-04-21 Thread David Dynerman
 ,-
 | Code within @@latex:some code@@ a paragraph.
 `-

This works great! Thanks Tom!

It might be nice to document this somehwere, to make the transition a
little easier when 8.3 rolls out and the old [[latex:textsc][Hello]]
links cause export errors.

I'd be happy to write something. Where would a good place be? The NEWS
file? The wiki?

David


signature.asc
Description: PGP signature


[O] ox-latex and small caps links

2015-04-21 Thread David Dynerman
Hi there,

I've been using links to render text in small caps when exporting to
LaTeX and HTML, e.g.

[[latex:textsc][this is in small caps]]

This worked fine in 8.2.10, but causes an error in latest. When I try to
export the file to LaTeX, the export fails with:

Unable to resolve link latex:textsc

Is this a bug? Is there a better way to render text in small caps? This
latex: trick in a link was the standard way to bracket text with any
latex command, right?

Thanks,
David


signature.asc
Description: PGP signature


[O] Only evaluate code blocks interactively, but export results

2015-04-04 Thread David Dynerman
Hi all,

I’m trying to accomplish the following:

1) I have an org-babel python block in my code that produces a figure file
2) I’d like to include the resulting figure HTML export of my org file
3) The code takes a bit to run, so I don’t want to execute the code block 
during each HTML export

What I have so far:

#+NAME: my_python_function
#+HEADER: :var some python vars
#+BEGIN_SRC python :results value file
  my python code
#+END_SRC

#+CALL: my_python_function(some python vars=values) :results value file 
:exports results
#+CAPTION: Here is a figure
#+LABEL: fig:an_amazing_figure
#+ATTR_HTML: :height 200em
#+RESULTS:
[[file:output_file]]

This block works when I export to HTML (e.g. the code runs, and the figure is 
placed in the appropriate figure with the appropriate caption).

Question: How can I modify this so that the code is only executed when I run 
C-c C-c on the +CALL line, but still have the figure in the exported HTML?

I tried adding :eval no-export to the code and to the +CALL line, but then the 
resulting HTML doesn’t contain the figure (it outputs “nil”, presumably because 
the CALL line is trying to call it, but the code is refusing to run because of 
the no-export line)

I’ve been digging around this for a few hours, any help would be appreciated.

Thanks,
David


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [O] Only evaluate code blocks interactively, but export results

2015-04-04 Thread David Dynerman
Hi Tom,

Does :cache yes work with #+CALL lines? I’m not able to get it to work.

I’m calling my function through #+CALL’s because I’d like to generate several 
figures from the same org-babel code block/

I tried adding :cache yes to:

1) The actual org-code block
2) The +CALL line, at the end
3) The +CALL line, before the argument list (i.e., my_python_function[:cache 
yes](…))

None of these worked - the code was still re-evaluated when I exported the 
file, although the +RESULTS line got a hash value.

Thank you very much,
David


 On Apr 4, 2015, at 12:15, Thomas S. Dye t...@tsdye.com wrote:
 
 Aloha David,
 
 David Dynerman da...@block-party.net mailto:da...@block-party.net writes:
 
 Hi all,
 
 I’m trying to accomplish the following:
 
 1) I have an org-babel python block in my code that produces a figure file
 2) I’d like to include the resulting figure HTML export of my org file
 3) The code takes a bit to run, so I don’t want to execute the code
 block during each HTML export
 
 What I have so far:
 
 #+NAME: my_python_function
 #+HEADER: :var some python vars
 #+BEGIN_SRC python :results value file
  my python code
 #+END_SRC
 #+CALL: my_python_function(some python vars=values) :results value file 
 :exports results
 #+CAPTION: Here is a figure
 #+LABEL: fig:an_amazing_figure
 #+ATTR_HTML: :height 200em
 #+RESULTS:
 [[file:output_file]]
 
 This block works when I export to HTML (e.g. the code runs, and the
 figure is placed in the appropriate figure with the appropriate
 caption).
 
 Question: How can I modify this so that the code is only executed when
 I run C-c C-c on the +CALL line, but still have the figure in the
 exported HTML?
 
 I tried adding :eval no-export to the code and to the +CALL line, but
 then the resulting HTML doesn’t contain the figure (it outputs “nil”,
 presumably because the CALL line is trying to call it, but the code is
 refusing to run because of the no-export line)
 
 You can set :cache yes, which can be used to avoid re-evaluating
 unchanged code blocks.
 
 hth,
 Tom
 
 --
 Thomas S. Dye
 http://www.tsdye.com http://www.tsdye.com/


signature.asc
Description: Message signed with OpenPGP using GPGMail


[O] Best practices for dual HTML/LaTeX export for scientific papers

2015-04-02 Thread David Dynerman
Hi all,

I’m currently trying to use org mode to write a scientific paper. Here is my 
wishlist:

1) Citations to an external bibliography
2) Figures containing multiple side-by-side figures with subcaptions (e.g. in 
LaTeX I would use minipage + subcaption)
3) In-document links (i.e., cross references) to figures (e.g., “See Figure 1”)
4) LaTeX and HTML export

This seems like a modest set of requirements, but I’ve had trouble getting it 
going.

For #1, I’m currently using John Kitchin’s org-ref package. This is nice - it 
gives me an HTML bibliography, but it has it’s own link syntax for in-document 
links to figures that doesn’t export to HTML. Thus I have to use org-ref style 
links for citations, but regular org-style links for figure cross references.

I haven’t figured out how to do #2. Is this currently possible? Is it an issue 
of adding some functionality to the HTML exporter?

For #3, I’m currently using #+LABEL: fig:foo, followed by [[fig:foo]]. Is this 
the suggested way of doing it?

The hard part seems #4: org-ref gives a workable HTML bibliography, but I run 
into some other issues listed above.

Can anyone suggest some “Best practices” for the above? I’d be willing to 
collect these into a list, which I think would be really helpful for new users. 
I’d also be willing to look into adding this functionality, if someone could 
suggest a good way for it to fit into the codebase/framework.

Thank you,
David



signature.asc
Description: Message signed with OpenPGP using GPGMail