pst-circ:图形和标题重叠

pst-circ:图形和标题重叠

我正在写一篇论文,需要解决这个问题。我刚开始使用它pst-circ作为替代方案cirtuitikz(在我看来它有更好的文档),但我有点被标题与电路部分重叠所困扰。

我不知道是否应该使用\vspace{something},但我正在寻找更干净的解决方案(如果可能的话)。我不确定我是否使用了正确的封装。也许我也应该使用 minipage。

在此处输入图片描述

我使用了以下代码:

\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}

(忽略标题内的文字:它根本没有任何意义,因为这只是从文档的另一部分截断的复制粘贴)

我不确定这是否真的是一个pst-circ问题:它可能是一个常规的图形问题(尽管使用外部 PNG / PDF 文件作为源我从未遇到过这种情况),可能是因为尺寸已指定且已知。

我将其封装在一个图形之间,因为我想为其添加一些标题。

有什么建议么?

答案1

您可以使用shift=选项来pspicture更改基线(默认设置在框的底部):

\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}

在此处输入图片描述

顺便提一下,我使用了\centering而不是center环境来避免添加额外的不需要的垂直间距。

答案2

贡萨洛的回答确实有效,但我建议您总体上采取不同的方法。

环境的一般语法pspicture

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

但正如您所演示的,您可以关闭它(xmin,ymin),它将默认为(0,0)。这会将给定大小的单个框放入文档中。绘图本身将通过 postscript 完成。

如果你使用\psgrid

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

然后你得到

在此处输入图片描述

其中突出了一些事情

  • ymin显然不够小
  • ymax太大了

因此,一个解决方案是使用

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

这使

在此处输入图片描述

这似乎更接近你想要的。现在你已经完成了构建,你可以删除\psgrid

以下是完整的 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}

相关内容