Re: [O] Best way of including tikz into latex (pdf and beamer) export with preview?

2016-05-19 Thread Russell Adams
On Thu, May 19, 2016 at 10:25:09AM +0100, Myles English wrote:
> > What is the best way of including tikz into org for latex export
> > (beamer and pdf), and to have preview as well?

I have used R in the past to generate two outputs for a given graph,
one PNG and one PDF from a source block in my Org file.

Then immediately under the source block I would put a commented out
file link so that Org's inline image display would show it to me. Then
I used the latex include command beneath to include the PDF for the
final output.

This let me preview and have high quality output.

Sample code:

#+BEGIN_SRC R :session *R-Buffer* :tangle myfile.R :exports none :results none 
silent :var basename="playerAging"
  doublePlot = function (base, plotFunc,
 pngopts = c( width = 1024, height = 500 ),
 pdfopts = c( width = 10, height = 7.5, paper =
 'usr')
 ) {

# basename from org-babel
myPng = paste(base,"png",sep=".")
myPdf = paste(base,"pdf",sep=".")

png(myPng, pngopts )
plotFunc()
dev.off()
pdf(myPdf, pdfopts)
plotFunc()
dev.off()
  }

  doublePlot(base=basename, plotFunc = function() {
plot(players$last_save,players$age,main="Player Age vs Last Login")
grid(col="gray",lty=2)
  })
#+END_SRC

# [[file:playerAging.png]]

#+LATEX: \includegraphics[width=\textwidth]{playerAging.pdf}\newpage




--
Russell Adamsrlad...@adamsinfoserv.com

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

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



Re: [O] Best way of including tikz into latex (pdf and beamer) export with preview?

2016-05-19 Thread Myles English

Hello Rainer,

Rainer M Krug writes:

> What is the best way of including tikz into org for latex export
> (beamer and pdf), and to have preview as well?

I don't know, but I do remember that using the `standalone' document
class was useful because you can keep the tikz picture in its own .tex
file, develop it using command line processing to pdf and, when it is
ready, use it in in several different documents (report, poster, thesis)
by including the .tex file file.  Not sure about previewing though.

Sorry I can't find a comprehensive example but here is an example usage
of standalone:

http://drvinceknight.blogspot.co.uk/2013/04/makefiles-for-tikz-sagemath-and.html

Myles


signature.asc
Description: PGP signature


Re: [O] Best way of including tikz into latex (pdf and beamer) export with preview?

2016-05-17 Thread briangpowell .
* ImageMagick is great for shrinking images and/or making thumbnails for
previews and/or maybe the emacs elisp program "thumbs.el" will help:

;;; thumbs.el --- Thumbnails previewer for images files
;;;
;; Author: Jean-Philippe Theberge 
...



On Thu, May 12, 2016 at 4:45 AM, Rainer M Krug  wrote:

> Hi
>
> What is the best way of including tikz into org for latex export (beamer
> and pdf), and to have preview as well?
>
> Thanks,
>
> Rainer
>
> --
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
> Biology, UCT), Dipl. Phys. (Germany)
>
> Centre of Excellence for Invasion Biology
> Stellenbosch University
> South Africa
>
> Tel :   +33 - (0)9 53 10 27 44
> Cell:   +33 - (0)6 85 62 59 98
> Fax :   +33 - (0)9 58 10 27 44
>
> Fax (D):+49 - (0)3 21 21 25 22 44
>
> email:  rai...@krugs.de
>
> Skype:  RMkrug
>
> PGP: 0x0F52F982
>


Re: [O] Best way of including tikz into latex (pdf and beamer) export with preview?

2016-05-17 Thread Rasmus
Rainer M Krug  writes:

> What is the best way of including tikz into org for latex export (beamer
> and pdf),

I typically create tikz images with R tikzDevice or matplotlib.  In this
case, it’s useful to refer to the generated file:

  file:link/to/pix.tikz

> and to have preview as well?

I believe you’d have to include the code directly in the Org file to make
the preview of latex fragments work.  If this is essential, you could do
something like this:

#+latex_header: \usepackage{tikz}
#+Caption: A special block that’s a figure with a tikz picture.
#+begin_figure
\begin{tikzpicture}
\input{t.tikz} % raw tikz-content w/o \begin{}/end{}
\end{tikzpicture}
#+end_figure

See also the tikz section on ob-latex in worg:


http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html#sec-4-3

Rasmus

-- 
Hooray!




[O] Best way of including tikz into latex (pdf and beamer) export with preview?

2016-05-17 Thread Rainer M Krug
Hi

What is the best way of including tikz into org for latex export (beamer
and pdf), and to have preview as well?

Thanks,

Rainer

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

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

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

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

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


signature.asc
Description: PGP signature