5

Googling already for five hours. I'm very newbie to LaTeX. :( I use pdfLaTeX+MakeIndex+BibTeX in TeXworks (yep, it ran on Windows). Packages from MiKTeX.

Sample code, that didn't work:

\documentclass{article}

\usepackage{pst-barcode,pstricks-add}

\begin{document}
    \psset{unit=1in}
    \begin{pspicture}(3.5,1.2)
        \psbarcode{^10412345678}{includetext}{code128}
    \end{pspicture}
\end{document}

So it give an error:

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

l.11 ...arcode{^10412345678}{includetext}{code128}

I tried to genereate a QR code,

\documentclass{minimal}
\usepackage[pdf]{pstricks}
\usepackage{pst-barcode}
\begin{document}
    \begin{pspicture}(0.7in,0.7in)
        \psbarcode{ctan.org}{}{qrcode}
    \end{pspicture}
    %
    \begin{pspicture}(0.7in,0.7in)
        \psbarcode{tug.org}{}{qrcode}
    \end{pspicture}
\end{document}

but problem the same :(

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

l.7 \psbarcode{ctan.org}{}{qrcode}

? 

Also tried standalone code128 package from ctan.org (code taken from documentarion):

\documentclass{minimal}
\input code128
\X=.5mm        % width of line
\barheight=1cm % height
\code{text}       \bigskip 
\end

It can't find \end

Runaway argument?
! File ended while scanning use of \end.
<inserted text> 
                \par 
<*> ...eX/LaTeX training 16.05/code128/test-2.tex"

? 
4

For pstricks you need to use latex not pdflatex or use xelatex.

Or add \usepackage{auto-pst-pdf} and use pdflatex --shell-escape

enter image description here

\documentclass{article}

\usepackage{pst-barcode,pstricks-add}
\usepackage{auto-pst-pdf}

\begin{document}
    \psset{unit=1in}
    \begin{pspicture}(3.5,1.2)
        \psbarcode{123456789012}{includetext}{code128}
    \end{pspicture}
\end{document}
  • It work perfectly on first computer, but on another it fall with Package pst-pdf Warning: pspicture No. 1 undefined. and create two pdf's: test.pdf, and test-autopp.pdf – Egor Egorov May 16 '17 at 16:41
  • latex doesn't output anything, xelatex output blank pdf :( – Egor Egorov May 16 '17 at 16:47
  • @EgorEgorov in the form above, with auto-pst-pdf you should use pdflatex --shell-escape but xelatex and latex never just do nothing. If there is an error the details will be in the .log file. Compare the log files on the two computers perhaps one has old versions of the packages. – David Carlisle May 16 '17 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.