使用 \addtolength 指定 itemize

使用 \addtolength 指定 itemize

我正在为我的求职信和简历写一个附加页面,所以我使用 moderncv。因此,itemize 的样式由包定义。对于我的附加页面,我想要一种不同于简历中的 itemize 样式的新样式。特别是,我想增加左边距。我尝试了以下一个

\documentclass[12pt,a4paper,sans]{moderncv}       
\usepackage[ngerman]{babel}

\usepackage{tabularx}

% moderncv themes
\moderncvstyle{classic}
\moderncvcolor{blue}                             

\setlength{\hintscolumnwidth}{3.3cm} 

% character encoding
\usepackage[utf8]{inputenc}                      
\name{Name}{name}
\title{Lebenslauf}                             
\address{...}{...}
\phone[mobile]{...}                   
\email{Mail}  

   %Justification    
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
\patchcmd{\makeletterhead}% <cmd>
   {\raggedright \@opening}% <search>
  {\@opening}% <replace>
  {}{}% <success><failure>
\makeatother   





\begin{document}

\makecvtitle

\section{Foo}

\section{Foo2}
\subsection*{FooFoo}

\clearpage

\noindent\begin{tabularx}{\linewidth}{@{}p{10cm}Xp{5cm}@{}}
Lineare Regression & &Sehr gute Kenntnisse \tabularnewline
Logistische Regression    & & Basiskenntnisse \tabularnewline
Regularisierte Regression (LASSO, Ridge, Elastic Net) \begin{itemize}
\addtolength{\itemindent}{0.4cm}
\item Bachelorthesis: \glqq \textit{The Name of the thesis, that goes over two lines. It is too gong.}\grqq{} \vspace{-\baselineskip}\mbox{}
\end{itemize}   && Sehr gute Kenntnisse 
\end{tabularx}

\end{document}

现在的问题是,项目中的文本太长,并且与项目符号对齐。它应该与项目的第一个单词对齐。

请注意,我不想使用 enumitem 包,因为它改变了所有列表的样式。 在此处输入图片描述

答案1

这是你想要的吗?

\documentclass[12pt,a4paper,sans]{moderncv}
\usepackage[ngerman]{babel}
\usepackage{tabularx}

% moderncv themes
\moderncvstyle{classic}
\moderncvcolor{blue}

\setlength{\hintscolumnwidth}{3.3cm}

% character encoding
\usepackage[utf8]{inputenc}
\name{Name}{name}
\title{Lebenslauf}
\address{...}{...}
\phone[mobile]{...}
\email{Mail}

   %Justification
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
\patchcmd{\makeletterhead}% <cmd>
   {\raggedright \@opening}% <search>
  {\@opening}% <replace>
  {}{}% <success><failure>
\makeatother

\begin{document}

\makecvtitle

\section{Foo}

\section{Foo2}
\subsection*{FooFoo}

\clearpage

\noindent\begin{tabularx}{\linewidth}{@{}p{10cm}Xp{5cm}@{}}
Lineare Regression & &Sehr gute Kenntnisse \tabularnewline
Logistische Regression & & Basiskenntnisse \tabularnewline
Regularisierte Regression (LASSO, Ridge, Elastic Net)
\def\itemhook{\addtolength{\leftmargin}{0.4cm}\setlength{\topsep}{0pt}}
\begin{itemize}
\item Bachelorthesis: \glqq \textit{The Name of the thesis, that goes over two lines. It is too gong.}\grqq{} \vspace{-\baselineskip}\mbox{}
\end{itemize} && Sehr gute Kenntnisse
\end{tabularx}

\end{document} 

在此处输入图片描述

答案2

一个解决方案可能是使用顶部对齐的迷你页面:

\documentclass[12pt,a4paper,sans]{moderncv}       
\usepackage[ngerman]{babel}

\usepackage{tabularx}

% moderncv themes
\moderncvstyle{classic}
\moderncvcolor{blue}                             

\setlength{\hintscolumnwidth}{3.3cm} 

% character encoding
\usepackage[utf8]{inputenc}                      
\name{Name}{name}
\title{Lebenslauf}                             
\address{...}{...}
\phone[mobile]{...}                   
\email{Mail}  

   %Justification    
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
\patchcmd{\makeletterhead}% <cmd>
   {\raggedright \@opening}% <search>
  {\@opening}% <replace>
  {}{}% <success><failure>
\makeatother   


\newsavebox{\mybox}


\begin{document}

\makecvtitle

\section{Foo}

\section{Foo2}
\subsection*{FooFoo}

\clearpage

\noindent\begin{tabularx}{\linewidth}{@{}p{10cm}Xp{5cm}@{}}
Lineare Regression & &Sehr gute Kenntnisse \tabularnewline
Logistische Regression    & & Basiskenntnisse \tabularnewline
Regularisierte Regression (LASSO, Ridge, Elastic Net) \begin{itemize}
\addtolength{\itemindent}{0.4cm}
\savebox\mybox{\hbox{Sehr gute Kenntnisse}}
\item \begin{minipage}[t]{\dimexpr\textwidth-\itemindent-\wd\mybox-20pt}
Bachelorthesis: \glqq \textit{The Name of the thesis, that goes over two lines. It is too gong.}
\grqq{}\end{minipage} \vspace{-\baselineskip}\mbox{}
\end{itemize}   && Sehr gute Kenntnisse
\end{tabularx}

\end{document}

在此处输入图片描述

PS:忘记了 minipage 中的引号,但已在代码中修复

相关内容