Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

help sought with cairolatex terminal

1,205 views
Skip to first unread message

Alex van der Spek

unread,
Oct 31, 2013, 11:05:46 AM10/31/13
to
My first baby steps with LaTeX and this gnuplot script:

set output 'gnuplotout.tex'
set terminal cairolatex pdf size 3, 3
set title 'this is the first' font "Arial Bold, 14"
set xlabel 'Hello x'
set ylabel 'hello y'

plot sin(x), cos(x)

unset out

Then my LaTeX document. (I did put the required packages in the pre-able).

\begin{figure}
\input{gnuplotout.tex}
\includegraphics[scale=1]{gnuplotout.pdf}
\end{figure}

The latex compiler complains about two things:

1. It cannot find the 'gnuplotout.tex' file.
2. There is no BoundingBox in the pdf file.

Yet the dvi output does contain all the text (not the graph). A pdf
version (by dvipdfm) contains both although offset from each other.

Any help much appreciated...

Alex van der Spek

Dan Luecking

unread,
Oct 31, 2013, 2:41:09 PM10/31/13
to
On 31 Oct 2013 15:05:46 GMT, Alex van der Spek <zd...@xs4all.nl>
wrote:

>My first baby steps with LaTeX and this gnuplot script:

Your main problem is latex's failure to find the file.
But there are other things you will need to deal with.

>
>set output 'gnuplotout.tex'
>set terminal cairolatex pdf size 3, 3
>set title 'this is the first' font "Arial Bold, 14"

The documentation for cairolatex says that the text
and font are handled by latex, so you need to use
latex's font selection syntax.

There is no Arial support in my version of TeX, so the
following example uses Helvetica. I experimented with
various things and settled on

set terminal cairolatex pdf size 3, 3 font "phv, 12"
set title '\large\textbf{this is the first}' font ",14"

Then my test file contains:

\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage[T1]{fontenc}
\begin{document}

\input gnuplotout

\end{document}

Note that cairolatex terminal does not seem to pass the size
part of the font options to the output, and uses them only
for spacing purposes. The gnuplotout.tex file contain
\fontfamily{phv}\selectfont
which switches to Helvetica, but there is no size switch.
Hence the 12pt class option in the tex document file to get
12pt in the normal text, and the \large command to get 14pt
in the title.


>set xlabel 'Hello x'
>set ylabel 'hello y'
>
>plot sin(x), cos(x)
>
>unset out
>
>Then my LaTeX document. (I did put the required packages in the pre-able).
>
>\begin{figure}
>\input{gnuplotout.tex}
>\includegraphics[scale=1]{gnuplotout.pdf}

Only \input{gnuplotout.tex} is to be used. That file already
contains the actual \includegraphics command.

>\end{figure}
>
>The latex compiler complains about two things:
>
>1. It cannot find the 'gnuplotout.tex' file.
>2. There is no BoundingBox in the pdf file.
>
>Yet the dvi output does contain all the text (not the graph). A pdf
>version (by dvipdfm) contains both although offset from each other.

If you are using a PDF figure, you need to be compiling with
pdflatex, and there should be no .dvi file, only a .pdf.

As for finding the file, see if you can locate it yourself
(along with gnuplotout.pdf) and move both to the directory
where you are processing your document file.


Dan
To reply by email, change LookInSig to luecking

Alex van der Spek

unread,
Nov 1, 2013, 5:52:50 AM11/1/13
to
Thanks,

pdflatex did it. All is well now. I learned something along the way!

Alex
0 new messages