From edc3e409cf915b10441ab876c8e3c29b4b2962e3 Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Sun, 4 Jun 2023 03:22:34 -0700 Subject: [PATCH] Fix `Underfull \hbox (badness 10000)` warning in `\makecvtitle` (#162) * Fix underfull \hbox warning in classic style * Fix underfull \hbox warning in casual style * Fix underfull \hbox warning in banking style * Fix underfull \hbox warning in fancy style --- moderncvheadi.sty | 12 +++++++++--- moderncvheadii.sty | 11 +++++++---- moderncvheadiii.sty | 15 +++++++++++---- moderncvheadv.sty | 21 +++++++++++++++------ template.tex | 11 +++++------ 5 files changed, 47 insertions(+), 23 deletions(-) diff --git a/moderncvheadi.sty b/moderncvheadi.sty index 51d9737e..346bf125 100644 --- a/moderncvheadi.sty +++ b/moderncvheadi.sty @@ -137,11 +137,17 @@ \rlap{\usebox{\makecvheaddetailsbox}}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvheadnamewidth is forced \hfill% \usebox{\makecvheadnamebox}\fi% - \\[2.5em]% % optional quote \ifthenelse{\isundefined{\@quote}}% - {}% - {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}% + {\vspace{2.5em}}% + {% + \\[2.5em]% + {% + \centering% + \begin{minipage}{\quotewidth}% + \centering% + \quotestyle{\@quote}% + \end{minipage}\\[2.5em]}}% \par}% to avoid weird spacing bug at the first section if no blank line is left after \makecvhead diff --git a/moderncvheadii.sty b/moderncvheadii.sty index 7f484c8b..bf0a6d66 100644 --- a/moderncvheadii.sty +++ b/moderncvheadii.sty @@ -158,15 +158,18 @@ \titlestyle{\MakeLowercase\@title}% \else% \titlestyle{\@title}\fi% - }\\[2.5em]% + } % optional quote \ifthenelse{\isundefined{\@quote}}% - {}% - {{\null\hfill% + {\vspace{2.5em}}% + {% + \\[2.5em]% + {% + \centering% \begin{minipage}{\quotewidth}% \centering% \quotestyle{\@quote}% - \end{minipage}\hfill\null\\[2.5em]}}% + \end{minipage}\\[2.5em]}}% \par}% to avoid weird spacing bug at the first section if no blank line is left after \maketitle diff --git a/moderncvheadiii.sty b/moderncvheadiii.sty index 7bec702d..c3fafce2 100644 --- a/moderncvheadiii.sty +++ b/moderncvheadiii.sty @@ -82,7 +82,7 @@ \centering% % name and title \namestyle{\@firstname~\@lastname}% - \ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title) + \ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title) % optional detailed information \if@details{% \\% @@ -100,7 +100,7 @@ \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link \addtomakeheaddetails{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}% \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomakeheaddetails{\@extrainfo}}% - \flushmakeheaddetails}\fi}\\[2.5em]}% need to force a \par after this to avoid weird spacing bug at the first section if no blank line is left after \makehead + \flushmakeheaddetails}\fi}}% need to force a \par after this to avoid weird spacing bug at the first section if no blank line is left after \makehead %------------------------------------------------------------------------------- @@ -118,8 +118,15 @@ \makehead% % optional quote \ifthenelse{\isundefined{\@quote}}% - {}% - {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}% + {\vspace{2.5em}}% + {% + \\[2.5em]% + {% + \centering% + \begin{minipage}{\quotewidth}% + \centering% + \quotestyle{\@quote}% + \end{minipage}\\[2.5em]}}% \par}% to avoid weird spacing bug at the first section if no blank line is left after \maketitle} diff --git a/moderncvheadv.sty b/moderncvheadv.sty index 936ec79d..eaabd4a1 100644 --- a/moderncvheadv.sty +++ b/moderncvheadv.sty @@ -95,14 +95,23 @@ \namestyle{\@firstname\ \@lastname}% \ifthenelse{\equal{\@title}{}}{ \ifthenelse{\isundefined{\@quote}}% - {}% - {\\[1.25em]\begin{minipage}{\quotewidth}\quotestyle{\@quote}\end{minipage}\\[2.5em]} - }{ - \\[1.25em]\titlestyle{\@title}\\[2.5em]% + {}% + {% + \\[1.25em]% + \begin{minipage}{\quotewidth}% + \quotestyle{\@quote}% + \end{minipage}}% + }{% + \\[1.25em]% + \titlestyle{\@title} % optional quote \ifthenelse{\isundefined{\@quote}}% - {}% - {\begin{minipage}{\quotewidth}\quotestyle{\@quote}\end{minipage}\\[2.5em]}}}% + {\vspace{2.5em}}% + {% + \\[2.5em]% + \begin{minipage}{\quotewidth}% + \quotestyle{\@quote} + \end{minipage}}}}% \par}% to avoid weird spacing bug at the first section if no blank line is left after \makecvhead % underlying command to implement \makecvtitle, identical to \@cvitem from moderncvbodyv diff --git a/template.tex b/template.tex index 73cd4601..22be6f0c 100644 --- a/template.tex +++ b/template.tex @@ -30,7 +30,7 @@ \setmainfont{Latin Modern Roman} \setsansfont{Latin Modern Sans} \setmonofont{Latin Modern Mono} - \setmathfont{Latin Modern Math} + \setmathfont{Latin Modern Math} \else \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} @@ -161,9 +161,9 @@ \section{Computer skills} \section{Skill matrix} \cvitem{Skill matrix}{Alternatively, provide a skill matrix to show off your skills} -%% Skill matrix as an alternative to rate one's skills, computer or other. +%% Skill matrix as an alternative to rate one's skills, computer or other. -%% Adjusts width of skill matrix columns. +%% Adjusts width of skill matrix columns. %% Usage \setcvskillcolumns[][][] %% , should be lengths smaller than \textwidth, needs to be between 0 and 1. %% Examples: @@ -202,12 +202,12 @@ \section{Skill matrix} %% Adjust head of the skill matrix for other languages % \cvskillhead[0.25em][Level][F\"ahigkeit][Jahre][Bemerkung] -%% \cvskillentry[*][]{}{<0-5>}{}{}{}% +%% \cvskillentry[*][]{}{<0-5>}{}{}{}% %% Example usages: \cvskillentry*{Language:}{3}{Python}{2}{I'm so experienced in Python and have realised a million projects. At least.} \cvskillentry{}{2}{Lilypond}{14}{So much sheet music! Man, I'm the best!} \cvskillentry{}{3}{\LaTeX}{14}{Clearly I rock at \LaTeX} -\cvskillentry*{OS:}{3}{Linux}{2}{I only use Archlinux btw}% notice the use of the starred command and the optional +\cvskillentry*{OS:}{3}{Linux}{2}{I only use Archlinux btw}% notice the use of the starred command and the optional \cvskillentry*[1em]{Methods}{4}{SCRUM}{8}{SCRUM master for 5 years} %% \cvskill{<0-5>} command % \cvitem{\textbackslash{cvskill}:}{Skills can be visually expressed by the \textbackslash{cvskill} command, e.g. \cvskill{2}} @@ -279,4 +279,3 @@ \section{References} %% end of file `template.tex'. -