LyX 上的 PSTricks(通过 pdflatex)

LyX 上的 PSTricks(通过 pdflatex)

我正在使用 LyX(在 Windows 上),并且我试图在有 PSTricks 代码(我将其作为)的情况下获取 pdf 文件输出\ERT
我尝试在序言中写入类似以下内容:\usepackage[off]{auto-pst-pdf} \usepackage[pdf]{pstricks},但它仍然无法编译为 pdf 文件输出。(也ps4pdf无济于事……)。

你能告诉我怎样做吗?

谢谢你!


以下是代码:

 % Preview source code

%% LyX 2.0.5.1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[twocolumn,english,hebrew]{article}
\renewcommand{\familydefault}{\rmdefault}
\usepackage[T1]{fontenc}
\usepackage[cp1255]{inputenc}
\setlength{\parindent}{0bp}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\def\@outputdblcol{%
  \if@firstcolumn
    \global \@firstcolumnfalse
    \global \setbox\@leftcolumn \box\@outputbox
  \else
    \global \@firstcolumntrue
    \setbox\@outputbox \vbox {%
      \hb@xt@\textwidth {%
      \kern\textwidth \kern-\columnwidth %**
      \hb@xt@\columnwidth {%
         \box\@leftcolumn \hss}%
      \kern-\textwidth %**
      \hfil
      {\normalcolor\vrule \@width\columnseprule}%
      \hfil
      \kern-\textwidth  %**
      \hb@xt@\columnwidth {%
         \box\@outputbox \hss}%
      \kern-\columnwidth \kern\textwidth %**
    }%
  }%
  \@combinedblfloats
  \@outputpage
  \begingroup
  \@dblfloatplacement
  \@startdblcolumn
  \@whilesw\if@fcolmade \fi
  {\@outputpage
    \@startdblcolumn}%
  \endgroup
  \fi
}
\@mparswitchtrue

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\usepackage{theorem}
\theorembodyfont{\upshape}
\newtheorem{theorem}{\R{משפט}}[section]
\AtBeginDocument{\make@lr\thetheorem}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage[crop=off]{auto-pst-pdf}
\usepackage{pstricks}

\makeatother

\usepackage{babel}
\begin{document}
\pscircle(0,0){1}
\end{document}

答案1

问题在于缺少 的可选参数-shell-escapepdflatex您可以使用以下方式添加它:Tools->Setup->File->Converter->LaTeX (pdflatex)

在此处输入图片描述

那么你只需要在序言中

\usepackage{auto-pst-pdf}
\usepackage{pstricks}

当然,但是 PSTricks 的内容进入了pspicture环境:

\begin{pspicture}(-1,-1)(1,1)
\pscircle(0,0){1}
\end{pspicture}

但是,使用xelatex可以使其更容易,不需要包auto-pst-pdf

相关内容