• Overfull \hbox (78.88861pt too wide) in paragraph

    From Jinsong Zhao@21:1/5 to All on Mon Mar 10 11:41:43 2025
    Hi there,

    I hope to use the vtop or vbox to typeset some codes:

    \documentclass{article}
    \begin{document}
    The \TeX{} way: \vtop{some codes here}
    \end{document}

    However, when compiling, LaTeX give the warning message:

    Overfull \hbox (78.88861pt too wide) in paragraph at lines 3--4

    In my case, \parbox or minipage environment could not be used.

    How to fix the warning? Thanks in advance.

    Best,
    Jinsong

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to Jinsong Zhao on Mon Mar 10 09:17:06 2025
    Jinsong Zhao <jszhao@yeah.net> wrote or quoted:
    The \TeX{} way: \vtop{some codes here}
    Overfull \hbox (78.88861pt too wide) in paragraph at lines 3--4

    Inside the "vtop" there's a paragraph that wraps to the current
    page width. That's way too wide! But we can nip that in the bud
    by first tucking the text into an "hbox".

    \documentclass{article}
    \begin{document}
    The \TeX{} way: \vtop{\hbox{some codes here}}
    \end{document}

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Flynn@21:1/5 to Stefan Ram on Mon Mar 10 12:15:00 2025
    On 10/03/2025 09:17, Stefan Ram wrote:
    Jinsong Zhao <jszhao@yeah.net> wrote or quoted:
    The \TeX{} way: \vtop{some codes here}
    Overfull \hbox (78.88861pt too wide) in paragraph at lines 3--4

    Inside the "vtop" there's a paragraph that wraps to the current
    page width. That's way too wide! But we can nip that in the bud
    by first tucking the text into an "hbox".

    \documentclass{article}
    \begin{document}
    The \TeX{} way: \vtop{\hbox{some codes here}}
    \end{document}

    Or you can set the desired width inside the \vtop, eg

    The \TeX{} way: \vtop{\hsize3cm some codes here}

    But it's hard to know because you don't say what you are trying to do.

    Peter

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jinsong Zhao@21:1/5 to Peter Flynn on Mon Mar 10 23:28:04 2025
    On 2025/3/10 20:15, Peter Flynn wrote:
    On 10/03/2025 09:17, Stefan Ram wrote:
    Jinsong Zhao <jszhao@yeah.net> wrote or quoted:
    The \TeX{} way: \vtop{some codes here}
    Overfull \hbox (78.88861pt too wide) in paragraph at lines 3--4

       Inside the "vtop" there's a paragraph that wraps to the current
       page width. That's way too wide! But we can nip that in the bud
       by first tucking the text into an "hbox".

    \documentclass{article}
    \begin{document}
    The \TeX{} way: \vtop{\hbox{some codes here}}
    \end{document}

    Or you can set the desired width inside the \vtop, eg

      The \TeX{} way: \vtop{\hsize3cm some codes here}

    But it's hard to know because you don't say what you are trying to do.

    Peter

    Thank you so much. Your solution is exactly what I need. I am trying to
    use a minted environment in the \vtop. Since minted environment could
    not be used in LR mode, so \hbox could not be used.

    Best,
    Jinsong

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)