0

I would like to use the following formatting of the OpenSans font which are available according to the samples that are provided here:

  • OpenSansCondensed-Light
  • OpenSansCondensed-Bold
  • OpenSansCondensed-LightItalic

The font can easily be integrated using the opensans package, but how can I access the above formatting? Could anyone provide an example? Thanks for your help!

This is what I got so far:

\documentclass{article}
\usepackage{opensans}
\usepackage{lipsum}

\begin{document}

\lipsum[1]

\end{document}
  • Can you provide a minimal working example showing what you've got and be a bit more specific about what you want? Do you just want to be able to switch to condensed? Do you want to use it as the default sans serif font? Or what? – cfr Mar 1 '18 at 0:14
  • There is no condensed bold as far as I can see. Where did you find mention of this? – cfr Mar 1 '18 at 0:19
  • I added a working example. Google lists a condensed bold version here: fonts.google.com/specimen/Open+Sans+Condensed – deboerk Mar 1 '18 at 6:53
  • 1
    A condensed bold may be available, but is not in the LaTeX package. All you can do in this case is (1) not use condensed bold, (2) create your own support files for it or (3) send the package maintainer a feature request, asking her/him to add support for condensed bold in a future update. The other option you have is to install the font family for your OS and use LuaTeX or XeTeX (rather than pdfTeX or TeX) with fontspec. – cfr Mar 1 '18 at 17:00
1

You have to select the light series using \fontseries{cl}\selectfont where cl stands for condensed light, I guess.

\documentclass{article}
\usepackage[default]{opensans}
\begin{document}
\fontseries{cl}\selectfont

Condensed

\textit{Condensed Italic}

\textbf{There is no Condensed Bold}
\end{document}

enter image description here

2

Unfortunately, although the package makes the fonts available, it does not provide a convenient user interface. This is unfortunate because the author of the package is in the best position to provide this. Hence, the following might have unintended consequences as a result of the details of the font configuration. That said, it seems to work OK in minimal testing on Kant's metaphysics.

Caveat emptor

First, we provide \clseries to switch to condensed, light. This will be ignored if the current family is not fos. If you are using hanging figures, substitute fosj for fos.

\DeclareRobustCommand\clseries{%
  \not@math@alphabet\clseries\relax
  \edef\tempa{\f@family}\edef\tempb{fos}%
  \ifx\tempa\tempb
    \fontseries{cl}\selectfont
  \fi
}

Then we do the same for the semi-bold series. There is no condensed bold. However, the straight bold probably looks too much with light as the contrast, so try this instead. Alternatively, you could substitute the regular weight medium (m) for bold.

\DeclareRobustCommand\sbseries{%
  \not@math@alphabet\sbseries\relax
  \edef\tempa{\f@family}\edef\tempb{fos}%
  \ifx\tempa\tempb
    \fontseries{sb}\selectfont
  \fi
}

Now provide \textXX macros which, as with similar macros, will set their argument in condensed light or semi-bold, as the case may be.

\DeclareTextFontCommand\textcl{\clseries}
\DeclareTextFontCommand\textsb{\sbseries}

Then it is straightforward to utilise these series in a document.

sampler

Complete code:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[defaultsans]{opensans}
\makeatletter
\DeclareRobustCommand\clseries{%
  \not@math@alphabet\clseries\relax
  \edef\tempa{\f@family}\edef\tempb{fos}%
  \ifx\tempa\tempb
    \fontseries{cl}\selectfont
  \fi
}
\DeclareRobustCommand\sbseries{%
  \not@math@alphabet\sbseries\relax
  \edef\tempa{\f@family}\edef\tempb{fos}%
  \ifx\tempa\tempb
    \fontseries{sb}\selectfont
  \fi
}
\DeclareTextFontCommand\textcl{\clseries}
\DeclareTextFontCommand\textsb{\sbseries}
\makeatother
\newcommand\testtext{As any dedicated reader can clearly see, the Ideal of practical reason is a representation of, as far as I know, the things in themselves; as I have shown elsewhere, the phenomena should only be used as a canon for our understanding. }

\begin{document}
{%
  \sffamily
  {%
    \clseries
    \testtext
    \itshape
    \testtext
    \scshape
    \testtext
    \upshape
    \testtext
  }%
  Antelopes and \textcl{aardvarks}\par
  {%
    \sbseries
    \testtext
    \itshape
    \testtext
    \scshape
    \testtext
    \upshape
    \testtext
  }%  
  Antelopes and \textsb{aardvarks}
}
\end{document}

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.