2

Per default all fibers in diagrams drawn using pst-optexp appear to be black, except when setting the color explicitly, as shown with the example

\begin{pspicture}(18,6)
    \psset[optexp]{fiber=none, usefiberstyle}
    %\newpsstyle{Fiber}{linecolor=orange, linewidth=2\pslinewidth}
    \newpsstyle{Fiber}{linewidth=2\pslinewidth}
    \pnodes(1.5, 4){LaserIn}(2, 4){LaserOut}
    \pnodes(1.5, 2){SESAMIn}(2, 2){SESAMOut}
    \pnodes(4, 4){InputIsolatorIn}(5, 4){InputIsolatorOut}
    \pnodes(6.5, 2){PolarizerIn}(7.5, 2){PolarizerOut}
    \pnodes(9, 4){TSFIn}(11, 4){TSFOut}
    \pnodes(14, 3){LoopIn}(14, 2){LoopOut}
    \pnodes(10, 1){OutputIsolatorIn}(12,1){OutputIsolatorOut}
    \pnodes(16, 1){LaserOutLow}
    \optdiode[compname=PumpDiode, position=start](LaserIn)(LaserOut){\begin{tabular}{@{}c@{}}Laser\\diode\end{tabular}}
    \optisolator[compname=InputIsolator](InputIsolatorIn)(InputIsolatorOut){Pump Isolator}
    \optfiber[compname=ActiveFiber, position=start, linecolor=red](TSFIn)(TSFOut){Active fiber}
    
    \nput{75}{LaserOutLow}{Laser output}
    
    \drawfiber{InputIsolator}{ActiveFiber}
    \drawfiber{PumpDiode}{InputIsolator}
    \drawfiber{ActiveFiber}(LaserOutLow)
\end{pspicture}

which results in enter image description here On the other hand, when removing the comment in line three, I will get enter image description here where the entire fiber is colored orange, even though I explicitly set the fiber color of the active fiber. Therefore, I assume that the global setting will always override the local setting for the fiber color. Is that correct? Or can I still use a global fiber color and override it locally?

1 Answer 1

2

In general usefiberstyle=false should allow you to use a local style. However, it seems that \optfiber is special with this respect. But you can use addtoFiber to change the fiber line style locally, or newFiber to override it:

\optfiber[compname=ActiveFiber, position=start, addtoFiber={linecolor=red}](TSFIn)(TSFOut){Active fiber}

The full example:

\documentclass{standalone}
\usepackage{pst-optexp}
\begin{document}
\begin{pspicture}(18,6)
    \psset[optexp]{fiber=none}
    \newpsstyle{Fiber}{linecolor=orange, linewidth=2\pslinewidth}
    \pnodes(1.5, 4){LaserIn}(2, 4){LaserOut}
    \pnodes(1.5, 2){SESAMIn}(2, 2){SESAMOut}
    \pnodes(4, 4){InputIsolatorIn}(5, 4){InputIsolatorOut}
    \pnodes(6.5, 2){PolarizerIn}(7.5, 2){PolarizerOut}
    \pnodes(9, 4){TSFIn}(11, 4){TSFOut}
    \pnodes(14, 3){LoopIn}(14, 2){LoopOut}
    \pnodes(10, 1){OutputIsolatorIn}(12,1){OutputIsolatorOut}
    \pnodes(16, 1){LaserOutLow}
    \optdiode[compname=PumpDiode, position=start](LaserIn)(LaserOut){\begin{tabular}{@{}c@{}}Laser\\diode\end{tabular}}
    \optisolator[compname=InputIsolator](InputIsolatorIn)(InputIsolatorOut){Pump Isolator}
    \optfiber[compname=ActiveFiber, position=start, addtoFiber={linecolor=red}](TSFIn)(TSFOut){Active fiber}
    
    \nput{75}{LaserOutLow}{Laser output}
    
    \drawfiber{InputIsolator}{ActiveFiber}
    \drawfiber{PumpDiode}{InputIsolator}
    \drawfiber{ActiveFiber}(LaserOutLow)
\end{pspicture}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .