I am new to PStricks and Tex in general and no matter what I do, I get the same error message running a very simple code like the following:
\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{pst-all}
\usepackage{graphics}
% !TeX program = xelatex
\begin{document}
\begin{pspicture}(2,2)(5,5)
\psline(0,0)(1,1)
\end{pspicture}
\end{document}
These are the error messages I get:
! Undefined control sequence.
<recently read> \c@lor@to@ps
l.12 ^^I^^I\psline(
0,0)(1,1)
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
And:
! Package inputenc Error: inputenc is not designed for xetex or luatex.
(inputenc) only UTF-8 supported.
I don't understand what the error is since I run the document with XeTex and use TexStudio (if that is of any importance). Thank you for your help :)
inputenc. Is your documentutf8encoded? – Bernard Jan 06 '18 at 21:23\c@lor@to@pserror if you use pdflatex instead of latex or xelatex, and you get the inputenc error if you use xelatex when using inputenc. If you are using xelatex the file must be utf8 encoded – David Carlisle Jan 06 '18 at 21:35xelatexandlualatexrequire it, and even for(pdf)latex, it is strongly recommended nowadays. It's the only encoding with ascii working on all platforms, and most modern editors use it. – Bernard Jan 06 '18 at 21:37inputencand it will work withxelatex– Jan 06 '18 at 21:38XeLaTex, I should have used "and" instead of "or". Should I put\usepackage[utf8]instead? – Bucephalus Jan 06 '18 at 22:20xelatex, you don't have to declare any encoding – but your code has to be in utf8. – Bernard Jan 06 '18 at 22:33