Emergency stop with automatically generated pspicture

I have to show up with several cdx files in my document. I didn't find a ChemDraw handling package for LaTeX, so I took the cdx files converted to pdf and imported them in inkscape, which I then could save as tex files containing the cdx content as pspicture.

Now I wanted to include the tex files into my LaTeX document, which couldn't deal with that. I got an Undefined control sequence in my document.aux (troubling line is bold):

\relax
\providecommand\hyper@newdestlabel[2]{}
\catcode "\active
\bibstyle{biblatex}
\bibdata{x-2-2-blx,quellen}
\citation{biblatex-control}
\abx@aux@refcontext{none/global//global/global}


\abx@aux@refcontext{none/global//global/global}

\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument}
\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined
\global\let\oldcontentsline\contentsline
\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}}
\global\let\oldnewlabel\newlabel
\gdef\newlabel#1#2{\newlabelxx{#1}#2}
\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
\AtEndDocument{\ifx\hyper@anchor\@undefined
\let\contentsline\oldcontentsline
\let\newlabel\oldnewlabel
\fi}
\fi}
\global\let\hyper@last\relax
\gdef\HyperFirstAtBeginDocument#1{#1}


I tried to reduce the problem to an MWE recognizing it wasn't minimal and now, I cannot reproduce it :-/

With the folliwing MWE, I got an Undefined control sequence for the third last line:

\documentclass[a4paper,twoside,twocolumn,9pt]{article}
%\usepackage[pdf]{pstricks} - either one of two
\begin{document}
%LaTeX with PSTricks extensions
%%Creator: inkscape 0.92.3
%%Please note this file requires PSTricks extensions
\psset{xunit=.5pt,yunit=.5pt,runit=.5pt}
\begin{pspicture}(718,922)
{
\newrgbcolor{curcolor}{1 0 0}
\pscustom[linestyle=none,fillstyle=solid,fillcolor=curcolor]
{
\newpath
\moveto(41.9793042,780.79536604)
\lineto(37.03209961,788.66890119)
\lineto(37.06490601,788.0324571)
\lineto(37.0977124,786.93672346)
\closepath
}
}
\end{pspicture}
\end{document}

• Why don't you import the .pdf graphic files? – Bernard Apr 4 '18 at 18:10
• \abx@aux@refcontext is a biblatex auxiliary command. It will only be recognised if you have biblatex loaded. The only way this command can end up in the aux file of a document that does not load biblatex is if the document used to have \usepackage{biblatex} and that line was removed on the last run. In your MWE you don't load biblatex, so you can't reproduce the problem there. Did you try to delete the temporary files (.aux, ...) and compile again? – moewe Apr 4 '18 at 21:45
• @Bernard I ought to put in the *.cdx files, but I didn't find any package to include a *.cdx; although BKChem can save files as cdx it couldn't read/open the ChemDraw files at all -.- (which makes me wonder wether that's "real" cdx) I don't want to write this work with LibreOffice or - way more frustrating - with MS Office. Therefore, I'd like to include the formula / reactions as postscript and I got "automacitally made" tex files containing one pspicture each. @moewe I did delete every LaTeX file except *.tex "and*.pdf". Also my main problem here is pspicture... – Nepumuk Apr 6 '18 at 7:28
• Maybe you should update your question with the .aux file of your MWE then. The unknown \abx@aux@refcontext is definitely a biblatex command, and if it is in the .aux when biblatex is not loaded it stems from a previous run. This should be irrelevant to your question and you should remove it to avoid confusing people like me. For what it is worth I tried your MWE and it compiled fine with XeLaTeX (I only got a blank page, though). You can't compile PS stuff with pdfLaTeX out of the box. See en.wikibooks.org/wiki/LaTeX/PSTricks, tex.stackexchange.com/q/8413/35864 – moewe Apr 6 '18 at 7:55
• delete all auxiliary files and everything will be fine. – user2478 Apr 6 '18 at 8:25

run this document with pdflatex --shell-escape <file> in a command line interface and it should work. But you will see nothing in the created PDF, the used coordinates in your example do not really make sense.

\documentclass[a4paper,twoside,twocolumn,9pt]{article}
\usepackage{auto-pst-pdf}
\begin{document}
%LaTeX with PSTricks extensions
%%Creator: inkscape 0.92.3
%%Please note this file requires PSTricks extensions
\psset{xunit=.5pt,yunit=.5pt,runit=.5pt}
\begin{pspicture}(718,922)
{
\newrgbcolor{curcolor}{1 0 0}
\pscustom[linestyle=none,fillstyle=solid,fillcolor=curcolor]
{
\newpath
\moveto(41.9793042,780.79536604)
\lineto(37.03209961,788.66890119)
\lineto(37.06490601,788.0324571)
\lineto(37.0977124,786.93672346)
\closepath
}
}
\end{pspicture}
\end{document}


this is the same (exports from inkscape are rubbish ...):

\psset{unit=.5pt}
\psframebox{%
\begin{pspicture}(718,922)
\pspolygon*[linecolor=red](41.9,780.7)(37.0,788.6)(37.0,788.0)(37.0,786.9)
\end{pspicture}}
`