使用 pdflatex 生成 PDF 会生成许多个Underfull \hbox (badness 10000) in paragraph at lines 539--542
,每组行号都指向一个小型页面块。
\begin{minipage}{\columnwidth}
\vskip 1ex\textbf{GenZoom Recovery\hfill\begin{minipage}{\dimexpr\linewidth-27ex\relax}\raggedleft \mbox{6:30PM}\end{minipage}}
Zoom-Only\hfill WA\\{\6pt
We meet daily for quick and short meetings to help each other through the work day.}
\end{minipage}
\begin{minipage}{\columnwidth}
\vskip 1ex\textbf{Broken Meeting No.1\hfill\begin{minipage}{\dimexpr\linewidth-27ex\relax}\raggedleft \mbox{6:30PM}\end{minipage}}
Guiding Schoolhouse\hfill WA\\
567 Beacon Lane, Nurtureville, NV, 89007
\end{minipage}
我怀疑这与在 minipage 中使用 minipage 以使时间/标签与右侧对齐有关。我读到 trailing/unused\\
会导致这些警告,但删除它们似乎不会产生任何变化。
根据要求,完整示例:
\documentclass[11pt,twoside,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage[letterpaper,margin=0.25in]{geometry}
\setlength{\parindent}{0em}
\setlength{\parskip}{1ex}
\usepackage{anyfontsize}
\usepackage{mathptmx}
\usepackage{multicol}
\usepackage{microtype}
\usepackage{graphicx}
\usepackage{enumitem}
\def\6pt{\fontsize{6}{7.2}\selectfont}
\def\7pt{\fontsize{7}{8}\selectfont}
\def\8pt{\fontsize{8.5}{10}\selectfont}
\def\gutter{\hspace{0.02\textwidth}}
\fontfamily{phv}\fontseries{mc}\selectfont
\begin{document}
{\textbf{Meetings}}\hrulefill\vskip 1ex
\begin{multicols}{4}
\vskip 2ex{\8pt\textbf{Sunday}}\hrulefill\vskip 1ex
{\7pt
\begin{minipage}{\columnwidth}
\vskip 1ex\textbf{Serenity Path AA\hfill\begin{minipage}{\dimexpr\linewidth-27ex\relax}\raggedleft \mbox{6:30PM}\end{minipage}}\\
Harmony Church\hfill WA\\
345 Ascend Street, Serenity Springs, NV, 89007\\
\end{minipage}
\begin{minipage}{\columnwidth}
\vskip 1ex\textbf{GenZoom Recovery\hfill\begin{minipage}{\dimexpr\linewidth-27ex\relax}\raggedleft \mbox{6:30PM}\end{minipage}}\\
Zoom-Only\hfill WA\\{\6pt
We meet daily for quick and short meetings to help each other through the work day.}
\end{minipage}
}
\end{multicols}
\end{document}
答案1
我可以向您解释为什么在处理完整示例时会出现两个 Underfull \hbox 警告。
Underfull \hbox (badness 10000) in paragraph at lines 27--30
Underfull \hbox (badness 10000) in paragraph at lines 26--37
第一个原因是你\\
在第 29 行末尾写错了。 在本上下文中\\
定义为\hfil\break
,这会在段落中创建空行,而段落内容不够丰富。 更准确的解释需要深入了解 TeX 中的段落拆分算法,它不仅适用于简短的解释。 主要信息是:段落不能以 结尾\\
。
出现第二条 Underfull 消息是因为您声明了四列,\begin{multicols}
但只有三列的材料可用。如果您\end{multicols}
在前面添加一行,例如:
...
}
something
\end{multicols}
...
然后第二条 Underfull 消息消失。
请注意,如果你定义
\def\6pt{...}
那么你就不用定义控制序列,而只需定义具有强制参数的宏\6pt
控制序列。它在你的例子中是有效的,但似乎对 TeX 标记器的工作方式和宏的定义方式存在误解。\6
pt
答案2
您\\
在段落末尾生成了一个未填满的框,但更一般地,multicols
嵌套的迷你页面没有帮助。如果您简化标记,则更容易避免出现空框。
\documentclass[11pt,twoside,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage[letterpaper,margin=0.25in]{geometry}
\setlength{\parindent}{0em}
\setlength{\parskip}{1ex}
\usepackage{anyfontsize}
\usepackage{mathptmx}
\usepackage{multicol}
\usepackage{microtype}
\usepackage{graphicx}
\usepackage{enumitem}
\def\sixpt{\fontsize{6}{7.2}\selectfont}
\def\sevenpt{\fontsize{7}{8}\selectfont}
\def\eightpt{\fontsize{8.5}{10}\selectfont}
\def\gutter{\hspace{0.02\textwidth}}
\fontfamily{phv}\fontseries{mc}\selectfont
\begin{document}
\textbf{Meetings}\hrulefill\vspace{1ex}
\sevenpt
\begin{minipage}[t]{.235\columnwidth}
\eightpt\textbf{Sunday}\hrulefill
\end{minipage}\gutter
\begin{minipage}[t]{.235\columnwidth}
\textbf{Serenity Path AA\hfill 6:30PM}\par
Harmony Church\hfill WA\par
\sixpt 345 Ascend Street, Serenity Springs, NV, 89007
\end{minipage}\gutter
\begin{minipage}[t]{.235\columnwidth}
\textbf{GenZoom Recovery\hfill 6:30PM}\par
Zoom-Only\hfill WA\par
\sixpt We meet daily for quick and short meetings to help each other through the work day.
\end{minipage}
\end{document}
答案3
请为此类工作定义命令!
您不需要嵌套小页面,也不需要猜测间距。以下每行可容纳三场会议,如果某天有更多会议,则将它们设置在其他会议之下。
\documentclass[11pt,twoside,letterpaper]{article}
%\usepackage[utf8]{inputenc} % <-- no longer needed
\usepackage[letterpaper,margin=0.25in]{geometry}
%\usepackage{anyfontsize}% <-- obsolete and useless with mathptmx
\usepackage{mathptmx}
%\usepackage{multicol}% <-- not needed
\usepackage{microtype}
\newcommand{\sixpt}{\fontsize{6}{7.2}\selectfont}
\newcommand{\sevenpt}{\fontsize{7}{8}\selectfont}
\newcommand{\eightpt}{\fontsize{8.5}{10}\selectfont}
\newcommand{\gutter}{1em}
\newcommand{\WIDTH}{\dimeval{(\textwidth-\dimeval{\gutter}*3)/4}}
\newcommand{\DAY}[1]{%
\par\addvspace{2ex}%
\hspace*{-\leftskip}%
\makebox[\WIDTH][l]{\eightpt\bfseries #1\hrulefill}%
\hspace{\gutter}\ignorespaces
}
\newcommand{\MEETING}[5]{%
\begin{minipage}[t]{\WIDTH}
\setlength{\lineskip}{1pt}
\sevenpt
{\bfseries #1\hfill #2\par}
{#3\hfill #4\par}
#5
\end{minipage}\hspace{\gutter plus 2pt minus 2pt}\ignorespaces
}
\setlength{\parindent}{0em}
\AtBeginDocument{%
\setlength{\leftskip}{\dimeval{\WIDTH+\gutter}}%
\setlength{\lineskip}{1ex}%
}
%\fontfamily{phv}\fontseries{mc}\selectfont % <-- does nothing at all
\begin{document}
\hspace*{-\leftskip}\textbf{Meetings}\hrulefill
\vspace{1ex}
\DAY{Sunday}
\MEETING{Serenity Path AA}{6:30PM}{Harmony Church}{WA}{
345 Ascend Street, Serenity Springs, NV, 89007
}
\MEETING{GenZoom Recovery}{6:30PM}{Zoom-Only}{WA}{
\sixpt
We meet daily for quick and short meetings to help each other through the work day.
}
\DAY{Monday}
\MEETING{Serenity Path AA}{6:30PM}{Harmony Church}{WA}{
345 Ascend Street, Serenity Springs, NV, 89007
}
\MEETING{GenZoom Recovery}{6:30PM}{Zoom-Only}{WA}{
\sixpt
We meet daily for quick and short meetings to help each other through the work day.
}
\MEETING{GenZoom Recovery}{6:30PM}{Zoom-Only}{WA}{
\sixpt
We meet daily for quick and short meetings to help each other through the work day.
}
\DAY{Tuesday}
\MEETING{Serenity Path AA}{6:30PM}{Harmony Church}{WA}{
345 Ascend Street, Serenity Springs, NV, 89007
}
\MEETING{Serenity Path AA}{6:30PM}{Harmony Church}{WA}{
345 Ascend Street, Serenity Springs, NV, 89007
}
\MEETING{GenZoom Recovery}{6:30PM}{Zoom-Only}{WA}{
\sixpt
We meet daily for quick and short meetings to help each other through the work day.
}
\MEETING{GenZoom Recovery}{6:30PM}{Zoom-Only}{WA}{
\sixpt
We meet daily for quick and short meetings to help each other through the work day.
}
\end{document}
列之间的间距已参数化,因此您可以在一个位置进行更改。列宽将据此计算。
请检查<--
代码中的标签并删除这些部分。例如,anyfontsize
当您加载可缩放字体(例如 提供的字体)时, 已经过时且无用mathptmx
。
请注意,\def\6pt{...}
TeX 接受它,但我不建议使用它。
答案4
欢迎来到 TeX.SE!
编辑:
- 感谢您编辑问题。
- 提供的文档示例工作不会生成任何警告,但是会抛出两个坏框。
- 您的代码没有必要那么复杂。
- 在下面的 MWE 中,我删除了所有
\mbox
es 和嵌套的小页面。 - 因此,不会产生您的问题的 MWE 可以是:
\documentclass[11pt,twoside,letterpaper]{article}
\usepackage[letterpaper,margin=0.25in]{geometry}
\setlength{\parindent}{0em} % <----
\setlength{\parskip}{1ex}
\usepackage{anyfontsize}
\usepackage{mathptmx}
\usepackage{multicol}
\usepackage{microtype}
\usepackage{graphicx}
\usepackage{enumitem}
\def\6pt{\fontsize{6}{7.2}\selectfont}
\def\7pt{\fontsize{7}{8}\selectfont}
\def\8pt{\fontsize{8.5}{10}\selectfont}
\def\gutter{\hspace{0.02\textwidth}}
\fontfamily{phv}
\fontseries{mc}\selectfont
\begin{document}
Nunc sed pede. Praesent vitae lectus. Praesent neque justo, vehicula eget, interdum id, facilisis et, nibh. Phasellus at purus et libero lacinia dictum. Fusce aliquet. Nulla eu ante placerat leo semper dictum. Mauris metus. Curabitur lobortis. Curabitur sollicitudin hendrerit nunc. Donec ultrices lacus id ipsum.
\textbf{Meetings}\hrulefill
\vskip 1ex
\begin{multicols}{4}
\vskip 2ex
\begin{minipage}[t]{\linewidth}\8pt
\textbf{Sunday} \hrulefill
\end{minipage}
\begin{minipage}[t]{\linewidth}\7pt
\textbf{Serenity Path AA} \hfill 6:30PM \\
Harmony Church \hfill WA \\
345 Ascend Street, Serenity Springs, NV, 89007
\end{minipage}
\begin{minipage}[t]{\linewidth}
\textbf{GenZoom Recovery} \hfill 6:30PM \\
Zoom-Only \hfill WA \\
\6pt
We meet daily for quick and short meetings to help each other through the work day.
\end{minipage}
\end{multicols}
\end{document}
它不会产生任何警告或坏框
顺便问一下,你确定需要 4 列吗?对于你的例子来说,3 列还不够吗?