2

I am in the process of writing my thesis with latex and I have a header issue in the glossary section.

I modified the headers using titlesec and I keep an abbreviations list with the glossaries package.

I provide here a MWE of my problem. Basically I would like even pages to show the page number and odd pages to show the page number and section name of the glossary. This works fine in the rest of my document but the glossary section is somehow different. Also, I would like the header in the blank page after the glossary to be just the page number.

\documentclass[
    openright,
    twoside,
    12pt]
    {report}

   \usepackage[
    paperwidth=16cm,
    paperheight=24cm]
    {geometry} 

\linespread{1.5}

\usepackage[
acronym,
nomain,
nonumberlist]
{glossaries} %for list of abbreviations

\usepackage[
    pagestyles] %option allow to change page header (remove "chapter" from header)
    {titlesec}
\titleformat{\chapter}{\normalfont\huge}{\bf\thechapter.}{20pt}{\huge\bf} %change chapter N to N. chapter title
\newpagestyle{mystyle} %page style for whole document
{\sethead[\thepage][][\thechapter .~\chaptertitle]{\thesection~\sectiontitle}{}{\thepage}
}
\newpagestyle{bibstyle} %page style for bibliography
{\sethead[\thepage][][\thechapter .~\chaptertitle]{}{}{\thepage}
}
\newpagestyle{content} %page style for forewords sections
{\sethead[\thepage][][]{\chaptertitle}{}{\thepage}
}

\usepackage{lipsum}

\newacronym {eeg} {EEG} {Electroencephalogram}
\newacronym {cam} {CAM} {Counting Arm Movement}
\newacronym {anova} {ANOVA} {Analysis Of Variance}
\newacronym {bci} {BCI} {Brain-Computer Interface}
\newacronym {ecam} {eCAM} {electronic Counting Arm Movement}
\newacronym {fes} {FES} {Functional Electrical Stimulation}
\newacronym {bb} {BB} {Biceps Brachii}
\newacronym {tb} {TB} {Triceps Brachii}
\newacronym {fcr} {FCR} {Flexor Carpi Radialis}
\newacronym {ecr} {ECR} {Extensor Carpi Radialis}
\newacronym {st} {ST} {Sensory Threshold}
\newacronym {vas} {VAS} {Visual Analog Scale}
\newacronym {cns} {CNS} {Central Nervous System}
\newacronym {tms} {TMS} {Transcranial Magnetic Stimulation}
\newacronym {tdcs} {tDCS} {transcranial Direct Current Stimulation}
\newacronym {cbi} {CBI} {Cerebellum-Brain Inhibition}
\newacronym {atdcs} {atDCS} {anodal tDCS}
\newacronym {ctdcs} {ctDCS} {cathodal tDCS}
\newacronym {emg} {EMG} {Electromyogram}
\newacronym {fft} {FFT} {Fast Fourier Transform}
\newacronym {psd} {PSD} {Power Spectral Density}
\newacronym {pse} {PSE} {Power Spectral Entropy}
\newacronym {kld} {KLD} {Kullback-Leibler Divergence}
\newacronym {lc} {LC} {Laterality Coefficient}
\newacronym {snk} {SNK} {Student-Newman-Keuls}
\newacronym {tccdcs} {tCCDCS} {transcranial Cerebello-Cerebral Direct Current Stimulation}
\newacronym {icc} {ICC} {Intra-Class Coefficient}
\newacronym {cv} {CV} {Coefficient of Variation}
\newacronym {csf} {CSF} {Cerebrospinal Fluid}
\newacronym {nmda} {NMDA} {N-methyl-D-aspartate}
\newacronym {bmi} {BMI} {Brain-Machine Interface}
\newacronym {ecog} {ECoG} {Electrocorticogram}
\newacronym {meg} {MEG} {Magnetoencephalogram}
\newacronym {pet} {PET} {Positron Emission Tomography}
\newacronym {fmri} {fMRI} {functional Magnetic Resonance Imaging}
\newacronym {erd} {ERD} {Event-Related Desynchronization}
\newacronym {ers} {ERS} {Event-Related Synchronization}

\makeglossaries

\begin{document}
\pagestyle{content}

\printglossary[title = List of abbreviations]


\pagestyle{mystyle}
\chapter {First Chapter}

\glsaddall 
\lipsum[1-1]
\lipsum[2-2]

\end{document}

And this is the resulting document (I marked in red and blue what I would like to be changed):

first glossary page is fine second glossary page also fine third glossary page header missing blank page header is wrong remaining document is ok

