LaTeX forum ⇒ Page LayoutHeader is empty Topic is solved

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Matam
Posts: 29
Joined: Thu Jun 07, 2018 12:12 pm

Header is empty

Postby Matam » Sat Jun 09, 2018 7:00 pm

Header in Acknowledgement and Abstract pages is empty. Please help me correct it. Please, see the
Below is the code.
  1. \documentclass[11pt, a4paper, oneside]{thesis}
  2. \usepackage[body={7.0in, 9.5in},top=1.2in, left=1.69in, right=1.0in, includefoot]{geometry}
  3. \bibliographystyle{IEEEtran}
  4. \hyphenation{op-tical net-works semi-conduc-tor}
  5. \usepackage{wrapfig}
  6. \usepackage[utf8]{inputenc}
  7. \usepackage[english]{babel}
  8. \usepackage{graphicx}
  9. \usepackage{amsmath}
  10. \usepackage{multirow}
  11. \setcounter{secnumdepth}{3}
  12. \usepackage{pdfpages}
  13. \usepackage[nottoc,notlof,notlot]{tocbibind}
  14. %\renewcommand\bibname{References}
  15. \usepackage{cite}
  16. %\usepackage{natbib}
  17. \usepackage{float}
  18. \usepackage{color}
  19. \usepackage{algorithm,algpseudocode}
  20. \usepackage[graphicx]{realboxes}
  21. \usepackage{varwidth}
  22. \renewcommand{\baselinestretch}{1.3}
  23. \usepackage{titlesec} % Modifica títulos
  24.  
  25.  
  26. \titleformat{\chapter}[hang]
  27. {\LARGE\normalfont\bfseries}
  28. {\thechapter}{1em}{}
  29. \titleformat{name=\chapter,numberless}[hang]
  30. {\normalfont\LARGE\bfseries\filcenter}{}{1ex}{}{}
  31. \titleformat{\section}[hang]{\normalfont\bfseries}{\thesection}{0.5em}{}
  32.  
  33.  
  34. \titleformat{\chapter}[display]
  35. {\normalfont\Huge\bfseries}{Chapter\ \thechapter}{10pt}{\Huge}
  36.  
  37.  
  38. \titleformat{\subsection}[hang]{\normalfont\bfseries}{\thesubsection}{0.5em}{}
  39. \titleformat{\subsubsection}[hang]{\normalfont\bfseries}{\thesubsubsection}{0.5em}{}
  40.  
  41. \titlespacing{\chapter}{0pt}{0pt}{40pt}
  42. \titlespacing{\section}{0pt}{\baselineskip}{0.625\baselineskip}
  43. \titlespacing{\subsection}{0pt}{\baselineskip}{0.6\baselineskip}
  44. \titlespacing{\subsubsection}{0pt}{\baselineskip}{\baselineskip}
  45. \usepackage{tikz}
  46. \usetikzlibrary{shapes,arrows}
  47. \newcommand*\circled[1]{\tikz[baseline=(char.base)]{
  48. \node[shape=circle,draw,inner sep=0.5pt] (char) {#1};}}
  49. \usetikzlibrary{calc}
  50. \usetikzlibrary{calc,matrix}
  51. \usepackage[skip=2pt,font=scriptsize]{caption}
  52. \usepackage{subcaption}
  53. \usepackage{array}
  54. \usepackage{mdwmath}
  55. \usepackage{mdwtab}
  56. \usepackage{multirow}
  57. \usepackage{siunitx}
  58. \usepackage{soul}
  59. \usepackage{cancel}
  60. \usepackage{amssymb}% http://ctan.org/pkg/amssymb
  61. \usepackage{pifont}% http://ctan.org/pkg/pifont
  62. \newcommand{\cmark}{\ding{41}}%
  63. \newcommand{\xmark}{\ding{55}}
  64. %\usetikzlibrary{calc,matrix}
  65. \usepackage{color,soul}
  66. \usepackage{enumerate}
  67. \usepackage{IEEEtrantools}
  68. \usepackage{bbding}
  69. %\bibliographystyle{ieeebib}
  70. \usepackage{rotating}
  71. \usepackage{listings}
  72. \usepackage{lineno}
  73. \usepackage{lscape}
  74. \usepackage{adjustbox}
  75. %\modulolinenumbers[1]
  76. \lstdefinestyle{mystyle}{
  77. breakatwhitespace=false,
  78. breaklines=true,
  79. captionpos=b,
  80. keepspaces=true,
  81. numbers=left,
  82. numbersep=20pt,
  83. showspaces=false,
  84. showstringspaces=false,
  85. showtabs=false,
  86. tabsize=2
  87. }
  88. \lstset{style=mystyle}
  89. % % Nomenclature commands
  90. \usepackage[intoc]{nomencl}
  91. \makenomenclature
  92.  
  93. \usepackage[toc,nopostdot,nonumberlist,acronym,section]{glossaries}
  94. \newrobustcmd{\bffirst}[1]{{\let\mfirstucMakeUppercase\textbf\capitalisewords{#1}}}
  95.  
  96. \newacronymstyle{bf-long-short}{\GlsUseAcrEntryDispStyle{long-short}}{\GlsUseAcrStyleDefs{long-short}\renewcommand*{\GenericAcronymFields}{description={\bffirst{\the\glslongtok}}}}
  97. \setacronymstyle{bf-long-short}
  98.  
  99. \newglossary[ch1]{chstyle}{ch2}{ch3}{List of Greek Symbols}
  100. \makeglossaries
  101. \glsdisablehyper
  102.  
  103. \newglossarystyle{csyle}{%
  104. \glossarystyle{list}%
  105. \renewcommand*{\glossaryentryfield}[5]{%
  106. \item[\glsentryitem{##1}\glstarget{##1}{##2}]%
  107. \hspace{2.5cm}##3\glspostdescription\dotfill ##5}%
  108. }
  109. %\renewcommand{\chaptername}[2]{\chaptername{#1} \thechapter{#2}}
  110.  
  111. % %
  112.  
  113.  
  114. \include{glossary-nomen-entries}
  115. \begin{document}
  116. ...
  117. ..
  118.  
  119. \clearpage
  120.  
  121.  
  122. \newpage
  123. \pagenumbering{roman}
  124. \addcontentsline{toc}{chapter}{Acknowledgement}
  125. \chapter*{\centering Acknowledgment}
  126. ............
  127.  
  128. \pagebreak
  129. \clearpage
  130. \addcontentsline{toc}{chapter}{Abstract}
  131. \chapter*{\centering Abstract}
  132. .................
  133.  
Attachments
abstrHeader.png
abstrHeader.png (82.18 KiB) Viewed 421 times
acknowHeader.png
acknowHeader.png (116.54 KiB) Viewed 421 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 9151
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Jun 10, 2018 11:30 am

Chapter starting pages have a different page style by default, since it doesn't make much sense to repeat the huge chapter title in the header as header line (if it's put there). You used \chapter for acknowledgement and abstract.

You could switch at such places this way:

  1. \chapter*{Acknowledgment}
  2. \thispagestyle{headings}


Stefan
Site admin

rais
Posts: 175
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Sun Jun 10, 2018 4:10 pm

I think the OP rather needs \markboth here...yet again.

KR
Rainer

User avatar
Stefan Kottwitz
Site Admin
Posts: 9151
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Jun 10, 2018 4:48 pm

Hi Rainer,

I guess \markboth doesn't help because the page style is plain there by default, so it wouldn't show a head mark even if it has been set.

By changing the page style the header would show the page number. But indeed, if a header "Abstract" shall be put above the actual heading "Abstract" :-o an additional \markboth{Abstract}{Abstract} could do that.

Now while writing I see the OP means the second page (I never thought an abstract would take several pages) - in that case that \markboth is needed, yes.

Stefan
Site admin

Matam
Posts: 29
Joined: Thu Jun 07, 2018 12:12 pm

Postby Matam » Sun Jun 10, 2018 5:43 pm

It worked. Excellent. I think \markboth did had an impact to change it. Thanks Rainer.
Thanks a ton stefan. Please find the attached screen shots.

The code i entered is given below:

  1. .
  2. .
  3. \clearpage
  4. \newpage
  5. \cleardoublepage
  6. \pagenumbering{roman}
  7. \addcontentsline{toc}{chapter}{Acknowledgement}
  8. \thispagestyle{headings}
  9. \markboth{Acknowledgment}{Acknowledgment}
  10. \chapter*{\centering Acknowledgment}
  11. ..
  12. ..
  13.  
Attachments
ABSTRACT_DONE.png
ABSTRACT_DONE.png (75.01 KiB) Viewed 384 times
ACKNOWLEDGEMENT_DONE.png
ACKNOWLEDGEMENT_DONE.png (73.73 KiB) Viewed 384 times


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 2 guests