对齐文本//新命令

对齐文本//新命令

我正在使用以下代码,但不知道该如何将段落左对齐。有人能帮我吗?

在此处输入图片描述

\documentclass{scrartcl}

\reversemarginpar % Move the margin to the left of the page 

\newcommand{\MarginText}[1]{\marginpar{\raggedleft\itshape\small#1}} % New command defining the margin text style

\usepackage[nochapters]{classicthesis} % Use the classicthesis style for the style of the document
\usepackage[LabelsAligned]{currvita} % Use the currvita style for the layout of the document
\usepackage{xparse}

\renewcommand{\cvheadingfont}{\LARGE\color{Maroon}} % Font color of your name at the top

\usepackage{hyperref} % Required for adding links and customizing them
\hypersetup{colorlinks, breaklinks, urlcolor=Maroon, linkcolor=Maroon} % Set link colors

\newlength{\datebox}\settowidth{\datebox}{Spring 2011} % Set the width of the date box in each block

\newcommand{\NewEntry}[3]{\noindent\hangindent=2.5em\hangafter=0\parbox{\datebox} {\small\textit{#1}} \hspace{1em}#2 #3 
% Define a command for each new block - change spacing and font sizes here: #1 is the left margin, #2 is the italic date field and #3 is the position/employer/location field
\vspace{0.3em}} % Add some white space after each new entry


\begin{document}

\NewEntry{Dirección} {xxxxxxxxxxxxx xxxxxxxxx xxxxxxxxx xxxxxx \\ 
xxxxxxxxxxxxx xxxxxxx xxxxx xxxxxxxxxxx\\
xxxxxxxxx xxxxxx xxxxxxx xxxxxxxx xxxxxx} % Direccion

\NewEntry{Correo electrónico}{\href{mailto:[email protected]}{[email protected]}}  % Email address

\end{document}

答案1

姆韦

\documentclass{scrartcl}
\usepackage[colorlinks]{hyperref}
\newlength{\datebox}
\settowidth{\datebox}{Correo electrónico y más} 
\newcommand\NewEntry[2]{\noindent\hangindent\datebox%
\makebox[\datebox][l]{#1}{\small\em #2}\bigskip}  
\begin{document}

\NewEntry{Dirección:}{xxxxxxxxxxxxx xxxxxxxxx xxxxxxxxx\\
xxxxxx  xxxxxxxxxxxxx xxxxxxx xxxxx xxxxxxxxxxx xxxxxxxxx xxxxxx \\
xxxxxxx xxxxxxxx xxxxxx}

\NewEntry{Correo electrónico:}{% 
\href{mailto:[email protected]}{[email protected]}}  

\end{document}

答案2

也许你想要这样的东西?(根据你的使用情况\NewEntry,我将其参数数量减少到两个。)

\documentclass{scrartcl}

\usepackage{hyperref}
\usepackage{newpxtext}


\usepackage{enumitem}
\NewDocumentCommand \NewEntry { m m }
  {
    \begin{itemize}[nosep, align = parleft, labelwidth = 6em, leftmargin = 6.5em]
      \item[\small\textit{#1}] #2
    \end{itemize}
    \vspace*{.3\baselineskip}
  }


\begin{document}

\NewEntry{Dirección} {xxxxxxxxxxxxx xxxxxxxxx xxxxxxxxx xxxxxx \\ 
xxxxxxxxxxxxx xxxxxxx xxxxx xxxxxxxxxxx\\
xxxxxxxxx xxxxxx xxxxxxx xxxxxxxx xxxxxx} % Direccion

\NewEntry{Correo electrónico}{\href{mailto:[email protected]}{[email protected]}}  % Email address

\end{document}

在此处输入图片描述

相关内容