3

There is a \cleardoublepage missing before the change of the page style. So page style mystyle is enabled on the last page of the glossary.

\cleardoublepage% <- added
\pagestyle{mystyle}

Or you have to move \pagestyle{mystyle} behind/below \chapter{First Chapter} as suggested by @Schweinebacke in a comment.

enter image description here

enter image description here

\documentclass[
    openright,
    twoside,
    12pt]
    {report}

   \usepackage[
    paperwidth=16cm,
    paperheight=24cm]
    {geometry} 

\linespread{1.5}

\usepackage[
acronym,
nomain,
nonumberlist]
{glossaries} %for list of abbreviations

\usepackage[
    pagestyles] %option allow to change page header (remove "chapter" from header)
    {titlesec}
\titleformat{\chapter}{\normalfont\huge}{\bf\thechapter.}{20pt}{\huge\bf} %change chapter N to N. chapter title
\newpagestyle{mystyle} %page style for whole document
{\sethead[\thepage][][\thechapter .~\chaptertitle]{\thesection~\sectiontitle}{}{\thepage}
}
\newpagestyle{bibstyle} %page style for bibliography
{\sethead[\thepage][][\thechapter .~\chaptertitle]{}{}{\thepage}
}
\newpagestyle{content} %page style for forewords sections
{\sethead[\thepage][][]{\chaptertitle}{}{\thepage}
}

\usepackage{lipsum}

\newacronym {eeg} {EEG} {Electroencephalogram}
\newacronym {cam} {CAM} {Counting Arm Movement}
\newacronym {anova} {ANOVA} {Analysis Of Variance}
\newacronym {bci} {BCI} {Brain-Computer Interface}
\newacronym {ecam} {eCAM} {electronic Counting Arm Movement}
\newacronym {fes} {FES} {Functional Electrical Stimulation}
\newacronym {bb} {BB} {Biceps Brachii}
\newacronym {tb} {TB} {Triceps Brachii}
\newacronym {fcr} {FCR} {Flexor Carpi Radialis}
\newacronym {ecr} {ECR} {Extensor Carpi Radialis}
\newacronym {st} {ST} {Sensory Threshold}
\newacronym {vas} {VAS} {Visual Analog Scale}
\newacronym {cns} {CNS} {Central Nervous System}
\newacronym {tms} {TMS} {Transcranial Magnetic Stimulation}
\newacronym {tdcs} {tDCS} {transcranial Direct Current Stimulation}
\newacronym {cbi} {CBI} {Cerebellum-Brain Inhibition}
\newacronym {atdcs} {atDCS} {anodal tDCS}
\newacronym {ctdcs} {ctDCS} {cathodal tDCS}
\newacronym {emg} {EMG} {Electromyogram}
\newacronym {fft} {FFT} {Fast Fourier Transform}
\newacronym {psd} {PSD} {Power Spectral Density}
\newacronym {pse} {PSE} {Power Spectral Entropy}
\newacronym {kld} {KLD} {Kullback-Leibler Divergence}
\newacronym {lc} {LC} {Laterality Coefficient}
\newacronym {snk} {SNK} {Student-Newman-Keuls}
\newacronym {tccdcs} {tCCDCS} {transcranial Cerebello-Cerebral Direct Current Stimulation}
\newacronym {icc} {ICC} {Intra-Class Coefficient}
\newacronym {cv} {CV} {Coefficient of Variation}
\newacronym {csf} {CSF} {Cerebrospinal Fluid}
\newacronym {nmda} {NMDA} {N-methyl-D-aspartate}
\newacronym {bmi} {BMI} {Brain-Machine Interface}
\newacronym {ecog} {ECoG} {Electrocorticogram}
\newacronym {meg} {MEG} {Magnetoencephalogram}
\newacronym {pet} {PET} {Positron Emission Tomography}
\newacronym {fmri} {fMRI} {functional Magnetic Resonance Imaging}
\newacronym {erd} {ERD} {Event-Related Desynchronization}
\newacronym {ers} {ERS} {Event-Related Synchronization}

\makeglossaries

\begin{document}
\pagestyle{content}
\printglossary[title = List of abbreviations]

\pagestyle{mystyle}
\chapter {First Chapter}
\pagestyle{mystyle}% <- moved behind the \chapter command
\glsaddall 
\lipsum[1-1]
\lipsum[2-2]
\end{document}
1
  • 1
    Or move \pagestyle{mystyle} behind/below \chapter{First Chapter}. Jul 24 '17 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.