Hello,

I'm new to LyX and TeX and while searching for resources about document
styling I came across several tutorials. One of them explained how to use
fancyhdr, which worked perfectly using the book document class.
Later I came across these blog posts:
http://hstuart.dk/2007/05/21/styling-the-chapter/
http://hstuart.dk/2007/06/12/styling-the-page-footer-and-header/

So I started using the document class to "book (Memoir)" to style the
chapters as described in the fist blog spot, but for some reason I can't
style the page header.
Changing the page layout using Document > Settings > Page layout doesn't
work either, it always end up using the "plain" header style.

I tried using fancyhdr again, but it doesn't work. Apparently the memoir
document class already includes an implementation of it or something like
that.


I'm using Windows XP SP3 and LyX 2.0.3.

This is my local layout:

Style Chapterstar

Copystyle Chapter

LatexName chapterstar

LabelType Top_Environment

LabelString "Unnumbered chapter"

LabelFont

Series Bold

Size LARGE

EndFont

End



This is my preamble:
%used by the cover
\usepackage{graphicx}

% T1 Helvetica scaled
\usepackage[T1]{fontenc}
\usepackage[scaled]{helvet}
\renewcommand*{\familydefault}{\sfdefault}

% Chapter style
\usepackage{xcolor,calc}

\makechapterstyle{combined}{
  \setlength{\beforechapskip}{30pt}
  \setlength{\midchapskip}{-60pt}
  \setlength{\afterchapskip}{60pt}
  \renewcommand*{\printchaptername}{}

\renewcommand*{\chapnumfont}{\normalfont\sffamily\bfseries\fontsize{80}{0}\selectfont}

\renewcommand*{\printchapternum}{\flushright\chapnumfont\textcolor[rgb]{.64,.79,.87}{\thechapter}}
  \renewcommand*{\chaptitlefont}{\normalfont\sffamily\Huge\bfseries}
  \renewcommand*{\printchaptertitle}[1]{%
    \raggedright\chaptitlefont\parbox[t]{\textwidth-3cm}{\raggedright##1}}
}

\chapterstyle{combined}

% Code listing
\usepackage{listings,color}

\definecolor{dkgreen}{RGB}{63,127,95}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{light-gray}{rgb}{0.925,0.925,0.925}
\definecolor{mauve}{RGB}{127,0,85}

 \lstset{
        language=Java,
        backgroundcolor=\color{light-gray},
         basicstyle=\footnotesize\ttfamily,
         numbers=left,
         numberstyle=\tiny,
         numbersep=5pt,
         tabsize=2,
         extendedchars=true,
         breaklines=true,
         keywordstyle=\color{mauve}\textbf,
         frame=b,
         commentstyle=\color{dkgreen},
         stringstyle=\color{blue},
         showspaces=false,
         showtabs=false,
         xleftmargin=17pt,
         framexleftmargin=17pt,
         framexrightmargin=5pt,
         framexbottommargin=4pt,
         showstringspaces=false
 }
 \lstloadlanguages{
         %[Visual]Basic
         %Pascal
         %C
         %C++
         %XML
         %HTML
         Java
 }
%\DeclareCaptionFont{blue}{\color{blue}}

%\captionsetup[lstlisting]{singlelinecheck=false, labelfont={blue},
textfont={blue}}
\usepackage{caption}
\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\colorbox[cmyk]{0.43, 0.35,
0.35,0.01}{\parbox{\textwidth}{\hspace{15pt}#1#2#3}}}
\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white,
singlelinecheck=false, margin=0pt, font={bf,footnotesize}}

% New style chapter star, so we can have unumbered chapters to show in ToC
\newcommand{\tocchap}[1]{\addcontentsline{toc}{chapter}{\protect\numberline
{}#1}\markboth{\textsc{#1}}{\textsc{#1}}\thispagestyle{plain}}
\newcommand{\chapterstar}[1]{\chapter*{#1}\tocchap{#1}}

% Sections are not numbered
\setcounter{secnumdepth}{0}

% Vertical gap between paragraphs
\setlength{\parskip}{\medskipamount}


Thanks in advance,

Fabio.

Reply via email to