Discussion:
Change Section Style using a Module
Raul Acuña
2011-03-10 21:13:15 UTC
Permalink
Hi,

Am working on my thesis using the "book" Document Class in Lyx. Everything
in the book Class works for me except the style of the sections and
subsections, i need to change the size from Large to Normal, also i want
a different space between the section and the text following.

I've been reading about the modules and i think its the best way to make the
changes that i want, i tried the following code:

#\DeclareLyXModule{ThesisStyle}
#DescriptionBegin
#Change Section Style
#DescriptionEnd
Format 11
Style Section
Category Section
Margin Dynamic
LabelType Counter
LabelCounter section
TocLevel 1
LatexType Command
LatexName section
NeedProtect 1
NextNoIndent 1
LabelSep xxx
ParSkip 0.4
TopSep 1.3
BottomSep 0.7
ParSep 0.7
Align Left
OptionalArgs 1
Font
Series Bold
Size Normal
EndFont
End



The code changes the font size in Lyx but doesn't change anything in the
PDF.

Any help would be greatly appreciated.

Thanks,


Raúl
Richard Heck
2011-03-11 12:56:57 UTC
Permalink
Post by Raul Acuña
Hi,
Am working on my thesis using the "book" Document Class in Lyx.
Everything in the book Class works for me except the style of the
sections and subsections, i need to change the size from Large to
Normal, also i want a different space between the section and the
text following.
I've been reading about the modules and i think its the best way to
#\DeclareLyXModule{ThesisStyle}
#DescriptionBegin
#Change Section Style
#DescriptionEnd
Format 11
Style Section
Category Section
Margin Dynamic
LabelType Counter
LabelCounter section
TocLevel 1
LatexType Command
LatexName section
NeedProtect 1
NextNoIndent 1
LabelSep xxx
ParSkip 0.4
TopSep 1.3
BottomSep 0.7
ParSep 0.7
Align Left
OptionalArgs 1
Font
Series Bold
Size Normal
EndFont
End
The code changes the font size in Lyx but doesn't change anything in
the PDF.
That is right: Modules control the appearance in LyX, unless you also do
something in them to change the LaTeX output. In this case, you want to
use the titlesec package to style your headings. So you'll need to add
this to your module, in the Section style:
Premable
\usepackage{titlesec}
...put relevant titlesec command here....
EndPreamble
Now LyX will put these commands into your preamble whenever you use a
section. Which titlesec commands you use will depend upon what you want
to do.

Richard

Loading...