74

Although this question is quite old (only found it because lockstep reactivated it) it’s maybe worth to add this information. For my lectures on LaTeX I use the following image to explain the way LaTeX categorizes the different characteristics of printed material. 1. Encoding The first thing to select is how the font is encoded in it’s file(s), that means ...


33

Some examples for fonts in T1 font-encoding Found in a full MiKTeX installation, but also in my (portable) TeX Live installation: \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage[english]{babel} \usepackage{lmodern} \newcommand*{\test}{W. H. Gates III. | Ill Bill} \newcommand*{\testfont}[2]{#1: \textsf{\fontfamily{#2}\selectfont\test}} ...


33

Your issue is "font-dependent". Background Indeed, special shapes of a font (bold, italic, slanted, small caps) are not defined relatively to a main font (its regular shape), but independently. The "bold version" of a font is defined per se (it is an independent *otf, *.ttf-file you can install and use, even if you don't have the main/regular version), and ...


23

I'm now doing one: https://github.com/firamath/firamath, which is based on FiraSans. Here is a showcase (use beamer theme metropolis): Of course, this work is far away from finished. For example, most of the relation symbols haven't been drawn. By the way, I'm a newbie to font design and creation, so if you have any suggestions, please tell me. Update: ...


20

As has been said, \text is for text, and will change depending on the surrounding font. But math symbols in a document should always look the same: The meaning of a symbols also depends on the font used. So you should not use \text for mathematical symbols. If you want an upright math font which adapts to the main document define it by using \familydefault: ...


20

The answer, as I have pieced together, appears here on one page, for posterity. The package sansmath ... ...is designed to offer sans-serif mathematics in the absence of proper sans maths fonts. After \usepackage{sansmath}, a new “math version” sans is defined, together with a command \sansmath, which behaves as \boldmath does. -from the ...


18

TeX fonts have only 256 slots. And you can't mix encodings without telling LaTeX to do it; \textcyrillic defined by babel with the russian option does this. The last specified encoding becomes the default one. This should be a complete list of sans serif fonts available also in T2A encoding (for cyrillic): \documentclass{article} \usepackage[T2A,T1]{...


17

The easiest way I've found to do this is to use \mathsf. So I write $ 7\times \rho = \mathsf{c_1} $


17

There are not many real sans serif math fonts. You can try \usepackage{cmbright} that has math symbol fonts, except for the "large symbols". Perhaps decent results can be obtained by loading the Iwona font: \documentclass{article} \usepackage{cmbright} \SetSymbolFont{largesymbols}{normal}{OMX}{iwona}{m}{n} \begin{document} \[ abc+\sum_{k=1}^{n}\int_{0}^{k}...


17

There is no small caps shape in the Latin Modern Sans typeface family (either in Type1 or in OpenType format). So the answer is "no, you can't have sans serif small caps", because the shape doesn't exist. See this paper by W. Robertson for a description of the available faces and shapes.


16

The command \allsectionsfont{\normalfont\sffamily\bfseries} of the sectsty package achieves this easily.


16

\renewcommand{\familydefault}{\sfdefault} That is: \documentclass{article} \usepackage{fontspec} \setmainfont{Latin Modern Roman} \setsansfont{Latin Modern Sans} \renewcommand{\familydefault}{\sfdefault} \begin{document} abc \textrm{abc} \textsf{abc} \end{document}


15

The warning (now: info, see edit below) for missing font-specific settings is not a bug but a new feature in the latest microtype beta version. The fallback settings, which are used for fonts unknown to microtype, are by nature incomplete, quite conservative and in no way guaranteed to match all possible fonts; therefore, microtype now draws the user's ...


14

It is a big difference. It depends on the tastes of Jörg Knappen who designed the European Modern fonts and apparently liked less heavy sans serif fonts. With \usepackage{lmodern} you'll get the same weight.


14

The cleanest way is to define a new math alphabet: \DeclareMathAlphabet{\mathbfsf}{\encodingdefault}{\sfdefault}{bx}{n} and then \newcommand{\tens}[1]{\mathbfsf{#1}} If you want italic bold sans serif, just change the first declaration into \DeclareMathAlphabet{\mathbfsf}{\encodingdefault}{\sfdefault}{bx}{sl} but keep in mind that the OT1 encoded ...


13

This can be achieved using a setting in the tick label style key. By default (without getting into too much details), pgf/pgfplots uses some "\ensuremath-like" business internally when typesetting the tick labels. We can disable this by setting tick label style={/pgf/number format/assume math mode=true}. What this does is tells pgf to assume that the input ...


13

Math alphabets commands such as \mathit and \mathsf are not “cumulative”. You have to allocate a specific math alphabet. \documentclass{article} \usepackage{amsmath} \usepackage{amssymb} \usepackage{bm} \DeclareMathAlphabet{\mathsfit}{T1}{\sfdefault}{\mddefault}{\sldefault} \SetMathAlphabet{\mathsfit}{bold}{T1}{\sfdefault}{\bfdefault}{\sldefault} \begin{...


12

This should do what you want. Of course, you can choose the command name (\twobar) and the amount of kerning (–0.2em): \documentclass{article} \newcommand{\twobar}{/\kern-0.2em/} \begin{document} {\sffamily http://www.jb.com.br http:\twobar{}www.jb.com.br } \end{document}


12

Mico's shown a possibility of using one of the unicode TeX engines, but to answer you explict questions, and using pdftex, you are not doing anything wrong, and TeX isn't adding space anywhere (as you can see from the log output generated by the code below. the side bearings on teh M are equal, but the - is not centred. TeX has no knowledge of this, to TeX ...


12

Partial solution. \usepackage{graphicx} \renewcommand*\partial{\textsf{\reflectbox{6}}}


12

You'll notice the following warning in your .log file: LaTeX Font Warning: Font shape `OT1/cmss/bx/it' undefined (Font) using `OT1/cmss/bx/n' instead on input line 4. It suggests that under the OT1 font encoding, there is no bold bx *italic** it version within the sans serif font. So, it substitutes it just for a normal bold, hence the output ...


11

The problem The problem arises because you are using very old and deprecated two-letter font commands, which, as you have discovered, yield unexpected effects when combined together. Here's what you probably tried first: \documentclass[12pt]{beamer} \usepackage[T1]{fontenc} \title{\rm\sc Great title} \date{\tiny Blah blah} \author{Fred} \begin{...


11

From the usage of \RequirePackage I guess you're writing a package, so you'd like it to be as independent as possible on a particular user's setup. I'll assume that your users will be supposed to have an up-to-date TeX distribution, but not that they have the fonts available as system fonts. Setting Erewhon as the main font can be obtained by \setmainfont{...


11

Fira Math: sans-serif font with Unicode math support Developed by Xiangdong Zeng (Stone-Zeng) at https://github.com/Stone-Zeng/FiraMath


11

The x-height of the sans-serif font you're working with -- tgheros, an Helvetica clone -- is much larger than the x-height of your math font, which is Computer Modern. As far as I know, the tgheros package doesn't provide a scaling option. However, if you replace \usepackage{tgheros} with \usepackage[scaled=0.78]{helvet} and change the document font ...


10

There's no need of \ensuremath: just use \newcommand{\nptime}{\textsf{NP}} \newcommand{\bnptime}{\textsf{\textbf{NP}}} so that \nptime and \bnptime work both in text and math mode, even scaling when used in subscript or superscript if the amsmath package is used. You discovered why \sf, \bf and all two letter font change commands are deprecated (and they ...


10

Imitation of small caps by reducing the uppercase letters can, in some rare cases, give a result slightly above the atrocious level. With Computer Modern Sans Serif such an attempt is doomed to horrible failure, because the heavy strokes are a distinctive feature of the font and you'd be mixing very different strokes between capitals and small capitals. I ...


10

The sansmath package provides a command (\sansmath) and environment (sansmath) for exactly this purpose: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{sansmath} \def\mySfFamily{\fontfamily{cmbr}\selectfont\sffamily\sansmath} \def\N{\mathbf{N}} \def\R{\mathbf{R}} \def\Q{\mathbf{Q}} \def\Z{\mathbf{Z}} \def\C{\mathbf{C}} \begin{document} \...


10

Latin Modern doesn't support Cyrillic. There are not many choices for a monospaced font in TeX Live 2013 featuring boldface and supporting Cyrillic. You can do it with PTMono, though. \documentclass{article} \usepackage[T2A]{fontenc} \usepackage[utf8]{inputenc} \usepackage[russian]{babel} \usepackage[scaled=.85]{PTMono} \usepackage{lipsum} \begin{document}...


10

If the document is going to take the form of a beamer presentation, I recommend you -- or the colleague you're helping to get started -- do two things: issue the instruction \usefonttheme{professionalfonts} in the preamble, and load the arev package, which loads the arevtext and arevmath packages. In my experience, the arev text and math fonts are both a ...


Only top voted, non community-wiki answers of a minimum length are eligible