Reputation: 13
When using the gnuplot epslatex terminal the associated TeX file creates overlapping plot text (axis/key/labels). The eps file is as expected.
As the user is not supposed to worry about the generated gnuplot TeX file, I am at a loss as to what the problem is.
I have tried the epslatex monochrome option to no avail as with specifying the encoding in gnuplot TeX and main TeX document. Reinstalled both MiKTeX and gnuplot (5.4 level 6) several times. Ran code with TeXmaker, Overleaf and TeXworks with same results.
gnuplot with size change that illustrates issue
set terminal push
set terminal epslatex size 10,5 cm
#set terminal wxt
set output 'Run3DimC.tex'
#
f(x) = 1/(2*sqrt(pi*d))*exp(-1*(1-x)**2/(4*d))
fit f(x) "Run3.dat" using 1:2 via d
set xlabel "Dimensionless Time"
set ylabel "Dimensionless Concentration"
set xrange [0:2]
set yrange [0:4]
plot "Run3.dat" using 1:2 linetype 7 linecolor -1 title "Run 3",\
f(x) lc -1 title "Fit"
set output
set terminal pop
pause -1 "Hit return to continue"
#
# Clean up: reset parameter defaults
#
reset
TeX main document
\documentclass[12pt,letterpaper]{article}
\usepackage[cp1252]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{color}
\begin{document}
\begin{figure}[h]
\centering
%\includegraphics{Run3DimC.eps}
\input{Run3DimC.tex}
\input{DULfitted.tex}
\caption{Please work}
\end{figure}
\end{document}
I have uninstalled MikTeX and TeXmaker. I have now installed TeXlive and TeXworks. I now get an error message.
`[1{c:/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] [2] [3]
(./NH3MM.tex)
! Missing } inserted.
<inserted text>
}
l.131 \end{figure}`
It seems to be a font mapping issue.
Diagram with gnuplot size 10,5 cm
Upvotes: 1
Views: 123
Reputation: 15118
If you add the keyword standalone
to the terminal specification in gnuplot it will produce a minimal *.tex document that contains the necessary package loads etc at the top. You can inspect these to see what your actual document might be missing. In this case the head of the file gnuplot emits with set terminal epslatex standalone
is
% GNUPLOT: LaTeX picture with Postscript
\documentclass{minimal}
% Set font size
\makeatletter
\def\@ptsize{1}
\InputIfFileExists{size11.clo}{}{%
\GenericError{(gnuplot) \space\space\space\@spaces}{%
Gnuplot Error: File `size11.clo' not found! Could not set font size%
}{See the gnuplot documentation for explanation.%
}{For using a font size a file `size<fontsize>.clo' has to exist.
Falling back ^^Jto default fontsize 10pt.}%
\def\@ptsize{0}
\input{size10.clo}%
}%
\makeatother
% Load packages
\usepackage{calc}
\usepackage{graphicx}
\usepackage{color}
\usepackage[cp1252]{inputenc}
\makeatletter
I don't quite follow your description of what your output looked like, but it sounds like maybe you need at the least \usepackage{color}
?
Upvotes: 0