1

I try to make a thesis in pdf and i like to put two things in:

  1. Change the style of chapters (Lenny);
  2. Put the chapter in a header top on the page;

When i use \usepackage{fancyhdr} to do that the bookmarks disappear !

I put here my template so you can see better where I am wrong:

\documentclass[11pt,a4paper]{book}
 \usepackage[dvips,colorlinks=true]{hyperref}
 \hypersetup{
    bookmarksnumbered=false,
    linkcolor=black,
    citecolor=black,
    pagecolor=black,
    urlcolor=black,
 }
\usepackage{amsmath,amstext}
\usepackage{amsthm}
\usepackage{amsfonts}

\theoremstyle{plain} \newtheorem{thm}{Teorema}[chapter] \newtheorem{cor}[thm]{Corollario} \newtheorem{lem}[thm]{Lemma} \newtheorem{prop}[thm]{Proposizione}

\theoremstyle{definition} \newtheorem{defn}{Definizione}[chapter]

\theoremstyle{remark} \newtheorem{oss}{Osservazione}

\usepackage[english,italian]{babel}

\frenchspacing \usepackage{verbatim} \usepackage{alltt}

\usepackage{graphicx}

\graphicspath{{./imgs/}}

\usepackage{subfigure}

\usepackage[bf]{caption2}

\addtolength{\oddsidemargin}{30pt} \addtolength{\evensidemargin}{-30pt}

\usepackage{multirow}

\usepackage{natbib}

\usepackage{lscape}

\usepackage{fancyhdr} % \usepackage[Sonny]{fncychap} % \usepackage[]{hyperref}

Thanks a lot for Your help !!!!

hola
  • 4,026
  • 3
  • 35
  • 72

1 Answers1

1

Your two questions can be solved as follows:

  1. Load the package hyperref as last package: Which packages should be loaded after hyperref instead of before?
  2. You are loading the package fancyhdr so you can use the package to modify your headers. In your case the following should work:

    \usepackage{fancyhdr}
    \fancyhead{}
    \fancyhead[RO,LE]{\leftmark}
    \pagestyle{fancy}
    

Here I made a minimal working example (MWE) without unnecessary information:

\documentclass[11pt,a4paper]{book}

\usepackage{blindtext}%filling text

\usepackage{fancyhdr}
\fancyhead{}
\fancyhead[RO,LE]{\leftmark}
\pagestyle{fancy}

\usepackage[Sonny]{fncychap}

\usepackage[colorlinks=true]{hyperref}
 \hypersetup{
    bookmarksnumbered=false,
    linkcolor=black,
    citecolor=black,
    pagecolor=black,
    urlcolor=black,
 }
\begin{document}
\tableofcontents

\Blinddocument
\Blinddocument

\end{document}
Marco Daniel
  • 95,681