Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

problems using fancyhdr in lyx

  • 18-11-2009 02:41PM
    #1
    Closed Accounts Posts: 5,284 ✭✭✭


    I need to set custom headers in a paper.
    I installed fancyhdr package, set it to use fancy headers in the document settings. Inserted the example code in the preamble from the fancyhdr documentation.
    No headers appear though. Document compiles without error, but there are no headers in it.

    edit: I see that if I increase the amount of content, that there are headers on the pages after the first page. I need headers on the first page too though

    here is the tex code:
    % Preview source code
    
    %% LyX 1.6.1 created this file.  For more info, see http://www.lyx.org/.
    %% Do not edit unless you really know what you are doing.
    \documentclass[10pt,twocolumn,english]{article}
    \usepackage{mathptmx}
    \renewcommand{\familydefault}{\rmdefault}
    \usepackage[T1]{fontenc}
    \usepackage[latin9]{inputenc}
    \usepackage{geometry}
    \geometry{verbose,a4paper,tmargin=2.54cm,bmargin=2.54cm,lmargin=3.3cm,rmargin=2.29cm,headheight=10pt,headsep=6pt,footskip=18pt,columnsep=1.25cm}
    \usepackage{fancyhdr}
    \pagestyle{fancy}
    \setlength{\parskip}{10pt}
    \setlength{\parindent}{0pt}
    \usepackage{babel}
    
    \usepackage[unicode=true, 
     bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
     breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
     {hyperref}
    \hypersetup{pdftitle={blah blah}}
     
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
    \lhead{}
    \chead{}
    \rhead{\bfseries The performance of new graduates}
    \lfoot{From: K. Grant}
    \cfoot{To: Dean A. Smith}
    \rfoot{\thepage}
    \renewcommand{\headrulewidth}{0.4pt}
    \renewcommand{\footrulewidth}{0.4pt}
    
    \begin{document}
    


Comments

  • Registered Users, Registered Users 2 Posts: 13,104 ✭✭✭✭djpbarry


    pwd wrote: »
    I see that if I increase the amount of content, that there are headers on the pages after the first page. I need headers on the first page too though
    Is the first page a title page or the beginning of a chapter? Because LaTex defaults to clear headers for these. You need to override the default setting. For example:
    \chapter{Chapter 1} \thispagestyle{fancy}
    


Advertisement