表格与图片

表格与图片

我的表格和图片好像有冲突。

    \documentclass[12pt]{book} % Default font size 
\usepackage{pstricks-add} % for geogebra
\usepackage{tabularx,array,booktabs} % for stretching tables to page width
\newcolumntype{Y}{>{\centering\arraybackslash}X} % for centering tables in tabularx

\begin{document}


Default text
\begin{table}[H]
\begin{tabularx}{\textwidth}{p{0.1cm} Y p{0.1 cm} Y}
\psset{xunit=1.0cm,yunit=1.0cm,algebraic=true,dimen=middle,dotstyle=o,dotsize=3pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\begin{pspicture*}(-4.49277492614,-2.44717671372)(7.46425421908,7.2627555749)
\pspolygon[linecolor=black,fillcolor=white,fillstyle=solid,opacity=0.1](-1.75090444974,2.39748164685)(0.33126786693,2.39748164685)(0.33126786693,4.47965396351)(-1.75090444974,4.47965396351)
\psline[linecolor=black](-1.75090444974,2.39748164685)(0.33126786693,2.39748164685)
\psline[linecolor=black](0.33126786693,2.39748164685)(0.33126786693,4.47965396351)
\psline[linecolor=black](0.33126786693,4.47965396351)(-1.75090444974,4.47965396351)
\psline[linecolor=black](-1.75090444974,4.47965396351)(-1.75090444974,2.39748164685)
\psline{<->}(-2.1,4.48)(-2.1,2.4)
\psline{<->}(-1.75,2.01)(0.33,2.01)
\rput[tl](-2.90537622928,3.55195342639){3 cm}
\rput[tl](-0.967512885051,1.88209245955){3 cm}
\end{pspicture*} & (b) &  \\
(c) & & (d) &  \\
(e) & & (f) &  \\
\end{tabularx}
\end{table}
\end{document}

在此处输入图片描述

我只是想让它成为:

在此处输入图片描述

谢谢。

答案1

您忘记了一个“&”符号。

这就像你想要的吗?我使用了更简单的代码,使用pst-node。但是没有更改十一位小数(!)坐标。我真的不明白为什么\pspolygon(也可能是\psframe)在这里:\documentclass[12pt, x11names, pdf]{book} % 默认字体大小 \usepackage{pstricks-add} % 用于 geogebra \usepackage{tabularx,array,booktabs} % 用于将表格拉伸至页面宽度 \renewcommand{\tabularxcolumn}1{>{\centering\arraybackslash}m{#1}}

\begin{document}

Default text
\begin{table}[H]
    \psset{algebraic=true,dimen=middle,dotstyle=o,dotsize=3pt 0,arrowsize=3pt 2,arrowinset=0.25, shortput=nab}
    \begin{tabularx}{\linewidth}{c X c X}
        (a)
        &
        \begin{pspicture}(-4.49277492614,-2.44717671372)(7.46425421908,7.2627555749)
        \pnodes{A}(-1.75090444974,2.39748164685)(0.33126786693,2.39748164685)(0.33126786693,4.47965396351)(-1.75090444974,4.47965396351)
        \pspolygon[fillcolor=OliveDrab1!20!,fillstyle=solid](A0)(A1)(A2)(A3)
        \psframe[linecolor=DarkSeaGreen4, linewidth=2pt](A0)(A2)
        \psset{offset=-8pt, arrows = |<->|}
        \ncline{A0}{A1}_{3\,cm}
        \ncline{A3}{A0}_{3\,cm}
        \end{pspicture}
        & (b) &
        \begin{pspicture*}(-4.49277492614,-2.44717671372)(7.46425421908,7.2627555749)
        \pnodes{A}(-1.75090444974,2.39748164685)(0.33126786693,2.39748164685)(0.33126786693,4.47965396351)(-1.75090444974,4.47965396351)
        \pspolygon[fillcolor=Thistle2!30!,fillstyle=solid](A0)(A1)(A2)(A3)
        \psframe[linecolor=DeepSkyBlue4, linewidth=2pt](A0)(A2)
        \psset{offset=-8pt, arrows = |<->|}
        \ncline{A0}{A1}_{3\,cm}
        \ncline{A3}{A0}_{3\,cm}
        \end{pspicture*}\\
        (c) & & (d) & \\
        (e) & & (f) &
    \end{tabularx}
\end{table}

\end{document} 

在此处输入图片描述

相关内容