LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How can I generate a PDF from a *.tex file in Slackware 14.2? (https://www.linuxquestions.org/questions/slackware-14/how-can-i-generate-a-pdf-from-a-%2A-tex-file-in-slackware-14-2-a-4175668382/)

crts 01-24-2020 05:32 PM

How can I generate a PDF from a *.tex file in Slackware 14.2?
 
I am using the following command
Code:

texi2pdf dummy.tex
to create a PDF from a *.tex file, which was created from 'GeoGebra' by "export->graphics view as pstricks".
However, it always throws several errors (see below) and the resulting PDF is corrupted/incomplete. I have added /usr/share/texmf/bin to my PATH variable and installed the 'texlive' package from slackbuilds.org. It still does not build properly.

Is there some additional configuration that I need to do or some additional package that needs to be installed?

Addtional information:

The content of the tex file
Code:

\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{pstricks-add}
\pagestyle{empty}
\begin{document}
\psset{xunit=1.0cm,yunit=1.0cm,algebraic=true,dimen=middle,dotstyle=o,dotsize=5pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\begin{pspicture*}(-12.49984777440859,-11.265342340794472)(28.03951999775536,19.802881102297736)
\multips(0,-11)(0,5.0){7}{\psline[linestyle=dashed,linecap=1,dash=1.5pt 1.5pt,linewidth=0.4pt,linecolor=lightgray]{c-c}(-12.5,0)(28.0,0)}
\multips(-12,0)(5.0,0){9}{\psline[linestyle=dashed,linecap=1,dash=1.5pt 1.5pt,linewidth=0.4pt,linecolor=lightgray]{c-c}(0,-11.265342340794472)(0,19.802881102297736)}
\psaxes[labelFontSize=\scriptstyle,xAxis=true,yAxis=true,Dx=5.,Dy=5.,ticksize=-2pt 0,subticks=2]{->}(0,0)(-12.49984777440859,-11.265342340794472)(28.03951999775536,19.802881102297736)
\psline{->}(0.,0.)(3.,3.)
\psline{->}(3.,3.)(6.44,3.26)
\psline{->}(6.44,3.26)(0.96,5.86)
\psplot[linestyle=dashed,dash=17pt 17pt]{-12.49984777440859}{28.03951999775536}{(--40.59956282946034-7.020271276268703*x)/9.106684230332956}
\begin{scriptsize}
\psdots[dotsize=3pt 0,dotstyle=*,linecolor=darkgray](0.,0.)
\rput[bl](0.27184685115810553,0.43008588374139306){\darkgray{$A$}}
\psdots[dotstyle=*,linecolor=blue](3.,3.)
\rput[bl](3.285392774044629,3.730636180236177){\blue{$B$}}
\rput[bl](1.2763621587869467,1.7216055649784825){$u$}
\psdots[dotstyle=*,linecolor=blue](6.44,3.26)
\rput[bl](6.729445257343513,3.9458894604423587){\blue{$C$}}
\rput[bl](4.64866354868377,3.443631806627935){$v$}
\psdots[dotstyle=*,linecolor=blue](0.96,5.86)
\rput[bl](1.2763621587869467,6.600679916318598){\blue{$D$}}
\rput[bl](3.572397147652869,4.376396020854722){$w$}
\psdots[dotstyle=*,linecolor=blue](-2.,6.)
\rput[bl](-1.7371837640995769,6.74418210312272){\blue{$E$}}
\psdots[dotstyle=*,linecolor=blue](7.106684230332957,-1.020271276268703)
\rput[bl](7.375205097962054,-0.2874250502792122){\blue{$F$}}
\rput[bl](-12.141092307398289,12.4125184818855){$f$}
\end{scriptsize}
\end{pspicture*}
\end{document}

and the first error is:

Code:

...
(/usr/share/texmf-dist/tex/generic/pst-math/pst-math.tex
`pst-math' v0.64 , (CJ,hv)) `pstricks-add' v3.87, 2019/01/12 (dr,hv))
 v1.91, 2018/08/31 (tvz,hv)))
(/usr/share/texmf-dist/tex/latex/pst-node/pst-node.sty
(/usr/share/texmf-dist/tex/generic/pst-node/pst-node.tex))
(/usr/share/texmf-dist/tex/latex/pst-3d/pst-3d.sty
(/usr/share/texmf-dist/tex/generic/pst-3d/pst-3d.tex))
(/usr/share/texmf-dist/tex/latex/pst-math/pst-math.sty
(/usr/share/texmf-dist/tex/latex/pst-calculate/pst-calculate.sty
(/usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/share/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/share/texmf-dist/tex/latex/l3kernel/l3pdfmode.def)))
(/usr/share/texmf-dist/tex/latex/siunitx/siunitx.sty
(/usr/share/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/share/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/share/texmf-dist/tex/latex/tools/array.sty)
(/usr/share/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty)
(/usr/share/texmf-dist/tex/latex/translator/translator.sty)))
(/usr/share/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texmf-dist/tex/generic/xstring/xstring.sty
(/usr/share/texmf-dist/tex/generic/xstring/xstring.tex))
(/usr/share/texmf-dist/tex/generic/pst-math/pst-math.tex))
(/usr/share/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex))
(/home/user/workspace/shell/subdir/dummy.aux)
(/usr/share/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texmf-dist/tex/latex/base/ts1enc.dfu)
(/usr/share/texmf-dist/tex/latex/translator/translator-basic-dictionary-English
.dict) (/usr/share/texmf-dist/tex/latex/siunitx/siunitx-abbreviations.cfg)
./dummy.tex:8: Undefined control sequence.
\c@lor@to@ps ->\PSTricks
                        _Not_Configured_For_This_Format
