2

I am trying latex for the first time to write an essay for school, in the beginning the \textbf \texttt and \textit worked normaly. But i started to use more and more different packages and copied some of a friend of mine. Now i'm not getting any bold or italic fonds. Are there any packages that can overwrite the bold or italic fonds?

i am using the following packages

\documentclass{article}
\usepackage[utf8]{inputenc} %voor accenten op letters ( umlaut bijv.)
\usepackage[T1]{fontenc} %For better font
\usepackage[dutch]{babel}
\usepackage{amsmath}
\usepackage{comment}
\usepackage{fullpage}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{float}
\usepackage{textcomp}
\usepackage{enumerate}
\usepackage{csquotes}
\usepackage{xcolor}
\usepackage{gensymb} %  Generic symbols for both text and math mode
\usepackage{hyperref} % voor het toevoegen van links aan het document
\usepackage{graphicx} % voor plaatjes in het document
\usepackage{tabularx} % Tabulars with adjustable-width columns
\usepackage{fancyhdr} % Extensive control of page headers and footers in LaTeX2e
\usepackage{lastpage} % Needed for extra-fancy page numbering
\usepackage{pdfpages} % Include PDF documents in LaTeX
\usepackage{eurosym} %(geen idee of het nodig is) voor het 'euro'-%teken
\usepackage{wrapfig} %  Produces figures which text can flow around
\usepackage{tocloft} %  Control table of contents, figures, etc
\usepackage{textgreek} %voor textomega enzo
\usepackage{mathtools}
\usepackage{listings}
\usepackage{parskip}
\usepackage{adjustbox}
\usepackage{paralist}
\usepackage{textcomp}
\usepackage{enumitem}
\usepackage{pdfpages}
\counterwithin{figure}{section}
\counterwithin{table}{section}
\counterwithin{equation}{section}
\floatstyle{plain}
\restylefloat{table}
\usepackage{nameref}
\usepackage{hyperref}
\usepackage{subfiles}
\usepackage{url}
\usepackage{subcaption}
\usepackage{verbatim} % for \begin{comment} and \end{comment}
\usepackage[a4paper,margin=1in,headheight=.4in,headsep=12pt,heightrounded]{geometry}
\usepackage[
backend=biber,
style=ieee,
]{biblatex}
\addbibresource{bibliography.bib}
\usepackage{tablefootnote}
\usepackage{nomencl}
\makenomenclature
\usepackage{emptypage}
\usepackage{tabularx}
\usepackage{adjustbox}
%\usepackage{showframe}
\usepackage[normalem]{ulem}
\useunder{\uline}{\ul}{}
\usepackage{longtable}


\pagestyle{fancy}
\fancyhead[L]{Heijmans}
\fancyhead[R]{S. Kusters}

% Language setting
% Replace `english' with e.g. `spanish' to change the document language
\usepackage[dutch]{babel}
\selectlanguage{dutch}

% Set page size and margins
% Replace `letterpaper' with `a4paper' for UK/EU standard size
% Useful packages
\usepackage{parskip}
\usepackage{multirow}
\usepackage{caption, float}
\usepackage{blindtext}
\usepackage{titlesec}
\newfloat{chart}{tbhp}{crt}
\title{Stage HTL-DHT: bulk glycerine tulip afdeling}
\author{Gijs van Asten}

\usepackage[normalem]{ulem}
\useunder{\uline}{\ul}{}
\usepackage{longtable}


\pagestyle{fancy}
\fancyhead[L]{HTL-DHT}
\fancyhead[R]{Dhr G.A.J. van Asten}

%\fontfamily{lmss}

\newcommand{\nocontentsline}[3]{}
\newcommand{\tocless}[2]{\bgroup\let\addcontentsline=\nocontentsline#1{#2}\egroup}
\renewcommand{\familydefault}{sfdefault}
\begin{document}
7
  • 4
    Well it is easy for you to find the culprit: simply comment one by one the lines in your preamble until the fonts work again. Sep 20, 2023 at 6:59
  • 2
    If you're writing an essay for school I'm pretty sure that you don't need comment, fullpage, lipsum, textcomp, enumerate (which is incompatible with enumitem that you load as well), gensymb, tabularx, lastpage, pdfpages, eurosym (unless you actually need the euro symbol), wrapfig, tocloft, textgreek, listings, parskip, adjustbox, paralist, subfiles, subcaption, verbatim, tablefootnote, emptypage, ulem (underlining is typographically bad outside of single symbols in math), etc. I suggest you clean up your preamble.
    – Skillmon
    Sep 20, 2023 at 7:04
  • 1
    BTW: You are loading some packages more than once. This is not generally a mistake, but it can easily lead to a mistake, because it is somehow confusing. And package hyperref should be loaded as late as possible. In general, a package should only be loaded after hyperref if this is explicitly documented in the package's manual or the hyperref manual.
    – cabohah
    Sep 20, 2023 at 7:05
  • 3
    Better yet: I suggest starting with an empty preamble and adding stuff only if you need it. This is a common mistake by beginners, starting with an overfull preamble they got from some friend/colleague without understanding what the things do. They don't mean to do harm, but often they do.
    – Skillmon
    Sep 20, 2023 at 7:06
  • 2
    Apart from the advice in the above comments which I totally agree with, I think the culprit here is \renewcommand{\familydefault}{sfdefault} which should probably rather be \renewcommand{\familydefault}{\sfdefault} (with a backslash added to the second argument). Sep 20, 2023 at 7:28

1 Answer 1

9

You should really consider cleaning up your preamble and only load those packages that you really need. It is not a problem per se to load packages that are not being used, but loading many packages quickly lead to confusion and eventually errors may occur.

In your case, however, the problem you are encountering is not being generated by any specific package. Rather the very last line of your preamble has an error and this is completely unrelated to any of the loaded packages. A minimal (non-)working example would be:

\documentclass{article}

\renewcommand{\familydefault}{sfdefault}
\begin{document}
\textit{this should be italic}
\end{document}

This outputs:

enter image description here

The relevant line is missing a backslash in the second argument: It should be \sfdefault and not just sfdefault. The following should work:

\documentclass{article}

\renewcommand{\familydefault}{\sfdefault}
\begin{document}
\textit{this should be italic}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .