[Tex/LaTex] How to set the justification for all the standard paragraphs in a LyX document

horizontal alignmentlyxparagraphs

This must be trivial. I am new to LyX but I have read most of the 183 page User Guide and not found the answer. When I change the justification setting (to remove right justify) it only does it for the current paragraph. Document-Settings-Textlayout offers very limited ability to make changes.

If I open the Customization Guide, the heading says "Features for the Advanced User". Surely something as trivial as turning off justification does not require advanced user customization. It looks like local layout may be the answer. But the customization guide says enter a format tag and searching the guide for "format tag" yields no results.

Is there an easy way to do this?

Best Answer

Open up stdclass.inc and find the Standard style:

Style Standard
    Category              MainText
    Margin                Static
    LatexType             Paragraph
    LatexName             dummy
    ParIndent             MM
    ParSkip               0.4
    Align                 Block
    AlignPossible         Block, Left, Right, Center
    LabelType             No_Label
    # FIXME This ought to be set dynamically.
    HTMLStyle
        div.standard {
            margin-bottom: 2ex;
        }
    EndHTMLStyle
End

The Align property designates the default justification under the Standard style. In the above case, the default is Block. Available alignments are given under AlignPossible

  • Block = Justified (or left- and right-aligned);
  • Left = \raggedright
  • Right = \raggedleft
  • Center = \centering

Change Align to Left and insert it as a Local Layout under Document > Settings... to obtain a \raggedright output:

enter image description here

Of course, it would also be possible to define your own, new paragraph style.


An easy LaTeX-type way of achieving this is by issuing \raggedright in your Document > Settings... > LaTeX Preamble.