%20en%20el%20encabezado%3F.png)
Estoy escribiendo un libro de reglas de juego en el que los títulos de las partes se muestran en dos líneas. La primera línea es la misma que el título corto (p. ej. \part[introduction]{introduction\\PARTIE PREMIÈRE}\label{\thepart}
) y quiero agregar solo la línea superior/título corto al encabezado. Logré que funcione con este código: \fancyhead[CE]{\textsc{\nameref{\thepart}}}
pero cuando lo personalizo \part
con el paquete titlesec, desaparece del encabezado. No "??" o errores, solo un encabezado vacío. (El encabezado de las páginas impares muestra el nombre corto del capítulo y funciona sin problemas aunque he personalizado su estilo).
Aquí está el código completo:
\documentclass[a4paper,twocolumn,openright,14pt]{memoir}
\usepackage[french]{babel}
\usepackage{blindtext}
\usepackage{fancyhdr}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{titling}
\usepackage{nameref}
\usepackage{pdfpages}
\usepackage{pifont}
\usepackage[explicit]{titlesec}
\titleformat{\part}[display]
{\fontsize{21pt}{15pt}\scshape\centering}
{#1}
{1em}
{}
\titleformat{\chapter}[display]
{\fontsize{18pt}{15pt}\scshape\centering}
{#1\\\ligne}
{1em}
{}
\titlespacing{\chapter}{0pt}{0pt}{-40pt}
\newcommand{\chry}
{\ding{97}}
\newcommand{\ligne}
{\vspace{0.5cm}\fancybreak{
\begin{tikzpicture}\draw[line width=0.45mm](0,0)--(3.75,0);\end{tikzpicture}
}\vspace{0.5cm}}
\newcommand{\petiteligne}
{\vspace{0.5cm}\fancybreak{
\begin{tikzpicture}\draw[line width=0.45mm](0,0)--(1.875,0);\end{tikzpicture}
}\vspace{0.5cm}}
\renewcommand{\headrulewidth}
{0.45mm}
\fancyhf{}
\fancypagestyle{plain}
{\renewcommand{\headrulewidth}
{0pt}\fancyhf{}}
\begin{document}
%Titre
\begin{titlingpage}
\includepdf{titre}
\end{titlingpage}
%/Titre
\cleardoublepage
%Préface
\blindtext[5]
\thispagestyle{empty}
\pagestyle{fancy}
\fancyhead[CE,CO]{\textsc{préface}}
\fancyhead[LE,RO]{\thepage}
\pagenumbering{Roman}
%/Préface
\cleardoublepage
%Contenu
\fancyhead[CE]{\textsc{\nameref{\thepart}}}
\fancyhead[CO]{\textsc{\nameref{\thepart.\thechapter}}}
\pagenumbering{arabic}
\part[introduction]{introduction\\PARTIE PREMIÈRE}\label{\thepart}
\chapter[univers]{univers\\CHAPITRE PREMIER}\label{\thepart.\thechapter}
\blindtext[2]
\petiteligne
\blindtext[2]
%/Contenu
\end{document}
Respuesta1
Descubrí como gracias a@Martin Scharrer! Aquí está el código sin etiquetas:
\newcommand*\parttitle{}
\let\origpart\part
\renewcommand*{\part}[2][]{%
\ifx\\#1\\% optional argument not present?
\origpart{#2}%
\renewcommand*\parttitle{#2}%
\else
\origpart[#1]{#2}%
\renewcommand*\parttitle{#1}%
\fi
}