emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Best diagram, image software?
@ 2016-10-04 13:11 Lawrence Bottorff
  2016-10-04 13:45 ` Rainer M Krug
                   ` (4 more replies)
  0 siblings, 5 replies; 24+ messages in thread
From: Lawrence Bottorff @ 2016-10-04 13:11 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

I know lots of you use Emacs and org mode to prepare scholarly books and
papers, either doing the HTML or, more probably, the Latex export.
Question: Let's say I want to produce a math text with
Emacs/org-mode/Latex. What is the best way to make diagrams and images?
I've seen things like Inkscape and LibreOffice Draw. But then there is
Gnuplot and Tikz. Yes, what Tikz does seems optimal, but the learning curve
is a year's sabbatical. Just wondering what you people are using to do your
images.

LB

[-- Attachment #2: Type: text/html, Size: 560 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-04 13:11 Best diagram, image software? Lawrence Bottorff
@ 2016-10-04 13:45 ` Rainer M Krug
  2016-10-11 21:03   ` Eduardo Mercovich
  2016-10-04 13:52 ` Fabrice Popineau
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 24+ messages in thread
From: Rainer M Krug @ 2016-10-04 13:45 UTC (permalink / raw)
  To: Lawrence Bottorff; +Cc: emacs-orgmode Mailinglist

[-- Attachment #1: Type: text/plain, Size: 1019 bytes --]

Lawrence Bottorff <borgauf@gmail.com> writes:

> I know lots of you use Emacs and org mode to prepare scholarly books
> and papers, either doing the HTML or, more probably, the Latex
> export. Question: Let's say I want to produce a math text with
> Emacs/org-mode/Latex. What is the best way to make diagrams and
> images? I've seen things like Inkscape and LibreOffice Draw. But then
> there is Gnuplot and Tikz. Yes, what Tikz does seems optimal, but the
> learning curve is a year's sabbatical. Just wondering what you people
> are using to do your images.

Depends, what kind of images you are talking about. If they are data
based (graphs, ...) I use R or GRASS (spatial data, GIS). For non-data
driven images, I use tikz (conceptual models) or PlantUML
[[http://plantuml.com/]] for different kinds of diagrams (uml, ...).

Thank there is obviously Inkscape and Scribus and GIMP as well.

Cheers,

Rainer


>
> LB
>

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 454 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
       [not found] <c3be170e3fe74232a0a9f5d5ed3981f2@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
@ 2016-10-04 13:46 ` Eric S Fraga
  0 siblings, 0 replies; 24+ messages in thread
From: Eric S Fraga @ 2016-10-04 13:46 UTC (permalink / raw)
  To: Lawrence Bottorff; +Cc: emacs-orgmode Mailinglist

On Tuesday,  4 Oct 2016 at 13:11, Lawrence Bottorff wrote:
> I've seen things like Inkscape and LibreOffice Draw. But then
> there is Gnuplot and Tikz. Yes, what Tikz does seems optimal, but the
> learning curve is a year's sabbatical. Just wondering what you people
> are using to do your images.

My data point:

I use tikz for diagrams (sorry) and gnuplot for plots/graphs for all of
my research publications.  And for my lectures, but that's by the by, I
guess.  All in org, of course!

Yes, tikz has a steep learning curve but there are so many examples
available (e.g. http://www.texample.net/tikz/examples/) that it is
usually easy to get something reasonable unless you have very complex
needs.  There is also a WSYIWYG editor for tikz which I've never used...

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-04 13:11 Best diagram, image software? Lawrence Bottorff
  2016-10-04 13:45 ` Rainer M Krug
@ 2016-10-04 13:52 ` Fabrice Popineau
  2016-10-04 13:54 ` Peter Davis
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 24+ messages in thread
From: Fabrice Popineau @ 2016-10-04 13:52 UTC (permalink / raw)
  To: Lawrence Bottorff; +Cc: emacs-orgmode Mailinglist

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

2016-10-04 15:11 GMT+02:00 Lawrence Bottorff <borgauf@gmail.com>:

> I know lots of you use Emacs and org mode to prepare scholarly books and
> papers, either doing the HTML or, more probably, the Latex export.
> Question: Let's say I want to produce a math text with
> Emacs/org-mode/Latex. What is the best way to make diagrams and images?
> I've seen things like Inkscape and LibreOffice Draw. But then there is
> Gnuplot and Tikz. Yes, what Tikz does seems optimal, but the learning curve
> is a year's sabbatical. Just wondering what you people are using to do your
> images.
>

Tikz (+stackoverflow to cut on the sabbatical year :-) ) most of the time.
I'm not good at drawing with Inkscape.
Emacs can be setup to preview tikz pictures in the Org buffer, which helps
a lot.

Fabrice

[-- Attachment #2: Type: text/html, Size: 1171 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-04 13:11 Best diagram, image software? Lawrence Bottorff
  2016-10-04 13:45 ` Rainer M Krug
  2016-10-04 13:52 ` Fabrice Popineau
@ 2016-10-04 13:54 ` Peter Davis
  2016-10-04 15:12   ` David A. Gershman
  2016-10-04 14:06 ` Russell Adams
  2016-10-05 20:14 ` Jeremie Juste
  4 siblings, 1 reply; 24+ messages in thread
From: Peter Davis @ 2016-10-04 13:54 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1588 bytes --]


On Tue, Oct 4, 2016, at 09:11 AM, Lawrence Bottorff wrote:
> I know lots of you use Emacs and org mode to prepare scholarly books
> and papers, either doing the HTML or, more probably, the Latex export.
> Question: Let's say I want to produce a math text with Emacs/org-
> mode/Latex. What is the best way to make diagrams and images? I've
> seen things like Inkscape and LibreOffice Draw. But then there is
> Gnuplot and Tikz. Yes, what Tikz does seems optimal, but the learning
> curve is a year's sabbatical. Just wondering what you people are using
> to do your images.

I think it really depends on what kinds of diagrams and images you're
trying to use. I've been using embedded dot (GraphViz) diagrams with org
for a number of years, and I find it fantastically helpful for things
like graphs (nodes connected by arrows, optionally all labelled), data
structure diagrams, etc. ... the basic boxes and lines kind of drawing.

I also just discovered ditaa, which seems also good for boxes and lines,
but with more freedom (and more work to edit the input).

I've also used PlantUML for modelling diagrams.

I know others are using embedded R code to get data visualization
graphics automatically.

This page gives some examples:
http://ehneilsen.net/notebook/orgExamples/org-examples.html. There
should be an authoritative page on graphics formats, but I'm not
aware of one.

Most of these use separate packages to create the graphics, but there
are hooks in org to call the external programs and include the results
in the document.

-pd

--
  Peter Davis
  www.techcurmudgeon.com

[-- Attachment #2: Type: text/html, Size: 2688 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-04 13:11 Best diagram, image software? Lawrence Bottorff
                   ` (2 preceding siblings ...)
  2016-10-04 13:54 ` Peter Davis
@ 2016-10-04 14:06 ` Russell Adams
  2016-10-05 20:14 ` Jeremie Juste
  4 siblings, 0 replies; 24+ messages in thread
From: Russell Adams @ 2016-10-04 14:06 UTC (permalink / raw)
  To: emacs-orgmode

I make topology diagrams with yEd, and export to PDF for inclusion in
my Latex PDF reports.

On Tue, Oct 04, 2016 at 09:11:49AM -0400, Lawrence Bottorff wrote:
> I know lots of you use Emacs and org mode to prepare scholarly books and
> papers, either doing the HTML or, more probably, the Latex export.
> Question: Let's say I want to produce a math text with
> Emacs/org-mode/Latex. What is the best way to make diagrams and images?
> I've seen things like Inkscape and LibreOffice Draw. But then there is
> Gnuplot and Tikz. Yes, what Tikz does seems optimal, but the learning curve
> is a year's sabbatical. Just wondering what you people are using to do your
> images.
>
> LB


------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-04 13:54 ` Peter Davis
@ 2016-10-04 15:12   ` David A. Gershman
  0 siblings, 0 replies; 24+ messages in thread
From: David A. Gershman @ 2016-10-04 15:12 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2361 bytes --]

Honestly, the sky is the limit.  I agree with what everyone else is
saying, it depends on the diagram, your skill level, comfort level,
etc.  Personally, I export to HTML, not LaTeX, plus I'm more
old-school.  I just use Perl w/GD to make many of my images.  The PNG
export is easily viewed/inserted into my .org files and I can include
the code in my .org files as well if I choose.

Point is, any programming language can also be used to generate images
as well.  Ditaa, PlantUML, GnuPlot, etc, help do the job faster for
specific types of data/drawings.  Anything outside the box (no pun
intended), you need something more "arbitrary" like LibreDraw, GD, etc.


On 10/04/2016 06:54 AM, Peter Davis wrote:
>
> On Tue, Oct 4, 2016, at 09:11 AM, Lawrence Bottorff wrote:
>> I know lots of you use Emacs and org mode to prepare scholarly books
>> and papers, either doing the HTML or, more probably, the Latex
>> export. Question: Let's say I want to produce a math text with
>> Emacs/org-mode/Latex. What is the best way to make diagrams and
>> images? I've seen things like Inkscape and LibreOffice Draw. But then
>> there is Gnuplot and Tikz. Yes, what Tikz does seems optimal, but the
>> learning curve is a year's sabbatical. Just wondering what you people
>> are using to do your images.
>
> I think it really depends on what kinds of diagrams and images you're
> trying to use. I've been using embedded dot (GraphViz) diagrams with
> org for a number of years, and I find it fantastically helpful for
> things like graphs (nodes connected by arrows, optionally all
> labelled), data structure diagrams, etc. ... the basic boxes and lines
> kind of drawing.
>
> I also just discovered ditaa, which seems also good for boxes and
> lines, but with more freedom (and more work to edit the input).
>
> I've also used PlantUML for modelling diagrams.
>
> I know others are using embedded R code to get data visualization
> graphics automatically.
>
> This page gives some examples:
> http://ehneilsen.net/notebook/orgExamples/org-examples.html. There
> should be an authoritative page on graphics formats, but I'm not aware
> of one.
>
> Most of these use separate packages to create the graphics, but there
> are hooks in org to call the external programs and include the results
> in the document.
>
> -pd
>
> --
>   Peter Davis
>   www.techcurmudgeon.com
>


[-- Attachment #2: Type: text/html, Size: 4671 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-04 13:11 Best diagram, image software? Lawrence Bottorff
                   ` (3 preceding siblings ...)
  2016-10-04 14:06 ` Russell Adams
@ 2016-10-05 20:14 ` Jeremie Juste
  2016-10-06 16:48   ` Peter Davis
  4 siblings, 1 reply; 24+ messages in thread
From: Jeremie Juste @ 2016-10-05 20:14 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Lawrence Bottorff <borgauf@gmail.com> writes:

> I know lots of you use Emacs and org mode to prepare scholarly books and papers, either doing the HTML or, more probably, the Latex
> export. Question: Let's say I want to produce a math text with Emacs/org-mode/Latex. What is the best way to make diagrams and
> images? I've seen things like Inkscape and LibreOffice Draw. But then there is Gnuplot and Tikz. Yes, what Tikz does seems optimal,
> but the learning curve is a year's sabbatical. Just wondering what you people are using to do your images.
>

I'm very impressed by tikz and gnuplot. I use both of them inefficiently
sometimes trying to understand some code here and there. There
documentation are very good though. It would be great for a sabatical in
my opinion.

Because I didn't take the time to learn tikz and gnuplot, these days I
mostly make graphics with R and ggplot2 though. The advantage is that in
addition of the good documentation there is a quite a number of people
using it so it more likely that some people have encountered your
problem before or has a solution to your problem. So you can find
solution more quickly I believe. Yet this is an easy
way out because I think taking the time to learn how the stuff really
works give you some perspective.

Best regards,
Jeremie

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-05 20:14 ` Jeremie Juste
@ 2016-10-06 16:48   ` Peter Davis
  2016-10-06 17:59     ` John Kitchin
                       ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Peter Davis @ 2016-10-06 16:48 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-06 16:48   ` Peter Davis
@ 2016-10-06 17:59     ` John Kitchin
  2016-10-06 18:23       ` Peter Davis
  2016-10-06 18:15     ` Nick Dokos
  2016-10-07  6:38     ` Robert Klein
  2 siblings, 1 reply; 24+ messages in thread
From: John Kitchin @ 2016-10-06 17:59 UTC (permalink / raw)
  To: Peter Davis; +Cc: emacs-orgmode

I tried this, and it worked for me. Check *Messages* for things like:
Failed to create dvi file from
/var/folders/5q/lllv2yf95hg_n6h6kjttbmdw0000gn/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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-06 16:48   ` Peter Davis
  2016-10-06 17:59     ` John Kitchin
@ 2016-10-06 18:15     ` Nick Dokos
  2016-10-06 18:26       ` Peter Davis
  2016-10-07  6:38     ` Robert Klein
  2 siblings, 1 reply; 24+ messages in thread
From: Nick Dokos @ 2016-10-06 18:15 UTC (permalink / raw)
  To: emacs-orgmode

Peter Davis <pfd@pfdstudio.com> 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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-06 17:59     ` John Kitchin
@ 2016-10-06 18:23       ` Peter Davis
  2016-10-06 22:05         ` John Kitchin
  0 siblings, 1 reply; 24+ messages in thread
From: Peter Davis @ 2016-10-06 18:23 UTC (permalink / raw)
  To: John Kitchin; +Cc: emacs-orgmode


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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-06 18:15     ` Nick Dokos
@ 2016-10-06 18:26       ` Peter Davis
  2016-10-06 18:59         ` Nick Dokos
  0 siblings, 1 reply; 24+ messages in thread
From: Peter Davis @ 2016-10-06 18:26 UTC (permalink / raw)
  To: emacs-orgmode


On Thu, Oct 6, 2016, at 02:15 PM, Nick Dokos wrote:
> Peter Davis <pfd@pfdstudio.com> 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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-06 18:26       ` Peter Davis
@ 2016-10-06 18:59         ` Nick Dokos
  2016-10-06 19:10           ` Peter Davis
  0 siblings, 1 reply; 24+ messages in thread
From: Nick Dokos @ 2016-10-06 18:59 UTC (permalink / raw)
  To: emacs-orgmode

Peter Davis <pfd@pfdstudio.com> writes:

> On Thu, Oct 6, 2016, at 02:15 PM, Nick Dokos wrote:
>> Peter Davis <pfd@pfdstudio.com> 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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-06 18:59         ` Nick Dokos
@ 2016-10-06 19:10           ` Peter Davis
  2016-10-06 19:25             ` Clément Pit--Claudel
  2016-10-06 19:32             ` Martin Schöön
  0 siblings, 2 replies; 24+ messages in thread
From: Peter Davis @ 2016-10-06 19:10 UTC (permalink / raw)
  To: emacs-orgmode



On Thu, Oct 6, 2016, at 02:59 PM, Nick Dokos wrote:
> Peter Davis <pfd@pfdstudio.com> writes:
> 
> > On Thu, Oct 6, 2016, at 02:15 PM, Nick Dokos wrote:
> >> Peter Davis <pfd@pfdstudio.com> 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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-06 19:10           ` Peter Davis
@ 2016-10-06 19:25             ` Clément Pit--Claudel
  2016-10-06 19:49               ` Peter Davis
  2016-10-06 19:32             ` Martin Schöön
  1 sibling, 1 reply; 24+ messages in thread
From: Clément Pit--Claudel @ 2016-10-06 19:25 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 405 bytes --]

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.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-06 19:10           ` Peter Davis
  2016-10-06 19:25             ` Clément Pit--Claudel
@ 2016-10-06 19:32             ` Martin Schöön
  1 sibling, 0 replies; 24+ messages in thread
From: Martin Schöön @ 2016-10-06 19:32 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-06 19:25             ` Clément Pit--Claudel
@ 2016-10-06 19:49               ` Peter Davis
  2016-10-06 20:15                 ` John Hendy
  2016-10-06 20:15                 ` Peter Davis
  0 siblings, 2 replies; 24+ messages in thread
From: Peter Davis @ 2016-10-06 19:49 UTC (permalink / raw)
  To: emacs-orgmode


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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-06 19:49               ` Peter Davis
@ 2016-10-06 20:15                 ` John Hendy
  2016-10-06 20:15                 ` Peter Davis
  1 sibling, 0 replies; 24+ messages in thread
From: John Hendy @ 2016-10-06 20:15 UTC (permalink / raw)
  To: Peter Davis; +Cc: emacs-orgmode

On Thu, Oct 6, 2016 at 2:49 PM, Peter Davis <pfd@pfdstudio.com> 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
>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-06 19:49               ` Peter Davis
  2016-10-06 20:15                 ` John Hendy
@ 2016-10-06 20:15                 ` Peter Davis
  2016-10-06 23:23                   ` John Kitchin
  1 sibling, 1 reply; 24+ messages in thread
From: Peter Davis @ 2016-10-06 20:15 UTC (permalink / raw)
  To: emacs-orgmode


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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-06 18:23       ` Peter Davis
@ 2016-10-06 22:05         ` John Kitchin
  0 siblings, 0 replies; 24+ messages in thread
From: John Kitchin @ 2016-10-06 22:05 UTC (permalink / raw)
  To: Peter Davis; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-06 20:15                 ` Peter Davis
@ 2016-10-06 23:23                   ` John Kitchin
  0 siblings, 0 replies; 24+ messages in thread
From: John Kitchin @ 2016-10-06 23:23 UTC (permalink / raw)
  To: Peter Davis; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-06 16:48   ` Peter Davis
  2016-10-06 17:59     ` John Kitchin
  2016-10-06 18:15     ` Nick Dokos
@ 2016-10-07  6:38     ` Robert Klein
  2 siblings, 0 replies; 24+ messages in thread
From: Robert Klein @ 2016-10-07  6:38 UTC (permalink / raw)
  To: Peter Davis; +Cc: emacs-orgmode

Hi,

I'm using the following header, which lets me export to PDF and HTML,
both (basically from here:
http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html).



#+header: :exports results :file fsa.png
#+header: :imagemagick yes :iminoptions -density 600 :imoutoptions
-geometry 1200 
#+header: :fit yes :noweb yes :headers '("\\usepackage{tikz}") 
#+begin_src latex :exports results :results raw :file fsa.png


(and no #+Results line, but I don't know if this matters)


Also, regarding the babel I use the following to map source blocks to
"supported" LaTeX listings languages:


Add “text” and “conf” to =latex-listings-langs= with empty (space as a
trick) language name to be used in the LaTeX listings package.

#+begin_src emacs-lisp
  (add-to-list 'org-latex-listings-langs
               '(text " "))
  (add-to-list 'org-latex-listings-langs
               '(conf " "))
  (add-to-list 'org-latex-listings-langs
               '(nxml "XML"))
  (add-to-list 'org-latex-listings-langs
               '(org " "))


Best regards

 On Thu, 06 Oct 2016 12:48:52 -0400
Peter Davis <pfd@pfdstudio.com> wrote:

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Best diagram, image software?
  2016-10-04 13:45 ` Rainer M Krug
@ 2016-10-11 21:03   ` Eduardo Mercovich
  0 siblings, 0 replies; 24+ messages in thread
From: Eduardo Mercovich @ 2016-10-11 21:03 UTC (permalink / raw)
  To: Rainer M Krug; +Cc: emacs-orgmode Mailinglist, Lawrence Bottorff

Hi everyone. 

>> [...] What is the best way to make diagrams and
>> images? [...]

> Depends, what kind of images you are talking about. [...]

Agreed 200%.

Detail: if your result is vector like (not like a photo, but more like a
graph), you can export to pdf and include the pdf as it is. It works
perfectly directly for inside org.

Also, if your pdfs have raster images on them, check this great script
for compression:
http://www.tjansson.dk/2012/04/compressing-pdfs-using-ghostscript-under-linux/

Best...


-- 
eduardo mercovich 

 Donde se cruzan tus talentos 
 con las necesidades del mundo, 
 ahí está tu vocación.

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2016-10-11 21:03 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-04 13:11 Best diagram, image software? Lawrence Bottorff
2016-10-04 13:45 ` Rainer M Krug
2016-10-11 21:03   ` Eduardo Mercovich
2016-10-04 13:52 ` Fabrice Popineau
2016-10-04 13:54 ` Peter Davis
2016-10-04 15:12   ` David A. Gershman
2016-10-04 14:06 ` Russell Adams
2016-10-05 20:14 ` Jeremie Juste
2016-10-06 16:48   ` Peter Davis
2016-10-06 17:59     ` John Kitchin
2016-10-06 18:23       ` Peter Davis
2016-10-06 22:05         ` John Kitchin
2016-10-06 18:15     ` Nick Dokos
2016-10-06 18:26       ` Peter Davis
2016-10-06 18:59         ` Nick Dokos
2016-10-06 19:10           ` Peter Davis
2016-10-06 19:25             ` Clément Pit--Claudel
2016-10-06 19:49               ` Peter Davis
2016-10-06 20:15                 ` John Hendy
2016-10-06 20:15                 ` Peter Davis
2016-10-06 23:23                   ` John Kitchin
2016-10-06 19:32             ` Martin Schöön
2016-10-07  6:38     ` Robert Klein
     [not found] <c3be170e3fe74232a0a9f5d5ed3981f2@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-10-04 13:46 ` Eric S Fraga

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).