5

I feel stupid. The Iwona package seems to load Iwona as \rmfamily font but I want to use it as sans serif font, after all it is a sans serif font... How do I get it as the \sffamily font?


Example for clarification:

\documentclass{article}

\usepackage{iwona}

\begin{document}
This should be Computer Modern but is Iwona

\sffamily
This should be Iwona but is Computer Modern Sans Serif
\end{document}
6
  • 1
    Hm, I just made a very simple document with Iwona and it's sans serif
    – user31729
    Feb 12, 2016 at 15:10
  • yes... But it doesn't load into the \textsf{} command but it goes as default font
    – jonalv
    Feb 12, 2016 at 15:13
  • Hm, I not sure I understand you correctly. Do you want to have the font sans serif for the whole document? Does \renewcommand{\rmdefault}{\sfdefault} help then?
    – user31729
    Feb 12, 2016 at 15:15
  • Hm it's very much Friday afternoon and I am not making a good work at explaining I guess. I would need to do something like: (pseudocode) \temp = \rmdefault; \usepackage{iwona}; \sfdefault = \rmdefault; \rmdefault=\temp;
    – jonalv
    Feb 12, 2016 at 15:20
  • @jonalv prefix assignments with \let as in \let\temp=\rmdefault and that's exactly what you should do Feb 12, 2016 at 15:31

1 Answer 1

5

Prepare a file sansiwona.sty

\ProvidesPackage{sansiwona}

\DeclareOption{regular}{\renewcommand{\sfdefault}{iwona}}
\DeclareOption{light}{\renewcommand{\sfdefault}{iwonal}}
\DeclareOption{condensed}{\edef\sfdefault{\sfdefault c}}
%\DeclareOption{mathnoalias}{\let\define@iwona@mathversions\relax}
\DeclareOption{math}{%
  \let\define@iwona@mathversions a%
  \PassOptionsToPackage{mathnoalias}{iwona}%
}

\ExecuteOptions{regular}
\ProcessOptions

\let\sansiwona@saved@rmdefault\rmdefault
\let\sansiwona@saved@bfdefault\bfdefault

\RequirePackage[mathnoalias]{iwona}

\let\rmdefault\sansiwona@saved@rmdefault
\let\bfdefault\sansiwona@saved@bfdefault
\mathversion{normal}

\endinput

Then the document

\documentclass{article}
\usepackage[math]{sansiwona}

\begin{document}

What font will this be?

{\sffamily And this? \bfseries And this?}

$a+b=\sum$

\mathversion{iwona}

$a+b=\sum$

\end{document}

will do the right thing, because the “wrong” settings made by iwona.sty are reverted.

Put sansiwona.sty where TeX will find it, see Adding style files

enter image description here

The math option is needed only if you need Iwona Math.

1
  • Aren’t the two occurrences of mathnoalias redundant? Mar 17, 2018 at 3:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.