DVISVGM 和 PSTricks

DVISVGM 和 PSTricks

EPS 文件转换不令人满意,dvisvgm因为没有显示标签。

  \documentclass[a4paper,11pt]{article}
  \usepackage{etex}
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}
  \usepackage{lmodern}
  \usepackage{mathtools,amsmath,amsfonts,amssymb,amsthm,mathrsfs,nccmath}
  \usepackage{pstricks}
  \usepackage{pstricks-add,pst-bezier,pst-tree,pst-sigsys,pst-grad,pst-all}
  \usepackage[frenchb]{babel}
  \begin{document}
  \TeXtoEPS
  \psset{xunit=4cm,yunit=2cm,algebraic=true,arrowscale=1.2}
  \begin{pspicture}(-1.5,-3)(2.5,2.5) 
  \psgrid[gridwidth=0.6pt,subgriddiv=0,gridlabels=0,gridcolor=lightgray,xunit=0.25,yunit=0.5](-6,-6)(10,5)
 \psaxes[linewidth=1pt,Dx=1,Dy=1,labels=none,ticksize=-3pt 0pt]{->} (0,0)(-1.5,-3)(2.5,2.5)
 \psxTick[ticksize=-3pt](1.25){\frac{5}{4}}
 \psxTick[ticksize=-3pt](0.666666666666){\frac{2}{3}}
 \begin{psclip}
 {\psframe[linestyle=none](-1.5,-3)(2.5,2.5)}
 {\psplot[linewidth=0.8pt,plotpoints=2000]{0}{1.25}{6*x-3}}%
 {\psplot[linewidth=0.8pt,plotpoints=2000]{0}{1.25}{1-(2-3*x)^2}}%
 \end{psclip}
 \psline[linestyle=dashed,dash=3pt 2pt](0,1)(0.666666666666,1) (0.666666666666,0)    
 \uput[dl](0,0){O}
 \uput[d](1,0){I}
 \uput[l](0,1){J}
 \uput[ur](1.25,-2){$\mathscr{C}_{f}$}
 \uput[ur](0.75,1){$\mathscr{C}_{g}$}
 \uput[d](2.42,0){$x$}
 \uput[l](0,2.35){$y$}
 \end{pspicture}
 \endTeXtoEPS
 \end{document} 

使用这个简单的编译Makefile

 all:
    latex fichier.tex
    dvips -Ppk -V -E -o fichier.eps fichier.dvi
    dvisvgm -E --libgs=/usr/lib/libgs.so.9 fichier.eps fichier.eps
    gpicview fichier.svg

答案1

  • 使用环境毫无意义TeXtoEPS
  • 的参数之间\psaxes不允许有空格
  • 无需使用 eps 文件
\documentclass[a4paper,11pt]{article}
\usepackage{etex}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{mathtools,amsmath,amsfonts,amssymb,amsthm,mathrsfs,nccmath}
\usepackage{pstricks-add}
\usepackage[frenchb]{babel}
\begin{document}

  \psset{xunit=4cm,yunit=2cm,algebraic=true,arrowscale=1.2}
  \begin{pspicture}(-1.5,-3)(2.5,2.5) 
  \psgrid[gridwidth=0.6pt,subgriddiv=0,gridlabels=0,gridcolor=lightgray,xunit=0.25,yunit=0.5](-6,-6)(10,5)
 \psaxes[linewidth=1pt,Dx=1,Dy=1,ticksize=-3pt 0pt]{->}(0,0)(-1.5,-3)(2.5,2.5)
 \psxTick[ticksize=-3pt](1.25){\frac{5}{4}}
 \psxTick[ticksize=-3pt](0.666666666666){\frac{2}{3}}
 \begin{psclip}{\psframe[linestyle=none](-1.5,-3)(2.5,2.5)}
   \psplot[linewidth=0.8pt,plotpoints=2000]{0}{1.25}{6*x-3}
   \psplot[linewidth=0.8pt,plotpoints=2000]{0}{1.25}{1-(2-3*x)^2}
 \end{psclip}
 \psline[linestyle=dashed,dash=3pt 2pt](0,1)(0.666666666666,1) (0.666666666666,0)    
 \uput[dl](0,0){O}
 \uput[d](1,0){I}
 \uput[l](0,1){J}
 \uput[ur](1.25,-2){$\mathscr{C}_{f}$}
 \uput[ur](0.75,1){$\mathscr{C}_{g}$}
 \uput[d](2.42,0){$x$}
 \uput[l](0,2.35){$y$}
 \end{pspicture}

\end{document} 

顺序如下:

latex fichier.tex
dvisvgm --libgs=/usr/lib64/libgs.so.9 child.dvi

但是正确的数学字体存在问题。

相关内容