[O] mass conversion?

2016-10-06 Thread Sharon Kimble

In an org-mode document which is then converted I'm using the latex
glossary package, which shows my glossary items as '\gls{foo}'. I'm now
getting to the stage of having a paper copy of the latexed PDF but am
finding that the glossary items in the main text do not show at all when
using just black text on a white background in the PDF.

So what I'm trying to do is to underline each one in the org-mode text
which converts very easily to underlined in the black/white paper PDF.

But how can I do it globally please, using just a couple of commands to
work on all instances in the org-mode file please?

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.4, fluxbox 1.3.7, emacs 25.1.1


signature.asc
Description: PGP signature


Re: [O] Best diagram, image software?

2016-10-06 Thread John Kitchin
That is probably because with minted you have to modify how the pdf is
built to use pdflatex -shell-escape.

The variable org-latex-pdf-process controls this.


Peter Davis writes:

> Ok, my problem was that the minted package was causing errors. Taking
> that out lets me generate pdf.
>
> Now to figure out how to generate other formats, to work with HTML and
> LaTeX/PDF output.
>
> Thanks, all!!
>
> -pd


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



[O] MySQL params as global properties?

2016-10-06 Thread Gary Oberbrunner
I guess I've been out of the loop for a while. I used to have this at the
end of my org-mode SQL files:

#+PROPERTY: engine mysql
#+PROPERTY: dbhost xx.xx.xx.xx
#+PROPERTY: dbuser xx
#+PROPERTY: dbpassword x
#+PROPERTY: database x

But since I recently updated org-mode, these don't have any effect anymore.
In ob-sql I can see they're not getting passed to org-babel-execute:sql.

I tried a different form that I saw in the doc:

#+PROPERTY: header-args:sql :engine mysql
#+PROPERTY: header-args:sql :dbhost xxx
#+PROPERTY: header-args:sql :dbuser xxx
#+PROPERTY: header-args:sql :dbpassword xx
#+PROPERTY: header-args:sql :database 

but that doesn't work either. Can anyone tell me the proper new-style form
for passing header args to all sql code blocks?

thanks!

-- 
Gary


Re: [O] Best diagram, image software?

2016-10-06 Thread John Kitchin
That implies you have not configured org-mode to include the tikz
package.

If you execute this block in a buffer does it work?

#+BEGIN_SRC emacs-lisp
(org-babel-do-load-languages
 'org-babel-load-languages
 '((emacs-lisp . t)
   (python . t)
   (ditaa . t)
   (dot . t)
   (plantuml . t)
   (gnuplot . t)
   (sh . t)
   (org . t)
   (latex . t)))

