Fonts & Character SetsGlossaries: abbreviation names in bold

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

Glossaries: abbreviation names in bold

Post by Matam »

One more help. Please, observe contents in the List of Abbreviations.
Abbreviation is normal font. But, the first letter of each word is in Bold. So, I want the abbreviations in bold.

Example: the first line is in my PDF is
BOP Best Output Power

But, I want
BOP (some gap here) Best Output Power

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Glossaries: abbreviation names in bold

Post by Stefan Kottwitz »

Try this:

\renewcommand{\glsnamefont}[1]{\textbf{#1}}

Stefan
LaTeX.org admin
Matam
Posts: 29
Joined: Thu Jun 07, 2018 12:12 pm

Glossaries: abbreviation names in bold

Post by Matam »

I added the code. But, it did not work. The issue remained same.

THe code is:
% List of Abbreviations 
\cleardoublepage
\renewcommand{\glossarysection}[2][]{\chapter*{#1}}
\markboth{List of Abbrevations}{List of Abbrevations}
\addcontentsline{toc}{chapter}{List of Abbrevations}
\printglossary[title=List of Abbreviations,type=\acronymtype]
\renewcommand{\glsnamefont}[1]{\makefirstuc{#1}}
\renewcommand{\glsnamefont}[1]{\textbf{#1}}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Glossaries: abbreviation names in bold

Post by Stefan Kottwitz »

Put \renewcommand{\glsnamefont}[1]{\textbf{#1}} before \printglossary, not afterwards.

Stefan
LaTeX.org admin
Matam
Posts: 29
Joined: Thu Jun 07, 2018 12:12 pm

Glossaries: abbreviation names in bold

Post by Matam »

I tried this way also. It did not work.

Code is given below and screen shot is attached.
% List of Abbreviations 
\cleardoublepage
\renewcommand{\glossarysection}[2][]{\chapter*{#1}}
\markboth{List of Abbrevations}{List of Abbrevations}
\addcontentsline{toc}{chapter}{List of Abbrevations}
\renewcommand{\glsnamefont}[1]{\textbf{#1}}
\printglossary[title=List of Abbreviations,type=\acronymtype]
\renewcommand{\glsnamefont}[1]{\makefirstuc{#1}}
Attachments
abbreBOLD.png
abbreBOLD.png (168.17 KiB) Viewed 12273 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Glossaries: abbreviation names in bold

Post by Stefan Kottwitz »

It works for me. Check this complete example:

Code: Select all

\documentclass{report}
\usepackage{glossaries}
\newglossaryentry{test}{name=test, description={This is a test}}
\makeglossaries
\begin{document}
This is a \gls{test}.
\renewcommand{\glossarysection}[2][]{\chapter*{#1}}
\renewcommand{\glsnamefont}[1]{\makefirstuc{\textbf{#1}}}
\printglossary[title=List of Abbreviations,type=\acronymtype]
\end{document}
Check your settings what is different. I see your names are written in italic shape (and uppercase) - where do you set this?

Stefan
LaTeX.org admin
Matam
Posts: 29
Joined: Thu Jun 07, 2018 12:12 pm

Glossaries: abbreviation names in bold

Post by Matam »

I have reinstalled my Textstudio and then executed the same code. It worked.
Please, find the attached screen shot. However, I need one more help: I want all the full abbreviations come in line. Example,


The code for List of Abbreviations is given below:
% List of Abbreviations 
\cleardoublepage
\renewcommand{\glossarysection}[2][]{\chapter*{#1}}
\markboth{List of Abbrevations}{List of Abbrevations}
\addcontentsline{toc}{chapter}{List of Abbrevations}
\renewcommand{\glsnamefont}[1]{\textbf{#1}}
\printglossary[title=List of Abbreviations,type=\acronymtype]
\renewcommand{\glsnamefont}[1]{\makefirstuc{#1}}


\clearpage
\pagenumbering{arabic}

\chapter{Introduction to solar PV systems and Dynamic PV arrays}
\section{Introduction}
Attachments
abbreviationsLISTinLINE.png
abbreviationsLISTinLINE.png (74.99 KiB) Viewed 12247 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Glossaries: abbreviation names in bold

Post by Stefan Kottwitz »

You could choose some of the tabular styles (longtable), see the glossaries manual, 15.1 Predefined Styles.

Stefan
LaTeX.org admin
Matam
Posts: 29
Joined: Thu Jun 07, 2018 12:12 pm

Glossaries: abbreviation names in bold

Post by Matam »

Thanks for the quick response about the new reference. I have checked the 15.1. They have not given how to use the code or Examples. I am bit poor in understanding those terminology. Could you help me with some code that would be fine. Please,
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

Glossaries: abbreviation names in bold

Post by nlct »

The glossary style can be set globally using the style package option. For example:

Code: Select all

\usepackage[style=long]{glossaries}
or you can set it locally within the optional argument of \printglossary. For example:

Code: Select all

\printglossary[title=List of Abbreviations,type=\acronymtype,style=long]
There's a complete list of all predefined styles, with samples of their appearance, at https://www.dickimaw-books.com/gallery/ ... es-styles/

Regards
Nicola Talbot
Post Reply