我第一次尝试使用 latex 为学校写论文,一开始 \textbf \texttt 和 \textit 工作正常。但我开始使用越来越多不同的软件包,并复制了一些我朋友的软件包。现在我没有得到任何粗体或斜体字体。是否有可以覆盖粗体或斜体字体的软件包?
我正在使用以下软件包
\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}
答案1
您确实应该考虑清理您的前言,只加载您真正需要的包。加载未使用的包本身不是问题,但快速加载许多包会导致混乱,最终可能会出现错误。
但是,就您而言,您遇到的问题不是由任何特定软件包引起的。相反,您的前言的最后一行有错误,这与任何已加载的软件包完全无关。一个最小(非)工作示例是:
\documentclass{article}
\renewcommand{\familydefault}{sfdefault}
\begin{document}
\textit{this should be italic}
\end{document}
输出:
相关行在第二个参数中缺少反斜杠:应该是\sfdefault
而不仅仅是sfdefault
。以下应该有效:
\documentclass{article}
\renewcommand{\familydefault}{\sfdefault}
\begin{document}
\textit{this should be italic}
\end{document}