(setq org-latex-packages-alist
  (quote (("" "color" t)
  ("" "minted" t)
  ("" "parskip" t)
  ("" "tikz" t

(setq org-latex-create-formula-image-program 'imagemagick)
#+END_SRC


Peter Davis writes:

> On Thu, Oct 6, 2016, at 01:59 PM, John Kitchin wrote:
>> I tried this, and it worked for me. Check *Messages* for things like:
>> Failed to create dvi file from
>> /var/folders/5q/lllv2yf95hg_n6h6kjttbmdwgn/T/orgtex93386BIQ.tex
>> 
>> if you see that try manually building the tex file to see if there are
>> LaTeX issues.
>> 
>
> Thanks, John. Just running pdflatex from the command line gives me:
>
> ! Undefined control sequence.
> l.36 \tikz
>   [remember picture]\node[coordinate,yshift=0.5em] (n1) {};
>
> So perhaps TikZ itself is not available to some part of this.
>
> Thanks,
> -pd


-- 
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] Bug: org-mode interprets * as a headline in text between #+BEGIN_.. and #+END_...

2016-10-06 Thread Nick Dokos
John Hendy  writes:

> On Thu, Oct 6, 2016 at 3:28 PM, David Talmage
>  wrote:
>> I often paste verbatim text into the lab notebook I keep with org-mode.
>> Org-mode always interprets any line that begins with an asterisk as a
>> headline, even when the line is surrounded by #+BEGIN_... and #+END_...
>> patterns. This breaks org-special-edit, making it complain, "No special
>> environment to edit here", unless I manually insert another character at the
>> beginning of every line in the block that begins with an asterisk.
>>
>> The behavior surprised me.  I found two ways to work around it.  First, I
>> can edit the would-be verbatim text as described above. It will always look
>> like the original text in org-special-edit. That's marginally acceptable
>> because it alters my original text and makes me take one more step before I
>> can copy and paste it elsewhere.  Second, I can put such text in a drawer.
>> I discovered that org-mode does not mis-interpret my text in a drawer.
>>
>>
>
> I don't have a good explanation of why, but I know you need a comma to
> escape org syntax, even within src blocks:
> - mention of it in the manual (footnote 4):
> http://orgmode.org/manual/Literal-examples.html
> - SO answer:
> http://stackoverflow.com/questions/7431167/escaping-org-mode-example-block-inside-of-an-example-block
>

C-c ' to edit the block will rewrite it with a , in front - but only
if the line does not start with a * - if it starts with a *, then C-c
' will complain as the OP posted. And if you have speed keys enabled,
then comma or space will not self-insert, and you got to do something
like C-q , to enter the comma or C-q SPC for a space, making the whole
thing even more confusing. I don't know how it would interact with
org-indent turned off: I didn't try that.

Is the "* on column 0 is a headline" convention a consequence of the
dependence on outline.el? Or is it just historical baggage? I cannot
remember the grammar rules, but I'm wondering if the parser could be
made to say "not a headline" in this situation, and if so, what the
consequences might be (particularly, the bad consequences).

I'm not sure whether Nicolas has actually explained this situation in
the past, but, with gmane non compos mentis, I did not attempt to find
an earlier discussion.

-- 
Nick




Re: [O] Bug: org-mode interprets * as a headline in text between #+BEGIN_.. and #+END_...

2016-10-06 Thread John Hendy
On Thu, Oct 6, 2016 at 3:28 PM, David Talmage
 wrote:
> I often paste verbatim text into the lab notebook I keep with org-mode.
> Org-mode always interprets any line that begins with an asterisk as a
> headline, even when the line is surrounded by #+BEGIN_... and #+END_...
> patterns. This breaks org-special-edit, making it complain, "No special
> environment to edit here", unless I manually insert another character at the
> beginning of every line in the block that begins with an asterisk.
>
> The behavior surprised me.  I found two ways to work around it.  First, I
> can edit the would-be verbatim text as described above. It will always look
> like the original text in org-special-edit. That's marginally acceptable
> because it alters my original text and makes me take one more step before I
> can copy and paste it elsewhere.  Second, I can put such text in a drawer.
> I discovered that org-mode does not mis-interpret my text in a drawer.
>
>

I don't have a good explanation of why, but I know you need a comma to
escape org syntax, even within src blocks:
- mention of it in the manual (footnote 4):
http://orgmode.org/manual/Literal-examples.html
- SO answer: 
http://stackoverflow.com/questions/7431167/escaping-org-mode-example-block-inside-of-an-example-block

> Here is an example.  It's markdown text.  I use #+{BEGIN,END}_EXAMPLE but
> this behavior occurs in all of the #+BEGIN_.. and #+END_... patterns.
>
> #+BEGIN_EXAMPLE
> This is the README.md for rfc-tools, a collection of programs for
> processing IETF RFCs.
>
> * fetch-rfcs-by-title.sh downloads into the current directory the RFCs
>whose titles contain the string given on the command line.  Uses an
>   rfc-index file in the current directory.  Prefers the PDF version of
>   RFCs but will obtain the text version if the PDF is not available.
>
> * fetch-sip-rfcs.sh downloads RFCs that contain "Session Initiation"
>   in their titles into the current directory.
>
> * search-rfc-index.sh searches an rfc-index file in the current
>   directory for the string given on the command line.  The string can
>   contain spaces.
>
> * join-titles.awk turns the contents of an rfc-index file into a
>   series of long lines.  Each line begins with the RFC number, then a
>   space, then the rest of the entry from the rfc-index.
> #+END_EXAMPLE
>



[O] Bug: org-mode interprets * as a headline in text between #+BEGIN_.. and #+END_...

2016-10-06 Thread David Talmage
I often paste verbatim text into the lab notebook I keep with org-mode.
Org-mode always interprets any line that begins with an asterisk as a
headline, even when the line is surrounded by #+BEGIN_... and #+END_...
patterns. This breaks org-special-edit, making it complain, "No special
environment to edit here", unless I manually insert another character at
the beginning of every line in the block that begins with an asterisk.

The behavior surprised me.  I found two ways to work around it.  First, I
can edit the would-be verbatim text as described above. It will always look
like the original text in org-special-edit. That's marginally acceptable
because it alters my original text and makes me take one more step before I
can copy and paste it elsewhere.  Second, I can put such text in a drawer.
I discovered that org-mode does not mis-interpret my text in a drawer.


Here is an example.  It's markdown text.  I use #+{BEGIN,END}_EXAMPLE but
this behavior occurs in all of the #+BEGIN_.. and #+END_... patterns.

#+BEGIN_EXAMPLE
This is the README.md for rfc-tools, a collection of programs for
processing IETF RFCs.

* fetch-rfcs-by-title.sh downloads into the current directory the RFCs
   whose titles contain the string given on the command line.  Uses an
  rfc-index file in the current directory.  Prefers the PDF version of
  RFCs but will obtain the text version if the PDF is not available.

* fetch-sip-rfcs.sh downloads RFCs that contain "Session Initiation"
  in their titles into the current directory.

* search-rfc-index.sh searches an rfc-index file in the current
  directory for the string given on the command line.  The string can
  contain spaces.

* join-titles.awk turns the contents of an rfc-index file into a
  series of long lines.  Each line begins with the RFC number, then a
  space, then the rest of the entry from the rfc-index.
#+END_EXAMPLE


Re: [O] Best diagram, image software?

2016-10-06 Thread Peter Davis

Ok, my problem was that the minted package was causing errors. Taking
that out lets me generate pdf.

Now to figure out how to generate other formats, to work with HTML and
LaTeX/PDF output.

Thanks, all!!

-pd

-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Best diagram, image software?

2016-10-06 Thread John Hendy
On Thu, Oct 6, 2016 at 2:49 PM, Peter Davis  wrote:
>
> On Thu, Oct 6, 2016, at 03:25 PM, Clément Pit--Claudel wrote:
>> On 2016-10-06 15:10, Peter Davis wrote:
>> >> > (add-to-list 'org-latex-packages-alist
>> >> >  '(("AUTO" "inputenc" t)
>> >> >("" "color" t)
>> >> >("" "minted" t)
>> >> >("" "parskip" t)
>> >> >("" "tikz" t)))
>>

Maybe I'm dense, but why is everyone recommending changing the alist?
Granted, for future proofing and convenience this is nice... but I do
a fair amount with TikZ and have never done this.

~/org/aux/setupfile.org contains:
#+latex_header: \usepackage{tikz}
#+latex_header: \usepackage[siunitx]{circuitikz}
#+latex_header: \usetikzlibrary{shapes, positioning}

any given .org file contains:
#+setupfile: "~/org/aux/setupfile.org"

I modified your original aim like so, ditching the .png output which
looks like requires imagemagick. Maybe that's in org somehow, but when
you're just starting out I'd suggest eliminating as many other
mechanisms as possible. TikZ is in LaTeX, so just stick to pdf at the
start. This works for me.

#+latex_header: \usepackage{tikz}
#+latex_header: \usetikzlibrary{shapes, positioning}

* test

#+begin_src latex :results raw
% Define block styles
\usetikzlibrary{shapes,arrows}
\tikzstyle{astate} = [circle, draw, text centered, font=\footnotesize,
fill=blue!25]
\tikzstyle{rstate} = [circle, draw, text centered, font=\footnotesize,
fill=red!25]

\begin{tikzpicture}[->,>=stealth', shorten >=1pt, auto, node
distance=2.8cm, semithick]
\node [astate] (1) at (0,0) {1};
\node [astate] (2) at (1,0) {2};
\node [rstate] (3) at (2,0) {3};
\path (1) edge [bend left] node {b} (2)
(2) edge node {b} (3)
(2) edge [bend left] node {a} (1)
(3) edge [loop above] node {(a, b)} (3);
\end{tikzpicture}

#+end_src



John

>> This looks wrong.  You're adding a single list to
>> org-latex-package-alist, instead of adding multiple elements one-by-one.
>>
>
> Ok, I tried changing it to:
>
> (add-to-list 'org-latex-packages-alist '("AUTO" "inputenc" t))
> (add-to-list 'org-latex-packages-alist '("" "color" t))
> (add-to-list 'org-latex-packages-alist '("" "minted" t))
> (add-to-list 'org-latex-packages-alist '("" "parskip" t))
> (add-to-list 'org-latex-packages-alist '("" "tikz"))
> (add-to-list 'org-latex-packages-alist '("" "listingsutf8"))
>
> so now org-latex-packages-alist has the value
>
> (("" "listingsutf8")
>  ("" "tikz")
>  ("" "parskip" t)
>  ("" "minted" t)
>  ("" "color" t)
>  ("AUTO" "inputenc" t))
>
> Still getting the failure on tikz output.
>
> Thanks!
> -pd
>
> --
>   Peter Davis
>   www.techcurmudgeon.com
>



Re: [O] Best diagram, image software?

2016-10-06 Thread Peter Davis

On Thu, Oct 6, 2016, at 03:25 PM, Clément Pit--Claudel wrote:
> On 2016-10-06 15:10, Peter Davis wrote:
> >> > (add-to-list 'org-latex-packages-alist
> >> >  '(("AUTO" "inputenc" t)
> >> >("" "color" t)
> >> >("" "minted" t)
> >> >("" "parskip" t)
> >> >("" "tikz" t)))
> 
> This looks wrong.  You're adding a single list to
> org-latex-package-alist, instead of adding multiple elements one-by-one.
> 

Ok, I tried changing it to:

(add-to-list 'org-latex-packages-alist '("AUTO" "inputenc" t))
(add-to-list 'org-latex-packages-alist '("" "color" t))
(add-to-list 'org-latex-packages-alist '("" "minted" t))
(add-to-list 'org-latex-packages-alist '("" "parskip" t))
(add-to-list 'org-latex-packages-alist '("" "tikz"))
(add-to-list 'org-latex-packages-alist '("" "listingsutf8"))

so now org-latex-packages-alist has the value

(("" "listingsutf8")
 ("" "tikz")
 ("" "parskip" t)
 ("" "minted" t)
 ("" "color" t)
 ("AUTO" "inputenc" t))

Still getting the failure on tikz output.

Thanks!
-pd

-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Best diagram, image software?

2016-10-06 Thread Martin Schöön
Maybe a distraction from the discussion on graphing alternatives that
can be embedded into the org/LaTeX code but I am pretty happy with the
results I get from using Veusz.

http://home.gna.org/veusz/

Adding to the confusion by adding a recommendation for a program I use
to create numerical data from graphs:

http://markummitchell.github.io/engauge-digitizer/

-- 
Martin Schöön



Re: [O] Best diagram, image software?

2016-10-06 Thread Clément Pit--Claudel
On 2016-10-06 15:10, Peter Davis wrote:
>> > (add-to-list 'org-latex-packages-alist
>> >  '(("AUTO" "inputenc" t)
>> >("" "color" t)
>> >("" "minted" t)
>> >("" "parskip" t)
>> >("" "tikz" t)))

This looks wrong.  You're adding a single list to org-latex-package-alist, 
instead of adding multiple elements one-by-one.



signature.asc
Description: OpenPGP digital signature


Re: [O] Best diagram, image software?

2016-10-06 Thread Peter Davis


On Thu, Oct 6, 2016, at 02:59 PM, Nick Dokos wrote:
> Peter Davis  writes:
> 
> > On Thu, Oct 6, 2016, at 02:15 PM, Nick Dokos wrote:
> >> Peter Davis  writes:
> >> 
> >> > Since several people recommended TikZ, I decided to take a look at it.
> >> > It seems very powerful, but I'm unable to get any example to work. For
> >> > example, using the example here: 
> >> >
> >> > http://doblogit.com/posts/2015-10-23-org-graphics.html
> >> >
> >> 
> >> Did you add tikz to org-latex-packages-alist?
> >> 
> >
> > I do have:
> >
> > (add-to-list 'org-latex-packages-alist
> >  '(("AUTO" "inputenc" t)
> >("" "color" t)
> >("" "minted" t)
> >("" "parskip" t)
> >("" "tikz" t)))
> >
> > Any other setup work I need?
> >
> 
> Yes, but have you executed that? What does C-h v org-latex-pacakges-alist
> RET say?


org-latex-packages-alist is a variable defined in ‘org.el’.
Its value is (("" "tikz")
 ("" "listingsutf8")
 (("AUTO" "inputenc" t)
  ("" "color" t)
  ("" "minted" t)
  ("" "parskip" t)
  ("" "tikz" t)))



-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Best diagram, image software?

2016-10-06 Thread Nick Dokos
Peter Davis  writes:

> On Thu, Oct 6, 2016, at 02:15 PM, Nick Dokos wrote:
>> Peter Davis  writes:
>> 
>> > Since several people recommended TikZ, I decided to take a look at it.
>> > It seems very powerful, but I'm unable to get any example to work. For
>> > example, using the example here: 
>> >
>> > http://doblogit.com/posts/2015-10-23-org-graphics.html
>> >
>> 
>> Did you add tikz to org-latex-packages-alist?
>> 
>
> I do have:
>
> (add-to-list 'org-latex-packages-alist
>  '(("AUTO" "inputenc" t)
>("" "color" t)
>("" "minted" t)
>("" "parskip" t)
>("" "tikz" t)))
>
> Any other setup work I need?
>

Yes, but have you executed that? What does C-h v org-latex-pacakges-alist RET 
say?

-- 
Nick




Re: [O] Best diagram, image software?

2016-10-06 Thread Peter Davis

