Hi,
My document requires a specific format which includes left alignment (instead of full justification) and indentation at the beginning of each paragraph (default).
However, it doesn't seem possible to combine these two commands. When I select the main text and choose left alignment via the paragraph settings, the indentation disappears although it is still selected in the text format settings. Instead, there is a small space between paragraphs in the created PDF. The formatting in Lyx looks fine.
Is there a way I can get both requirements working at the same time?
Thanks very much for your help.
LyX ⇒ Left alignment and indentation
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Left alignment and indentation
You can copy the codeblock in the middle to your document preamble. It simply removes the part that sets the indent to zero.
Code: Select all
Code, edit and compile here:
\documentclass{article}\usepackage{blindtext}\usepackage{etoolbox}\makeatletter\patchcmd{\raggedright}{\parindent\z@}{}{}{}\makeatother\begin{document}\raggedright\blindtext\blindtext\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
Left alignment and indentation
Hi Jonny,
a similar solution was posted by Thorsten here: Ragged Right Justification cancels Indentation.
You could insert this in the document preamble with LyX, or Johannes' very good suggestion
Stefan
a similar solution was posted by Thorsten here: Ragged Right Justification cancels Indentation.
Code: Select all
Code, edit and compile here:
\newlength{\saveparindent}\setlength{\saveparindent}{\parindent}\raggedright\setlength{\parindent}{\saveparindent}
Code: Select all
Code, edit and compile here:
\usepackage{etoolbox}\makeatletter\patchcmd{\raggedright}{\parindent\z@}{}{}{}\makeatother
LaTeX.org admin
Re: Left alignment and indentation
Thanks for your answers, but none of the proposed codes work me. I simply added them to the preamble as you said. The document does not directly start with left alignment if that changes anything. Is there another place I could insert the codeblocks?
- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Left alignment and indentation
Hi Johnny,
could you please export your LyX document to LaTeX and post it as attachment? Of course you can remove confidential content, the most important to now is the preamble.
Stefan
could you please export your LyX document to LaTeX and post it as attachment? Of course you can remove confidential content, the most important to now is the preamble.
Stefan
LaTeX.org admin
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Left alignment and indentation
Never does directly after a sectioning command, or in other words, this is by design. Please load package indentfirst to get the first paragraph after sectioning commands as well.The document does not directly start with left alignment
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.