[pstricks] pstricks Digest, Vol 62, Issue 4

Herbert Voss LaTeX at ZEDAT.FU-Berlin.DE
Mon Mar 10 12:47:09 CET 2008


In-Sung Cho schrieb:
> Can "in-text" expressions be cured too?

no, this is only possible with \makebox

Herbert





>
> Badly typeset:
> The sum of $\pi$ and $e$ is
> $\alpha\approx\,$\psPrintValue{Pi Euler add},
> and hence $0<\alpha-5<1$.
>
> Want to typeset without \hspace or \makebox:
> The sum of $\pi$ and $e$ is
> $\alpha\approx\,$\makebox[3.15em][l]{\psPrintValue{Pi Euler add}},
> and hence $0<\alpha-5<1$.
>
> In-Sung
>
> 2008/3/6, pstricks-request at tug.org <pstricks-request at tug.org>:
>> Send pstricks mailing list submissions to
>>        pstricks at tug.org
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>        http://tug.org/mailman/listinfo/pstricks
>> or, via email, send a message with subject or body 'help' to
>>        pstricks-request at tug.org
>>
>> You can reach the person managing the list at
>>        pstricks-owner at tug.org
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of pstricks digest..."
>>
>>
>> Today's Topics:
>>
>>   1. psPrintValue (Poul Riis)
>>   2. Re: psPrintValue (Poul Riis)
>>   3. Re: psPrintValue (Herbert Voss)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Wed, 05 Mar 2008 18:22:52 +0100
>> From: "Poul Riis" <Poul.Riis at skolekom.dk>
>> Subject: [pstricks] psPrintValue
>> To: pstricks at tug.org
>> Message-ID: <fc.000f47bd2b5b43b0000f47bd2b5b43b0.2b5b50c3 at skolekom.dk>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> The example below works fine but more generally, I want to be able to
>> put
>> some text (for instance a unit) after psPrintValue without manual
>> adjustment with \hspace{}. How can I do that?
>> Furthermore, sometimes (mostoften if some of the parameters have
>> subscripts) I would like to align the equals signs in such a list of
>> parameter values. Is that possible?
>>
>> Yours,
>> Poul Riis
>>
>>
>> \documentclass{article}
>> \usepackage{amsmath,amssymb}
>> \usepackage{helvet,mathptmx}
>> \usepackage[T1]{fontenc}
>> \usepackage[latin1]{inputenc}
>> \usepackage[danish]{babel}
>> \usepackage[svgnames,x11names]{xcolor}
>> \usepackage{pst-func}
>> \usepackage{pstricks-add}
>>
>> \begin{document}
>> \begin{center}
>> \psset{xunit=4cm,yunit=10cm}
>> \begin{pspicture}(-1.85,0)(1.85,1.05)
>> \psaxes[ticksize=-3pt 0,Dx=0.2,Dy=0.1]{->}(0,0)(-1.85,0)(1.85,1.05)
>> \pstVerb{/pi 3.14159265 def /aa 0.0025 def /lambda 0.00006328 def /kk pi
>> aa mul lambda div def /LL 50 def}%%%% Everything in cm
>> \psplot[linecolor=red,plotpoints=200]{-1.8}{1.8}{x dup mul LL dup mul
>> add
>> sqrt x exch div kk mul /alpha exch def alpha pi div 360 mul sin alpha
>> div
>> dup mul x LL div dup mul 1 add div 4 div}
>> \uput{0pt}[0](1.0,0.95){$\lambda=$\psPrintValue{lambda 10000 mul 1000
>> mul}\hspace{2.5em}nm}
>> \uput{0pt}[0](1.0,0.90){$a=$\psPrintValue{aa 10 mul}\hspace{2.5em}mm}
>> \uput{0pt}[0](1.0,0.85){$L=$\psPrintValue{LL}\hspace{1.2em}cm}
>> \uput{7pt}[90](1.7,0){$x$ /cm}
>> \uput{9mm}[180]{90}(0,0.85){Intensity (arbitrary units)}
>> \end{pspicture}
>> \end{center}
>> \end{document}
>>
>>
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Wed, 05 Mar 2008 20:24:15 +0100
>> From: "Poul Riis" <Poul.Riis at skolekom.dk>
>> Subject: Re: [pstricks] psPrintValue
>> To: "Graphics with PSTricks" <pstricks at tug.org>
>> Message-ID: <fc.000f47bd2b5be41c000f47bd2b5b43b0.2b5be687 at skolekom.dk>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> I'd better correct some stupid errors in the example....
>>
>> Yours,
>> Poul Riis
>>
>>
>> \documentclass{article}
>> \usepackage{amsmath,amssymb}
>> \usepackage{helvet,mathptmx}
>> \usepackage[T1]{fontenc}
>> \usepackage[latin1]{inputenc}
>> \usepackage[danish]{babel}
>> \usepackage[svgnames,x11names]{xcolor}
>> \usepackage{pst-func}
>> \usepackage{pstricks-add}
>>
>> \begin{document}
>> \begin{center}
>> \psset{xunit=4cm,yunit=10cm}
>> \begin{pspicture}(-1.85,0)(1.85,1.05)
>> \psaxes[ticksize=-3pt 0,Dx=0.2,Dy=0.1]{->}(0,0)(-1.85,0)(1.85,1.05)
>> \pstVerb{/pi 3.14159265 def /aa 0.0025 def /lambda 0.00006328 def /kk pi
>> aa mul lambda div def /LL 50 def}%%%% Everything in cm
>> \psplot[linecolor=red,plotpoints=200]{-1.8}{1.8}{x dup mul LL dup mul
>> add
>> sqrt x exch div kk mul /alpha exch def alpha pi div 180 mul sin alpha
>> div
>> dup mul x LL div dup mul 1 add div}
>> \uput{0pt}[0](1.0,0.95){$\lambda=$\psPrintValue{lambda 10000 mul 1000
>> mul}\hspace{2.5em}nm}
>> \uput{0pt}[0](1.0,0.90){$a=$\psPrintValue{aa 10 mul}\hspace{2.5em}mm}
>> \uput{0pt}[0](1.0,0.85){$L=$\psPrintValue{LL}\hspace{1.2em}cm}
>> \uput{7pt}[90](1.7,0){$x$ /cm}
>> \uput{9mm}[180]{90}(0,0.85){Intensity (arbitrary units)}
>> \end{pspicture}
>> \end{center}
>> \end{document}
>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 3
>> Date: Thu, 6 Mar 2008 09:51:28 +0100 (CET)
>> From: "Herbert Voss" <LaTeX at ZEDAT.FU-Berlin.DE>
>> Subject: Re: [pstricks] psPrintValue
>> To: "Graphics with PSTricks" <pstricks at tug.org>
>> Message-ID:
>>        <49267.141.35.111.32.1204793488.webmail at portal.zedat.fu-berlin.de>
>> Content-Type: text/plain;charset=iso-8859-1
>>
>> Poul Riis schrieb:
>> > I'd better correct some stupid errors in the example....
>>
>> there are now the optional arguments valUnit= and valUnitSep=...
>>
>> \documentclass{article}
>> \usepackage{amsmath,amssymb}
>> \usepackage{helvet,mathptmx}
>> \usepackage[T1]{fontenc}
>> \usepackage[latin1]{inputenc}
>> \usepackage[danish]{babel}
>> \usepackage[svgnames,x11names]{xcolor}
>> \usepackage{pst-func}
>> \usepackage{pstricks-add}
>>
>> \makeatletter
>> \define at key[psset]{pst-func}{valUnit}{\def\psk at valunit{#1}}
>> \define at key[psset]{pst-func}{valUnitSep}{\pst at getlength{#1}\pst at valUnitSep
>> }
>> \psset[pst-func]{PSfont=Times-Roman,fontscale=10,valuewidth=10,
>>        valUnit={},valUnitSep=2pt}% unit and sep between value and unit
>> %
>> \def\psPrintValue{\pst at object{psPrintValue}}
>> \def\psPrintValue at i#1{%
>>  \begin at SpecialObj
>>  \addto at pscode{
>>     gsave \psk at PSfont findfont \psk at fontscale scalefont setfont
>>     #1 \psk at valuewidth string cvs 0 0 moveto show
>>        \pst at valUnitSep\space 0 rmoveto(\psk at valunit) show grestore
>>  }%
>>  \end at SpecialObj%
>> }\makeatother
>>
>> \begin{document}
>> \begin{center}
>> \psset{xunit=4cm,yunit=10cm}
>> \begin{pspicture}(-1.85,0)(1.85,1.05)
>> \psaxes[ticksize=-3pt 0,Dx=0.2,Dy=0.1]{->}(0,0)(-1.85,0)(1.85,1.05)
>> \pstVerb{/pi 3.14159265 def /aa 0.0025 def /lambda 0.00006328 def /kk pi
>>        aa mul lambda div def /LL 50 def}%%%% Everything in cm
>> \psplot[linecolor=red,plotpoints=200,linewidth=1.5pt]{-1.8}{1.8}{
>>        x dup mul LL dup mul add
>>        sqrt x exch div kk mul /alpha exch def alpha RadtoDeg sin alpha
>> div
>>        dup mul x LL div dup mul 1 add div}
>> \uput{0pt}[0](1.0,0.95){$\lambda=$%
>>        \psPrintValue[valUnit=nm]{lambda 10000 mul 1000 mul}}
>> \uput{0pt}[0](1.0,0.90){$a=$\psPrintValue[valUnit=mm]{aa 10 mul}}
>> \uput{0pt}[0](1.0,0.85){$L=$\psPrintValue[valUnit=cm]{LL}}
>> \uput{7pt}[90](1.7,0){$x$ /cm}
>> \uput{9mm}[180]{90}(0,0.85){Intensity (arbitrary units)}
>> \end{pspicture}
>> \end{center}
>> \end{document}
>>
>>
>> Herbert
>>
>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> pstricks mailing list
>> pstricks at tug.org
>> http://tug.org/mailman/listinfo/pstricks
>>
>>
>> End of pstricks Digest, Vol 62, Issue 4
>> ***************************************
>>
> _______________________________________________
> pstricks mailing list
> pstricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
>


Herbert




More information about the PSTricks mailing list