Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve large-enough overfull hboxes #1210

Merged
merged 2 commits into from
Dec 26, 2023

Conversation

muzimuzhi
Copy link
Member

@muzimuzhi muzimuzhi commented Oct 21, 2022

Motivation for this change

Resolve large overfull hboxes that will exceed beyond the page and add some sort of monitor to workflow doc.yml.

  • Main body has h-margin * h-part:(L,W,R)=(64.01869pt, 469.47049pt, 64.01869pt).

Fixes #1208

List of all the overfull hboxes >=10pt

Before: pgfmanual 3.1.10
After: pgfmanual from https://github.com/pgf-tikz/pgf/actions/runs/7294523405

Remaining small overfull boxes

Copied from annotations of https://github.com/pgf-tikz/pgf/actions/runs/7294523405

Overfull \hbox (7.2846pt too wide) in paragraph at lines 471--471
Overfull \hbox (2.65257pt too wide) in paragraph at lines 526--526
Overfull \hbox (1.54848pt too wide) in paragraph at lines 526--526
Overfull \hbox (2.07652pt too wide) in paragraph at lines 526--526
Overfull \hbox (1.26045pt too wide) in paragraph at lines 526--526
Overfull \hbox (11.46152pt too wide) in paragraph at lines 2666--2670
Overfull \hbox (9.64151pt too wide) in paragraph at lines 81--106

Checklist

Please signoff your commits to explicitly state your agreement to the Developer Certificate of Origin. If that is not possible you may check the boxes below instead:

@muzimuzhi
Copy link
Member Author

muzimuzhi commented Oct 21, 2022

TODOs and Discussions

  • Add changelog entry
  • Replace texloganalyser with grep or awk?
    • Replaced with a simple grep -r '^Overfull \\hbox' build/doc/pgfmanual.log.
  • Setting an error message, instead of a warning message, when large-enough (e.g., >=60pt) overfull hbox is detected?
  • Allow linebreak at space in inline verbatim?
    • This will automatically solve two remaining large overfull hboxes, and maybe more in the future.
    • See https://tex.stackexchange.com/q/14342 for possible solutions. \Verb[breaklines=true]|...| from fancyvrb package surely works but might slow down manual building. \def\@xobeysp{ } seems to work but I haven't looked closely enough.

@Mo-Gul
Copy link
Contributor

Mo-Gul commented Oct 21, 2022

A possible fix for pgfmanual-en-tikz-transparency is

\begin{codeexample}[]
\begin{tikzpicture}
  \shade [left color=red,right color=blue] (-2,-1) rectangle (2,1);
  \begin{scope}[transparency group=knockout]
    \fill [white] (-1.9,-.9) rectangle (1.9,.9);
    \node [opacity=0,
           font=\fontencoding{T1}\fontfamily{ptm}\fontsize{45}{45}\bfseries]
          {Ti\emph{k}Z};
  \end{scope}
\end{tikzpicture}
\end{codeexample}

and a possible fix for pgfmanual-en-library-automata (notice: your reference is one codeexample too low) is

\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,automata,positioning,shadows}}]
\begin{tikzpicture}[
    shorten >=1pt,node distance=2cm,on grid,>={Stealth[round]},thick,
    every state/.style={fill,draw=none,orange,text=white,circular drop shadow},
    accepting/.style  ={green!50!black,text=white},
    initial/.style    ={red,text=white},
]
  \node[state,initial]  (q_0)                      {$q_0$};
  \node[state]          (q_1) [above right=of q_0] {$q_1$};
  \node[state]          (q_2) [below right=of q_0] {$q_2$};
  \node[state,accepting](q_3) [below right=of q_1] {$q_3$};

  \path[->] (q_0) edge              node [above left]  {0} (q_1)
                  edge              node [below left]  {1} (q_2)
            (q_1) edge              node [above right] {1} (q_3)
                  edge [loop above] node               {0} ()
            (q_2) edge              node [below right] {0} (q_3)
                  edge [loop below] node               {1} ();
\end{tikzpicture}
\end{codeexample}

