Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm writing a thesis and need to get this problem solved. I just started to use pst-circ as an alternative to cirtuitikz (seemed to me like it has better documentation), however I'm kinda stuck with the caption overlapping partially the circuit.

I don't know if I should use \vspace{something}, but I was looking for a cleaner solution (if possible). I'm not really sure I used the correct encapsulation. Maybe I should use a minipage as well.

enter image description here

I used the following code:

\begin{figure}[H]
\begin{center}
\begin{pspicture}[showgrid=false](9,8)
    \Cnode(0,0){P1} \psdot(P1) \nput[labelsep=0.25]{180}{P1}{R}
    \Cnode(9,0){P2} \psdot(P2) \nput[labelsep=0.25]{0}{P2}{S}   
    \pnode(4,0){C}

    \multidipole(P1)(C)
        \coil{$L$}      
        \capacitor{$C$}.

    \multidipole(P2)(C)
        \coil{$L$}      
        \capacitor{$C$}.
\end{pspicture}

    \caption{Filtre LC simple en configuration étoile}
    \label{filtre_lc_etoile_simple}
\end{center}
\end{figure}

(ignore the text inside the caption: it doesn't make any sense at all, since this is just a truncated copy-paste from another part of the document)

I'm not sure this is really a pst-circ problem: it may be a regular figure problem (though using external PNG / PDF files as source I never got this behaviour), maybe because dimensions where specified and known.

I encapsulated between a figure because I wanted to add some caption to it.

Any suggestions?

share|improve this question

2 Answers 2

Gonzalo's answer certainly works, however I would recommend that, in general, you take a different approach.

The general syntax for the pspicture environment is

\begin{pspicture}(xmin,ymin)(xmax,ymax)

but as you've demonstrated, you can leave off (xmin,ymin) and it will default to (0,0). This puts a single box of the given size in the document. The drawing itself will be done by postscript.

If you use \psgrid

\begin{pspicture}(9,8)
\psgrid
...

then you get

enter image description here

which highlights a few things

  • ymin is clearly not small enough
  • ymax is far too big

So, one solution is to use

\begin{pspicture}(-1,-1)(10,1)
\psgrid

which gives

enter image description here

and this seems a bit closer to what you want. Now that you're done constructing, you can remove \psgrid

Here's a complete MWE

\documentclass{article}
\usepackage{pst-circ}

\begin{document}

\begin{figure}[H]
\centering
\begin{pspicture}(-1,-1)(10,1)
    \psgrid
    \Cnode(0,0){P1} \psdot(P1) \nput[labelsep=0.25]{180}{P1}{R}
    \Cnode(9,0){P2} \psdot(P2) \nput[labelsep=0.25]{0}{P2}{S}   
    \pnode(4,0){C}

    \multidipole(P1)(C)
        \coil{$L$}      
        \capacitor{$C$}.

    \multidipole(P2)(C)
        \coil{$L$}      
        \capacitor{$C$}.
\end{pspicture}

    \caption{Filtre LC simple en configuration étoile}
    \label{filtre_lc_etoile_simple}
\end{figure}

\end{document}
share|improve this answer
    
Thank you for your answer. I was hoping there was something which could be done automatically by latex, however your solution is not complicated either. Thanks again. –  user51166 Apr 22 '12 at 8:05

You can use the shift= option for pspicture to change the baseline (default is set at the bottom of the box):

\documentclass{article}
\usepackage{pst-circ}

\begin{document}

\begin{figure}[H]
\centering
\begin{pspicture}[shift=0.5](9,8)
    \Cnode(0,0){P1} \psdot(P1) \nput[labelsep=0.25]{180}{P1}{R}
    \Cnode(9,0){P2} \psdot(P2) \nput[labelsep=0.25]{0}{P2}{S}   
    \pnode(4,0){C}

    \multidipole(P1)(C)
        \coil{$L$}      
        \capacitor{$C$}.

    \multidipole(P2)(C)
        \coil{$L$}      
        \capacitor{$C$}.
\end{pspicture}

    \caption{Filtre LC simple en configuration étoile}
    \label{filtre_lc_etoile_simple}
\end{figure}

\end{document}

enter image description here

On a side note, I used \centering instead of the center environment to avoid adding extra undesired vertical spacing.

share|improve this answer
    
Seems a good and easy solution. Sorry for my delayed reply ;) –  user51166 Apr 22 '12 at 8:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.