Say I want to have my document in the default sans serif font, but I occasionally wish to have some other features in the document be in a different font. I am using \usepackage{libertine}
to load this other font, and I get the libertine font to show up by using \textsf{...}
.
However, now \textbf{}
no longer works in the document to bold the default sans serif font. How can I work around this?
Edit: I found the issue. The problem was the following offending line of code:
\renewcommand\rmdefault{cmss}
I changed this to
\renewcommand{\familydefault}{cmss}
in the MWE below, and all works fine.
MWE (solution found):
\documentclass[11pt]{article}
%% Import packages
%% ================================================================================================
\usepackage[numbers,sort&compress]{natbib} % Enable bibtex
\usepackage[hyphens]{url}
\usepackage[pdftex]{graphics,graphicx} % Augment graphics functionality
%\usepackage{concrete} % Concrete roman font -- COOL MATH. This package has some conflicts with fancyhdr. Recommend not to use.
\usepackage{latexsym} % Symbolic fonts for LaTeX
\usepackage{amsmath} % AMS math formatting options
\usepackage{amsfonts} % AMS fonts
\usepackage{bm} % Bold math
\usepackage[normalem]{ulem}
\usepackage{commath}
\usepackage[tiny,compact]{titlesec} % Allow better control over sections, headers, etc.
\usepackage{fancyhdr} % Allow better control over page layout
\usepackage[section]{placeins} % Keep figures in section
\usepackage{float} % Define tables and floating elements
\usepackage{flafter} % Never put floats before their references
\usepackage{floatflt} % wrap text around floats
\usepackage{wrapfig} % wrap text around figures
\usepackage{subcaption} % subcaptions for subfigures. USE SUBFIG, NOT SUBFIGURE. SUBFIGURE IS DEPRECATED AND MAY CONFLICT WITH OTHER PACKAGES
\usepackage{longtable} % A multi-page tabular environment
\usepackage{threeparttable} % tables with footnotes, capions all the same width
\usepackage{dcolumn} % decimal-aligned tabular math columns
\usepackage{multirow} % Allow table cells to span multiple rows
\usepackage{booktabs} % Formatting options for publication-quality tables
\usepackage{array} % Additional options for formatting columns in the array and tabular environments
\usepackage{caption} % Caption formatting -- use commands here instead of hangcaption
\usepackage[usenames,dvipsnames]{color} % Enable colors
\usepackage[table,hyperref]{xcolor} % Better control over color
\usepackage{import} % Let latex import files from different directories
\usepackage{datetime} % Format dates and times
\usepackage{enumitem} % Better control over lists
\usepackage{nomencl} % nomenclature package
\usepackage{lscape} % Allow text to be written in landscape mode
\usepackage{lipsum} % Lorem Ipsum, for placeholder text.
\usepackage[greek,english]{babel}
\usepackage[sort&compress]{natbib}
\usepackage{setspace}
%\usepackage{cabin}
\usepackage{libertine}
\usepackage[T1]{fontenc}
%\renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif
\usepackage[colorlinks=true, linkcolor=DarkBlue, citecolor=DarkBlue, urlcolor=DarkBlue, breaklinks=true]{hyperref} % Allow for hyperlinks in documents. THIS MUST ALWAYS BE LAST
\usepackage[nameinlink]{cleveref}
\usepackage{fancyvrb}
\renewcommand{\familydefault}{cmss}
\newlength{\tempintextsep}
\begin{document}
\setlength{\tempintextsep}{\intextsep}
\setlength{\intextsep}{0pt}
\begin{wrapfigure}[6]{l}{2.4in}
{
\setlength{\abovedisplayskip}{0pt}
$$
\left\{\;\;\;
\begin{minipage}{1.95in}
\centering
\fontsize{16pt}{19pt}\selectfont
\textsf{
This is a super awesome quote of super awesomeness.
}
\end{minipage}\;\;\;
\right\}
$$
}
\end{wrapfigure}
\lipsum[1]
\textbf{\lipsum[2]}
\setlength{\intextsep}{\tempintextsep}
\end{document}
\textsf{ <text> }
; it should really be\textsf{<text>}
. (Perhaps you were just trying to draw attention to its use, however....) – jon Sep 13 '13 at 20:07