From help-request at octave dot org Mon Jan 24 05:22:27 2005 Subject: Re: octave -> gnuplot -> latex in labels HOWTO ? From: Joan Picanyol i Puig To: Matt Flax Cc: help at octave dot org Date: Mon, 24 Jan 2005 12:25:54 +0100 * Matt Flax [20050124 08:03]: > I would like to put some formatting in my xlabels ... something like : > gset xlabel '$\\gamma h_2$' There are many caveats in attempting this. Some of them: 1.- pdflatex and dvipdf handle graphics in a different way 2.- eps does not allow Latex commands 3.- you have to escape the backslashes appropiately For Octave+gnuplot I've settled using the epslatex terminal, which generates a .tex file with the text and an .eps file with the graphics. I've I want to generate a PDF file I convert the .eps with epstopdf I have some code that looks like this (long lines): graw (sprintf("set output \"plots/latex/simulacions_previes-v%d-b%1d-n%d-f%d.eps\"\n",v, beta*10, noise, fading)); gset term epslatex color; title(sprintf("$\\\\\\\\beta = %3.2f$ (meṃria: %d snapshots), $v=%d$",beta, mem,v)); axis; gset xlabel "$t$ [s]"; gset ylabel "$\\\\theta [^\\\\circ]$" axis; replot; gset term x11; %gset output; Note how sprintf "eats" half the backslashes, but then I get dynamic file names, I'm not sure I got to understand why gset need twice as many though. If you go the epslatex route, watch out for the paths encoded in the .tex files. Oh! And forget about Lyx, LateX is not worth it (well, maybe for the tables...) qvb -- pica ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------