LaTeX forum ⇒ Fonts & Character SetsHow to bold the Table of Contents (PDF screen shot attached)

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

How to bold the Table of Contents (PDF screen shot attached)

Postby Matam » Fri Jun 15, 2018 9:20 am

Please, find the attached screen shot.
I have prepared the table of contents. But, all are is normal font. I want to bold them.
Could you please, provide me the code to bold the list of contents.

The present code in preamble is:
  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\Large\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\large\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. % % For Bibliography support
  112. \makeatletter
  113. \let\@openbib@code\relax
  114. \makeatother
  115.  
  116. % % List of Publications
  117. \DeclareUnicodeCharacter{FB01}{fi}
  118.  
  119. \include{glossary-nomen-entries}
  120. \begin{document}
  121. .............
  122.  
  123.  
  124. \clearpage
  125. \newpage
  126. \cleardoublepage
  127. \pagenumbering{roman}
  128. \addcontentsline{toc}{chapter}{Acknowledgement}
  129. \thispagestyle{headings}
  130. \markboth{Acknowledgment}{Acknowledgment}
  131. \chapter*{\centering Acknowledgment}
  132.  
  133. My ..
  134.  
  135.  
  136. \clearpage
  137. \newpage
  138. \cleardoublepage
  139. \addcontentsline{toc}{chapter}{Abstract}
  140. \thispagestyle{headings}
  141. \markboth{Abstract}{Abstract}
  142. \chapter*{\centering Abstract}
  143. ~~~~Solar Photovoltaic (PV) systems installed in the rural and urban areas face different kinds of problems. A rural PV
  144.  
  145.  
  146. \tableofcontents
  147.  
  148. \cleardoublepage
  149. %List of figures
  150. \addcontentsline{toc}{chapter}{\listfigurename}
  151. \listoffigures
  152. \cleardoublepage
  153. %List of tables
  154. \addcontentsline{toc}{chapter}{\listtablename}
  155. \listoftables
  156.  
  157. % Print Nomenclature
  158. \renewcommand*{\nompreamble}{\markboth{\nomname}{\nomname}}
  159. \printnomenclature
  160.  
  161.  
  162. % List of Abbreviations
  163. \cleardoublepage
  164. \renewcommand{\glossarysection}[2][]{\chapter*{#1}}
  165. \markboth{List of Abbrevations}{List of Abbrevations}
  166. \addcontentsline{toc}{chapter}{List of Abbrevations}
  167. \renewcommand{\glsnamefont}[1]{\textbf{#1}}
  168. \printglossary[title=List of Abbreviations,type=\acronymtype]
  169. \renewcommand{\glsnamefont}[1]{\makefirstuc{#1}}
  170.  
  171.  
  172. \clearpage
  173. \pagenumbering{arabic}
  174.  
  175. \chapter{Introduction to solar PV systems and Dynamic PV arrays}
Attachments
contentsBOLD.png
contentsBOLD.png (169.56 KiB) Viewed 742 times

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

Postby Stefan Kottwitz » Sat Jun 16, 2018 12:25 pm

How about this:

  1. \bfseries
  2. \tableofcontents
  3. \normalfont


Stefan
Site admin

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

Postby Matam » Tue Jun 19, 2018 12:35 pm

Thank a lot for the reply. Now, all TABLE OF CONTENTS are in bold.

One more request, I want to bold only the Chapter titles, but not the sections and subsections in TABLE OF CONTENTS. I want remaining sections and subsections to be in normal series and NOT bold.
Please, check the attachment and help me with code.
Attachments
contentsSECTIONSnotBOLD.png
contentsSECTIONSnotBOLD.png (138.99 KiB) Viewed 645 times

User avatar
Johannes_B
Site Moderator
Posts: 3906
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Wed Jun 20, 2018 7:09 am

I haven't addressed any of your questions so far. The problem is your class file, which is unknown. There used to be a template defining a class called Thesis.cls and it was terrible. There have been serious copyright and license issues and basically everybody using the class broke some law of some country. Luckily/Unfortunately, nobody cares about that.

For a minimal document, chapters are in bold in the table of contents. So, something in your document is changing that. Maybe the class file, maybe something in your very very long preamble. I don't know, i didn't test.

What i keep telling people, is not to use any templates. See LaTeX for scientific writing and Template confusion
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

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

Postby Stefan Kottwitz » Wed Jun 20, 2018 11:12 am

Over many years, there appeared several different classes thesis.cls. That's because on different universities people developed kind of templates and classes for the students theses, and called it the same way, that's a bit careless. So we cannot know which thesis class or template you are using.

I usually based on the assumption, that it's like a report class plus some tweaking. That could be a good guess. Where did you get your thesis.cls or thesis template from? Do you have a link, where we can download it and test it?

By the way, today the Masters Doctoral template is popular. There's even a manual for it, by Johannes.

Stefan
Site admin

User avatar
Johannes_B
Site Moderator
Posts: 3906
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Wed Jun 20, 2018 12:06 pm

Stefan Kottwitz wrote:By the way, today the Masters Doctoral template is popular. There's even a manual for it, by Johannes.

Yes, there is. But nobody needs it really.
I am against using templates.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

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

Postby Stefan Kottwitz » Wed Jun 20, 2018 12:24 pm

I made my peace with the existence of templates. Somehow users needs to start, also those users who want to focus on writing instead of learning some dozen packages to use them or not.

Still there are too many bad templates out in the world. I remember also good templates, with folder structure, where each line in the preamble was explained with options and alternatives.

Stefan
Site admin


Return to “Fonts & Character Sets”

Who is online

Users browsing this forum: No registered users and 2 guests