# How can I get pstricks and tikz to work in the same document?

I'm trying to get a \psbarcode in my document which also uses a tikzpicture. I'm using \usepackage{auto-pst-pdf,pst-barcode}, but---even though the document compiles and shows a document afterwards---the barcode doesn't show up... Any ideas what I should do exactly?

-
Welcome to TeX.SE! You might find that people are more willing to work on this problem if you post a minimum working example that replicates the issue. See this post. –  cslstr Apr 29 at 2:27

This works for me with pdflatex --shell-escape myfile assuming that the following is saved as myfile.tex.

\documentclass{article}
\usepackage{auto-pst-pdf}
\usepackage{pst-barcode}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle(2cm);
\end{tikzpicture}
\begin{pspicture}
\psbarcode[scalex=.75,scaley=.75]
{Harish Kumar}{eclevel=L}{qrcode}
\end{pspicture}
\end{document}


# Edit

I think some more help is needed in compiling as per the comments. In TeXworks, Go to EditPreferences. The following window appears:

Here click Typesetting tab. In this click + button (shown with arrow above). In the small new tool window that opens, enter the following values:

Click OK in all and come out. Now compile with pdflatexshell by selecting it in the drop down menu next to green arrow.

Hope it will be useful.

# Flying with arara

You can also use the tex automation tool arara. Download and install arara. In texlive, it comes along with by default. Add a menu entry in TeXworks for arara. The elegantly written manual has a section on how to do this for different editors including TeXworks. Follow the steps above (for pdflatexshell) and in the new tool window type like this:

Now press OK whenver you find it and you will have a new menu in the drop down list next to green arrow. Choose arara in it. Add the line % arara: pdflatex: { shell: yes} like

% arara: pdflatex: { shell: yes}
\documentclass{article}
\usepackage{auto-pst-pdf}
\usepackage{pst-barcode}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle(2cm);
\end{tikzpicture}
\begin{pspicture}
\psbarcode[scalex=.75,scaley=.75]
{Harish Kumar}{eclevel=L}{qrcode}
\end{pspicture}
\end{document}


in your code and press green button:

-
What the hell does that mean? How exactly do I do that? –  Green and White Apr 29 at 5:35
@GreenandWhite pdflatex --shell-escape myfile –  cmhughes Apr 29 at 5:54
And what does that mean? How do I implement this string of code? And where? Exactly... You must understand, I don't know what you're telling me. –  Green and White Apr 29 at 6:00
Here is my code: tex.stackexchange.com/questions/173370/… –  Green and White Apr 29 at 6:07
Compile it where? What do you mean by compile? What is that line of code? I just type my code in TeXworks and press the green button. –  Green and White Apr 29 at 6:07

Run with xelatex:

\listfiles
\documentclass{article}
\usepackage{pst-barcode}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle(2cm);
\end{tikzpicture}
\begin{pspicture}(1in,1in)
\psbarcode[scalex=.75,scaley=.75]{foo}{eclevel=L}{qrcode}
\end{pspicture}
\end{document}


-
I am running with xelatex. I don't get that result. –  Green and White Apr 29 at 6:01
what system do you use. Put \listfiles as first line into the source and show the file list which will be at the end of the log file. –  Herbert Apr 29 at 6:03
TeXworks on a Mac –  Green and White Apr 29 at 6:09
which version of MacTeX? Look into the log file (the first line) –  Herbert Apr 29 at 6:31
Version 3.1415926-2.50.9999.3 XeTeX –  Green and White Apr 29 at 6:39