# FancyHDR Problem

I'm having a hard time with fancyhdr package in overleaf. My goal is make a header where the \subsection apper on the top left side of odd pages. In even pages, i want the the \section to appear on the top right side (see images, which aren't mine).

\documentclass[12pt,a4paper,twoside]{article}
\usepackage[turkish]{babel}
\usepackage{fancyhdr}
\usepackage{blindtext}
\fancyhf{}
\pagestyle{fancy}

\begin{document}

\section{Section name} \newpage

\subsection{Subsection name}
firstpage \newpage

second page \newpage
... next page
%\input{sections/1introduction.tex}
\end{document}



If you notice, i put % in the front of \input{sections/1introduction.tex} because wheter i let this line to compile, only the \section name apper in the header. Any leads to solve this problem? If it might help, i divide my document in sections which i input them in the same way that is showed above.

Welcome to TeX.SX! If you just swap the \rightmark and \leftmark, you will get the name of the subsection on top left of odd pages and the name of the section on the top right of even pages.

\fancyhead[RE]{\leftmark}

To make it more like the style you have in the picture, you can add \textit before the commands, like \textit{\leftmark} in the first line.