LaTeX forum ⇒ Page LayoutHeader and page contents are different (PDF screen shot attached) 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 and page contents are different (PDF screen shot attached)

Postby Matam » Thu Jun 07, 2018 12:31 pm

  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. \renewcommand{\baselinestretch}{1.3}
  21. \usepackage{titlesec} % Modifica títulos
  22. \titleformat{\chapter}[hang]
  23. {\LARGE\normalfont\bfseries}
  24. {\thechapter}{1em}{}
  25. \titleformat{name=\chapter,numberless}[hang]
  26. {\normalfont\LARGE\bfseries\filcenter}{}{1ex}{}{}
  27. \titleformat{\section}[hang]{\normalfont\bfseries}{\thesection}{0.5em}{}
  28. \titleformat{\subsection}[hang]{\normalfont\bfseries}{\thesubsection}{0.5em}{}
  29. \titleformat{\subsubsection}[hang]{\normalfont\bfseries}{\thesubsubsection}{0.5em}{}
  30.  
  31. \titlespacing{\chapter}{0pt}{0pt}{40pt}
  32. \titlespacing{\section}{0pt}{\baselineskip}{0.625\baselineskip}
  33. \titlespacing{\subsection}{0pt}{\baselineskip}{0.6\baselineskip}
  34. \titlespacing{\subsubsection}{0pt}{\baselineskip}{\baselineskip}
  35. \usepackage{tikz}
  36. \usetikzlibrary{shapes,arrows}
  37. \newcommand*\circled[1]{\tikz[baseline=(char.base)]{
  38. \node[shape=circle,draw,inner sep=0.5pt] (char) {#1};}}
  39. \usetikzlibrary{calc}
  40. \usetikzlibrary{calc,matrix}
  41. \usepackage[skip=2pt,font=scriptsize]{caption}
  42. \usepackage{subcaption}
  43. \usepackage{array}
  44. \usepackage{mdwmath}
  45. \usepackage{mdwtab}
  46. \usepackage{multirow}
  47. \usepackage{siunitx}
  48. \usepackage{soul}
  49. \usepackage{cancel}
  50. \usepackage{amssymb}% <!-- m --><a class="postlink" href="http://ctan.org/pkg/amssymb">http://ctan.org/pkg/amssymb</a><!-- m -->
  51. \usepackage{pifont}% <!-- m --><a class="postlink" href="http://ctan.org/pkg/pifont">http://ctan.org/pkg/pifont</a><!-- m -->
  52. \newcommand{\cmark}{\ding{41}}%
  53. \newcommand{\xmark}{\ding{55}}
  54. %\usetikzlibrary{calc,matrix}
  55. \usepackage{color,soul}
  56. \usepackage{enumerate}
  57. \usepackage{IEEEtrantools}
  58. \usepackage{bbding}
  59. %\bibliographystyle{ieeebib}
  60. \usepackage{rotating}
  61. \usepackage{listings}
  62. \usepackage{lineno}
  63. \usepackage{lscape}
  64. \usepackage{adjustbox}
  65. %\modulolinenumbers[1]
  66. \lstdefinestyle{mystyle}{
  67. breakatwhitespace=false,
  68. breaklines=true,
  69. captionpos=b,
  70. keepspaces=true,
  71. numbers=left,
  72. numbersep=20pt,
  73. showspaces=false,
  74. showstringspaces=false,
  75. showtabs=false,
  76. tabsize=2
  77. }
  78. \lstset{style=mystyle}
  79. % % Nomenclature commands
  80. \usepackage[intoc]{nomencl}
  81. \makenomenclature
  82.  
  83. \usepackage[toc,nopostdot,nonumberlist,acronym,section]{glossaries}
  84. \newrobustcmd{\bffirst}[1]{{\let\mfirstucMakeUppercase\textbf\capitalisewords{#1}}}
  85.  
  86. \newacronymstyle{bf-long-short}{\GlsUseAcrEntryDispStyle{long-short}}{\GlsUseAcrStyleDefs{long-short}\renewcommand*{\GenericAcronymFields}{description={\bffirst{\the\glslongtok}}}}
  87. \setacronymstyle{bf-long-short}
  88.  
  89. \newglossary[ch1]{chstyle}{ch2}{ch3}{List of Greek Symbols}
  90. \makeglossaries
  91. \glsdisablehyper
  92.  
  93. \newglossarystyle{csyle}{%
  94. \glossarystyle{list}%
  95. \renewcommand*{\glossaryentryfield}[5]{%
  96. \item[\glsentryitem{##1}\glstarget{##1}{##2}]%
  97. \hspace{2.5cm}##3\glspostdescription\dotfill ##5}%
  98. }
  99. %\renewcommand{\chaptername}[2]{\chaptername{#1} \thechapter{#2}}
  100.  
  101. % %
  102.  
  103.  
  104. \include{glossary-nomen-entries}
  105. \begin{document}
  106. .
  107. .
  108. .
  109. \tableofcontents
  110.  
  111. \cleardoublepage
  112. %List of figures
  113. \addcontentsline{toc}{chapter}{\listfigurename}
  114. \listoffigures
  115. \cleardoublepage
  116. %List of tables
  117. \addcontentsline{toc}{chapter}{\listtablename}
  118. \listoftables
  119.  
  120. % Print Nomenclature
  121. \printnomenclature
Attachments
headererror.png
headererror.png (233.97 KiB) Viewed 416 times
headererror.png
See the PDF file to understand the problem. The PDF page shown is actually of Nomenclature. But, the header still shows as List of Tables, which is not. Please, help me.
headererror.png (233.97 KiB) Viewed 416 times
Last edited by Matam on Fri Jun 08, 2018 1:10 pm, edited 1 time in total.

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

Postby Stefan Kottwitz » Thu Jun 07, 2018 1:25 pm

Probably the easiest is adding this to the document preamble after \usepackage[intoc]{nomencl}:

\renewcommand*{\nompreamble}{\markboth{\nomname}{\nomname}}

Or later in the document:

  1. \cleardoublepage
  2. \markboth{\nomname}{\nomname}
  3. \printnomenclature


Stefan
Site admin

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

Postby Matam » Fri Jun 08, 2018 12:36 pm

Excellent. It solved my issue. Please refer the attachment.
Thanks a ton Stefan.
Attachments
headercorrection.png
headercorrection.png (270.13 KiB) Viewed 391 times


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 4 guests