LaTeX forum ⇒ Fonts & Character SetsWant the word 'Chapter' inscribed in the Chapter page Topic is solved

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Matam
Posts: 29
Joined: Thu Jun 07, 2018 12:12 pm

Want the word 'Chapter' inscribed in the Chapter page

Postby Matam » Thu Jun 07, 2018 1:00 pm

The first chapter title page dispayed as "1 Introduction to Solar PV.....". However, I want to display, "Chapter 1 (in the First line) Introduction to Solar PV ...(Second line)" and with bigger font. This error is for every chapter. Please, see the attachment to understand the problem.

I have included here the preamble code and chapter call:

  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.  
  110. \tableofcontents
  111.  
  112. \cleardoublepage
  113. %List of figures
  114. \addcontentsline{toc}{chapter}{\listfigurename}
  115. \listoffigures
  116. \cleardoublepage
  117. %List of tables
  118. \addcontentsline{toc}{chapter}{\listtablename}
  119. \listoftables
  120.  
  121. % Print Nomenclature
  122. \printnomenclature
  123.  
  124.  
  125. % List of Abbreviations
  126. \printglossary[title=List of Abbreviations,type=\acronymtype]
  127. \renewcommand{\glsnamefont}[1]{\makefirstuc{#1}}
  128.  
  129. \clearpage
  130. \pagenumbering{arabic}
  131.  
  132. \chapter{Introduction to solar PV systems and Dynamic PV arrays}
  133. \section{Introduction}
Attachments
chapname.png
The first chapter title page dispayed as "1 Introduction to Solar PV.....". However, I want to display, "Chapter 1 (in the First line) Introduction to Solar PV ...(Second line)" and with bigger font. This error is for every chapter. Please, see the attachment to understand the problem.
chapname.png (298.69 KiB) Viewed 555 times
Last edited by Stefan Kottwitz on Thu Jun 07, 2018 1:30 pm, edited 1 time in total.
Reason: code marked

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

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

Change \titleformat{\chapter}[hang] to \titleformat{\chapter}[display], for example:

  1. % commented out, to disable, will be replace below:
  2. %\titleformat{\chapter}[hang]
  3. %{\LARGE\normalfont\bfseries}
  4. %{\thechapter}{1em}{}
  5. %\titleformat{name=\chapter,numberless}[hang]
  6. % {\normalfont\LARGE\bfseries\filcenter}{}{1ex}{}{}
  7.  
  8. \titleformat{\chapter}[display]
  9. {\normalfont\large\bfseries}{\chaptertitlename\ \thechapter}{10pt}{\LARGE}


Change \large or \LARGE to the font size you prefer, adjust 10pt to the value you would like to have as additional distance between "Chapter X" and the chapter title.

Stefan
Site admin

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

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

Thanks a lot. Majority of issue solved. But, Chapter word did not appear. Please help me.
Please, refer the attachment to understand the actual scenario.

Chaptermissing Attachment caption: I implemented your suggestion as it is. I solved some issues. But, gave new issues. Please refer this attachment.

Chaptermissing2 Attachment caption: I slightly modified your suggestion. That is, I did not delete old code. yet, added new one. This gives better result. I hope, it is not going to cause any issues in future and at other places.
Attachments
chaptermissing2.png
I slightly modified your suggestion. That is, I did not delete old code. yet, added new one. This gives better result. I hope, it is not going to cause any issues in future and at other places.
chaptermissing2.png (306.51 KiB) Viewed 534 times
chaptermissing.png
Thanks a lot. Majority of issue solved. But, Chapter word did not appear. Please help me.
Please, refer the attachment to understand the actual scenario.
chaptermissing.png (366.61 KiB) Viewed 534 times

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

Postby Stefan Kottwitz » Fri Jun 08, 2018 2:09 pm

Perhaps \chaptertitlename is undefined in this thesis class. Write directly:

  1. \titleformat{\chapter}[display]
  2. {\normalfont\large\bfseries}{Chapter\ \thechapter}{10pt}{\LARGE}


Stefan
Site admin

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

Postby Matam » Sat Jun 09, 2018 7:39 am

Excellent. It did work and solved my issue.
Thanks a ton. Please, check the attachment.
Attachments
chapword.png
chapword.png (160.5 KiB) Viewed 513 times


Return to “Fonts & Character Sets”

Who is online

Users browsing this forum: No registered users and 4 guests