LyXalignment of section's title

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
godsila
Posts: 3
Joined: Wed Sep 15, 2010 1:01 am

alignment of section's title

Post by godsila »

hi,
i have a small problem. title of my section is larger then one line. because of justified alignment which is apparently not possible to change is first line of title unsightly expanded. solution of this is simple..insert a forced line break..but in content is this title of section also over two lines although there it could fit in. is there any trick how change alignment of section's title on left? or can i edit view of content item?
ps: i have a lyx 1.6.6.1 and document class is book
thanks for advice
Last edited by godsila on Wed Sep 15, 2010 11:23 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

alignment of section's title

Post by gmedina »

Hi,

you can use the optional argument of the sectioning commands:

Code: Select all

\section[Title in ToC and headings]{Title in\\ document}
Another option would be to set the titles raggedright, and this can be easily done using the titlesec package:

Code: Select all

\documentclass{article}
\usepackage[raggedright]{titlesec}

\begin{document}

\section{A really really really really really really really really really really really really really long title}

\end{document}
You'll have to figure out how to implement this possible solutions in LyX, since I've never used it.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
godsila
Posts: 3
Joined: Wed Sep 15, 2010 1:01 am

Re: alignment of section's title

Post by godsila »

thanks so much.. i used your first suggestion and it's working..
have a good time
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

alignment of section's title

Post by localghost »

godsila wrote:thanks so much.. i used your first suggestion and it's working. […]
But the second solution would be the preferable one.

Now that the problem is obviously solved, please be so kind and mark the topic accordingly as exactly written in the Board Rules (to be read before posting).


Best regards and welcome to the board
Thorsten
godsila
Posts: 3
Joined: Wed Sep 15, 2010 1:01 am

alignment of section's title

Post by godsila »

But the second solution would be the preferable one.
at first i didn't know how implement the second solution in lyx, i was pretty tired but it was enough to write

Code: Select all

\usepackage[raggedright]{titlesec}
to the document preamble.
thanks again, this is easier solution
Post Reply