[pstricks] [Fwd: Re: psframe/pspolygon problems]

Herbert Voss Herbert.Voss at gmx.net
Thu Nov 23 16:21:34 CET 2006


-------- Original-Nachricht --------
Betreff: Re: psframe/pspolygon problems
Datum: Thu, 23 Nov 2006 16:12:07 +0100
Von: Herbert Voss <Herbert.Voss at gmx.net>
Organisation: T-Online
Newsgruppen: comp.text.tex
Referenzen: <m3y7q2zl39.fsf at ieee.org>

Randy Yates schrieb:
> I am finding strange behaviour with this in my pspictures. Namely,
> it will distort the positions of some objects that come after it
> in the LaTeX file. For example, try this and then move
> psframe to the line just after the first \bddot.

cannot see any difference. Used the latest pstricks-add.tex
from http://perce.de/LaTeX/pstricks-add/

Herbert

\documentclass{article}
\usepackage{pstricks-add}

% #1 = tag name (created as fig:#1)
% #2 = figure caption
\newcommand{\psfiguretag}{dummytag}
\newcommand{\psfigurecaption}{dummycaption}
\newenvironment{psfigure}[2]
{\renewcommand{\psfiguretag}{#1}\renewcommand{\psfigurecaption}{#2}\begin{figure}[ht]\centering}
{\vskip\smallskipamount\caption{\psfigurecaption}\label{fig:\psfiguretag}\end{figure}}

% Macros to aid drawing block diagrams using pstricks
% #1 x pos
% #2 y pos
% #3 width
% #4 height
% #5 linewidth
% #6 label  The labels labell, labelr, labelt, and labelb are created
% #7 text
\newcommand\bdblock[7]{\rput(!#1 #3 2 div sub #2){\pnode(!0
0){#6l}\pnode(!#3 0){#6r}\pnode(!#3 2 div #4 2 div){#6t}\pnode(!#3 2 div
#4 2 div -1 mul){#6t}\pspolygon[linewidth=#5](!0 #4 2 div -1 mul)(!#3 #4
2 div -1 mul)(!#3 #4 2 div)(!0 #4 2 div)}\rput(!#1
#2){\psscalebox{0.8}{#7}}}
% #1 x pos
% #2 y pos
% #3 width
% #4 height
% #5 linewidth
% #6 label  The labels labell, labelr, labelt, and labelb are created
% #7 delay count (a positive integer)
\newcommand\bddelay[7]{\bdblock{#1}{#2}{#3}{#4}{#5}{#6}{$z^{-#7}$}}
% #1 x pos
% #2 y pos
% #3 label
\newcommand\bdnode[3]{\pnode(!#1 #2){#3}}
% #1 begin node
% #2 end node
% #3 linewidth
% #4 arrows
\newcommand\bdline[4]{\ncline[linewidth=#3]{#4}{#1}{#2}}
% #1 x pos
% #2 y pos
% #3 radius
% #4 linewidth
% #5 label
% #6 text
\newcommand\bdcircle[6]{\cnode[linewidth=#4](!#1 #2){#3}{#5}\rput(!#1
#2){\psscalebox{0.8}{#6}}}
% #1 x pos
% #2 y pos
% #3 radius
% #4 label
\newcommand\bddot[4]{\cnode*(!#1 #2){#3}{#4}}
% #1 x pos
% #2 y pos
% #3 radius
% #4 linewidth
% #5 label
% #6 text
\newcommand\bdmultiplier[6]{\bdcircle{#1}{#2}{#3}{#4}{#5}{\psscalebox{0.8}{#6}}}
% #1 x pos
% #2 y pos
% #3 radius
% #4 linewidth
% #5 label
\newcommand\bdsummer[5]{\bdcircle{#1}{#2}{#3}{#4}{#5}{\psscalebox{0.8}{$+$}}}

\begin{document}


\begin{psfigure}{block}{DC Block Filter Architecture}
\psset{unit=3pt,transpalpha=0.1}
\begin{pspicture}(0,-10)(100,10)
\sffamily
\bdnode{0}{0}{Beg}
\bdnode{100}{0}{End}
\bdsummer{30}{0}{2}{0.8pt}{SummerA}
\bdsummer{50}{0}{2}{0.8pt}{SummerB}
\bddelay{20}{-10}{6}{4}{0.8pt}{DelayA}{1}
\bdblock{60}{-10}{7}{4}{0.8pt}{Quantizer}{Q()}
\bdmultiplier{70}{-10}{2}{0.8pt}{Pole}{$\times$}
\bddelay{80}{-10}{6}{4}{0.8pt}{DelayB}{1}
\bdline{Beg}{SummerA}{0.4pt}{->}
\bdline{SummerA}{SummerB}{0.4pt}{->}
\bdline{SummerB}{End}{0.4pt}{->}
\bddot{10}{0}{0.5}{DotA}
\bdnode{10}{-10}{NodeA}
\bdline{DotA}{NodeA}{0.4pt}{-}
\bdline{NodeA}{DelayAl}{0.4pt}{->}
\bdnode{30}{-10}{NodeB}
\bdline{DelayAr}{NodeB}{0.4pt}{-}
\bdline{NodeB}{SummerA}{0.4pt}{->}
\bddot{90}{0}{0.5}{DotB}
\psframe[linestyle=none,fillstyle=transparent,fillcolor=blue,framearc=0.1](!7
-14)(!33 5)
\bdnode{90}{-10}{NodeC}
\bdline{DotB}{NodeC}{0.4pt}{-}
\bdline{NodeC}{DelayBr}{0.4pt}{->}
\bdline{DelayBl}{Pole}{0.4pt}{->}
\bdline{Pole}{Quantizerr}{0.4pt}{->}
\bdnode{50}{-10}{NodeD}
\bdline{Quantizerl}{NodeD}{0.4pt}{-}
\bdline{NodeD}{SummerB}{0.4pt}{->}
\bdnode{70}{-4}{NodeE}
\bdline{NodeE}{Pole}{0.4pt}{->}
% Annotations:
\rput[lb](!0 0.2){\psscalebox{0.6}{$x[n]$}}
\rput[b](!40 0.2){\psscalebox{0.6}{$w[n]$}}
\rput[rb](!99.2 0.2){\psscalebox{0.6}{$y[n]$}}
\rput[b](!70 -4){\psscalebox{0.6}{$p$}}
\rput[b](!20 2){\psscalebox{0.6}{Differentiator}}
\rput[b](!70 2){\psscalebox{0.6}{Integrator w/ Truncation}}
\rput[b](!60 -7){\psscalebox{0.6}{Quantizer}}
\rput[B](!110 -3 0.5 add){\psscalebox{0.6}{32-bit}}
\rput[B](!110 -7 0.5 add){\psscalebox{0.6}{16-bit}}
\end{pspicture}
\end{psfigure}


\begin{psfigure}{block}{DC Block Filter Architecture}
\psset{unit=3pt,transpalpha=0.1}
\begin{pspicture}(0,-10)(100,10)
\sffamily
\psframe[linestyle=none,fillstyle=transparent,fillcolor=blue,framearc=0.1](!7
-14)(!33 5)
\bdnode{0}{0}{Beg}
\bdnode{100}{0}{End}
\bdsummer{30}{0}{2}{0.8pt}{SummerA}
\bdsummer{50}{0}{2}{0.8pt}{SummerB}
\bddelay{20}{-10}{6}{4}{0.8pt}{DelayA}{1}
\bdblock{60}{-10}{7}{4}{0.8pt}{Quantizer}{Q()}
\bdmultiplier{70}{-10}{2}{0.8pt}{Pole}{$\times$}
\bddelay{80}{-10}{6}{4}{0.8pt}{DelayB}{1}
\bdline{Beg}{SummerA}{0.4pt}{->}
\bdline{SummerA}{SummerB}{0.4pt}{->}
\bdline{SummerB}{End}{0.4pt}{->}
\bddot{10}{0}{0.5}{DotA}
\bdnode{10}{-10}{NodeA}
\bdline{DotA}{NodeA}{0.4pt}{-}
\bdline{NodeA}{DelayAl}{0.4pt}{->}
\bdnode{30}{-10}{NodeB}
\bdline{DelayAr}{NodeB}{0.4pt}{-}
\bdline{NodeB}{SummerA}{0.4pt}{->}
\bddot{90}{0}{0.5}{DotB}
\bdnode{90}{-10}{NodeC}
\bdline{DotB}{NodeC}{0.4pt}{-}
\bdline{NodeC}{DelayBr}{0.4pt}{->}
\bdline{DelayBl}{Pole}{0.4pt}{->}
\bdline{Pole}{Quantizerr}{0.4pt}{->}
\bdnode{50}{-10}{NodeD}
\bdline{Quantizerl}{NodeD}{0.4pt}{-}
\bdline{NodeD}{SummerB}{0.4pt}{->}
\bdnode{70}{-4}{NodeE}
\bdline{NodeE}{Pole}{0.4pt}{->}
% Annotations:
\rput[lb](!0 0.2){\psscalebox{0.6}{$x[n]$}}
\rput[b](!40 0.2){\psscalebox{0.6}{$w[n]$}}
\rput[rb](!99.2 0.2){\psscalebox{0.6}{$y[n]$}}
\rput[b](!70 -4){\psscalebox{0.6}{$p$}}
\rput[b](!20 2){\psscalebox{0.6}{Differentiator}}
\rput[b](!70 2){\psscalebox{0.6}{Integrator w/ Truncation}}
\rput[b](!60 -7){\psscalebox{0.6}{Quantizer}}
\rput[B](!110 -3 0.5 add){\psscalebox{0.6}{32-bit}}
\rput[B](!110 -7 0.5 add){\psscalebox{0.6}{16-bit}}
\end{pspicture}
\end{psfigure}


\end{document}



More information about the PSTricks mailing list