Centrado de marca izquierda y marca derecha de Fancyhdr

Centrado de marca izquierda y marca derecha de Fancyhdr

Me gustaría saber cómo fue posiblecentrolos capítulos y secciones marcan (no sé si lo llaman así) con este código (MWE)

 \documentclass[10pt,twoside]{book}

 \usepackage{lipsum}

 \usepackage{fancyhdr}

 \fancyhf{}

 \fancyhead[RE]{\leftmark}

  \fancyhead[LO]{\rightmark}

  \fancyhead[LE,RO]{\thepage}

  \renewcommand\headrulewidth{0pt}

  \renewcommand\chaptermark[1]{\markboth{\scshape#1}{}} 

  \renewcommand\sectionmark[1]{\markright{\scshape #1}}

\begin{document}


 \chapter{chapter} % Even page header
 \lipsum[1]
 \section{section} % odd page header
  \lipsum[1-5]


  \end{document}

Respuesta1

Aquí hay un código. Se le olvidó declarar el estilo de la página como "elegante":

 \documentclass[10pt,twoside]{book}

 \usepackage{lipsum}
 \usepackage{fancyhdr}

 \fancyhf{}
 \fancyhead[CE]{\leftmark}
  \fancyhead[CO]{\rightmark}
  \fancyhead[LE,RO]{\thepage}
  \renewcommand\headrulewidth{0pt}

  \renewcommand\chaptermark[1]{\markboth{\scshape#1}{}}

  \renewcommand\sectionmark[1]{\markright{\scshape #1}}
  \pagestyle{fancy}

    \begin{document}

     \chapter{A First Chapter} % Even page header
     \lipsum
     \section{A section} % odd page header
      \lipsum[1-10]

  \end{document} 

ingrese la descripción de la imagen aquí

Editar: Si quieres tener sólo los títulos en los encabezados, es más fácil con titleps:

 \documentclass[10pt,twoside]{book}

 \usepackage{lipsum}
 \usepackage{titleps}


  \newpagestyle{mine}[\scshape]{%
  \sethead[\thepage][\chaptertitle][]{}{\sectiontitle}{\thepage}
   }
   \pagestyle{mine}
    \begin{document}

     \chapter{A First Chapter} % Even page header
     \lipsum
     \section{A section} % odd page header
      \lipsum[1-10]

  \end{document} 

ingrese la descripción de la imagen aquí

información relacionada