[texworks] texworks and eps graphics
Greg Bennett
gwbennett at sentex.ca
Thu Jun 17 17:22:47 CEST 2010
Good morning all. I am attempting to move a latex project to linux,
specifically Ubuntu 10.04, 64-bit, using TeXworks as a shell.
The project has includes a number of mathematical diagrams in eps
format, prepared under
Adobe, and using psfrag to annotate these. This combination, including
the example included
here, compile successfully under MikTeX (Windows) and TeXshop (MacOS).
I am aware of the recommendation on tug.org/PSTricks/pdf/pdfoutput and
can confirm that the
3-step approach produces expected output under MikTeX and from a shell
under Linux.
I had hoped to use TeXworks as a shell to carry out the latex command
step, but I have encountered
an error in the processing of the graphics. Below I include
(a) the source file, but NOT the eps file because of its size. It is, of
course, available if that would help;
(b) an edited version of the log from xelatex under TeXworks, having
removed all the redeclarations etc.
items;
(c) an similarly edited version of the log from the latex command issued
at a shell prompt. I note that
this log declares itself as running pdfTeX, rather than pdfLaTeX. Using
the pdfLaTeX button of TeXworks
produces a complaint that .eps is an unknown graphics extension, which
is an error I had expected.
Thanks in advance for clarifications, pointers, assistance
Cheers /Greg Bennett
**
(a) source
%% This is psfrag-test.tex
%% 05 May 2010
%% To look into dvi2pdf
%% on a file containing an .eps file
\documentclass[10pt]{amsbook}
\newcommand{\dirsep}{/}
\newcommand{\dirprefix}{}
\newcommand{\whichos}{"PC"}%{"Mac"}
\usepackage{pxfonts}
\usepackage{amssymb,xspace,amscd,ifthen,pmat,psfrag} %% for \circledcirc
symbol
%select graphics package
\ifthenelse{\equal{\whichos}{"PC"}}
{\usepackage{graphics}}
{\usepackage{graphicx}}
%scale and place .eps file
\newcommand{\puteps}[3][0.5]
{\ifthenelse{\equal{\whichos}{"PC"}}
{\scalebox{#1}{%
\includegraphics{\dirprefix #2\dirsep #3.eps}}}%
{\includegraphics[scale=#1]{\dirprefix #2\dirsep #3.eps}}}
\begin{document}
%definitions to match the example
\newcommand{\vs}[2][]{\ensuremath{\xspace\mathcal{#2}\xspace_{#1}}}
\newcommand{\cU}[1][]{\vs[{#1}]{U}}
\newcommand{\nvec}[2][]{\ensuremath{\xspace\mathbf{#2}_{#1}\xspace}}
\newcommand{\bfx}[1][]{\nvec[{#1}]{x}}
\newcommand{\bfy}[1][]{\nvec[{#1}]{y}}
\newcommand{\bfz}[1][]{\nvec[{#1}]{z}}
\newcommand{\vseq}[3]{\ensuremath{\nvec[{#2}]{#1},\ldots,\nvec[{#3}]{#1}}}
\title{Linear Algebra\\
\today}
\chapter{A diagram}
Here is a diagram copied from 1.4.9 line 522
\begin{figure}[h]
\begin{center}
$$
\psfrag{a}{$\cU[1]$}
%\psfrag{a}{$\cU_1$}
\psfrag{b}{$\cU[2]$}
%\psfrag{b}{$\cU_2$}
\psfrag{c}{$\cU[1]\cap\cU[2]$}
%\psfrag{c}{$\cU[1]\cap\cU[2]$}
\psfrag{d}{$\vseq{\bfx}{1}{q}$}
%\psfrag{d}{$\{\bx[1], \ldots, \bx[q]\}$}
\psfrag{e}{$\{\bfy[1], \ldots\ldots\ldots, \bfy[a]\}$}
%\psfrag{e}{$\{\by[1], \ldots\ldots\ldots, \by[a]\}$}
\psfrag{f}{$\{\bfz[1], \ldots\ldots\ldots, \bfz[b]\}$}
%\psfrag{f}{$\{\bz[1], \ldots\ldots\ldots, \bz[b]\}$}
\psfrag{C}{$\mbox{basis of }\cU[1]\cap\cU[2]$}
%\psfrag{C}{$\mbox{basis of }\cU_1\cap\cU[2]$}
\psfrag{E}{$\mbox{basis of }\cU[1]$}
%\psfrag{E}{$\mbox{basis of }\cU[1]$}
\psfrag{F}{$\mbox{basis of }\cU[2]$}
%\psfrag{F}{$\mbox{basis of }\cU[2]$}
%\myputeps{0}{0.40}{NewDimIntSum}
\puteps[0.80]{CH1}{NewDimIntSum}
$$
\end{center}
\caption{Two extensions of a basis for $\cU[1]\cap\cU[2]$
\label{PI1.4.9TwoExts}}%{PI1.4.6aTwoExts}}
\end{figure}
Now let's see how this runs.
%Yap show things correctly when switched to dvips render method.
%dvi2pdf complains but the command window closes too quickly to record
the messages.
%It leaves the psfrag substitutions. labelled a,b,.. , visible in a
column beside the figure
%and those small letters in the appropriate spots on the figure itself.
\end{document}
**
(b) log from XeLaTeX from the TeXworks menu
This is XeTeX, Version 3.1415926-2.2-0.9995.2 (TeX Live 2009/Debian)
(format=xelatex 2010.5.29) 17 JUN 2010 10:32
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**psfrag-test.tex
(./psfrag-test.tex
LaTeX2e <2009/09/24>
(SNIP)
Chapter 1
File: CH1/NewDimIntSum.eps Graphic file (type eps)
! Undefined control sequence.
\pfg at hidestart ...unt@ by\@ne \repeat \Gin at PS@raw
{/PSfrag
where{pop\pfg@ \t...
l.59 \puteps[0.80]{CH1}{NewDimIntSum}
? x
Here is how much of TeX's memory you used:
2500 strings out of 494665
28279 string characters out of 1166477
72346 words of memory out of 3000000
5559 multiletter control sequences out of 15000+50000
19616 words of font info for 66 fonts, out of 3000000 for 9000
830 hyphenation exceptions out of 8191
34i,4n,26p,274b,300s stack positions out of
5000i,500n,10000p,200000b,50000s
No pages of output.
**
(c) Log from latex psfrag-test at Ubuntu shell prompt
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
(format=latex 2010.5.29) 17 JUN 2010 10:40
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**psfrag-test
(./psfrag-test.tex
LaTeX2e <2009/09/24>
(SNIP)
Chapter 1
File: CH1/NewDimIntSum.eps Graphic file (type eps)
<CH1/NewDimIntSum.eps>
Overfull \hbox (217.35919pt too wide) detected at line 60
[]
[]
[1
] (./psfrag-test.aux)
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references
right.
)
Here is how much of TeX's memory you used:
2476 strings out of 493849
27993 string characters out of 1152846
75071 words of memory out of 3000000
5578 multiletter control sequences out of 15000+50000
21035 words of font info for 69 fonts, out of 3000000 for 9000
875 hyphenation exceptions out of 8191
34i,9n,29p,270b,304s stack positions out of
5000i,500n,10000p,200000b,50000s
Output written on psfrag-test.dvi (1 page, 2200 bytes).
More information about the texworks
mailing list