tkz 图表导致 vbox 问题

tkz 图表导致 vbox 问题

我如何停止下面的 vbox 不良现象,只有当我将图表比例设为 0.3cm 时它才会停止,我不希望它们那么小,我知道它不会在 WME 上显示,但在完整文档中,这是唯一影响它的图表。

    \documentclass[12pt, a4paper, twoside, openright,fleqn, leqno, draft, ]{book}

    \usepackage{tkz-euclide}            %Tkz-Euclide diagrams
    \usepackage{amsmath,amsthm,amssymb,cancel}                  %Math packages

    %Diagram environment
    \newenvironment{diagram}
    {%
    \par\addvspace{0pt}%
    \centering
    \stepcounter{CountDiag}
    \tkzSetUpCompass[lenth=1cm]
    \begin{tikzpicture}
    }{%
    \end{tikzpicture}\par
    \vspace{-20pt}
    Diagram~\theCountDiag\par
    \addvspace{0pt}
    }
%    \newcounter{CountDiag}\counterwithin*{CountDiag}.   {section}%
    \newcounter{CountDiag}\counterwithin*{CountDiag}{section}%

    \newcommand{\Tri}[8]{%%
    \tkzDefPoint(0,0){#1}%
    \tkzDefPoint({#2,#3}){#4}%
    \tkzDefPoint({#5,#6}){#7}%
    \tkzDrawPolygon[fill=#8](#1,#4,#7)%
    \tkzLabelPoint[left](#1){$#1$}% 
    \tkzLabelPoint[below](#4){$#4$}%
    \tkzLabelPoint[above](#7){$#7$}%
    \tkzDrawPoints(#1,#4,#7)%
    }

    \begin{document}

    \begin{diagram}[scale=0.7]
    \Tri{B}{3}{0}{C}{1.5}{3}{A}{none}
        \tkzDefPointOnLine[pos=2](A,B)          \tkzGetPoint{E}
        \tkzDefPointOnLine[pos=2](A,C)          \tkzGetPoint{D}
        \tkzDefPointOnLine[pos=1.5](A,B)            \tkzGetPoint{F}
        \tkzDefPointOnLine[pos=1.5](A,C)            \tkzGetPoint{G} 
         \tkzDrawPolygon(A,B,C)
         \tkzDrawSegment(A,E)
         \tkzDrawSegment(A,D)
        \tkzLabelPoints[left](E)
        \tkzLabelPoints[right](D)
        \tkzLabelPoints[left](F)
        \tkzLabelPoints[right](G)
        \tkzMarkSegment[mark=|](A,C)
        \tkzMarkSegment[mark=|](A,B)
        \tkzMarkAngle[size=0.5](A,C,B)
        \tkzMarkAngle[size=0.5](C,B,A)
        \tkzDrawPoints[fill=gray](A,B,C,D,E,F,G)
         \tkzDrawSegment[dashed](C,F)
     \end{tikzpicture}
    \hspace{0.3cm}
    \begin{tikzpicture}[scale=0.7]
       \Tri{B}{3}{0}{C}{1.5}{3}{A}{none}
       \tkzDefPointOnLine[pos=2](A,B)           \tkzGetPoint{E}
    \tkzDefPointOnLine[pos=2](A,C)      \tkzGetPoint{D}
        \tkzDefPointOnLine[pos=1.5](A,B)            \tkzGetPoint{F}
        \tkzDefPointOnLine[pos=1.5](A,C)            \tkzGetPoint{G} 
        \tkzDrawPolygon(A,B,C)
        \tkzDrawSegment(A,E)
        \tkzDrawSegment(A,D)
        \tkzLabelPoints[left](E)
        \tkzLabelPoints[right](D)
        \tkzLabelPoints[left](F)
        \tkzLabelPoints[right](G)       
        \tkzMarkSegment[mark=|](A,C)
        \tkzMarkSegment[mark=|](A,B)
        \tkzMarkAngle[size=0.5](A,C,B)
        \tkzMarkAngle[size=0.5](C,B,A)
        \tkzDrawSegment[dashed](B,G)
        \tkzDrawPoints[fill=gray](A,B,C,D,E,F,G)
    \end{tikzpicture}
    \hspace{0.3cm}
    \begin{tikzpicture}[scale=0.7]
       \Tri{B}{3}{0}{C}{1.5}{3}{A}{none}
          \tkzDefPointOnLine[pos=2](A,B)            \tkzGetPoint{E}
        \tkzDefPointOnLine[pos=2](A,C)          \tkzGetPoint{D}
        \tkzDefPointOnLine[pos=1.5](A,B)            \tkzGetPoint{F}
        \tkzDefPointOnLine[pos=1.5](A,C)            \tkzGetPoint{G} 
        \tkzDrawPolygon(A,B,C)
        \tkzDrawSegment(A,E)
        \tkzDrawSegment(A,D)
        \tkzLabelPoints[left](E)
        \tkzLabelPoints[right](D)
        \tkzLabelPoints[left](F)
        \tkzLabelPoints[right](G)       
        \tkzMarkSegment[mark=|](A,C)
        \tkzMarkSegment[mark=|](A,B)
        \tkzMarkAngle[size=0.5](A,C,B)
        \tkzMarkAngle[size=0.5](C,B,A)
        \tkzDrawSegment[dashed](B,G)
          \tkzDrawSegment[dashed](C,F)
        \tkzDrawPoints[fill=gray](A,B,C,D,E,F,G)
    \end{diagram}
    \end{document}

抱歉代码太长了,但是主要只是图表内容。

截屏:

结果

答案1

所示代码没有任何未满的垂直框,尽管它可能参与分页,从而产生未满的页面。(您可以简化示例,用 替换所有 tikz,因为\rule{5pt}{4cm}重要的是图表的垂直尺寸。)

您的问题的一个例子是

在此处输入图片描述

\documentclass[12pt, a4paper, twoside, openright,fleqn, leqno, draft, ]{book}

    \usepackage{tkz-euclide}            %Tkz-Euclide diagrams
    \usepackage{amsmath,amsthm,amssymb,cancel}                  %Math packages

    %Diagram environment
    \newenvironment{diagram}
    {%
    \par\addvspace{0pt}%
    \centering
    \stepcounter{CountDiag}
    \tkzSetUpCompass[lenth=1cm]
    \begin{tikzpicture}
    }{%
    \end{tikzpicture}\par
    \vspace{-20pt}
    Diagram~\theCountDiag\par
    \addvspace{0pt}
    }
%    \newcounter{CountDiag}\counterwithin*{CountDiag}.   {section}%
    \newcounter{CountDiag}\counterwithin*{CountDiag}{section}%

    \newcommand{\Tri}[8]{%%
    \tkzDefPoint(0,0){#1}%
    \tkzDefPoint({#2,#3}){#4}%
    \tkzDefPoint({#5,#6}){#7}%
    \tkzDrawPolygon[fill=#8](#1,#4,#7)%
    \tkzLabelPoint[left](#1){$#1$}% 
    \tkzLabelPoint[below](#4){$#4$}%
    \tkzLabelPoint[above](#7){$#7$}%
    \tkzDrawPoints(#1,#4,#7)%
    }

    \begin{document}

    \begin{diagram}[scale=0.7]
    \Tri{B}{3}{0}{C}{1.5}{3}{A}{none}
        \tkzDefPointOnLine[pos=2](A,B)          \tkzGetPoint{E}
        \tkzDefPointOnLine[pos=2](A,C)          \tkzGetPoint{D}
        \tkzDefPointOnLine[pos=1.5](A,B)            \tkzGetPoint{F}
        \tkzDefPointOnLine[pos=1.5](A,C)            \tkzGetPoint{G} 
         \tkzDrawPolygon(A,B,C)
         \tkzDrawSegment(A,E)
         \tkzDrawSegment(A,D)
        \tkzLabelPoints[left](E)
        \tkzLabelPoints[right](D)
        \tkzLabelPoints[left](F)
        \tkzLabelPoints[right](G)
        \tkzMarkSegment[mark=|](A,C)
        \tkzMarkSegment[mark=|](A,B)
        \tkzMarkAngle[size=0.5](A,C,B)
        \tkzMarkAngle[size=0.5](C,B,A)
        \tkzDrawPoints[fill=gray](A,B,C,D,E,F,G)
         \tkzDrawSegment[dashed](C,F)
     \end{tikzpicture}
    \hspace{0.3cm}
    \begin{tikzpicture}[scale=0.7]
       \Tri{B}{3}{0}{C}{1.5}{3}{A}{none}
       \tkzDefPointOnLine[pos=2](A,B)           \tkzGetPoint{E}
    \tkzDefPointOnLine[pos=2](A,C)      \tkzGetPoint{D}
        \tkzDefPointOnLine[pos=1.5](A,B)            \tkzGetPoint{F}
        \tkzDefPointOnLine[pos=1.5](A,C)            \tkzGetPoint{G} 
        \tkzDrawPolygon(A,B,C)
        \tkzDrawSegment(A,E)
        \tkzDrawSegment(A,D)
        \tkzLabelPoints[left](E)
        \tkzLabelPoints[right](D)
        \tkzLabelPoints[left](F)
        \tkzLabelPoints[right](G)       
        \tkzMarkSegment[mark=|](A,C)
        \tkzMarkSegment[mark=|](A,B)
        \tkzMarkAngle[size=0.5](A,C,B)
        \tkzMarkAngle[size=0.5](C,B,A)
        \tkzDrawSegment[dashed](B,G)
        \tkzDrawPoints[fill=gray](A,B,C,D,E,F,G)
    \end{tikzpicture}
    \hspace{0.3cm}
    \begin{tikzpicture}[scale=0.7]
       \Tri{B}{3}{0}{C}{1.5}{3}{A}{none}
          \tkzDefPointOnLine[pos=2](A,B)            \tkzGetPoint{E}
        \tkzDefPointOnLine[pos=2](A,C)          \tkzGetPoint{D}
        \tkzDefPointOnLine[pos=1.5](A,B)            \tkzGetPoint{F}
        \tkzDefPointOnLine[pos=1.5](A,C)            \tkzGetPoint{G} 
        \tkzDrawPolygon(A,B,C)
        \tkzDrawSegment(A,E)
        \tkzDrawSegment(A,D)
        \tkzLabelPoints[left](E)
        \tkzLabelPoints[right](D)
        \tkzLabelPoints[left](F)
        \tkzLabelPoints[right](G)       
        \tkzMarkSegment[mark=|](A,C)
        \tkzMarkSegment[mark=|](A,B)
        \tkzMarkAngle[size=0.5](A,C,B)
        \tkzMarkAngle[size=0.5](C,B,A)
        \tkzDrawSegment[dashed](B,G)
          \tkzDrawSegment[dashed](C,F)
        \tkzDrawPoints[fill=gray](A,B,C,D,E,F,G)
    \end{diagram}


    \section{aaaaaa}
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    \section{aaaaaa}
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    \section{aaaaaa}
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx    xxxx xxxx
    \end{document}

产生

Underfull \vbox (badness 4108) has occurred while \output is active

由于book类的默认值为\flushbottom但您不能在节标题后立即进行分页,所以整个节 0.3 必须转到下一页,然后就没有足够的灵活胶水或文本到达第 1 页的底部而不会过度拉伸白色空间,因此发出警告。

您可以编写更多文本来填充空间,或者\vfill在图表后添加以留出更多空白,或\clearpage在第 3 节之前使用以强制缩短页面。

相关内容