[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Latex Fonts and Octave

From: Ben Abbott
Subject: Re: Latex Fonts and Octave
Date: Thu, 26 Mar 2009 19:56:05 -0400

On Mar 26, 2009, at 5:51 PM, Thomas Markovich wrote:

On Mar 26, 2009, at 4:10 PM, Ben Abbott wrote:

On Thursday, March 26, 2009, at 02:49PM, "Thomas Markovich" <address@hidden > wrote:

Hi all,

I have googled around for about a day and haven't figured out how to
use latex fonts in octave.

What I am doing right now is using psfrag to replace fonts from
within the latex document with the graphics all being saved as
postscript files. This worked wonderfully; unfortunately the journal
that we are submitting to doesn't accept postscript files. Instead,
they want everything to be pdfs. To do this what I have to do is
convert the postscript to the pdf so that I have it in the right
format but I lose the functionality of psfrag. To work around this I have tried to use octave to generate plots for me with the fonts but
they aren't very pretty and what's more, the axis labels wander off
the graph when I make them big enough to be seen.

So, is there a way to use latex fonts (so they're consistent with my paper) in the generation of pdfs? and is there a way to move my axis
label up? (our x axis label is \varphi but half of it gets cut off
when the size is set to 18)

I am currently using

x = [-2:0.01:2]*pi;

xtick = [-2,-1.5,-1,-0.5,0,0.5,1,1.5,2] * pi;

xticklabel = { '{/Symbol -2p}', '{/Symbol -3p/2}', '{/Symbol -p}',
'{/Symbol -p/2}', '{0}', '{/Symbol p/2}', '{/Symbol p}', '{/Symbol
3p/2}', '{/Symbol 2p}'};

plot (potential1(:,1),potential1(:,2),'k','linewidth',5);
set (gca, 'xtick', xtick, 'xticklabel', xticklabel);

to generate my functions but unfortunately there's no pretty fonts.


Thomas Markovich

Regarding the pdf requirement, do you imply that your publisher is using pdflatex, or that he requires the manuscript to be submitted as a pdf document?

If you need a figure compatible with pdflatex, the only solution I can think of is a little *hack*.

octave:1> plot (1:10)
octave:2> drawnow ("latex", "test.tex")

Be aware, due to limitations of the latex terminal, gnuplot might complain. The resulting file "test.tex" is a LaTeX picture.


I'm not sure what the pdflatex thing is but they require that all images be either pdf or tiff and the manuscript be submitted as a .tex file. (Its the journal of physical chemistry) and psfrag doesn't work for either one. My advisor told me that pdf was absolutely preferred. I tried your 'hack' but it didn't give it to me in any way I knew to get it working.

pdflatex is unable to include ps/eps-files. In reciprocal fashion, normal latex is unable to include pdf-files.

The TikZ and pgf approaches offer a solution to this conundrum.

Unfortunately, I don't see this as a solution to your present problem (there is not TikZ/pgf terminal for gnuplot).

Back to the "test.tex" file ... it is intended for LaTeX picture environment.

I do not know if it will properly render your figure, but it is simple enough to try. The LaTeX commands below will produce a picture that is 6.4x4.8 inches.

            \caption{The figure's caption goes here.}

This works for the example "plot(1:10)", but you'll need to verify it works for your purposes.


p.s. Pls "reply-all" and respond below to make it easier for others to read along.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]