From 10cd63728912d74623700e5dc49429e55093f520 Mon Sep 17 00:00:00 2001 From: LLdaniel Date: Thu, 9 May 2024 23:07:20 +0200 Subject: [PATCH] space control feature realized with option 2 (option 1 reverted) --- CHANGELOG | 1 + moderncvbodyi.sty | 11 ++++++----- moderncvbodyiii.sty | 10 +++++----- moderncvbodyiv.sty | 10 +++++----- moderncvbodyv.sty | 10 +++++----- moderncvbodyvi.sty | 7 ++++--- template.tex | 10 +--------- 7 files changed, 27 insertions(+), 32 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 32c5ba4..b23350a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -24,6 +24,7 @@ version 2.?.? (29 Jun 2023) This requires the \moderncvcolor to be issued BEFORE \moderncvstyle. - all styles: make the head options 'details' and 'nodetails' available to the user. (previously they were hidden). Oldstyle does not respond too well to nodetails. - casual style: make the head options 'alternate', 'details' and 'nodetails' available to the user. (previously they were hidden). +- Setting \listitemsymbolspace allows custom spacing between list symbol and text item (for \cvlistitem and \cvlistdoubleitem). version 2.3.1 (21 Feb 2022) - Fix duplicate GitLab icon (#105). diff --git a/moderncvbodyi.sty b/moderncvbodyi.sty index 0d1ce82..4f46194 100644 --- a/moderncvbodyi.sty +++ b/moderncvbodyi.sty @@ -19,7 +19,7 @@ % provides the commands for the skillmatrix as well as the command % \recompute@cvskillmatrix@lengths \RequirePackage[moderncvbodyi]{moderncvskillmatrix} -\RequirePackage{xargs} + %------------------------------------------------------------------------------- % overall body definition %------------------------------------------------------------------------------- @@ -49,6 +49,7 @@ \@initializelength{\listitemcolumnwidth} % used by \cvlistdoubleitem \@initializelength{\listdoubleitemcolumnwidth} +\@initializelength{\listitemsymbolspace} \settowidth{\listitemsymbolspace}{0pt} % default moderncv \photo (change the definition such that by default the photo and its box align with the section bars \RenewDocumentCommand{\photo}{O{\hintscolumnwidth-0.8pt-2\fboxsep}O{0.4pt}m}{\def\@photowidth{#1}\def\@photoframewidth{#2}\def\@photo{#3}}% @@ -97,15 +98,15 @@ \hspace*{\separatorcolumnwidth}% \begin{minipage}[t]{\doubleitemcolumnwidth}#5\end{minipage}}} -\renewcommandx*{\cvlistitem}[3][1=.25em, usedefault, 2=0em]{% - \cvitem[#1]{}{\listitemsymbol\hspace{#2}\begin{minipage}[t]{\listitemcolumnwidth - #2}#3\end{minipage}}} +\renewcommand*{\cvlistitem}[2][.25em]{% + \cvitem[#1]{}{\listitemsymbol\hspace{\listitemsymbolspace}\begin{minipage}[t]{\listitemcolumnwidth-\listitemsymbolspace}#2\end{minipage}}} \renewcommand*{\cvlistdoubleitem}[3][.25em]{% - \cvitem[#1]{}{\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#2\end{minipage}% + \cvitem[#1]{}{\listitemsymbol\hspace{\listitemsymbolspace}\begin{minipage}[t]{\listdoubleitemcolumnwidth-\listitemsymbolspace}#2\end{minipage}% \hfill% fill of \separatorcolumnwidth \ifthenelse{\equal{#3}{}}% {}% - {\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#3\end{minipage}}}} + {\listitemsymbol\hspace{\listitemsymbolspace}\begin{minipage}[t]{\listdoubleitemcolumnwidth-\listitemsymbolspace}#3\end{minipage}}}} \renewcommand*{\cventry}[7][.25em]{% \cvitem[#1]{#2}{% diff --git a/moderncvbodyiii.sty b/moderncvbodyiii.sty index e64351c..453d821 100644 --- a/moderncvbodyiii.sty +++ b/moderncvbodyiii.sty @@ -40,7 +40,6 @@ % provides the commands for the skillmatrix as well as the command % \recompute@cvskillmatrix@lengths \RequirePackage[moderncvbodyiii]{moderncvskillmatrix} -\RequirePackage{xargs} %------------------------------------------------------------------------------- % overall body definition @@ -89,6 +88,7 @@ \@initializelength{\listitemcolumnwidth} % used by \cvlistdoubleitem \@initializelength{\listdoubleitemcolumnwidth} +\@initializelength{\listitemsymbolspace} \settowidth{\listitemsymbolspace}{0pt} % commands \renewcommand*{\recomputecvbodylengths}{% @@ -156,16 +156,16 @@ \begin{minipage}[t]{\doubleitemcolumnwidth}\ifstrempty{#4}{}{\hintstyle{#4}: }#5\end{minipage}% \par\addvspace{#1}} -\renewcommandx*{\cvlistitem}[3][1=.25em, usedefault, 2=0em]{% - \listitemsymbol\hspace{#2}\begin{minipage}[t]{\listitemcolumnwidth - #2}#3\end{minipage}% +\renewcommand*{\cvlistitem}[2][.25em]{% + \listitemsymbol\hspace{\listitemsymbolspace}\begin{minipage}[t]{\listitemcolumnwidth-\listitemsymbolspace}#2\end{minipage}% \par\addvspace{#1}} \renewcommand*{\cvlistdoubleitem}[3][.25em]{% - \cvitem[#1]{}{\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#2\end{minipage}% + \cvitem[#1]{}{\listitemsymbol\hspace{\listitemsymbolspace}\begin{minipage}[t]{\listdoubleitemcolumnwidth-\listitemsymbolspace}#2\end{minipage}% \hfill% fill of \separatorcolumnwidth \ifstrempty{#3}% {}% - {\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#3\end{minipage}}}} + {\listitemsymbol\hspace{\listitemsymbolspace}\begin{minipage}[t]{\listdoubleitemcolumnwidth-\listitemsymbolspace}#3\end{minipage}}}} \renewcommand*{\cventry}[7][.25em]{ \begin{tabular*}{\maincolumnwidth}{l@{\extracolsep{\fill}}r}% diff --git a/moderncvbodyiv.sty b/moderncvbodyiv.sty index ab19a06..606d6d7 100644 --- a/moderncvbodyiv.sty +++ b/moderncvbodyiv.sty @@ -19,7 +19,6 @@ % provides the commands for the skillmatrix as well as the command % \recompute@cvskillmatrix@lengths \RequirePackage[moderncvbodyiv]{moderncvskillmatrix} -\RequirePackage{xargs} %------------------------------------------------------------------------------- % overall body definition @@ -50,6 +49,7 @@ \@initializelength{\listitemcolumnwidth} % used by \cvlistdoubleitem \@initializelength{\listdoubleitemcolumnwidth} +\@initializelength{\listitemsymbolspace} \settowidth{\listitemsymbolspace}{0pt} % commands \renewcommand*{\recomputecvbodylengths}{% @@ -88,15 +88,15 @@ \begin{minipage}[t]{\doubleitemcolumnwidth}\ifthenelse{\equal{#4}{}}{}{\hintstyle{#4}: }#5\end{minipage}% \par\addvspace{#1}} -\renewcommandx*{\cvlistitem}[3][1=.25em, usedefault, 2=0em]{% - \cvitem[#1]{}{\listitemsymbol\hspace{#2}\begin{minipage}[t]{\listitemcolumnwidth - #2}#3\end{minipage}}} +\renewcommand*{\cvlistitem}[2][.25em]{% + \cvitem[#1]{}{\listitemsymbol\hspace{\listitemsymbolspace}\begin{minipage}[t]{\listitemcolumnwidth-\listitemsymbolspace}#2\end{minipage}}} \renewcommand*{\cvlistdoubleitem}[3][.25em]{% - \cvitem[#1]{}{\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#2\end{minipage}% + \cvitem[#1]{}{\listitemsymbol\hspace{\listitemsymbolspace}\begin{minipage}[t]{\listdoubleitemcolumnwidth-\listitemsymbolspace}#2\end{minipage}% \hfill% fill of \separatorcolumnwidth \ifthenelse{\equal{#3}{}}% {}% - {\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#3\end{minipage}}}} + {\listitemsymbol\hspace{\listitemsymbolspace}\begin{minipage}[t]{\listdoubleitemcolumnwidth-\listitemsymbolspace}#3\end{minipage}}}} \@initializebox{\cventryyearbox} \@initializelength{\cventrytitleboxwidth} diff --git a/moderncvbodyv.sty b/moderncvbodyv.sty index e6ff750..336dc83 100644 --- a/moderncvbodyv.sty +++ b/moderncvbodyv.sty @@ -19,7 +19,6 @@ % provides the commands for the skillmatrix as well as the command % \recompute@cvskillmatrix@lengths \RequirePackage[moderncvbodyv]{moderncvskillmatrix} -\RequirePackage{xargs} %------------------------------------------------------------------------------- % overall style definition @@ -54,6 +53,7 @@ % used by \cvlistdoubleitem \@initializelength{\listdoubleitemcolumnwidth} %\@initializelength{\listdoubleitemmaincolumnwidth} +\@initializelength{\listitemsymbolspace} \settowidth{\listitemsymbolspace}{0pt} % commands \@initializecommand{\recomputecvbodylengths}{% @@ -118,15 +118,15 @@ \hfill% fill of \separatorcolumnwidth \begin{minipage}[t]{\doubleitemcolumnwidth}\ifthenelse{\equal{#4}{}}{}{\hintstyle{#4}: }#5\end{minipage}}} -\renewcommandx*{\cvlistitem}[3][1=.5ex, usedefault, 2=0ex]{% - \@cvitem[#1]{}{\listitemsymbol\hspace{#2}\begin{minipage}[t]{\listitemcolumnwidth - #2}#3\end{minipage}}} +\renewcommand*{\cvlistitem}[2][.5ex]{% + \@cvitem[#1]{}{\listitemsymbol\hspace{\listitemsymbolspace}\begin{minipage}[t]{\listitemcolumnwidth-\listitemsymbolspace}#2\end{minipage}}} \renewcommand*{\cvlistdoubleitem}[3][.5ex]{% - \@cvitem[#1]{}{\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#2\end{minipage}% + \@cvitem[#1]{}{\listitemsymbol\hspace{\listitemsymbolspace}\begin{minipage}[t]{\listdoubleitemcolumnwidth-\listitemsymbolspace}#2\end{minipage}% \hfill% fill of \separatorcolumnwidth \ifthenelse{\equal{#3}{}}% {}% - {\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#3\end{minipage}}}} + {\listitemsymbol\hspace{\listitemsymbolspace}\begin{minipage}[t]{\listdoubleitemcolumnwidth-\listitemsymbolspace}#3\end{minipage}}}} \@initializebox{\cventryyearbox} \@initializelength{\cventrytitleboxwidth} diff --git a/moderncvbodyvi.sty b/moderncvbodyvi.sty index 60f9997..b7f2525 100644 --- a/moderncvbodyvi.sty +++ b/moderncvbodyvi.sty @@ -53,6 +53,7 @@ \@initializelength{\listitemcolumnwidth} % used by \cvlistdoubleitem \@initializelength{\listdoubleitemcolumnwidth} +\@initializelength{\listitemsymbolspace} \settowidth{\listitemsymbolspace}{0pt} % default moderncv \photo (change the definition such that by default the photo and its box align with the section bars \RenewDocumentCommand{\photo}{O{\hintscolumnwidth-0.8pt-2\fboxsep}O{0.4pt}m}{\def\@photowidth{#1}\def\@photoframewidth{#2}\def\@photo{#3}}% @@ -105,14 +106,14 @@ \begin{minipage}[t]{\doubleitemcolumnwidth}#5\end{minipage}}} \renewcommand*{\cvlistitem}[2][.25em]{% - \cvitem[#1]{}{\listitemsymbol\begin{minipage}[t]{\listitemcolumnwidth}#2\end{minipage}}} + \cvitem[#1]{}{\listitemsymbol\hspace{\listitemsymbolspace}\begin{minipage}[t]{\listitemcolumnwidth-\listitemsymbolspace}#2\end{minipage}}} \renewcommand*{\cvlistdoubleitem}[3][.25em]{% - \cvitem[#1]{}{\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#2\end{minipage}% + \cvitem[#1]{}{\listitemsymbol\hspace{\listitemsymbolspace}\begin{minipage}[t]{\listdoubleitemcolumnwidth-\listitemsymbolspace}#2\end{minipage}% \hfill% fill of \separatorcolumnwidth \ifthenelse{\equal{#3}{}}% {}% - {\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#3\end{minipage}}}} + {\listitemsymbol\hspace{\listitemsymbolspace}\begin{minipage}[t]{\listdoubleitemcolumnwidth-\listitemsymbolspace}#3\end{minipage}}}} \renewcommand*{\cventry}[7][.25em]{% \cvitem[#1]{\tl@milestone{#2}}{% diff --git a/template.tex b/template.tex index 0085780..7988dae 100644 --- a/template.tex +++ b/template.tex @@ -20,6 +20,7 @@ %\usepackage[scale=0.75]{geometry} %\setlength{\hintscolumnwidth}{3cm} % if you want to change the width of the column with the dates %\setlength{\makecvheadnamewidth}{10cm} % for the 'classic' style, if you want to force the width allocated to your name and avoid line breaks. be careful though, the length is normally calculated to avoid any overlap with your personal info; use this at your own typographical risks... +%\setlength{\listitemsymbolspace}{10pt} % set custom spacing between list symbol and text item (influences \cvlistitem and \cvlistdoubleitem) % the 'contemporary' style allows to append additional elements to the head background; uncomment and customize if needed %\def\@moderncvheadBackground{ @@ -231,15 +232,6 @@ Detailed achievements: \cvitem{hobby 3}{Description} \section{Extra 1} -%% Fine tuned examples due to two default parameters: -%% - full specification command: -%% cvlistitem[vertical spacing between list items][space after list symbol]{Item} -%% - single default command: \cvlistitem[0.75em]{Item} leads to -%% 0.75em vertical spacing and default -%% - single default command: \cvlistitem[][0.25em]{Item} leads to -%% default vertical spacing and 0.25em space after list symbol -%% - full default command: \cvlistitem{Item} leads to -%% default vertical spacing and default space after list symbol \cvlistitem{Item 1} \cvlistitem{Item 2} \cvlistitem{Item 3. This item is particularly long and therefore normally spans over several lines. Did you notice the indentation when the line wraps?}