On Thu, Oct 6, 2016, at 02:15 PM, Nick Dokos wrote:
> Peter Davis  writes:
> 
> > Since several people recommended TikZ, I decided to take a look at it.
> > It seems very powerful, but I'm unable to get any example to work. For
> > example, using the example here: 
> >
> > http://doblogit.com/posts/2015-10-23-org-graphics.html
> >
> 
> Did you add tikz to org-latex-packages-alist?
> 

I do have:

(add-to-list 'org-latex-packages-alist
 '(("AUTO" "inputenc" t)
   ("" "color" t)
   ("" "minted" t)
   ("" "parskip" t)
   ("" "tikz" t)))

Any other setup work I need?

Thanks!

-pd


-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Best diagram, image software?

2016-10-06 Thread Peter Davis

On Thu, Oct 6, 2016, at 01:59 PM, John Kitchin wrote:
> I tried this, and it worked for me. Check *Messages* for things like:
> Failed to create dvi file from
> /var/folders/5q/lllv2yf95hg_n6h6kjttbmdwgn/T/orgtex93386BIQ.tex
> 
> if you see that try manually building the tex file to see if there are
> LaTeX issues.
> 

Thanks, John. Just running pdflatex from the command line gives me:

! Undefined control sequence.
l.36 \tikz
  [remember picture]\node[coordinate,yshift=0.5em] (n1) {};

