【问题标题】:How to fix "Underfull \hbox (badness 10000)" warning?如何修复“Underfull \hbox (badness 10000)”警告?
【发布时间】:2020-09-28 17:50:13
【问题描述】:

我有这个小的 .tex 文件。

\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{titling}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{tikz}


\setlength{\droptitle}{-3.5cm}
\setlength{\parindent}{0cm}
\newcommand{\squad}{\hspace{0.5em}}

\author{vladgovor77771}
\title{Some article}

\begin{document}
\maketitle

\textbf{Task 1} \newline
Task description: \newline

\end{document}

编译时会提示行

\textbf{Task 1} \newline

带有以下信息:

“未满 \hbox (badness 10000)”。

我该如何解决这个问题?

【问题讨论】:

标签: latex tex pdflatex


【解决方案1】:

您可以简单地留下一个空行来开始一个新段落,而不是用 \newline 强制一个未满的框:

\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{titling}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{tikz}


\setlength{\droptitle}{-3.5cm}
\setlength{\parindent}{0cm}
\newcommand{\squad}{\hspace{0.5em}}

\author{vladgovor77771}
\title{Some article}

\begin{document}
\maketitle

\textbf{Task 1} 

Task description: 

blabla

\end{document}

【讨论】:

    【解决方案2】:

    我有一个类似的问题,我通过删除下面没有任何文字的每个句子中的任何 \newline\\ 来解决它。

    例如,导致该问题的两个示例:

    An example. \\
    This is well used. \\
    This line will cause the error. \\
    
    (I'm a new paragraph) \\
    Because there's nothing directly underneath.\\
    The last line does NOT require a "newline".
    
    This is a thid paragraph. \\
    :D
    

    数字或类似物也是如此

    This is a line.
    Putting a "newline", as here, before a \begin will cause the error. \\
    \begin{figure}[h]
    ....
    \end{figure}
    

    【讨论】:

      【解决方案3】:

      一个快速而好的解决方案是使用包parskip,而不是使用\newline\\ 换行,只需插入一个空行

      \documentclass{article}
      \usepackage[T2A]{fontenc}
      \usepackage[utf8]{inputenc}
      \usepackage{titling}
      \usepackage{amssymb}
      \usepackage{amsthm}
      \usepackage{tikz}
      \usepackage{parskip} %% <-- added
      
      \setlength{\droptitle}{-3.5cm}
      \setlength{\parindent}{0cm}
      \newcommand{\squad}{\hspace{0.5em}}
      
      \author{vladgovor77771}
      \title{Some article}
      
      \begin{document}
      \maketitle
      
      \textbf{Task 1}
      
      Task description:
      
      \end{document}
      

      警告将消失。


      顺便说一下,要知道它发生的原因,请参阅 TeX Stack Exchange 上的this question

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-07-15
        • 2019-08-08
        • 2020-11-28
        • 2017-10-25
        • 2017-07-03
        • 1970-01-01
        • 2019-12-07
        • 1970-01-01
        相关资源
        最近更新 更多