In no way do I recommend doing this as I think it is aesthetically extremely dubious, at best. However, this site is not concerned with whether things are typographically judicious but only with the most technically elegant implementations of them in TeX.
iwona
sets the font up as the default roman family. cmbright
sets up the font as the default sans family and then sets the default family to sans.
So, if we load iwona
first, we can let cmbright
overwrite the maths configuration, which will fall back to iwona
's choices for e.g. OMX
wheere these are not provided by CM Bright. (This is not a good idea but it seems to be what you have in mind.)
We can then switch the default family back to roman to obtain Iwona for text.
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[math]{iwona}
\usepackage{cmbright}
\usepackage{amsfonts, amsmath, amssymb}
\usepackage{lipsum}
\renewcommand*{\familydefault}{\rmdefault}
\begin{document}
\begin{equation}
\begin{aligned}
H\!\left(x\right)
& \ = \ \int_0^x h\!\left(t\right)\mathsf{d}t\\
&\\
\widehat{H}\!\left(t\right)
& \ = \ \sum_{k \, | \, t_k \leq t} d_k / n_k\\
\end{aligned}
\qquad
\begin{aligned}
S\!\left(x\right)
& \ = \ \mathsf{Pr}\!\left[X > x\right]\\
&\\
\widehat{S}\!\left(t\right)
& \ = \ \textsf{exp}\!\left(-\widehat{H}\!\left(t\right)\right).
\end{aligned}
\end{equation}
\noindent
\lipsum[1-1]
\end{document}
See cmbright
's documentation for suggestions concerning suitable large symbols, such as cmex
. These may go a bit better than mixing Iwona. But, since you are already mixing two sans fonts, perhaps large symbols are the least of your worries.
You should also consider a solution which involves replacing just the symbols you do not like. There are several questions of this kind on the site to use as guides.
EDIT: NOTES
If you use the following code:
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[math]{iwona}
\usepackage{cmbright}
\usepackage{amsfonts, amsmath, amssymb}
\usepackage{lipsum}
\renewcommand*{\familydefault}{\sfdefault}
\begin{document}
\begin{equation}
\begin{aligned}
H\!\left(x\right)
& \ = \ \int_0^x h\!\left(t\right)\mathsf{d}t\\
&\\
\widehat{H}\!\left(t\right)
& \ = \ \sum_{k \, | \, t_k \leq t} d_k / n_k\\
\end{aligned}
\qquad
\begin{aligned}
S\!\left(x\right)
& \ = \ \mathsf{Pr}\!\left[X > x\right]\\
&\\
\widehat{S}\!\left(t\right)
& \ = \ \textsf{exp}\!\left(-\widehat{H}\!\left(t\right)\right).
\end{aligned}
\end{equation}
\noindent
\lipsum[1-1]
\end{document}
then you will get CM Bright for text and maths. The only exception is the large maths symbols, lacking from CM Bright, which will come from Iwona:
I think in that case, you might be better off dropping Iwona altogether and using the configuration suggested in cmbright
's documentation:
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{cmbright}
\usepackage{amsfonts, amsmath, amssymb}
\usepackage{lipsum}
\renewcommand*{\familydefault}{\sfdefault}
\begin{document}
\begin{equation}
\begin{aligned}
H\!\left(x\right)
& \ = \ \int_0^x h\!\left(t\right)\mathsf{d}t\\
&\\
\widehat{H}\!\left(t\right)
& \ = \ \sum_{k \, | \, t_k \leq t} d_k / n_k\\
\end{aligned}
\qquad
\begin{aligned}
S\!\left(x\right)
& \ = \ \mathsf{Pr}\!\left[X > x\right]\\
&\\
\widehat{S}\!\left(t\right)
& \ = \ \textsf{exp}\!\left(-\widehat{H}\!\left(t\right)\right).
\end{aligned}
\end{equation}
\noindent
\lipsum[1-1]
\end{document}
UPDATE
This is a response to the edited question. As I explain in a comment, the solution posted there is not a good one because it is not really doing what you think.
Let's start by examining the different fonts because this is causing some confusion:
Code:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts, amsmath, amssymb}
\usepackage{lipsum}
\begin{document}
Default Computer Modern Roman (serif):
\lipsum[1]
\sffamily Computer Modern Sans Serif:
\lipsum[1]
\fontfamily{cmbr}\selectfont Computer Modern Bright:
\lipsum[1]
\fontfamily{iwona}\selectfont Iwona:
\lipsum[1]
\end{document}
I gather from comments, that you do not actually like Iwona. That is, you do not want to use the last font in the sampler above. This is not 'Iwona serif' or 'Iwona roman'. It is just Iwona. If you don't like that font, you don't like Iwona.
Computer Modern Sans
What you wish to use, I think, is either Computer Modern Bright or Computer Modern Sans Serif. The code I gave earlier demonstrates how to use CM Bright. To use Computer Modern Sans Serif:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts, amsmath, amssymb}
\usepackage{lipsum}
\renewcommand*{\familydefault}{\sfdefault}
\begin{document}
\lipsum[1]
\end{document}
The complication in all this is that iwona.sty
installs Iwona as the default roman/serif family even though Iwona is actually a sans serif font. So, if you load iwona
but then switch to sans for the document, you don't actually see any Iwona in use for text at all. (Unless you explicitly request the roman family.)
I think what you really wish to do is to use the large maths symbols from Iwona to avoid the serif versions you otherwise get. And I'm not sure that is the best solution. However,...
Maths
What happens to maths? By default, nothing. All we've done is change the text font. As you explain, sfmath
can be used to activate sans maths:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts, amsmath, amssymb}
\usepackage{lipsum}
\usepackage{sfmath}
\renewcommand*{\familydefault}{\sfdefault}
\begin{document}
\lipsum[1]
\begin{equation}
\begin{aligned}
S\!\left(x\right) & \ = \ \mathsf{Pr}\!\left[X > x\right]\\
H\!\left(x\right) & \ = \ \int_0^x h\!\left(t\right)\mathsf{d}t\\
\end{aligned}
\qquad
\begin{aligned}
\widehat{S}\!\left(t\right) & \ = \ \textsf{exp}\!\left(-\widehat{H}\!\left(t\right)\right)\\
\widehat{H}\!\left(t\right) & \ = \ \sum_{k \, | \, t_k \leq t} d_k / n_k
\end{aligned}
\end{equation}
\end{document}
This is taking large symbols from Computer Modern's cmex
font, with letters and operators from the sans serif font.
Large Symbols from Iwona
If you would prefer to take the large symbols from Iwona, you can do this:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts, amsmath, amssymb}
\usepackage{lipsum}
\usepackage{sfmath}% use cm, cmbright or lm as options for similar maths fonts (cm is default)
\renewcommand*{\familydefault}{\sfdefault}
% take large maths symbols from Iwona as these aren't available in Computer Modern for sans (otherwise we get serif symbols from cmex)
\SetSymbolFont{largesymbols}{normal} {OMX}{iwona}{m}{n}
\SetSymbolFont{largesymbols}{bold} {OMX}{iwona}{b}{n}
\begin{document}
\lipsum[1]
\begin{equation}
\begin{aligned}
S\!\left(x\right) & \ = \ \mathsf{Pr}\!\left[X > x\right]\\
H\!\left(x\right) & \ = \ \int_0^x h\!\left(t\right)\mathsf{d}t\\
\end{aligned}
\qquad
\begin{aligned}
\widehat{S}\!\left(t\right) & \ = \ \textsf{exp}\!\left(-\widehat{H}\!\left(t\right)\right)\\
\widehat{H}\!\left(t\right) & \ = \ \sum_{k \, | \, t_k \leq t} d_k / n_k
\end{aligned}
\end{equation}
\end{document}
Iwona, Bold and Computer Modern
The issue of bold sections is different. What happens if you load iwona
is that it redefines the bold series
\renewcommand{\bfdefault}{b}
So the following document
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts, amsmath, amssymb}
\usepackage[math]{iwona}
\usepackage{lipsum}
\usepackage{sfmath}% use cm, cmbright or lm as options for similar maths fonts (cm is default)
\renewcommand*{\familydefault}{\sfdefault}
% take large maths symbols from Iwona as these aren't available in Computer Modern for sans (otherwise we get serif symbols from cmex)
\SetSymbolFont{largesymbols}{normal} {OMX}{iwona}{m}{n}
\SetSymbolFont{largesymbols}{bold} {OMX}{iwona}{b}{n}
\begin{document}
\textbf{bold} and normal text
\end{document}
will produce this:
That is, you cannot use bold at all. This happens because the far-from-ideal redefinition in iwona.sty
interacts with the far-from-ideal default setup of the Computer Modern fonts. In fact, the manual for sfmath
recommends loading fix-cm
and doing so before \documentclass
. Adding
\RequirePackage{fix-cm}
before \documentclass
fixes the problem:
So loading iwona
merely to get non-bold sections is also going to kill bold everywhere. But fixing bold will also reinstate bold sections because if LaTeX can find bold fonts, it will use them for section headings by default. Moreover, it is likely to lead to inconsistencies in surprising places. It would be better to ask LaTeX for non-bold sections rather than hoping that LaTeX will be unable to find bold fonts at all.
Non-Bold Sections
The titlesec
package can be used to achieve this easily. The following passes titlesec
the sf
and md
options for sans serif, medium weight section headings. [Note that the options are sf
and md
rather than sffamily
and mdseries
i.e. they do not correspond to the LaTeX font commands \sffamily
and \mdseries
.]
\RequirePackage{fix-cm}% recommended in documentation for sfmath
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts, amsmath, amssymb}
\usepackage{lipsum}
\usepackage{sfmath}% use cm, cmbright or lm as options for similar maths fonts (cm is default)
\renewcommand*{\familydefault}{\sfdefault}
% take large maths symbols from Iwona as these aren't available in Computer Modern for sans (otherwise we get serif symbols from cmex)
\SetSymbolFont{largesymbols}{normal} {OMX}{iwona}{m}{n}
\SetSymbolFont{largesymbols}{bold} {OMX}{iwona}{b}{n}
\usepackage[sf,md]{titlesec}
\begin{document}
\section{A section}
\section{Another section}
\subsection{A subsection}
\subsubsection{A subsubsection}
\lipsum[1]
\begin{equation}
\begin{aligned}
S\!\left(x\right) & \ = \ \mathsf{Pr}\!\left[X > x\right]\\
H\!\left(x\right) & \ = \ \int_0^x h\!\left(t\right)\mathsf{d}t\\
\end{aligned}
\qquad
\begin{aligned}
\widehat{S}\!\left(t\right) & \ = \ \textsf{exp}\!\left(-\widehat{H}\!\left(t\right)\right)\\
\widehat{H}\!\left(t\right) & \ = \ \sum_{k \, | \, t_k \leq t} d_k / n_k
\end{aligned}
\end{equation}
\end{document}
Importantly, this preserves your ability to use bold when you wish:
\textbf{bold} and normal
Note that even if you do not wish to use bold, loading iwona
to get rid of it is not a good solution because some fonts (such as Iwona) do have a bold b
series and you are likely to get weird things happening. Moreover, your logs and output on the console will complain frequently about missing fonts, making it harder to identify real issues which you do want to find.
Best Answer
or