# Problem with \quote and \raggedright in ModernCV

Having an issue with the \quote part of ModernCV.

\quote{\raggedright \lipsum[2]}


Whilst the above produces exactly what I'm after, any effort to replace

\lipsum[2]


with other text results in the text not aligning as I wish.

This confuses me since the regular quote is as follows

\quote{Text}


Also, here is the full doc:

\documentclass[11pt,a4paper,roman]{moderncv/moderncv}
\renewcommand*{\listitemsymbol}{\itemsep-2em \labelitemi~}
% moderncv themes
\moderncvstyle{classic}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.9]{geometry}
\usepackage{pdfpages/pdfpages}
\usepackage{moderntimeline/moderntimeline}
\tlmaxdates{2005}{2016}
\usepackage{lipsum}
\usepackage{xpatch/xpatch}
\xpatchcmd{\cvitem}{#3}{\small #3}{}{}
\xpatchcmd\makecvtitle{\quotewidth}{0.9\textwidth}{}{}
\usepackage{xcolor}
\usepackage[url=false,
backend=biber,
style=authoryear,
doi=false,
isbn=false,
backref=false,
dashed=false,
maxnames=99,
sorting=ydnt]{biblatex}
\input{biblatex_modifications/standard_modification.tex}
\newcommand{\cvreferencecolumn}[2]{%
\cvitem[0.75em]{}{%
\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#1\end{minipage}%
\hfill%
\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#2\end{minipage}%
}%
}
\newcommand{\cvreference}[8]{%
\textbf{#1}\newline% Name
\ifthenelse{\equal{#3}{}}{}{#3\newline}%
\ifthenelse{\equal{#4}{}}{}{#4\newline}%
\ifthenelse{\equal{#5}{}}{}{#5\newline}%
\ifthenelse{\equal{#7}{}}{}{\phonesymbol~#7\newline}
\ifthenelse{\equal{#8}{}}{}{\mobilephonesymbol~#8}}
\name{Name}{Name}
\phone[mobile]{+00000000000}
\email{mail@mail.com}
\quote{\raggedright Text text text Text text text Text text text Text text text Text text text Text text text Text text text Text text text Text text text Text text text Text text text Text text text Text text text }
\begin{document}
\makecvtitle
\end{document}

• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Mike Renfro Feb 11 '15 at 3:37
• Apologies - hopefully now okay? – DrDe Feb 11 '15 at 3:56
• I should have been clearer on what a MWE is. If you can reproduce the same problem after removing a section of code, remove it. Repeat the process until the smallest number of lines remain. That will make it much easier for others to assist. – Mike Renfro Feb 11 '15 at 3:59
• Is this suitable? – DrDe Feb 11 '15 at 4:13
• It's much closer, at least. I suspect more lines can be removed (pdfpages, biblatex, etc.). And it'll be much easier to read if you replace the '>' quoting you did with the 4-space indent you used on the earlier lines of code. – Mike Renfro Feb 11 '15 at 4:21

When you use

\usepackage{lipsum}


and place a \lipsum, it inherently adds \par at the end of the Lorem Ipsum. This \par forces the setting of a paragraph in whichever paragraph alignment has been set. As such,

\quote{\raggedright \lipsum[2]}


will set in a \raggedright fashion. However, using

\quote{\raggedright <some lengthy text>}


may not set it in \raggedright if there is no forced \par initiated. If you had used \usepackage[nopar]{lipsum} instead, you may have experienced similar problems. To guarantee this, use one should use

\quote{\raggedright <some lengthy text>\endgraf}


The use of \endgraf circumvents the current non-\long definition of \quote.

\makeatletter
\xpatchcmd{\makecvtitle}
{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}
{\centering\begin{minipage}{\quotewidth}\raggedright\quotestyle{\@quote}\end{minipage}\\[2.5em]}%
{}{}
\makeatletter
\xpatchcmd\makecvtitle{\quotewidth}{0.9\textwidth}{}{}      %% this should be done here (after removing \centering)


Code:

\documentclass[11pt,a4paper,roman]{moderncv/moderncv}
\renewcommand*{\listitemsymbol}{\itemsep-2em \labelitemi~}
% moderncv themes
\moderncvstyle{classic}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.9]{geometry}
\usepackage{pdfpages/pdfpages}
\usepackage{moderntimeline/moderntimeline}
\tlmaxdates{2005}{2016}
\usepackage{lipsum}
\usepackage{xpatch}

\makeatletter
\xpatchcmd{\makecvtitle}
{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}
{\centering\begin{minipage}{\quotewidth}\raggedright\quotestyle{\@quote}\end{minipage}\\[2.5em]}%
{}{}
\makeatletter
\xpatchcmd\makecvtitle{\quotewidth}{0.9\textwidth}{}{}

\usepackage{xcolor}
\name{Name}{Name}
\phone[mobile]{+00000000000}
\email{mail@mail.com}
\quote{Text text text Text text text Text text text Text text text Text text text Text text text Text text text Text text text Text text text Text text text Text text text Text text text Text text text }
\begin{document}
\makecvtitle
\end{document}


Remember to patch \makecvtitle for \quotewidth after you have removed \centering and added \raggedright.

It's quite easy, actually. The \quote command simply stores the text in \@quote; when this text is printed it is passed as argument to \quotestyle, which is defined by default as

\newcommand*{\quotestyle}[1]{{\quotefont#1}}


So all you need is to redefine this macro as

\renewcommand{\quotestyle}[1]{{\quotefont\raggedright#1\par}}


and your quote will be ragged right:

\documentclass[11pt,a4paper,roman]{moderncv}
\renewcommand*{\listitemsymbol}{\itemsep-2em \labelitemi~}
% moderncv themes
\moderncvstyle{classic}
\moderncvcolor{blue}

\usepackage{lipsum}

\renewcommand{\quotestyle}[1]{{\quotefont\raggedright #1\par}}

\name{Name}{Name}