Re: fancyhdr solo titolo capitolo

#8621
DMW
    Up
    0
    Down
    ::

    Scusate, sto usando fancyhdr, con questo codice:

    `\pagestyle{fancy}
    \fancyfoot{}
    \renewcommand{\chaptermark} [1]{\chaptername\ \thechapter.\ #1}{}
    \renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
    \fancyhead[LE,RO]{\bfseries\thepage}

    \fancyhead[LE]{\bfseries\leftmark}
    \fancyhead[RO]{\bfseries\rightmark}
    \renewcommand{\headrulewidth}{0.3pt} `

    Ma in questo modo mi mette il titolo del paragrafo, mentre io vorrei mi mettesse solo il titolo del capitolo.
    (il mio documento è a una sola facciata, non fronte/retro)
    Sapete come dovrei fare?
    Grazie

    La sezione tu la metti con \renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}} seguito da \fancyhead[RO]{\bfseries\rightmark} .

    Quindi alla sezione corrisponde il \rightmark mentre al capitolo il \leftmark.

    Quindi, devi togliere
    `\fancyhead[RO]{\bfseries\rightmark}` oppure sostituirlo con
    `\fancyhead[RO]{\bfseries\leftmark}` oppure scrivere al posto di \fancyhead[LE]{\bfseries\leftmark}
    \fancyhead[RO]{\bfseries\rightmark} , il più compatto
    `\fancyhead[L]{\bfseries\leftmark} %oppure la R a posto della L se lo vuoi a destra.`

    Ciao

    Andrea

    Go to top