So perhaps TikZ itself is not available to some part of this.

Thanks,
-pd


-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] Best diagram, image software?

2016-10-06 Thread Nick Dokos
Peter Davis  writes:

> Since several people recommended TikZ, I decided to take a look at it.
> It seems very powerful, but I'm unable to get any example to work. For
> example, using the example here: 
>
> http://doblogit.com/posts/2015-10-23-org-graphics.html
>

Did you add tikz to org-latex-packages-alist?

> #+begin_src latex :exports results :results output raw :file
> images/fsa.png
> % Define block styles
> \usetikzlibrary{shapes,arrows}
> \tikzstyle{astate} = [circle, draw, text centered, font=\footnotesize,
> fill=blue!25]
> \tikzstyle{rstate} = [circle, draw, text centered, font=\footnotesize,
> fill=red!25]
>
> \begin{tikzpicture}[->,>=stealth', shorten >=1pt, auto, node
> distance=2.8cm, semithick]
> \node [astate] (1) at (0,0) {1};
> \node [astate] (2) at (1,0) {2};
> \node [rstate] (3) at (2,0) {3};
> \path (1) edge [bend left] node {b} (2)
> (2) edge node {b} (3)
> (2) edge [bend left] node {a} (1)
> (3) edge [loop above] node {(a, b)} (3);
> \end{tikzpicture}
> #+end_src
>
>
> I get:
>
> org-babel-exp process latex at line 6...
> executing Latex code block...
> org-latex-compile: PDF file
> c:/Users/pdavis/AppData/Local/Temp/orgtex5448hGP.pdf wasn’t produced
>
> I've got ImageMagick installed. I don't know how to debug this.

I always go back to straight LaTeX to debug such problems:

--8<---cut here---start->8---
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\tikzstyle{astate} = [circle, draw, text centered, font=\footnotesize, 
fill=blue!25]
\tikzstyle{rstate} = [circle, draw, text centered, font=\footnotesize, 
fill=red!25]

\begin{document}

\begin{tikzpicture}[->,>=stealth', shorten >=1pt, auto, node distance=2.8cm, 
semithick]
\node [astate] (1) at (0,0) {1};
\node [astate] (2) at (1,0) {2};
\node [rstate] (3) at (2,0) {3};
\path (1) edge [bend left] node {b} (2)
(2) edge node {b} (3)
(2) edge [bend left] node {a} (1)
(3) edge [loop above] node {(a, b)} (3);
\end{tikzpicture}

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
--8<---cut here---end--->8---

-- 
Nick




Re: [O] Best diagram, image software?

2016-10-06 Thread John Kitchin
I tried this, and it worked for me. Check *Messages* for things like:
Failed to create dvi file from
/var/folders/5q/lllv2yf95hg_n6h6kjttbmdwgn/T/orgtex93386BIQ.tex

if you see that try manually building the tex file to see if there are
LaTeX issues.

#+BEGIN_SRC emacs-lisp
(org-babel-do-load-languages
 'org-babel-load-languages
 '((emacs-lisp . t)
   (python . t)
   (ditaa . t)
   (dot . t)
   (plantuml . t)
   (gnuplot . t)
   (sh . t)
   (org . t)
   (latex . t)))

