不足している \hbox を削除できません

不足している \hbox を削除できません

私は履歴書に書かれている、記入不足の警告を取り除こうとしています\hbox。私が取り組んでいることの簡単な例は次のとおりです。

\documentclass{article}
\usepackage{calc}
\setlength{\parindent}{0pt}

\newcommand\Job[3]{{\bf #1}, #2\\ #3}

\newcommand\LongestDate{\widthof{7777 (Spring)}}
\newcommand\DatedItem[2]{
    \begin{tabular*}{\linewidth}[t]{@{\hspace{0.25in}}p{\LongestDate}@{\hspace{0.125in}}p{\linewidth - \LongestDate - 0.375in}@{}}
            #1 & {\raggedright #2}
    \end{tabular*}}

\begin{document}

\DatedItem{2013--}{\Job{Rice University}{Houston, TX}{Associate Professor}}

\end{document}

さまざまな場所に を挿入してみました\hfill( の前など\\)。また、 をたくさん追加してみました\raggedright。しかし、警告は消えないようです。すべてが希望どおりにタイプセットされていることを述べておきます。警告なしでコンパイルしたいだけです。

答え1

私は\parnot \\(通常)、used \textbfnot \bf(ラテックスでは使用すべきではない) を使用し、missing \parin the scope of \raggedright(そうでない場合は何もしない)、use tabularnot tabular*(tabular*列間にストレッチ接着剤を追加しない限り何もできない) を追加しました。

\documentclass{article}
\usepackage{calc}
\setlength{\parindent}{0pt}

\newcommand\Job[3]{\textbf{#1}, #2\par #3}

\newcommand\LongestDate{\widthof{7777 (Spring)}}
\newcommand\DatedItem[2]{%
    \begin{tabular}[t]{@{\hspace{0.25in}}p{\LongestDate}@{\hspace{0.125in}}p{\linewidth - \LongestDate - 0.375in}@{}}
            #1 & {\raggedright #2\par}
    \end{tabular}}

\begin{document}

\DatedItem{2013--}{\Job{Rice University}{Houston, TX}{Associate Professor}}

\end{document}

答え2

enumitemおそらく、このよりシンプルな代替案を検討してもいいでしょう。必要に応じて、パッケージを使用してリストの外観をカスタマイズできます。

\documentclass{article}

\newcommand{\Job}[3]{%
    \textbf{#1}, #2\newline #3%
}

\begin{document}

\begin{itemize}
\item[2013--] \Job{Rice University}{Houston, TX}{Associate Professor}
\item[2000--2012] \Job{Harvard University}{Boston, MA}{Assistant Professor}
\end{itemize}

\end{document}

ここに画像の説明を入力してください

関連情報