LyXTitle without number but in the index

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
Gabriel
Posts: 4
Joined: Tue Nov 20, 2007 1:57 am

Title without number but in the index

Post by Gabriel »

Hi,
I use the "section*" type to get titles without numbers. But i want them to be in the index, do you know how to do?
New on Latex using Lyx ang Jabref
System: Linux Ubuntu 7.10

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

Title without number but in the index

Post by gmedina »

Use the \addcontentsline command just after the \section* command as the following example shows

Code: Select all

\documentclass{article}

\begin{document}

\tableofcontents

\section*{First section}
\addcontentsline{toc}{section}{First section}
Some text.
\section*{Second section}
\addcontentsline{toc}{section}{Second section}
Some more text.
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Gabriel
Posts: 4
Joined: Tue Nov 20, 2007 1:57 am

Re: Title without number but in the index

Post by Gabriel »

Thank you but i'm totally new on Latex and Lyx, so i don't know where to add the code you gave me.
In the code view, i can't edit the Latex code.
New on Latex using Lyx ang Jabref
System: Linux Ubuntu 7.10
User avatar
Maksi
Posts: 52
Joined: Sun Mar 16, 2008 12:12 pm

Re: Title without number but in the index

Post by Maksi »

In LyX, LaTeX code is always inserted via ERT (which stands for Evil Red Text). So, make a section* and then click on the ERT butten and then type the \addtocontentsline-command as written above.
A Humanities user of LaTeX :)
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Title without number but in the index

Post by Stefan Kottwitz »

Hi Gabriel,

do you want every section without number? I'm asking because you mentioned several titles.
In that case you can use \section and decrease the secnumdepth-counter:

Code: Select all

\setcounter{secnumdepth}{0}
Stefan
annez
Posts: 1
Joined: Thu Sep 15, 2011 3:10 pm

Re: Title without number but in the index

Post by annez »

hey! i tried using the \addcontentsline{toc}{section}{First section}
there was no number infront of the section, however it did have a number in the contentlist:

The index should have been
nomenclature
1 introduction
2 methodology

what i now have is however
1 nomenclature
2 introduction
even though the introductionsection is numbered 1 in the actual text..

any tips on this?
Post Reply