(setq org-latex-packages-alist
  (quote (("" "color" t)
  ("" "minted" t)
  ("" "parskip" t)
  ("" "tikz" t

(setq org-latex-create-formula-image-program 'imagemagick)
#+END_SRC

#+RESULTS:
: imagemagick



#+begin_src latex :exports results :results output raw :file fsa.png
% Define block styles
\usetikzlibrary{shapes,arrows}
\tikzstyle{astate} = [circle, draw, text centered, font=\footnotesize,
  fill=blue!25]
\tikzstyle{rstate} = [circle, draw, text centered, font=\footnotesize,
  fill=red!25]

\begin{tikzpicture}[->,>=stealth', shorten >=1pt, auto, node
   distance=2.8cm, semithick]
\node [astate] (1) at (0,0) {1};
\node [astate] (2) at (1,0) {2};
\node [rstate] (3) at (2,0) {3};
\path (1) edge [bend left] node {b} (2)
(2) edge node {b} (3)
(2) edge [bend left] node {a} (1)
(3) edge [loop above] node {(a, b)} (3);
\end{tikzpicture}
#+end_src

#+RESULTS:
[[file:fsa.png]]

Peter Davis writes:

> Since several people recommended TikZ, I decided to take a look at it.
> It seems very powerful, but I'm unable to get any example to work. For
> example, using the example here: 
>
> http://doblogit.com/posts/2015-10-23-org-graphics.html
>
> #+begin_src latex :exports results :results output raw :file
> images/fsa.png
> % Define block styles
> \usetikzlibrary{shapes,arrows}
> \tikzstyle{astate} = [circle, draw, text centered, font=\footnotesize,
> fill=blue!25]
> \tikzstyle{rstate} = [circle, draw, text centered, font=\footnotesize,
> fill=red!25]
>
> \begin{tikzpicture}[->,>=stealth', shorten >=1pt, auto, node
> distance=2.8cm, semithick]
> \node [astate] (1) at (0,0) {1};
> \node [astate] (2) at (1,0) {2};
> \node [rstate] (3) at (2,0) {3};
> \path (1) edge [bend left] node {b} (2)
> (2) edge node {b} (3)
> (2) edge [bend left] node {a} (1)
> (3) edge [loop above] node {(a, b)} (3);
> \end{tikzpicture}
> #+end_src
>
>
> I get:
>
> org-babel-exp process latex at line 6...
> executing Latex code block...
> org-latex-compile: PDF file
> c:/Users/pdavis/AppData/Local/Temp/orgtex5448hGP.pdf wasn’t produced
>
> I've got ImageMagick installed. I don't know how to debug this.


-- 
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] Problem with python session

2016-10-06 Thread William Henney
Hi Florian

I can reproduce your problem.  This is (arguably) a bug in ob-python when
using the vanilla python interpreter together with the :session argument.
You can work around it by putting a blank line after the for-loop in your
second code block.

I say that it is arguable that this is a bug or not since you would have
exactly the same error if you were to literally type your code block in at
the python interactive prompt.  That is, you have to give a second newline
in order to close the loop and return to the top-level prompt.  However, it
is admittedly confusing to have different behavior with and without the
":session" argument.

I had never come across this bug myself, since I use ob-ipython for
interactive python sessions (https://github.com/gregsexton/ob-ipython)

Here is a minimal example that shows the problem.

Cheers

Will

* Test of ob-python in session mode with vanilla python interpreter

** FAILS: Without blank line after indented loop
#+BEGIN_SRC python :session *ob-python session*
for x in 1, 2:
pass
x
#+END_SRC

#+RESULTS:

An error message appears in the =*ob-python session*= buffer, which can be
visited via =C-c C-v C-z= with point inside the code block.

#+BEGIN_EXAMPLE
>>> 'org_babel_python_eoe'
>>> 'org_babel_python_eoe'
>>> for x in 1, 2:
... pass
... x
  File "", line 3
x
^
SyntaxError: invalid syntax
#+END_EXAMPLE

** SUCCEEDS: With blank line after indented loop
#+BEGIN_SRC python :session *ob-python session*
for x in 1, 2:
pass

x
#+END_SRC

#+RESULTS:
: 2

** SUCCEEDS: Without using a session
#+BEGIN_SRC python :return x
for x in 1, 2:
pass
x
#+END_SRC

#+RESULTS:
: 2

** SUCCEEDS: Using ob-ipython instead of ob-python
#+BEGIN_SRC ipython :session
for x in 1, 2:
pass
x
#+END_SRC

#+RESULTS:
: 2


On Thu, Oct 6, 2016 at 7:41 AM, Florian Lindner  wrote:

> Hello,
>
> I have an org file:
>
> * Overview of available basis functions
> #+BEGIN_SRC python :session generateBFpics :exports results :results file
>   import matplotlib.pyplot as plt
>   import numpy as np
>
>   def set_plotoptions():
>   plt.xlabel("x")
>   plt.ylabel("$\phi(x)$")
>   plt.grid()
>
>
>   np.seterr(invalid='ignore')
>
>   x = np.linspace(-3, 3, 1000)
>
>   plt.plot(x,  np.log(abs(x))*np.power(x, 2))
>   plt.suptitle("Thin Plate Splines")
>   plt.title("$\phi(|x|) = \log(x) \cdot x^2$")
>   set_plotoptions()
>   plt.savefig("bf-tps.pdf")
>   plt.close()
>   "bf-tps.pdf"
> #+END_SRC
>
> #+RESULTS:
> [[file:bf-tps.pdf]]
>
> #+BEGIN_SRC python :session generateBFpics :exports results :results file
>   for shape in [1, 2, 3, 4]:
>   plt.plot(x, np.power(shape, 2) + np.power(x,2), label = "s = %i" %
> shape)
>   plt.suptitle("Multi Quadrics")
>   plt.title("$\phi(|x|) = s^2 + x^2$")
>   plt.legend()
>   set_plotoptions()
>   plt.savefig("bf-multiquadrics.pdf")
>   plt.close()
>   "bf-multiquadrics.pdf"
> #+END_SRC
>
> #+RESULTS:
> [[file:bf-multiquadrics.pdf]]
>
>
>
> Both PDFs are generated. But only the first one has the content I expect,
> the othe one is an empty plot (it's a plot,
> yes, but empty axes.
>
> When I copy these pieces of code into on .py file it works just great. To
> my understanding that just how session mode works.
>
> What could be the problem here?
>
> Thanks,
> Florian
>
>
>


-- 

  Dr William Henney, Instituto de Radioastronomía y Astrofísica,
  Universidad Nacional Autónoma de México, Campus Morelia


Re: [O] Best diagram, image software?

2016-10-06 Thread Peter Davis
Since several people recommended TikZ, I decided to take a look at it.
It seems very powerful, but I'm unable to get any example to work. For
example, using the example here: 

http://doblogit.com/posts/2015-10-23-org-graphics.html

#+begin_src latex :exports results :results output raw :file
images/fsa.png
% Define block styles
\usetikzlibrary{shapes,arrows}
\tikzstyle{astate} = [circle, draw, text centered, font=\footnotesize,
fill=blue!25]
\tikzstyle{rstate} = [circle, draw, text centered, font=\footnotesize,
fill=red!25]

\begin{tikzpicture}[->,>=stealth', shorten >=1pt, auto, node
distance=2.8cm, semithick]
\node [astate] (1) at (0,0) {1};
\node [astate] (2) at (1,0) {2};
\node [rstate] (3) at (2,0) {3};
\path (1) edge [bend left] node {b} (2)
(2) edge node {b} (3)
(2) edge [bend left] node {a} (1)
(3) edge [loop above] node {(a, b)} (3);
\end{tikzpicture}
#+end_src


I get:

org-babel-exp process latex at line 6...
executing Latex code block...
org-latex-compile: PDF file
c:/Users/pdavis/AppData/Local/Temp/orgtex5448hGP.pdf wasn’t produced

I've got ImageMagick installed. I don't know how to debug this.


-- 
  Peter Davis
  www.techcurmudgeon.com



Re: [O] [RFC] Change visibility for bracket links

2016-10-06 Thread William Denton

On 6 October 2016, Eric S Fraga wrote:


In any case, Nicolas, I am fully in favour of your proposed
change.  Editing links has always been very frustrating for me and your
suggestion would make it much easier.


+1 from me too.

Bil
--
William Denton :: Toronto, Canada :: https://www.miskatonic.org/
Caveat lector.



[O] Problem with python session

2016-10-06 Thread Florian Lindner
Hello,

I have an org file:

* Overview of available basis functions
#+BEGIN_SRC python :session generateBFpics :exports results :results file
  import matplotlib.pyplot as plt
  import numpy as np

  def set_plotoptions():
  plt.xlabel("x")
  plt.ylabel("$\phi(x)$")
  plt.grid()


  np.seterr(invalid='ignore')

  x = np.linspace(-3, 3, 1000)

  plt.plot(x,  np.log(abs(x))*np.power(x, 2))
  plt.suptitle("Thin Plate Splines")
  plt.title("$\phi(|x|) = \log(x) \cdot x^2$")
  set_plotoptions()
  plt.savefig("bf-tps.pdf")
  plt.close()
  "bf-tps.pdf"
#+END_SRC

#+RESULTS:
[[file:bf-tps.pdf]]

#+BEGIN_SRC python :session generateBFpics :exports results :results file
  for shape in [1, 2, 3, 4]:
  plt.plot(x, np.power(shape, 2) + np.power(x,2), label = "s = %i" % shape)
  plt.suptitle("Multi Quadrics")
  plt.title("$\phi(|x|) = s^2 + x^2$")
  plt.legend()
  set_plotoptions()
  plt.savefig("bf-multiquadrics.pdf")
  plt.close()
  "bf-multiquadrics.pdf"
#+END_SRC

#+RESULTS:
[[file:bf-multiquadrics.pdf]]



Both PDFs are generated. But only the first one has the content I expect, the 
othe one is an empty plot (it's a plot,
yes, but empty axes.

When I copy these pieces of code into on .py file it works just great. To my 
understanding that just how session mode works.

What could be the problem here?

Thanks,
Florian




[O] [BUG] TRAMP error in PDF export

2016-10-06 Thread Philip Hudson
Not 100% sure this is a bug rather than misconfiguration, but it looks
like it at first sight:

Open an Org file via ssh:

  C-x C-f /ssh:me@host:/org/anOrgFile.org

Export it to PDF:

  C-c C-e l p

I get:

  (lots of pdfTex error text about not being able to find the file
/ssh:me@host:/org/anOrgFile.tex)

ending with:

  byte-code: Forbidden reentrant call of Tramp

-- 
Phil Hudson   http://hudson-it.ddns.net
@UWascalWabbit PGP/GnuPG ID: 0x887DCA63



Re: [O] [RFC] Change visibility for bracket links

2016-10-06 Thread Eric S Fraga
On Thursday,  6 Oct 2016 at 00:27, Clément Pit--Claudel wrote:
> What about having our cake and eating it too? :) We could do just the
> same as what prettify-symbols-mode does with its
> prettify-symbols-unprettify-at-point variable.

This would be nice.

In any case, Nicolas, I am fully in favour of your proposed
change.  Editing links has always been very frustrating for me and your
suggestion would make it much easier.

Thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.1.1, Org release_8.3.6-1131-gd68497