段落第 36-37 行的 \hbox 未满(badness 10000)

段落第 36-37 行的 \hbox 未满(badness 10000)

我收到了无法理解的警告。

这是我的乳胶代码:

\documentclass[a4paper,10]{article}
\usepackage[zw32010,crossmark]{ticket}
\usepackage{graphicx}

\usepackage{fontspec}

\usepackage[paperwidth=80mm, paperheight=50mm]{geometry}

\usepackage{xcolor}
\definecolor{red}{RGB}{218,37,29}

\renewcommand{\ticketdefault}{}
\newcommand{\vcard}[6]{\ticket{
    \put(4.5, 49.5){\tt #1}
    \put(4.5, 47){\tt #2}
    \put(4.5, 44){\tt #3}
    \put(39, 25){\tt #4}
    \put(4.5, 11){\tt #5}
    \put(35, 11){\tt #6}
}}

\newcounter{numcards}
\begin{document}

\setcounter{numcards}{0}

\whiledo{\thenumcards<1}{
  \stepcounter{numcards}
  \vcard
  {\parbox{\textwidth}{ {\fontsize{10.5pt}{10.5pt}{ Matija Lukic,}} \fontsize{9pt}{9pt} M.Sc.EE.} }
  {\includegraphics[width=50mm, height=1mm]{example-image}}
  {\parbox{\textwidth}{\fontsize{7.5pt}{7.5pt} Engineer}}
  {\includegraphics[width=40mm, height=20mm]{example-image}}
  {\parbox{\textwidth}{\scriptsize Company LTD \\Address \\ 11070 Belgrade, Serbia \\ \color{red} www.COMPANY.com}}
  {\parbox{.8\textwidth}{\scriptsize \raggedleft M: 064534444\\  T: +381 (0)11 22 22 222\\ F: +381 (0)11 65 333 333\\ [email protected]}}
}

\end{document}

答案1

\\[-\baselineskip]\vspace*{-\baselineskip}删除警告来代替可疑的指令。

\documentclass[a4paper]{article}
\usepackage[zw32010,crossmark]{ticket}

\usepackage{regexpatch}

\makeatletter
\xpatchcmd*{\ticket@counter}{\\[-\baselineskip]}{\vspace*{-\baselineskip}}{}{}
\makeatother

\usepackage{graphicx}

\usepackage{fontspec}

\usepackage[paperwidth=80mm, paperheight=50mm]{geometry}

\usepackage{xcolor}
\definecolor{red}{RGB}{218,37,29}

\renewcommand{\ticketdefault}{}
\newcommand{\vcard}[6]{\ticket{
    \put(4.5, 49.5){\tt #1}
    \put(4.5, 47){\tt #2}
    \put(4.5, 44){\tt #3}
    \put(39, 25){\tt #4}
    \put(4.5, 11){\tt #5}
    \put(35, 11){\tt #6}
}}

\newcounter{numcards}

\begin{document}

\setcounter{numcards}{0}

\whiledo{\value{numcards}<4}{
  \stepcounter{numcards}
  \vcard
  {\parbox{\textwidth}{ {\fontsize{10.5pt}{10.5pt}\selectfont Matija Lukic,} \fontsize{9pt}{9pt}\selectfont M.Sc.EE.} }
  {\includegraphics[width=50mm, height=1mm]{example-image}}
  {\parbox{\textwidth}{\fontsize{7.5pt}{7.5pt}\selectfont Engineer}}
  {\includegraphics[width=40mm, height=20mm]{example-image}}
  {\parbox{\textwidth}{\scriptsize Company LTD \\Address \\ 11070 Belgrade, Serbia \\ \color{red} www.COMPANY.com}}
  {\parbox{.8\textwidth}{\scriptsize \raggedleft M: 0645383256\\  T: +381 (0)11 22 22 222\\ F: +381 (0)11 65 333 333\\ [email protected]}}
}

\end{document}

请注意,\fontsize{100}{200}除非后面跟着,否则什么也不做\selectfont

在此处输入图片描述

答案2

您可以将示例简化为

\documentclass[a4paper]{article}
\usepackage[zw32010,crossmark]{ticket}

\begin{document}

  \ticket{}
\end{document}

与往常一样,警告是由于误用而导致的\\,在这种情况下,避免警告的快速解决方法是

 \ticket{}\mbox{}

尽管这会使警告静音,但在最后一张罚单后仍然会留下一条额外的虚假白线。

并得到相同的警告,也许将其报告给票证包的维护者。

相关内容