fancyhdr solo titolo capitolo

  • Creatore
    Topic
  • #8620
    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

Visualizzazione 3 filoni di risposte
  • Autore
    Risposte
    • #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

      • #8622
        Up
        0
        Down
        ::


        Grazie mille, ho utilizzato il codice

        `\usepackage{fancyhdr}

        \pagestyle{fancy}
        \fancyfoot{}
        \renewcommand{\chaptermark} [1]{\chaptername\ \thechapter.\ #1}{}
        \renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}
        \fancyhead[LE,RO]{\bfseries\thepage}
        \fancyhead[L]{\bfseries\leftmark}

        \renewcommand{\headrulewidth}{0.3pt}`

        e tutto va come desideravo.

        Alla prossima, Delia.

      • #8623
        DMW
          Up
          0
          Down
          ::

          Grazie mille, ho utilizzato il codice

          `\usepackage{fancyhdr}

          \pagestyle{fancy}
          \fancyfoot{}
          \renewcommand{\chaptermark} [1]{\chaptername\ \thechapter.\ #1}{}
          \renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}
          \fancyhead[LE,RO]{\bfseries\thepage}
          \fancyhead[L]{\bfseries\leftmark}

          \renewcommand{\headrulewidth}{0.3pt}`

          e tutto va come desideravo.

          Alla prossima, Delia.

          Devo ammettere che il tuo codice non è un gran che perché visualizza sia a destra che a sinistra il capitolo. Per rimediare metti \fancyhead{} al posto di \fancyfoot{} . Poi il primo \renewcommand è superfluo ed anche errato quindi lo puoi togliere. Io se fossi in te visto che usi solo fronte, proverei con
          `
          \pagestyle{fancy}
          \fancyhead{}
          \renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}
          \fancyhead[LE,RO]{\bfseries\thepage}
          \fancyhead[CE]{\bfseries\leftmark}`

          Ti consiglio il manuale di fanchyhdr che è anche in italiano
          ftp://tug.ctan.org/pub/tex-archive/info/italian/fancyhdr/itfancyhdr.pdf

          Ciao

          Andrea

        • #8624
          Up
          0
          Down
          ::


          Grazie, ma andava meglio in quel modo

          mi mette n°capito e titolo capitolo a sinistra
          e a destra il numero di pagina

          Al momento ho anche molta fretta di finire, per cui me lo tengo così, visto che funziona.

      Visualizzazione 3 filoni di risposte
      • Devi essere connesso per rispondere a questo topic.

      Go to top