@muzimuzhi
Copy link
Member Author

A possible fix for pgfmanual-en-tikz-transparency is

% [...]
    \node [opacity=0,
           font=\fontencoding{T1}\fontfamily{ptm}\fontsize{45}{45}\bfseries]
          {Ti\emph{k}Z};
% [...]

@Mo-Gul I've considered \usefont then gave up. Partly because I thought that amount of overfull is not unacceptable. Of course if one takes pgfmanual as an art or masterpiece then... .

and a possible fix for pgfmanual-en-library-automata (notice: your reference is one codeexample too low) is

Edited, thank you.

@muzimuzhi muzimuzhi force-pushed the docs-overfull-hbox branch 2 times, most recently from 0e1d82a to 53a1f85 Compare October 21, 2022 05:16
@muzimuzhi muzimuzhi force-pushed the docs-overfull-hbox branch 2 times, most recently from 2304285 to ff50e4f Compare December 21, 2023 20:11
@muzimuzhi muzimuzhi mentioned this pull request Dec 21, 2023
2 tasks
@muzimuzhi muzimuzhi marked this pull request as ready for review December 21, 2023 23:33
@muzimuzhi
Copy link
Member Author

muzimuzhi commented Dec 21, 2023

All overfull hboxes >= 20pt are addressed now.

Screenshots in the first comment #1210 (comment) are not updated yet.

@Mo-Gul Your suggestion in #1210 (comment) is applied. thanks

@muzimuzhi
Copy link
Member Author

muzimuzhi commented Dec 21, 2023

A notice annotation containing "Overfull \hbox ..." log lines can be found on workflow run pages (of workflow doc.yml), for example https://github.com/pgf-tikz/pgf/actions/runs/7294270657.

image

