GeneralRe-starting

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
dwjones1
Posts: 3
Joined: Mon Sep 26, 2016 6:05 am

Re-starting

Post by dwjones1 »

I was 95% finished with writing physics textbook 4 years ago when I undertook a project that kept me away from writing 4 years. Now trying to restart with new computer and having trouble. In 2012 i was using Winedt as text editor and MikTex 2.9 (Pdftext version 3.1415926-2.5-1.40.14) in Windows 7 environment. I tried to open the file with TeXnic using Windows Vista but I get error messages in first figure using pst-arrow and from there on nothing works. I also tried the file on an iMac with OS X using MacTeX package with Tex Shop. That doesn't work either. So, what should I do? I can work on either computer but would prefer to use the iMac. Grateful for any suggestions or help.

dwjones1

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re-starting

Post by Stefan Kottwitz »

Welcome to the forum!
dwjones1 wrote:I get error messages in first figure using pst-arrow
What is the error message? pst-arrow not found? Then it's just not installed. Some other error message? Maybe it's used in a wrong way. Or you need to update pst-arrow. Please always post error message and all available details. Otherwise it's hard to help.
dwjones1 wrote:That doesn't work either.
And this means? Nobody can help if the problem description for the situation on the Mac is just, that it doesn't work. Tell us error messages.

I use a Mac with MacTeX 2016 and TeXworks as editor. MacTeX bases on TeX Live. Perhaps consider to use TeX Live on Windows too, or if you stick to MikTeX: update it to the latest version. It's MikTeX 2.9 still, but that version got partial updates.

Stefan
Last edited by cgnieder on Thu Sep 29, 2016 12:52 pm, edited 1 time in total.
LaTeX.org admin
dwjones1
Posts: 3
Joined: Mon Sep 26, 2016 6:05 am

Re: Re-starting

Post by dwjones1 »

Many thanks, that would probably help but I had many errors and it was hard to figure out where to start. So, I created another tex file using the same preamble as I did in 2012 using a PC with windows 7, MikTex 2.9 and Winedt and added bits of text a few pages at a time. I did this using the iMAC OS X EL CAPITAN version 10.11.6 with TexShop. Everything worked fine until I reached the first figure at the line 231 which is:

\psline[linecolor=black]{-}(1.5,4)(12.5,4)

The error message said undefined control sequence. The error message for the next 50 lines or so was exactly the same. The output showed all the pages correctly including the caption to the figure but deleted the figure. It is the same story throughout the next 380 pages of text and figures so I guess this is the major problem. I am amazed that it all worked so well considering the big jump in computers and programming, but I do not know where to go from here. Any suggestion will be appreciated.

D. W. Jones
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re-starting

Post by Stefan Kottwitz »

\psline is a command of the pstricks package. If it's undefined, the package was not loaded. So, ensure that the preamble contains

\usepackage{pstricks}

Stefan
LaTeX.org admin
dwjones1
Posts: 3
Joined: Mon Sep 26, 2016 6:05 am

Re: Re-starting

Post by dwjones1 »

It does contain the \usepackage{pstricks} line. Must be something else. Here is part of the figure where the trouble starts:

\begin{figure}[!h]
\psset{xunit=1cm,yunit=1cm}
\begin{picture}(0,2)(14,5)
%\psgrid[subgriddiv=0,griddots=5,gridlabels=7pt,xunit=1,yunit=1](14,8)
%\psaxes[linewidth=1pt,ticks=none,showorigin=false,Dx=1,Dy=1]{->}(14,8)
\psline[linecolor=black]{-}(1.5,4)(12.5,4)
\psline[linecolor=black,fillcolor=black,fillstyle=none]{-}(1.5,3)(12.5,3)
\psline[linecolor=black,linestyle=solid,linewidth=1pt]{-}(1.6,3)(1.6,3.3)
\psline[linecolor=black,linestyle=solid,linewidth=1pt]{-}(1.8,3)(1.8,3.3)
\psline[linecolor=black,fillcolor=black,fillstyle=none](2.0,3)(2.0,4)\rput(2,3.75){$15$}
\psline[linecolor=black,linestyle=solid,linewidth=1pt]{-}(2.2,3)(2.2,3.3)
\psline[linecolor=black,linestyle=solid,linewidth=1pt]{-}(2.4,3)(2.4,3.3)


D. W. Jones
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re-starting

Post by Stefan Kottwitz »

There's no problem in the code, except that it's incomplete. And still you did not tell us the exact error message, just "undefined control sequence" and referring to \psline. I guess it's not \psline, but another command that's undefined. The whole error message would show that.

For example, if LaTeX would show:

! Undefined control sequence.
<recently read> \c@lor@to@ps

l.9 \psline[linecolor=black]{-}
(1.5,4)(12.5,4)


then \c@lor@to@ps would be undefined. LaTeX error messages are sometimes hard to read, but these are things we know here. We just need the exact error message and the code.

In that case I mentioned, I know that pdfLaTeX has been used for directly compiling to PDF. That's the most common use today. But PSTricks requires LaTeX in DVI mode (running LaTeX, dvips, and ps2pdf for producing PDF). Or use XeLaTeX in your editor.

So, just try switching to XeLaTeX in your editor settings.

Btw. can you show this example as complete picture? Maybe I can show how to draw that in a nice modern way, with pdfLaTeX and TikZ.

Stefan
LaTeX.org admin
Post Reply