[Tex/LaTex] Aligning text in LyX: left/center/right

horizontal alignmentlyx

How can I center/right/left align text in LyX? In Microsoft Word, I can just click the
3 buttons on the toolbar.

Best Answer

Horizontal alignment is associated with a paragraph style in LyX. Select the paragraph, click Edit>Paragraph Settings... (or click the LyX paragraph settings button button in the toolbar) and choose one of the Alignment options:

LyX paragraph settings

Click OK or Apply for the selection to take effect. Checking Immediate Apply allows one to toggle and visualize the difference between selected options.


For inserting horizontal fill (or \hfill; which also leads to a flush left and flush right formatting on the same line), you follow Insert>Formatting>Horizontal Space... and for the Spacing choose Horizontal Fill:

enter image description here

Upon clicking OK, your document will show the horizontal fill as a stretchable dotted line which shrinks/expands to fit the window

enter image description here

and eventually typesets/compiles to

enter image description here

A similar output would have been obtain through the insertion of "TeX code":

enter image description here