l.8 ...linecolor=lightgray]{c-c}(-12.5,0)(28.0,0)}
?                                                 

./dummy.tex:8: Undefined control sequence.
\XC@usec@lor ...string \color@ #1#2\endcsname \@@
                                                  \fi \space
l.8 ...linecolor=lightgray]{c-c}(-12.5,0)(28.0,0)}
                                                 
?

It goes on for a while with similar errors. I have to hit 'Enter' after every '?' to continue.

jmccue 01-24-2020 05:55 PM

ignore
 
EDIT: very tired, read that as txt to pdf


Here you go, what I do:

Code:

enscript -p out.ps in.txt
ps2pdf out.ps out.pdf


vonbiber 01-25-2020 12:42 AM

[QUOTE=crts;6082658]I am using the following command
Code:

texi2pdf dummy.tex
Since the input file is a latex file, you should use
the following command:
Code:

pdflatex dummy.tex

NonNonBa 01-25-2020 04:02 AM

Quote:

Originally Posted by vonbiber (Post 6082727)
Quote:

Originally Posted by crts (Post 6082658)
I am using the following command
Code:

texi2pdf dummy.tex

Since the input file is a latex file, you should use
the following command:
Code:

pdflatex dummy.tex

Indeed. texi2pdf is meant to process texi files (e. g. the GNU manuals you can find in /usr/info), not latex. To process latex, you need texlive.

crts 01-25-2020 07:27 AM

Quote:

Originally Posted by vonbiber (Post 6082727)
Since the input file is a latex file, you should use
the following command:
Code:

pdflatex dummy.tex

Quote:

Originally Posted by NonNonBa (Post 6082760)
Indeed. texi2pdf is meant to process texi files (e. g. the GNU manuals you can find in /usr/info), not latex. To process latex, you need texlive.

'texi2pdf' is a script which does call 'pdflatex' eventually, however, I also tried running 'pdflatex' directly. The result is still the same. I installed texlive, texlive-extra and texlive-docs but it is still not building correctly.

Is anyone able to correctly build the above sample? This way I would at least know if it is only an issue on my side.

0XBF 01-25-2020 07:48 AM

I have the full suite of texlive software installed on my laptop and tried making a PDF from your tex sample with pdflatex. I get undefined control sequence errors here too. I usually use tikz and pgfplots for arrows/lines/graphs in my PDF files and haven't used the "pstricks" package before so I'm not sure if your syntax is correct.

captain_sensible 01-25-2020 07:48 AM

1 Attachment(s)
this is your pdf image when i ran your.tex latex2html

0XBF 01-25-2020 07:52 AM

@ captain_sensible: Thats the same thing that pdflatex spits out for me after all the errors.

NonNonBa 01-25-2020 07:55 AM

Quote:

Originally Posted by crts (Post 6082790)
'texi2pdf' is a script which does call 'pdflatex' eventually, however.

Indeed. I've learned something today. :)

Quote:

Originally Posted by crts (Post 6082790)
'texi2pdf' is a script which does call 'pdflatex' eventually,
Is anyone able to correctly build the above sample? This way I would at least know if it is only an issue on my side.

OK. I think it's purely LaTeX related. The pstricks-add documentation says you need pstricks to use it, which is not in your preamble.

0XBF 01-25-2020 08:34 AM

1 Attachment(s)
Seems it can't be done with pdflatex, and the issue seems to be specific to PSTricks. See here for reference:
http://tug.org/PSTricks/main.cgi?file=pdf/pdfoutput

I tried their method of using
Code:

latex <file>.tex
dvips <file>.dvi
ps2pdf <file>.ps

and got a PDF file that had your plot on it, although it didn't fit on the page properly. There's still some errors regarding out of bounds boxes.

crts 01-25-2020 11:50 AM

Using the triple 'latex', 'dvips' and 'ps2pdf' builds it properly. The fact that it is cut-off is due to the settings in GeoGebra while exporting it. Good to know that it was not a TeX configuration or wrong installation issue.

Thanks everybody.


All times are GMT -5. The time now is 06:16 AM.