texlogsieve (first mentioned in #1300 (comment)) can give more info, which helps in addressing problems in PDF and tex source, but (to me) it is too loose as a workflow run annotation and lacks the ability to only filter out underfull boxes.

texlogsieve --only-summary pgfmanual.log output (only partial)

Under/overfull boxes:
    page 347 (file ./pgfmanual-en-tikz-plots.tex):
    Underfull \hbox (badness 10000) in paragraph at lines 461--461
    Offending text:
    [][][][][][][] [][][][][][] [][][][][][]\TU/lmtt/m/n/8 [[][][][][][]=[][][][][][],[][][][][][]=[]\TU/lmtt/m/it/8 3[]\TU/lmtt/m/n/8 ,[][][][][][]] []file[] {[]plots/pgfmanual-

    page 347 (file ./pgfmanual-en-tikz-plots.tex):
    Overfull \hbox (7.2846pt too wide) in paragraph at lines 471--471
    Offending text:
    [][][][][][][] [][][][][][] [][][][][][]\TU/lmtt/m/n/8 [[][][][][][]=[][][][][][],[][][][][][]=[]\TU/lmtt/m/it/8 3[]\TU/lmtt/m/n/8 ,[][][][][][]=[]\TU/lmtt/m/it/8 6[]\TU/lmtt/m/n/8 ,[][][][][][]] []file[] {[]plots/pgfmanual-

    page 350 (file ./pgfmanual-en-tikz-plots.tex):
    Underfull \hbox (badness 10000) in paragraph at lines 666--666
    Offending text:
    [][][][][][][][][][][][][]\TU/lmtt/m/n/8 [[][][][][][]] [][][][][][][[][][][][][],[][][][][][],[][][][][][]=[]\TU/lmtt/m/it/8 *[]\TU/lmtt/m/n/8 ] []file[]{[]plots/pgfmanual-

    page 350 (file ./pgfmanual-en-tikz-plots.tex):
    Underfull \hbox (badness 10000) in paragraph at lines 707--707
    Offending text:
    [][][][][][][][][][][][][]\TU/lmtt/m/n/8 [[][][][][][]=[]\TU/lmtt/m/it/8 blue[]\TU/lmtt/m/n/8 ,[][][][][][]=[]\TU/lmtt/m/it/8 blue!60!black[]\TU/lmtt/m/n/8 ] [][][][][][][[][][][][][]] []file[]{[]plots/pgfmanual-

    page 736 (file ./pgfmanual-en-library-patterns.tex):
    Overfull \hbox (2.65257pt too wide) in paragraph at lines 526--526
    Offending text:
    [] [][][][][][]\TU/lmtt/m/n/8 [[][][][][][]=[]\TU/lmtt/m/it/8 mystars[]\TU/lmtt/m/n/8 ,[][][][][][]=[]\TU/lmtt/m/it/8 blue[]\TU/lmtt/m/n/8 ]               [](0,0)[] [][][][][][] []+[][](2,2)[];[]

    page 736 (file ./pgfmanual-en-library-patterns.tex):
    Overfull \hbox (1.54848pt too wide) in paragraph at lines 526--526
    Offending text:
    [] [][][][][][]\TU/lmtt/m/n/8 [[][][][][][]=[]\TU/lmtt/m/it/8 {mystars[[][][][][][]=[]7[],[][][][][][]=[]15pt[]]}[]\TU/lmtt/m/n/8 ]       [](2,0)[] [][][][][][] []+[][](2,2)[];[]

    page 736 (file ./pgfmanual-en-library-patterns.tex):
    Overfull \hbox (2.07652pt too wide) in paragraph at lines 526--526
    Offending text:
    [] [][][][][][]\TU/lmtt/m/n/8 [[][][][][][]=[]\TU/lmtt/m/it/8 {mystars[[][][][][][]=[]45[]]}[]\TU/lmtt/m/n/8 ,[][][][][][]=[]\TU/lmtt/m/it/8 red[]\TU/lmtt/m/n/8 ]   [](0,2)[] [][][][][][] []+[][](2,2)[];[]

    page 736 (file ./pgfmanual-en-library-patterns.tex):
    Overfull \hbox (1.26045pt too wide) in paragraph at lines 526--526
    Offending text:
    [] [][][][][][]\TU/lmtt/m/n/8 [[][][][][][]=[]\TU/lmtt/m/it/8 {mystars[[][][][][][]=[]30[],[][][][][][]=[]4[],[][][][][][]=[]5pt[]]}[]\TU/lmtt/m/n/8 ] [](2,2)[] [][][][][][] []+[][](2,2)[];[]

    page 905 (file ./pgfmanual-en-dv-axes.tex):
    Overfull \hbox (11.46152pt too wide) in paragraph at lines 2666--2670
    Offending text:
    \TU/lmr/m/n/10 The []\TU/lmtt/m/n/10 datavisualization \TU/lmr/m/n/10 li-brary comes with a num-ber of pre-de-fined axis sys-tems, like []\TU/lmtt/m/n/10 scientific axes=clean\TU/lmr/m/n/10 ,

    page 958 (file ./pgfmanual-en-dv-stylesheets.tex):
    Underfull \hbox (badness 10000) in paragraph at lines 3761--3765
    Offending text:
     []

    page 1022 (file ./pgfmanual-en-module-parser.tex):
    Overfull \hbox (9.64151pt too wide) in paragraph at lines 81--106
    Offending text:
    []\TU/lmtt/m/n/10 {myparser}[]{initial}[]{\meaning\bgroup}[]{foo}\TU/lmr/m/n/10 , and one might pre-fer to use []\TU/lmtt/m/n/10 \pgfparserdef[]{myparser}

Therefore for now and for workflow run annotation purpose, I think the current grep way is enough.

@muzimuzhi
Copy link
Member Author

Screenshots in the first comment #1210 (comment) are not updated yet.

Updated now.

and upload a second artifact containing pdf and all aux files

Signed-off-by: Yukai Chou <[email protected]>
@muzimuzhi muzimuzhi merged commit 14ef7f3 into pgf-tikz:master Dec 26, 2023
3 checks passed
@muzimuzhi muzimuzhi deleted the docs-overfull-hbox branch December 26, 2023 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

figure overflow in pdf manual
3 participants