diff --git a/CHANGELOG b/CHANGELOG index 50ddd43..f9d2f91 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ version next - Fix "Underfull \hbox (badness 10000)" warning in banking \subsection dotted rules by adding \hss glue as in \dotfill (#307) - Update "circle" option to allow for half-filled circles in skill matrix (#309) +- Fix "Arithmetic overflow" in cvcolumns when every column sets a width (#311) version 2.6.1 (24 Jun 2026) - Allow the customisation of the contemporary style (#297) diff --git a/moderncv.cls b/moderncv.cls index 1bc93cf..1f02b2a 100644 --- a/moderncv.cls +++ b/moderncv.cls @@ -676,7 +676,9 @@ % compute the width of each cvcolumn, considering a spacing of \separatorcolumnwidth and the columns with set width \ifnum\thecvcolumnscounter>0% \setlength{\cvcolumnswidth}{\maincolumnwidth-\value{cvcolumnscounter}\separatorcolumnwidth+\separatorcolumnwidth}% - \setlength{\cvcolumnautowidth}{\cvcolumnswidth*\ratio{\cvcolumnsautowidth}{\cvcolumnsdummywidth}/\value{cvcolumnsautowidthcounter}}\fi% + % only share the remaining width if some columns have no explicit width, to avoid a division by zero ("Arithmetic overflow") when all have one + \ifnum\value{cvcolumnsautowidthcounter}>0% + \setlength{\cvcolumnautowidth}{\cvcolumnswidth*\ratio{\cvcolumnsautowidth}{\cvcolumnsdummywidth}/\value{cvcolumnsautowidthcounter}}\fi\fi% % pre-aggregate the tabular definition, heading and content (required before creating the tabular, as the tabular environment doesn't like loops --- probably because "&" generates a \endgroup) % - the tabular definition is the aggregation of the different "\cvcolumn@def" (by default "p{\cvcolumnautowidth}"), separated by "@{\hspace*{\separatorcolumnwidth}}" % - the tabular heading is the aggregation of the different "\cvcolumn@head", separated by "&"