Open Sans Condensed comes in Light, Light Italic, and Bold, with no Bold Italic.
You can use it like this:
\documentclass[20pt]{beamer}
\usepackage{fontspec}
\usefonttheme{professionalfonts}
\setsansfont{Open Sans Condensed Light}[
Numbers=OldStyle,
ItalicFont={* Italic},
BoldFont={Open Sans Condensed Bold}]
\begin{document}
\begin{frame}
\frametitle{Open Sans Condensed}
\textbf{Boldly} \textit{emphasizing} nonsense.
\textbf{123} \textit{456} 7890
\end{frame}
\end{document}
If you have an old version of fontspec
, you should put the options between \setsansfont
and {Open Sans Condensed Light}
; you can do that anyway if you prefer.
For reasons unknown, TeX Live includes the Condensed Light fonts but not the Condensed Bold. You may wish to write to the package maintainer about this, but that would benefit people using pdftex
more than xetex
or luatex
.
At any rate, I wouldn’t use the bold and the light together under ordinary circumstances: usually one pairs bold with regular, and semi-bold with light.
If you can use LuaLaTeX instead of pdfLaTeX, it may be easier to just create a dedicated Lua function and set up an associated TeX "wrapper macro" rather than to try to hack the \num
macro of the siunitx
package. In the example below, the wrapper macro is called \mynum
, and its syntax is set up to be mimic the behavior of the \num
macro.
The only assumption that's made about about the numbers to be formatted is that their exponent part is non-empty, i.e., that the numbers contain an e<nn>
substring, where <nn>
is a positive or negative integer. With this setup, a number such as e1234
is a valid input for \mynum
(and for \num
too).
\documentclass{article}
\usepackage{siunitx}
\sisetup{exponent-product = \cdot,
round-mode = places}
%% Lua-side code
\usepackage{luacode}
\begin{luacode}
function formatnum ( prec, num )
if string.find ( num , "[%d%.]+[eE]" ) then
mant = string.format( "%."..prec.."f".."\\cdot", string.match ( num, "[%-%+]?[%d%.]+" ) )
else
mant = ""
end
expo = string.gsub ( num, ".-[eE]([%-%+]?)(%d+)", "10^{%1\\mathbf{%2}}" )
return ( tex.sprint( "$"..mant..expo.."$" ))
end
\end{luacode}
%% TeX-side code
\newcommand\mynum[2]{\directlua{ formatnum ( \luastring{#1}, \luastring{#2})}}
\begin{document}
\def\NumA{2.12e-14}
\def\NumB{12.34e56}
\def\NumC{e1234}
\num[round-precision=0]{\NumA}
\mynum{0}{\NumA}
\medskip
\num[round-precision=2]{\NumB}
\mynum{2}{\NumB}
\medskip
\num[round-precision=4]{\NumC}
\mynum{4}{\NumC}
\end{document}
Addendum: If you wanted to highlight the exponent in red instead of using bold-facing, you'd need to change \\mathbf{%2}
in the Lua code to \\color{red}%2
. Of course, either the xcolor
or color
package needs to be loaded in order to get access to the \color
macro.
\mynum{0}{2.12e-14}, \mynum{2}{-12.34e56}, \mynum{0}{e1234}
Best Answer
Use
\mathbf
not\textbf
, since\Omega
is not "text". An error would likewise occur if you had merely typed$\textbf{\Omega}$
, in the absence ofsiunitx
.