I have the same problem as How to use short subsection title in header but not in table of contents?, and the solution given works almost well.
The difference is that also use the package titlesec. Here the code
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{fancyhdr}
\usepackage{titlesec}
\pagestyle{fancy}
\newcommand{\markedsection}[2]{\section[#2]{#2%
\sectionmark{#1}}
\sectionmark{#1}}
\newcommand{\markedsubsection}[2]{\subsection[#2]{#2%
\subsectionmark{#1}}
\subsectionmark{#1}}
\lhead{\nouppercase \leftmark} \chead{} \rhead{\nouppercase \rightmark}
\begin{document}
\thispagestyle{plain}
\tableofcontents
\markedsection{short section}{Some section with quite a lengthy title}
\lipsum
\markedsubsection{short subsection}{Very very very long title of subsection}
\lipsum
\end{document}
But on the page where the subsection appears for the first time, the title in the header has not been modified, it is still the original long title, whereas on the next pages, the subsection titles ih the header is the short one. I want of course the short one even the first time. If I remove the titlesec package, everything works fine, as on the other post. Can anyone help me with that ?



\markbothand this is actually the problem. So the use of fancyhdr would be better for me for those reasons, but I will have again my original problem... I don't know if this is very clear – Antoine Apr 19 '16 at 09:30\bibliographythe header is the number of the previous section followed by "References", even using\bibliographystyle{plain}. So the number shoud not be there – Antoine Apr 19 '16 at 11:24biblatexfor your bibliography? – Bernard Apr 19 '16 at 11:36bibtex– Antoine Apr 19 '16 at 11:51\nonumsectionwith this adapted code:\newcommand\nonumsection[2][]{\setcounter{secnumdepth}{0}\def\thesection{\relax}\ifblank{#1}{\section{#2}}{\section[#1]{#2}}\par \setcounter{secnumdepth}{2}}. For the rest, it would be easier to have a concrete example. I suppose that if a section is unnumbered, you want its subsections to be unnumbered too? – Bernard Apr 21 '16 at 11:54bibetcpage style is done for that (if you don't like smallcaps in header, remove it from the code). So don't callownstylein the preamble. Instead callbibetcjust before the introduction, theownstyleafter the intro andbibetcagain just before the conclusion. This should reasonably work. – Bernard Apr 21 '16 at 12:17section*{}, right (since I want the section unnumbered) ? I am asking because using thebibetcstyle, I don't have anything for the introduction, and in the header of the conclusion, I have just the title of the previous section – Antoine Apr 21 '16 at 12:30