LyXPut "Contents", List of figure, table on the centre of the p

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
newnoise
Posts: 19
Joined: Thu Aug 21, 2008 11:57 am

Put "Contents", List of figure, table on the centre of the p

Post by newnoise »

Hello guys!

Do you know can i set lyx to move the Contents, list of figure and list of table on the centre of the page? I mean just the header...

thx
/davide

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
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Put "Contents", List of figure, table on the centre of the p

Post by Stefan Kottwitz »

Hi Davide,

it depends on the document class you are using.
One possibility is to use the titlesec package, see its documentation.
For instance this code will provide centered sections with standard classes:

Code: Select all

\titleformat{\section}{%
\centering\normalfont\Large\bfseries}{\thesection}{1em}{}
Stefan
LaTeX.org admin
newnoise
Posts: 19
Joined: Thu Aug 21, 2008 11:57 am

Re: Put "Contents", List of figure, table on the centre of the p

Post by newnoise »

Hmmm---maybe I'm doing something wrong since putting your piece of code in the lyx preamble I get an error...
newnoise
Posts: 19
Joined: Thu Aug 21, 2008 11:57 am

Re: Put "Contents", List of figure, table on the centre of the p

Post by newnoise »

I use Article Koma script document class
/davide
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Put "Contents", List of figure, table on the centre of the p

Post by Stefan Kottwitz »

Hi Davide,

which error did you get?
Perhaps you didn't include the titlesec package in your document preamble:

Code: Select all

\usepackage{titlesec}
Stefan
LaTeX.org admin
newnoise
Posts: 19
Joined: Thu Aug 21, 2008 11:57 am

Re: Put "Contents", List of figure, table on the centre of the p

Post by newnoise »

I've solved the problem with this

\usepackage{titlesec}
\titleformat{\section}[block]
{\filcenter\large
\addtolength{\titlewidth}{2pc}%
%\titleline*[c]{\titlerule*[.6pc]{\tiny\textbullet}}%
\addvspace{6pt}%
\bfseries\huge\sffamily}
{\thesection}{1em}{}
\titlespacing{\section}
{5pc}{*2}{*2}[5pc]

/davide
Post Reply