[Tex/LaTex] Correct left aligning items in simplecv (LyX)

horizontal alignmentitemizelyxlyx-layouts

The simplecv class (for LyX), provides the Itemize environment which is defined in simplecv.layout as follows:

Style Itemize
    Margin                Static
    LatexType             Item_Environment
    LatexName             itemize
    NextNoIndent          1
    LeftMargin            MMN
    LabelSep              xx
    ItemSep               0.2
    TopSep                0.7
    BottomSep             0.7
    ParSep                0.3
    Align                 Block
    AlignPossible         Block, Left
    LabelType             Itemize
    LabelString           "*"
End

Using items with the paragraph alignment set to justified (which is the default), produces a visually correct list of items (screenshot below, left).

I would like to have an Left alignment. Trying to do so (i.e. changing through LyX' paragraph settings interface), prints the (default) bullet, on its own, and pushes the text in the next line (screenshot below, right)!

enter image description hereenter image description here

The complete code, this time using {\raggedright ... \par}, as seen in LyX' LaTeX Source window reads:

% Preview source code

%% LyX 2.0.2 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage{charter}
\usepackage[scaled=0.8]{berasans}
\usepackage{beramono}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=1.4cm,bmargin=3cm,lmargin=2cm,rmargin=2.5cm}
\pagestyle{empty}
\setcounter{secnumdepth}{0}
\setcounter{tocdepth}{2}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{pifont}

\makeatletter
\@ifundefined{date}{}{\date{}}
\AtBeginDocument{
  \def\labelitemi{\footnotesize\(\bullet\)}
  \def\labelitemii{\footnotesize\(\circ\)}
  \def\labelitemiii{\tiny\ding{71}}
  \def\labelitemiv{\tiny\ding{75}}
}

\makeatother

\usepackage{babel}
\begin{document}
\begin{itemize}
\item \noindent \begin{flushleft}
{\raggedright Sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text\par}
\par\end{flushleft}
\item \noindent Sample text sample text sample text sample text sample text
sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text\end{itemize}

\end{document}

The visual result, as seen in a larger screenshot, is an incorrect left aligned item and a correctly justified item:

incorecct and correct left alingment of item

How is it possible to achieve a correct Left alignment? Are the Align, AlignPossible instructions in simplecv.layout related?

[Question to self: did I touch some other, global, setting which affects the behaviour in question?]

Best Answer

LyX inserts the "Don't Indent Paragraph" formatting before the alignment environment flushleft, which causes the layout problems. Instead, remove the \noindent by selecting "Indent Paragraph" from the paragraph settings window:

enter image description here

Note that the flushleft environment automatically sets the paragraph indent to be 0pt, so there's no need to specify the "No Paragraph Indent" check. Actually, this is done internally via \raggedright, so you could also achieve this via two ERTs manually {\raggedright ... \par}:

enter image description here

\raggedright sets the paragraph to be "left aligned" while \par ensures that the paragraph/bullet is finished - TeX requires this since it sets lines of text based on a paragraph basis.

enter image description here

Related Question