I've inserted a table of contents with LyX using Insert->List/TOC->Table of Contents and it is good, but the text color text is red and I want it black. I'm using book(KOMA-script) as document class.


Ok, here's a .lyx testing code

#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
\textclass scrbook

\usepackage{tikz, pgf, pgfplots}
\pgfplotsset{plot coordinates/math parser=false}


\usepackage{fancyhdr} %activamos el paquete
\date {}
\pagestyle{fancy} %seleccionamos un estilo
 \lhead{ECUACIONES} %texto izquierda de la cabecera
 \rhead{\thepage }
\chead{TEORÍA Y EJERCICIOS} %texto centro de la cabecera
 \rfoot{RESOLUCIÓN ECUACIONES} %texto izquierda del pie
\rhead{\thepage } %número de página a la derecha

% Referencias - Enlaces
citecolor=red, urlcolor=blue]{hyperref}

\renewcommand{\thefigure}{\arabic {figure}}

\renewcommand{\baselinestretch }{1.2}

\usepackage[superscript]{cite} %las citas

\renewcommand\citeform[1]{\textcolor{blue}{#1}}  % Ponemos las citas en azul


\use_default_options true
\maintain_unincluded_children false
\language spanish
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing onehalf
\use_hyperref false
\papersize a4paper
\use_geometry false
\use_amsmath 1
\use_esint 1
\use_mhchem 1
\use_mathdots 1
\cite_engine basic
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\use_refstyle 0
\index Index
\shortcut idx
\color #008000
\leftmargin 3cm
\topmargin 2cm
\rightmargin 3cm
\bottommargin 2cm
\headheight 3cm
\headsep 3cm
\footskip 3cm
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false


\begin_layout Title

\begin_layout Subtitle
Testing 2

\begin_layout Author
Joy Division

\begin_layout Standard
\begin_inset CommandInset toc
LatexCommand tableofcontents



\begin_layout Chapter
Chapter 1

\begin_layout Section
Section 1

\begin_layout Standard
A testing section

\begin_layout Subsection
Subsection 1

\begin_layout Standard
A testing subsection

\begin_layout Chapter
Chapter 2

\begin_layout Section
Section 2

\begin_layout Standard
Another testing section

\begin_layout Subsection
Subsection 2

\begin_layout Standard
Another subsection

  • I don't see this behaviour, can you create a minimal document showing the problem (e.g. one containing just an index entry), and edit you question to include the contents of the .lyx file and/or the exported LaTeX source code? Also, which version of LyX do you have, I don't have an Index submenu under Insert. Oct 15, 2013 at 11:25
  • I'm using LYX 2.0.6 Miktex and Windows I don't know what is the exact path to insert this index in english language cuz i'm using lyx in Spanish language, but it is something like that Insert->Index->General Index
    – Tobal
    Oct 15, 2013 at 17:57
  • 1
    Note that you should always post a minimal example for questions like this, especially if you have a non-trivial preamble like you have.
    – scottkosty
    Oct 15, 2013 at 18:50

1 Answer 1


In your preamble you have the following:

citecolor=red, urlcolor=blue]{hyperref}

This activates the hyperref package, which creates clickable hyperlinks of table of contents entries, cross references and similar. With colorlinks=true these links are given a colour, and as you've specified linkcolor=red the ToC entries are red. Change the colours to black, or use


instead. hidelinks causes all links to be printed black, as the surrounding text.

If you have activated hyperref using the LyX interface you need to change this inside the Document --> Settings --> PDF Properties, where Use Hyperref Support will be checked. There is a box for additional options at the bottom, in here you can add your details, for example


So as my TOC and internal links are in black (rather than the default of red and green). If you have both activated this and added \usepackage{hyperref} with other options to the LaTeX preamble, you may get errors when viewing the PDF.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .