1

I used fancyhdr and the solution of the how to use fancyhdr package to customize headers in landscape page post to create header on the top of landscape page. but i got familiar with Titleps package and i want to try that but again pdflscape did not work (the attached image)

enter image description here

insted of pdflscape, I used the solution of that post but i got following error:

LaTeX Warning: No \author given.

[1{e:/texlive/2013/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./untitled-2.toc) [1] <pic/male.jpg, id=15, 265.99374pt x 265.99374pt>
<use pic/male.jpg> [1 <./pic/male.jpg>]
! Undefined control sequence.
l.75 \headwidth
           =\textheight

i used the following MWE

\documentclass[12pt]{article}               
\usepackage[left=2cm, right=2cm, bottom=2cm, top=3cm]{geometry}
\geometry{letterpaper} 

\usepackage{amssymb,amsmath}
\usepackage{epstopdf}
\usepackage{setspace}
\usepackage{amsthm}
\usepackage{tikz}
\usepackage{float} %place image here
\usepackage{pdflscape,lipsum} %landscape page
\usepackage[absolute]{textpos}
\usepackage{pdfpages,titleps}
\usepackage[pdfpagelabels,draft,implicit=false]{hyperref}




\newpagestyle{main}{%
  \setheadrule{0.5pt}%
  \sethead{\thesection~\sectiontitle}                      % header left
    {}                                                    % header center
    {\thesubsection~\subsectiontitle\quad$|$\quad\thepage}% header right
}
\pagestyle{main}




\begin{document}


\newpage

\paperwidth=\pdfpageheight
\paperheight=\pdfpagewidth
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
\addtolength{\textheight}{1cm}
\headwidth=\textheight

\begingroup 
\vsize=\textwidth
\hsize=\textheight


\lipsum[1]

\endgroup

\end{document}

I really appreciate any help

4
  • Headwidth is used by fancyhdr only, if you don't want to use fancyhdr, you can remove that line. There's probably a similar command with the titleps package that you can use to specify the width of the header
    – user49901
    Commented May 17, 2015 at 6:48
  • @Grimler thanks i used \widenhead*{0pt}{15pc} and the 15 was experimental :) and after that i used \widenhead*{0pt}{0pc} to reset everything. everything is fine. tnx
    – lorraine
    Commented May 17, 2015 at 7:40
  • Can you extend your MWE with your solution and post it as an answer? It is easier for others to find it and take advantage.
    – Johannes_B
    Commented Jun 14, 2015 at 11:11
  • Is there any news here?
    – Johannes_B
    Commented May 9, 2016 at 8:51

1 Answer 1

1

The OP found that using \widenhead was a work around. To get the correct parameters just use the values of \textheight and \textwidth as follows:

\widenhead*{0pt}{\dimexpr\textheight-\textwidth}

Sample output

\documentclass[12pt]{article}

\usepackage[left=2cm, right=2cm, bottom=2cm, top=3cm]{geometry}
\geometry{letterpaper}

\usepackage{amssymb,amsmath}
\usepackage{epstopdf}
\usepackage{setspace}
\usepackage{amsthm}
\usepackage{tikz}
\usepackage{float} %place image here
\usepackage{pdflscape,lipsum} %landscape page
\usepackage[absolute]{textpos}
\usepackage{pdfpages,titleps}
\usepackage[pdfpagelabels,draft,implicit=false]{hyperref}

\newpagestyle{main}{%
  \setheadrule{0.5pt}%
  \sethead{\thesection~\sectiontitle}                      % header left
    {}                                                    % header center
    {\thesubsection~\subsectiontitle\quad$|$\quad\thepage}% header right
}
\pagestyle{main}




\begin{document}

\lipsum[1]

\clearpage

\paperwidth=\pdfpageheight
\paperheight=\pdfpagewidth
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
\addtolength{\textheight}{1cm}

\widenhead*{0pt}{\dimexpr\textheight-\textwidth}
\begingroup
\vsize=\textwidth
\hsize=\textheight

\lipsum[1]

\endgroup

\clearpage
\paperwidth=\pdfpageheight
\paperheight=\pdfpagewidth
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
\addtolength{\textheight}{-1cm}

\widenhead*{0pc}{0pc}
\lipsum[1]
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .