紧急停止并自动生成图片

紧急停止并自动生成图片

cdx我必须在文档中显示几个文件。我没有找到用于 LaTeX 的 ChemDraw 处理包,因此我将cdx文件转换为pdf并导入到 inkscape 中,然后我可以将其另存为包含内容的tex文件。cdxpspicture

现在我想将tex文件包含到我的 LaTeX 文档中,但它无法处理这个问题。我的 document.aux 中出现了未定义的控制序列(有问题的行以粗体显示):

\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{无/全局//全局/全局}

\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}
\providecommand\HyField@AuxAddToFields[1]{}
\providecommand\HyField@AuxAddToCoFields[2]{}

我尝试将问题简化为 MWE,认识到它不是最小问题,现在我无法重现它 :-/

通过以下 MWE,我得到了未定义控制序列倒数第三行:

\documentclass[a4paper,twoside,twocolumn,9pt]{article}
%\usepackage[pdf]{pstricks} - either one of two
%\usepackage{pstricks-add} - commented out
\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}

答案1

在命令行界面中运行此文档pdflatex --shell-escape <file>,它应该可以工作。但是您在创建的 PDF 中看不到任何内容,您示例中使用的坐标确实没有意义。

\documentclass[a4paper,twoside,twocolumn,9pt]{article}
\usepackage{auto-pst-pdf}
\usepackage{pstricks-add}
\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}

这是相同的(从 inkscape 导出的是垃圾......):

\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}}

相关内容