![在 texstudio 中使用 dia.exe 中的 pstrick 宏导出](https://linux22.com/image/364799/%E5%9C%A8%20texstudio%20%E4%B8%AD%E4%BD%BF%E7%94%A8%20dia.exe%20%E4%B8%AD%E7%9A%84%20pstrick%20%E5%AE%8F%E5%AF%BC%E5%87%BA.png)
我正在使用 dia.exe 生成可以与 texstudio 一起使用的图形。我已经能够毫无问题地包含它们,但还有其他我无法解决的问题。
如果我将其导出并包含在 texstudio 中,字体会变得非常非常小。此外,公式无法正确显示。有没有一种特殊的方法可以在 dia 中使用数学模式编写公式?这是我的 pdf 中的输出
我知道如果删除“\”,我可以将文本更改为公式,但我想从 dia 自动获取它。这是来自 dia 的 tex 文件:
e\ifx\setlinejoinmode\undefined
\newcommand{\setlinejoinmode}[1]{}
\fi
\ifx\setlinecaps\undefined
\newcommand{\setlinecaps}[1]{}
\fi
% This way define your own fonts mapping (for example with ifthen)
\ifx\setfont\undefined
\newcommand{\setfont}[2]{}
\fi
\pspicture(-3.295722,-6.084993)(12.059877,-2.742428)
\psscalebox{0.183607 -0.183607}{
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\newrgbcolor{diafillcolor}{1.000000 1.000000 1.000000}%
\psset{fillcolor=diafillcolor}
\newrgbcolor{dialinecolor}{1.000000 1.000000 1.000000}%
\psset{linecolor=dialinecolor}
\pspolygon*(15.152800,15.025100)(15.152800,19.965286)(28.562312,19.965286)(28.562312,15.025100)
\psset{linewidth=0.100000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(15.152800,15.025100)(15.152800,19.965286)(28.562312,19.965286)(28.562312,15.025100)
\setfont{Helvetica-Bold}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(21.857556,17.177693){\psscalebox{1 -1}{Wavelet Packet}}
\setfont{Helvetica-Bold}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(21.857556,18.765193){\psscalebox{1 -1}{Transformation}}
\newrgbcolor{dialinecolor}{1.000000 1.000000 1.000000}%
\psset{linecolor=dialinecolor}
\pspolygon*(41.012400,14.986400)(41.012400,19.942498)(55.859408,19.942498)(55.859408,14.986400)
\psset{linewidth=0.100000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(41.012400,14.986400)(41.012400,19.942498)(55.859408,19.942498)(55.859408,14.986400)
\setfont{Helvetica-Bold}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(48.435904,17.146949){\psscalebox{1 -1}{Teager Energie }}
\setfont{Helvetica-Bold}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(48.435904,18.734449){\psscalebox{1 -1}{Operator}}
\newrgbcolor{dialinecolor}{1.000000 1.000000 1.000000}%
\psset{linecolor=dialinecolor}
\pspolygon*(-9.098480,26.020700)(-9.098480,30.869950)(9.104020,30.869950)(9.104020,26.020700)
\psset{linewidth=0.100000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(-9.098480,26.020700)(-9.098480,30.869950)(9.104020,30.869950)(9.104020,26.020700)
\setfont{Helvetica-Bold}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(0.002770,28.127825){\psscalebox{1 -1}{Schwellwert Vergleich mit }}
\setfont{Helvetica-Bold}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(0.002770,29.715325){\psscalebox{1 -1}{SAKF jedes Segmentes}}
\newrgbcolor{dialinecolor}{1.000000 1.000000 1.000000}%
\psset{linecolor=dialinecolor}
\pspolygon*(16.070400,25.517400)(16.070400,31.379900)(32.260442,31.379900)(32.260442,25.517400)
\psset{linewidth=0.100000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(16.070400,25.517400)(16.070400,31.379900)(32.260442,31.379900)(32.260442,25.517400)
\setfont{Helvetica-Bold}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(24.165421,27.337400){\psscalebox{1 -1}{Schwellwert-}}
\setfont{Helvetica-Bold}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(24.165421,28.924900){\psscalebox{1 -1}{ermittlung in den}}
\setfont{Helvetica-Bold}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(24.165421,30.512400){\psscalebox{1 -1}{ersten 40 ms}}
\newrgbcolor{dialinecolor}{1.000000 1.000000 1.000000}%
\psset{linecolor=dialinecolor}
\pspolygon*(41.240800,26.070200)(41.240800,30.946662)(55.011160,30.946662)(55.011160,26.070200)
\psset{linewidth=0.100000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(41.240800,26.070200)(41.240800,30.946662)(55.011160,30.946662)(55.011160,26.070200)
\setfont{Helvetica-Bold}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(48.125980,28.984681){\psscalebox{1 -1}{Autokorrelation}}
\psset{linewidth=0.300000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(6.162930,17.508300)(14.393782,17.501426)
\psset{linestyle=solid}
\setlinejoinmode{0}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon*(14.768782,17.501113)(14.268991,17.751531)(14.393782,17.501426)(14.268574,17.251531)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(14.768782,17.501113)(14.268991,17.751531)(14.393782,17.501426)(14.268574,17.251531)
\psset{linewidth=0.300000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(28.562300,17.495200)(40.252272,17.477112)
\psset{linestyle=solid}
\setlinejoinmode{0}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon*(40.627272,17.476531)(40.127659,17.727305)(40.252272,17.477112)(40.126886,17.227305)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(40.627272,17.476531)(40.127659,17.727305)(40.252272,17.477112)(40.126886,17.227305)
\newrgbcolor{dialinecolor}{1.000000 1.000000 1.000000}%
\psset{linecolor=dialinecolor}
\pspolygon*(-9.914570,15.033300)(-9.914570,19.983300)(6.162930,19.983300)(6.162930,15.033300)
\psset{linewidth=0.100000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(-9.914570,15.033300)(-9.914570,19.983300)(6.162930,19.983300)(6.162930,15.033300)
\setfont{Helvetica-Bold}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(-1.875820,17.190800){\psscalebox{1 -1}{Aufteilen des Audios in }}
\setfont{Helvetica-Bold}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(-1.875820,18.778300){\psscalebox{1 -1}{Segmente (16ms)}}
\psset{linewidth=0.300000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(55.859400,17.464400)(56.909400,17.464400)(56.909400,28.508400)(55.721610,28.508400)
\psset{linestyle=solid}
\setlinejoinmode{0}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon*(55.346610,28.508400)(55.846610,28.258400)(55.721610,28.508400)(55.846610,28.758400)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(55.346610,28.508400)(55.846610,28.258400)(55.721610,28.508400)(55.846610,28.758400)
\psset{linewidth=0.300000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(41.240800,28.508400)(32.970808,28.488969)
\psset{linestyle=solid}
\setlinejoinmode{0}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon*(32.595809,28.488088)(33.096395,28.239264)(32.970808,28.488969)(33.095221,28.739262)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(32.595809,28.488088)(33.096395,28.239264)(32.970808,28.488969)(33.095221,28.739262)
\psset{linewidth=0.300000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(16.070400,28.448700)(9.814430,28.445737)
\psset{linestyle=solid}
\setlinejoinmode{0}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon*(9.439430,28.445559)(9.939549,28.195796)(9.814430,28.445737)(9.939312,28.695796)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(9.439430,28.445559)(9.939549,28.195796)(9.814430,28.445737)(9.939312,28.695796)
\psset{linewidth=0.300000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(-17.799600,17.537400)(-10.674953,17.524380)
\psset{linestyle=solid}
\setlinejoinmode{0}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon*(-10.299954,17.523695)(-10.799496,17.774608)(-10.674953,17.524380)(-10.800410,17.274609)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(-10.299954,17.523695)(-10.799496,17.774608)(-10.674953,17.524380)(-10.800410,17.274609)
\psset{linewidth=0.300000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(-9.148208,28.454190)(-16.397190,28.461212)
\psset{linestyle=solid}
\setlinejoinmode{0}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon*(-16.772190,28.461575)(-16.272432,28.211091)(-16.397190,28.461212)(-16.271948,28.711091)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(-16.772190,28.461575)(-16.272432,28.211091)(-16.397190,28.461212)(-16.271948,28.711091)
\setfont{Helvetica}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](-15.846200,16.530400){\psscalebox{1 -1}{Audio}}
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](10.300200,15.674400){\psscalebox{1 -1}{}}
\setfont{Helvetica}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](9.200220,16.474400){\psscalebox{1 -1}{X(n)}}
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](34.199700,15.674400){\psscalebox{1 -1}{}}
\setfont{Helvetica}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](31.349700,16.524400){\psscalebox{1 -1}{\$W\_\}j,m\}(n)\$ }}
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](58.356600,22.378700){\psscalebox{1 -1}{}}
\setfont{Helvetica}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](58.155600,24.303600){\psscalebox{1 -1}{\$T\_\}j,m\}(n)\$}}
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](37.931600,32.105000){\psscalebox{1 -1}{}}
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](35.402800,31.002700){\psscalebox{1 -1}{}}
\setfont{Helvetica}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](32.348800,32.473700){\psscalebox{1 -1}{\$SAKF\_\}j,m\}(n)\$}}
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](10.827900,30.629800){\psscalebox{1 -1}{}}
\setfont{Helvetica}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](7.968390,32.878900){\psscalebox{1 -1}{\$SAKF\_\}j,m\}(n)\$}}
\setfont{Helvetica}{1.587500}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](-14.790900,30.674300){\psscalebox{1 -1}{SAE}}
}\endpspicturenter code here
谢谢!
答案1
以下是代码pstricks
:
\documentclass[a4paper,german, x11names]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage[hmargin=2cm]{geometry}
\usepackage{pst-node}
\usepackage{auto-pst-pdf}
\newcommand\framenode[2]{\Rnode{#1}{\psframebox{\parbox{3.2cm}{\centering\bfseries#2}}}}
\begin{document}
\psset{framesep =5pt, arrows =->, arrowinset= 0.12, arrowsize = 6pt, linejoin=1, shortput=nab, npos=0.4}
\sffamily\small\noindent\sansmath
\begin{psmatrix}[rowsep=1.2, colsep=2, mnode =r]%
%%% nodes
\pnode{Beg} & \framenode{A}{Aufteilen des Audios \\ in Segmente (16 ms)} & \framenode{B}{Wavelet Packet \\ Transformation} & \framenode{C}{Teager Energie \\ Operator} \\
\pnode{End} & \framenode{F}{Schwellwert Vergleich mit SAKF\\ jedes Segmentes} & \framenode{E}{Schellwertermittlung\\ in den ersten 40 ms} & \framenode{D}{Autokorrelation}
%%% nodes connections
\ncline{Beg}{A}\naput[npos=0.4]{Audio}
\ncline{A}{B}^{$ \mathsf{X(n) }$}
\ncline{B}{C}^{$ \mathsf{W_{j, m}(n)} $}
\ncbar[linearc=0.15, arm =5mm]{C}{D}\naput[labelsep=0.5em, npos=1.5]{$ T_{j, m}(n) $}
\ncline{D}{E}_{$\mathsf{SAKF_{j, m}(n)} $}
\ncline{E}{F}_{$\mathsf{SAKF_{1, m}(n)} $}
\ncline{F}{End}\nbput[npos=0.5]{SAE}
\end{psmatrix}
\end{document}