TeX - LaTeX Asked by Christophe on June 25, 2021
My goal is to choose a “nice” font family (serif, sans serif, monospace, and “math”) for my basic LaTeX template.
I know the default setting (Computer Modern
‘s family) is a very good choice.
However, I want something a bit less “by default”, a bit less “used by everyone else”…
Also, I would like something with an increased readability (relative to the default setting, i.e. Computer Modern
) both for on paper reading and for on screen reading, and something that is at least as good with math typing and printing.
Finally, I would like a solution that I could easily use on other computers or give/suggest to a friend (i.e. it should ideally come with most standard LaTeX distributions at the present time (June 2012)).
These are my motivations or goals.
Initially, I used pslatex
which uses Times, Helvetica, and Courier (or slightly modified versions of them).
But then I discovered that pslatex
is outdated, and that I should use either (just) txfonts
or (the three) mathptmx
, helvet
([scaled=.90]), and courier
.
Then I read that tgtermes
is better (or at least prefered by some people).
Even later (June 2012), I then heard that newtx
is even better (usepackage[varg, cmintegrals, cmbraces, ]{newtxtext,newtxmath}
).
But in the newtx
/newtxtext
/newtxmath
documentation (and the internet follow-up searches), I got very confused about using lmodern
, textcomp
, bm
, amsmath
, amsfonts
, amssymb
, libertine
, libertineotf
, libertine-legacy
(edit: initial post had a mistake (‘libertine-heritage’)), etc…
Now I am completely lost!
Considering my motivations, what would you answer me if I asked you:
which ones could I use (‘alone’),
which ones could I use together,
which ones “should” I use (‘alone’), and
which ones “should” I use together?
Added “bonus” problem: I would like to keep the characters per line ratio to a nice, comfortable level (i.e. between 60 and 75), and, ideally, to be able to set it. (Please directly see, answer, and refer to: Nicely force 66 characters per line)
Note: I work on both Windows and Unix/Linux. I compile with pdflatex (sorry don’t know what capitalisation makes most consensus :))
Here I present you a reduced version of my template, relevant to this question (for you to play with if you want to). Note that I added a second, updated version of this template as edit at the end of this question post. Feel free to use it.
documentclass[draft, pdftex, a4paper, 12pt, openbib, ]{article}
usepackage[pdftex, final, pdfstartview = FitV, linktocpage = false, breaklinks = true, ]{hyperref}
usepackage[english]{babel}
usepackage{float} % Improved interface for floating objects ; add [H] option
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% FONTS and ENCODING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
usepackage{lmodern} % Latin Modern family of fonts
usepackage[T1]{fontenc} % fontenc is oriented to output, that is, what fonts to use for printing characters.
% https://tex.stackexchange.com/questions/44694/fontenc-vs-inputenc
% https://tex.stackexchange.com/questions/664/why-should-i-use-usepackaget1fontenc
% WHICH ONE TO CHOOSE?
% usepackage{pslatex}
% usepackage[varg, cmintegrals, cmbraces, ]{newtxtext,newtxmath} % libertine, uprightGreek (U.S.) or slantedGreek (ISO),
% usepackage{tgtermes}
% usepackage{txfonts}
% usepackage{mathptmx}
% usepackage[scaled=.90]{helvet}
% usepackage{courier}
% usepackage{textcomp} % required for special glyphs
% usepackage{bm} % load after all math to give access to bold math
usepackage[utf8]{inputenc} % inputenc allows the user to input accented characters directly from the keyboard;
% utf8x : much broader but less compatible ; latin1 : old?
% https://tex.stackexchange.com/questions/44694/fontenc-vs-inputenc
% References:
% http://www.latex-community.org/forum/viewtopic.php?f=8&t=6637
% ftp://ftp.rrzn.uni-hannover.de/pub/mirror/tex-archive/info/l2tabu/english/l2tabuen.pdf
% ftp://ftp.dante.de/tex-archive/info/l2tabu/english/l2tabuen.pdf
% http://xpt.sourceforge.net/techdocs/language/latex/latex32-LaTeXAndFonts/single/
% http://thirteen-01.stat.iastate.edu/wiki/LaTeXFonts
% http://www.tex.ac.uk/tex-archive/info/beginlatex/html/chapter8.html
% https://tex.stackexchange.com/questions/56876/times-new-roman-fonts-and-maths-without-mathptmx
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% LAY OUT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% See: https://tex.stackexchange.com/questions/59626/nicely-force-66-characters-per-line
% (must be after pslatex, tgterms, etc...)
% usepackage[DIV=calc]{typearea}
%
% usepackage[cm]{fullpage} % set 'default' full page
% usepackage{geometry} % margins?
usepackage{lipsum} % to fill in with arbitrary text
widowpenalty = 4000 % help suppress widows, default = 4,000 (?), from 0 to 10 000 (from 300 to 1 000 recommended, 10 000 not recommended)
clubpenalty = 4000 % help suppress orphans, default = 4,000 (?), from 0 to 10 000 (from 300 to 1 000 recommended, 10 000 not recommended)
usepackage[final, babel]{microtype} % many good lay-out/justification effects, see:
% texblog.net/latex-archive/layout/pdflatex-microtype/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% AMS MATH %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% usepackage{amsmath} % loads amstext, amsbsy, amsopn but not amssymb
% equation stuff (eqref, subequations, equation, align, gather, flalign, multline, alignat, split...)
% usepackage{amsfonts} % may be redundant with amsmath
% usepackage{amssymb} % may be redundant with amsmath
begin{document}
title{Correlation of procrastination and LaTeX}
author{Anne Onymous}
maketitle
textrm{lipsum[11]}
textsf{lipsum[11]}
texttt{lipsum[11]}
section{Alibaba and the 40 thieves}
subsection{La vie est un long fleuve tranquille}
begin{equation}
int_{-infty}^{+infty} e^{-x^2} dx = left( 6 sum_{n=1}^{infty} frac{1}{n^2} right)^frac{1}{4}
end{equation}
lipsum[1-7]
end{document}
Edit:
Trying to wrap up and put everything together (after both this post and “Nicely force 66 characters per line“, I give here my template with whatever I felt was most relevant (or cool :)). Enjoy!
(Note that the .tex source file is embedded in the .pdf output file!)
(New) Template:
% RequirePackage[l2tabu, orthodox]{nag}
%
% http://www.tug.org/texlive/Contents/live/texmf-dist/doc/latex/nag/nag.pdf
%
% Check for many common mistakes, and give hints on what to use instead.
% However, always refer to l2tabu for more detailed explanations.
% Orthodox checks for pitfalls that are not technically incorrect.
% If you know what you’re doing, omit orthodox.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CLASS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
documentclass[draft, pdftex, a4paper, 12pt, openbib, ]{article} % openright, doubleside, twoside, letterpaper, a4paper, ...
% draft or final option also in:
% - fixme
% - graphicx
% - hyperref
% - microtype
% - ...?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% BABEL and LANGUAGES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% usepackage{listings} % it is a source code printer for LATEX
% lstset{language=Python}
% lstinputlisting{source.py} % command used to pretty-print stand alone files
usepackage[english]{babel} % [french, frenchb, english, ]
% http://forum.mathematex.net/latex-f6/les-puces-avec-babel-t4256.html
% http://www.grappa.univ-lille3.fr/FAQ-LaTeX/11.1.html
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% FONTS and ENCODING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% See:
% https://tex.stackexchange.com/questions/59702/suggest-a-nice-font-family-for-my-basic-latex-template-text-and-math-i-am
%
usepackage{lmodern} % Latin Modern family of fonts. Very much like Computer Modern, but with many more glyphs
% (e.g., for characters with accents, glyphs, cedillas, etc)
usepackage[T1]{fontenc} % fontenc is oriented to output, that is, what fonts to use for printing characters.
% https://tex.stackexchange.com/questions/44694/fontenc-vs-inputenc
% https://tex.stackexchange.com/questions/664/why-should-i-use-usepackaget1fontenc
% Change some fonts or the whole font family (i.e. serif, sans serif, monospace, and 'math')
% usepackage[varg, cmintegrals, cmbraces, ]{newtxtext,newtxmath} % Other options: libertine, uprightGreek (U.S.) or slantedGreek (ISO), etc...
% usepackage{tgtermes} % Only serif ("TeX-Gyre" text)
% usepackage{kpfonts} % "Kepler" fonts
% usepackage{mathpazo} % Based on Hermann Zapf's Palatino font
% usepackage{txfonts} % More than a decade old
% usepackage{pslatex} % Obsolete?
% - usepackage{mathptmx}
% - usepackage[scaled=.90]{helvet}
% - usepackage{courier}
% usepackage{textcomp} % required for special glyphs
% usepackage{bm} % load after all math to give access to bold math
usepackage[utf8]{inputenc} % inputenc allows the user to input accented characters directly from the keyboard;
% utf8x : much broader but less compatible ; latin1 : old?
% https://tex.stackexchange.com/questions/44694/fontenc-vs-inputenc
% See:
% https://tex.stackexchange.com/questions/59626/nicely-force-66-characters-per-line
%
% pslatex is a very obsolete package and that its descendant mathptmx is rather inadequate for serious typesetting involving math.
% If you don't need mathematics, other choices based on (Linotype) Times Roman are
% - tgtermes
% - newtxtext (based on txfonts, but with corrected metrics) (with its companion math package newtxmath)
%
%
% See:
% http://www.latex-community.org/forum/viewtopic.php?f=8&t=6637
%
% (times, helvet, courier)
% pslatex and txfonts produce (almost) same resutls.
% pslatex supposedly obsolete
% txfonts supposedly up-to-date
%
%
% See:
% ftp://ftp.rrzn.uni-hannover.de/pub/mirror/tex-archive/info/l2tabu/english/l2tabuen.pdf
% or
% ftp://ftp.dante.de/tex-archive/info/l2tabu/english/l2tabuen.pdf
% in
% 2.3.3 pslatex.sty
%
% pslatex uses a Courier font scaled too narrowly.
% Its main disadvantage is that it does not work with T1 and TS1 encodings.
% So replace:
% usepackage{pslatex} or usepackage{txfonts}
% by all three:
% - usepackage{mathptmx}
% - usepackage[scaled=.90]{helvet}
% - usepackage{courier}
%
%
% See:
% http://xpt.sourceforge.net/techdocs/language/latex/latex32-LaTeXAndFonts/single/
% or http://thirteen-01.stat.iastate.edu/wiki/LaTeXFonts
% or http://www.tex.ac.uk/tex-archive/info/beginlatex/html/chapter8.html
%
% When changing fonts, you can change all of the default fonts at once with the following commands:
%
% Command Changes the defaults to
%
% times Times, Helvetica, Courier
% pslatex same as Times, but uses a specially narrowed Courier. This is preferred over Times because of the way it handles Courier.
% newcent New Century Schoolbook, Avant Garde, Courier
% palatino Palatino, Helevetica, Courier
% palatcm changes the Roman to Palatino only, but uses CM mathematics
% kpfonts "Kepler" fonts. A very nicely evolved set of fonts also based originally on Palatino, but with many special features.
%
%
% See:
% https://tex.stackexchange.com/questions/59702/suggest-a-nice-font-family-for-my-basic-latex-template-text-and-math-i-am
%
% There are, of course, many other font packages, most of which provide "only" text-mode fonts.
% Among these are the "TeX-Gyre" font families:
% - Termes (a Times Roman clone),
% - Pagella (a Palatino clone), and
% - Schola (a Century Schoolbook clone);
% one would load the packages tgtermes, tgpagella, and tgschola, respectively, to access these fonts.
% However, as these are text fonts, you still need to choose a suitable math font.
%
% Still another possibility you may want to look into is the Linux Libertine font family, to be loaded via the libertine-legacy package.
% If you like this text font and wish to employ the newtxmath package, be sure to load the newtxmath package with the libertine option set;
% doing so will set up a special set of math-mode fonts that harmonizes well with the libertine text fonts.
%
%
% See also:
% https://tex.stackexchange.com/questions/56876/times-new-roman-fonts-and-maths-without-mathptmx
%
%
% For a comparison, in:
% /home/christophe/Personal/Truc_Et_Astuce_Informatik/LaTeX/comparison_font_types/,
% see:
% computer.pdf lmodern.pdf pslatex.pdf test_font_type.pdf three_replacements.pdf txfonts.pdf
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% AMS MATH %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% usepackage{amsmath} % loads amstext, amsbsy, amsopn but not amssymb
% equation stuff (eqref, subequations, equation, align, gather, flalign, multline, alignat, split...)
% usepackage{amsfonts} % may be redundant with amsmath
% usepackage{amssymb} % may be redundant with amsmath
% numberwithin{equation}{section} % reset equation counters at start of each "section" and prefix numbers by section number
% numberwithin{figure}{section} % reset figure counters at start of each "section" and prefix numbers by section number
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% LAY OUT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% See:
% https://tex.stackexchange.com/questions/59626/nicely-force-66-characters-per-line
% (must be after pslatex, tgterms, etc...)
%
% a) (but works mostly for a4paper, and changes top and bottom margin too...)
% usepackage[DIV=calc]{typearea}
%
% or
%
% b) (but you have to choose the value and the margin ratio depending on the class...)
% newlength{alphabet}
% settowidth{alphabet}{normalfont abcdefghijklmnopqrstuvwxyz}
% usepackage{geometry}
% geometry{%
% textwidth=2.5alphabet,% (Note: 2.5 * 26 = 65)
% hmarginratio={2:3}} % (Problem: geometry uses 2:3 as default for twoside and 1:1 for oneside,
% % independently of what the class thinks about the margins)
% usepackage{layout} % use layout in the tex file to see the values
% usepackage{layouts} % it extends the functionality of layout, allowing you to do much, much more
% some commands: pagelayout, pagevalues, pagedesign, ...
% usepackage[cm]{fullpage} % set 'default' full page
% usepackage{geometry} % very customizable margins. Under some (rare) circumstances, should be loaded after hyperref
% usepackage{anysize} % marginsize{left}{right}{top}{bottom}
% usepackage{pdflscape} % include landscape layout pages (automatically rotate pages in pdf file for easier reading)
% usepackage{multicol} % for multi column environment
usepackage{lipsum} % to fill in with arbitrary text
widowpenalty = 4000 % help suppress widows, default = 4,000 (?), from 0 to 10 000 (from 300 to 1 000 recommended, 10 000 not recommended)
clubpenalty = 4000 % help suppress orphans, default = 4,000 (?), from 0 to 10 000 (from 300 to 1 000 recommended, 10 000 not recommended)
usepackage[final, babel]{microtype} % many good lay-out/justification effects, see:
% texblog.net/latex-archive/layout/pdflatex-microtype/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EMBED FILEs %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
usepackage{embedfile} % embed (attach) any files (eg tex source) to a PDF document.
% Currently only supported driver is pdfTEX >= 1.30 in PDF mode
embedfile{to_post.tex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EASY EDITS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
usepackage{ifdraft} % ask for selective behavior depending on the draft option (used for waterdraftmark, not draftmark)
% usepackage{comment} % provide new {comment} environment: all text inside the environment is ignored.
% usepackage{fixme} % allow nice comment / warning system, displayed in draft mode in right margin ; % [status=draft]
% usepackage{lineno} % number all lines in left margin if activated with linenumbers
% linenumbers
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% GRAPHICX %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% usepackage[final]{graphicx} % options = [final] = all graphics displayed, regardless of draft option in class
% options = [pdftex] = necessary (?) if import PDF files
% no option : when importing ps- and eps-files (?)
% graphicspath{{../images/}} % tell LaTeX where to look for images
% DeclareGraphicsExtensions{.pdf, .PDF, .jpg, .JPG, .jpeg, .JPEG, .png, .PNG, .bmp, .BMP, .eps, .ps}
usepackage{float} % Improved interface for floating objects ; add [H] option
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% FILIGREE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% draftmark : newer and better package but not on Phil's computers,
% in particular, draftmark has a "ifdraft" option included...
%
ifdraft{
usepackage{draftwatermark} % add watermark ("draft", "confidential"...)
% option: [firstpage] (insert on only the first page)
SetWatermarkText{COPY~---~DRAFT}
SetWatermarkAngle{55}
SetWatermarkScale{6.0}
SetWatermarkLightness{0.85}
SetWatermarkFontSize{12 pt}
}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HYPERREF (last) then HYPCAP %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% See:
% https://tex.stackexchange.com/questions/1863/which-packages-should-be-loaded-after-hyperref-instead-of-before
%
usepackage[
pdftex,
final, % if you do want to have clickable-colorful links
pdfstartview = FitV,
linktocpage = false, % ToC, LoF, LoT place hyperlink on page number, rather than entry text
breaklinks = true, % so long urls are correctly broken across lines
% pagebackref = false, % add page number in bibliography and link to position in document where cited
]{hyperref}
% usepackage{cleveref} % enhance cross-referencing, allow full formatting, commands:
% cref, Cref, crefrange, cref{eq2,eq1,eq3,eq5,thm2,def3}
% supposedly better than autoref as provided by hyperref
% usepackage[all]{hypcap} % when link to float (using hyperref), link anchors to beginning (instead of below) float
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TITLE PAGE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
title{}
author{This example's author's name.}
date{today}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% THE ACTUAL DOCUMENT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
begin{document}
% desactivate microtype protrusion for all "list of..."
% microtypesetup{protrusion=false}
% tableofcontents
% listoftables
% listoffigures
% reactivate microtype protrusion after all "list of..."
% microtypesetup{protrusion=true}
title{Correlation of procrastination and LaTeX}
maketitle
textrm{lipsum[11]}
textsf{lipsum[11]}
texttt{lipsum[11]}
section{Alibaba and the 40 thieves}
subsection{La vie est un long fleuve tranquille}
% lipsum[11]
begin{equation}
int_{-infty}^{+infty} e^{-x^2} dx = left( 6 sum_{n=1}^{infty} frac{1}{n^2} right)^frac{1}{4}
end{equation}
lipsum[1-7]
end{document}
Cheers.
Here's a non-exhaustive list of possibilities for "nice" font families -- which I take to mean that they provide both text and math fonts -- for use with pdflatex
.
Computer Modern -- the default font family for TeX and LaTeX, i.e., the font family that's used if no other font family is loaded.
The following image represents the output of the MWE listed at the end of this posting using the Computer Modern fonts. (All subsequent images use the same MWE but load one or more additional font-related packages.)
lmodern -- Latin Modern. Very much like Computer Modern, but with many more glyphs, e.g., for characters with accents, cedillas, ogoneks, etc. Very useful if the language you write your documents in isn't English (which has, of course, very little need for these additional glyphs).
If the following image strikes you as near-identical to the one above, that's of course no accident, given the close dependence of the Latin Modern fonts on the Computer modern fonts. (Hint: When comparing the two images, look closely at the word "Let" that starts the theorem's statements. In this word, the space between the "e" and the t" is ever so slightly wider for CM than it is for LM. I was able to detect this difference only by switching back and forth rapidly between the two images. To detect any more-significant differences between the two fonts, it's probably necessary to display various accented characters.)
pxfonts
font package. Comparing the screenshots below and above, you should notice the larger summation and integral symbols generated by the newpxmath
package.kpfonts
and mathpazo
packages, some important differences are immediately visible when looking at the integral and sum symbols and lowercase Greek letters such as gamma
.Times Roman
font. Times Roman (and its close cousin, Times New Roman) must surely among the world's most ubiquitous fonts. Whether that's an advantage (or not...) will depend importantly on your sense of aesthetics.mathptmx
package is passable, but if you really want good-looking mathematics in Times Roman, consider purchasing the MathTime Pro 2 package. This commercial package, which provides only math-mode fonts, provides optically scaled small glyphs for use in first- and second-level sub- and superscripts, good-looking large operator symbols (sums, integrals, ...), as well as many other goodies. Notice, in particular, the shapes of the integral and summation symbols in the following screenshot.mathptmx
package shown above, and not particularly similar to that of the mtpro2
, txfonts
or newtxmath
fonts (see below). The integral symbol provided by the stix
package quite slanted, as well as quite tall.mathptmx
and mtpro2
packages (or, for that matter, the Computer/Latin Modern font families) and is, instead, quite similar to the shape provided by the kpfonts
package.txfonts
package has been revised and improved considerably. The new version, by Michael Sharpe, is called newtx. It's a package with two sub-packages -- newtxtext
and newtxmath
. The newtxtext
package loads clones of Helvetica and of a monospaced font to provide reasonably well matched sans-serif and "typewriter" fonts.newtxmath
package, be sure to load the newtxmath
package with the libertine
option; doing so will set up a special set of math-mode fonts that is meant to harmonize well with the Libertine text fonts.newtxmath
package with the option libertine
; this is not surprising, given that the same person (the incomparable Michael Sharpe) produced both the newtxmath
and the libertinust1math
package (as well as many other font packages!).As I noted at the very beginning of this answer, this list is by no means intended to be exhaustive. Nevertheless, I hope it'll give you a good start if you need to choose a set of fonts.
There are, of course, many other font packages, most of which provide "only" text-mode fonts. Among these are the "TeX-Gyre" font families Termes
(a Times Roman clone), Pagella
(a Palatino clone), and Schola
(a Century Schoolbook clone); one would load the packages tgtermes
, tgpagella
, and tgschola
, respectively, to access these fonts. However, as these are text fonts, you still need to choose a suitable math font.
Here's the code that generated the images showing the residue theorem. Be sure to un-comment the appropriate font-related usepackage
statements.
documentclass{article}
usepackage[T1]{fontenc}
usepackage{ntheorem}
newtheorem{theorem}{Theorem}
usepackage{amsmath}
DeclareMathOperator{Res}{Res}
%% Choose one of the following (if not choosing the
%% default, viz., Computer Modern, font family):
%usepackage{lmodern}
%%
%usepackage{mathpazo}
%usepackage[theoremfont]{newpxmath} usepackage{newpxmath}
%usepackage{kpfonts}
%%
%usepackage{mathptmx}
%usepackage{times,mtpro2}
usepackage{stix}
%usepackage{txfonts}
%usepackage{newtxtext,newtxmath}
%%
%usepackage{libertine} usepackage[libertine]{newtxmath}
usepackage{libertine,libertinust1math} % added 2019/11/28
%%
%usepackage{newpxtext} usepackage[euler-digits]{eulervm}
begin{document}pagestyle{empty}
begin{theorem}[Residue Theorem]
Let $f$ be analytic in the region $G$ except for the isolated
singularities $a_1,a_2,dots,a_m$. If $gamma$ is a closed
rectifiable curve in $G$ which does not pass through any of the
points $a_k$ and if $gammaapprox 0$ in $G$, then
[
frac{1}{2pi i}int_gamma! f = sum_{k=1}^m
n(gamma;a_k)Res(f;a_k),.
]
end{theorem}
end{document}
Addendum, 2012/06/15 -- A personal note: the upvotes on this answer earned me, earlier today, my 100th "badge" from TeX.SE. What a great site! You, fellow users, readers, and contributors to TeX.SE, are the one that make it great! Many thanks to all of you.
Correct answer by Mico on June 25, 2021
here you'll find the "Survey of Free Math Fonts for TeX and LaTeX"
Answered by user2478 on June 25, 2021
If you do not have the Adobe reader installed, locate a copy for your operating system and install it. Locate the directory where the MinionPro
fonts are installed and copy them to a temp-directory.
Direct you browser to FontPro and read the README
on how to install the MinionPro` font for LaTeX. If this package does not work, you may try the original package you will find at this directory at CTAN.
Read the documentation for the MinionPro package. Add the following to your preamble:
usepackage[footnotefigures]{MinionPro}
input{glyphtounicode}
pdfgentounicode=1
renewcommand{scdefault}{ssc}
usepackage[scaled=0.85]{luximono} % Monospace font
usepackage[letterspace=160,babel=true,tracking=true,kerning=true]{microtype}
Then you can start using one of the most beautiful fonts made. In my documents (agreement, memos, legal opinions, etc.), I do not use any sans serif fonts (neither any boldface). Have look at the package classicthesis to get tips on how to compose nice looking documents.
Her is Mico’s MWE using MinionPro:
Answered by Sveinung on June 25, 2021
I really like Bitstream Charter. It has been designed for low-resolution laser printers and is very readable but still good looking. It has been donated by Bitstream to the X Consortium and is thus freely available (usepackage{charter}
, CTAN). It does not contain real small caps though.
Charis SIL is a free derivate that provides more glyphs. There is still a commercial version of Charter that contains small caps, ranging figures and additional glyphs.
Answered by vanto on June 25, 2021
Here is one combination omitted by Mico that I use extensively: mathpazo for text (based on Palatino) and AMS Euler (eulervm) for math:
Both fonts were designed by Hermann Zapf and harmonize quite well together. Since they are freely available, I can also use this for papers on http://arXiv.org for example. They are not quite so space efficient as other combinations (Minion Pro + AMS Euler works well for this purpose), but I find are much easier to read – especially on screen – than many of the other combinations (esp. the * Modern and Times based fonts.)
As AMS Euler is an upright math font, it does not look very nice when inserted in the midst of extended italic text. As a result, I felt it necessary to restyle the theorem environment somewhat to use roman text.
documentclass{article}
usepackage[T1]{fontenc}
usepackage[tracking]{microtype}
usepackage[sc,osf]{mathpazo} % With old-style figures and real smallcaps.
linespread{1.025} % Palatino leads a little more leading
% Euler for math and numbers
usepackage[euler-digits,small]{eulervm}
AtBeginDocument{renewcommand{hbar}{hslash}}
usepackage{ntheorem}
% No easy way of putting the theorem description in italics?
% It seems I need to define a new style...
makeatletter
newtheoremstyle{mystyle}%
{item[hskiplabelsep theorem@headerfont ##1 ##2theorem@separator]}%
{item[hskiplabelsep theorem@headerfont ##1 ##2 textit{(##3)}theorem@separator]}
makeatother
theoremstyle{mystyle}
theoremheaderfont{scshape}
theorembodyfont{upshape}
newtheorem{theorem}{theorem}
usepackage{amsmath}
DeclareMathOperator{Res}{Res}
begin{document}pagestyle{empty}
begin{theorem}[Residue Theorem]
Let $f$ be analytic in the region $G$ except for the isolated
singularities $a_1,a_2,dots,a_m$. If $gamma$ is a closed
rectifiable curve in $G$ which does not pass through any of the
points $a_k$ and if $gammaapprox 0$ in $G$, then
[
frac{1}{2pi i}int_gamma! f = sum_{k=1}^m
n(gamma;a_k)Res(f;a_k),.
]
end{theorem}
end{document}
Answered by mforbes on June 25, 2021
Many font packages will get listed within the answers to this question. So, instead of just adding another single "answer" with another single font package, here's a list of 30 Staple Fonts that cover the most popular Font Styles in common use, such as Garamond, Century, Charter, Palitino, Times, Libertine, Bookman, Utopia and Helvetica.
The code at the bottom would amount to a "font section" of a LaTeX Preamble, use it as a Template. You'd need to comment out every Serif (Roman) font except ONE, and also every Sans Serif font except ONE. The color effects of having the font packages stand out shows the package names well, with a description grayed out to make it more noticeable.
The LaTeX Font Catalogue is an excellent resource, but I've weeded through them for the packages with the most style glyphs of each variety (the most style options such as smallcaps, smallcaps bold, smallcaps italics etc.) and included just those of most popular fonts.
ALSO included are the VERY basic PSNFSS fonts. Those are fonts that every TeX user should be aware of, because they are included in Every Minimal TeX Installation, and will run on Every postscript printer even without embedding. So, popularity, availability, comparability with postscript printers, and expansive style assortment of the font were my basic criteria.
I keep these 30 in my Basic LaTeX Template, because of that. Also, note at the very start of the code below, I change the Computer Modern font family (Obsolete) to the Latin Modern. If no font packages are used, you will atleast get the benefits of [T1] font encoding. For the benefit of LaTeX users that find this tread like I did, by searching the internet, you should know that Computer Modern remains the default for TeX distributions only so that LaTeX documents created years ago, will look and process exactly the same.
%%%% FONTS PACKAGE OPTIONS in the Preamble %
%%%% always replace default Computer Modern with Latin Modern [T1] encoding:
renewcommand{ttdefault}{lmtt} % MONO Latin Modern Font % T1 encoding of cmtt font style
renewcommand{rmdefault}{lmr} % SERIF Latin Modern Font % T1 encoding of cmr font style
renewcommand{sfdefault}{lmss} % SANS Latin Modern Font % T1 encoding of cmss font style
% % % % % % % % % % % % % % % %
% % % PSNFSS ssfamily fonts (SANS)
usepackage{helvet} % PSNFSS Font, in every TeX distribution
usepackage{avant} % PSNFSS Font, in every TeX distribution
% % % Extended ssfamily (Sans) fonts; load extraFonts option from TeX
usepackage[scaled=0.88]{berasans}% package has a handy scaling option
usepackage{libris} % a nice, almost handwritten calligraphic look
usepackage{biolinum} % included with the {Libertine} font package
usepackage{iwona}
usepackage{paratype}
%%% END OF SANS SERIF FONT PACKAGES
% % % % % % % % % % % % % % % % % %
% % % PSNFSS rmfamily fonts (SERIF)
usepackage{mathptmx} % Times % PSNFSS Font, in every TeX distribution %
usepackage{charter} % Bitstream Charter % PSNFSS Font, in every TeX distribution %
usepackage{mathpazo} % Palatino % PSNFSS Font, in every TeX distribution
usepackage{bookman} % Bookman % PSNFSS Font in every TeX
usepackage{chancery} % Zapf Chancery % PSNFSS Font in every TeX, a Calligraphic Font
usepackage{newcent} % New Century Schoolbook % PSNFSS Font in every TeX distribution % To replace it's Avant Garde sans add this:% renewcommand{sfdefault}{xxx}
% % % Extended rmfamily (SERIF) fonts; load extraFonts option from TeX
usepackage[scaled=0.88]{beraserif}% package has a handy scaling option
usepackage{XCharter} % Bitstream's Charter extended with many style varieties
usepackage{fouriernc}% Century Schoolbook % compact and lighter than New Century Schoolbook
usepackage{tgschola} % TeX Gyre Schola, New Century Schoolbook with many font style varieties
usepackage{tgtermes} % TeX Gyre Termes, Times with many font style varieties
usepackage{tgbonum} % TeX Gyre Bonum, Bookman with many font style varieties
usepackage{tgpagella}% TeX Gyre Pagello, a Palatino font with many font style varieties
usepackage{fourier} % Utopia, package {utopia} is obsolete
usepackage{txfonts} % TX Serif and Sans (Helvetica)
usepackage{kpfonts} % KP Serif and Sans, large variety of font styles
usepackage{libertine}% Libertine + Linux Biolinum (Extra TeXLive fonts)
usepackage{fbb} % A Garamond Font (Bembo) with many font styles
%%% END SERIF FONTS
%%% NOTE!!! Be sure to comment out all but ONE Serif and ONE Sans
%%% from the package selections above.
% % % % % % % % % % % % % % %
% % % % % % % % % % % % % % %
% % % Load Math Support if necessary
%
usepackage[myFontPackage]{mathdesign}
%
%
%%% END OF FONTS In the Preamble
%%%%%%%%%%%%%%%%%%%%%%%%%%
Answered by user12711 on June 25, 2021
Cochineal
, newtxtt
, and Cabin
, with newtxmath
Cochineal is a serif font based on the free font Crimson. In this example I've used settings given by the packages' vignettes, with scale modifications of my own.
usepackage[p,osf]{cochineal}
usepackage[scale=.95,type1]{cabin}
usepackage[cochineal,bigdelims,cmintegrals,vvarbb]{newtxmath}
usepackage[zerostyle=c,scaled=.94]{newtxtt}
usepackage[cal=boondoxo]{mathalfa}
garamondx
, zlmtt
, and Source Sans Pro
with newtxmath
Here are two options using garamondx
, which is free but not included in texlive out-of-the-box, although I think it might be available in MikTeX. It has to be downloaded separately if you're running texlive, which the getnonfreefonts
program will do for you.
The first option also uses a modified version of the Latin Modern typewriter font, and Source Sand pro for serif.
usepackage[full]{textcomp}
usepackage{garamondx}
usepackage[scaled=1.01]{zlmtt}
usepackage{sourcesanspro}
usepackage[garamondx,cmbraces]{newtxmath}
useosf
garamondx
, inconsolata
, and Fira Sans
with mathdesign
Here, Inconsolata is used as the monospace font option with Fira Sans as the sans-serif font.
usepackage[garamond]{mathdesign}
usepackage[full]{textcomp}
usepackage{garamondx}
usepackage[varqu,varl,var0,scaled=0.97]{inconsolata}
usepackage{FiraSans}
I revised this answer to include solutions that showcased serif, mono-space, and sans-serif solutions (which is what was originally asked for).
Answered by Johan Larsson on June 25, 2021
mathastext
Another option is to use Jean-François Burnol's mathastext
which adopts some of the letters and symbols in the document's font (or any other) for use in math environments.
fbb
Here is an example using mathastext
with Michael Sharpe's great fbb
package (an expanded version of Bembo/Cardo), together with newtxmath
using the libertine option.
usepackage{fbb}
usepackage[libertine]{newtxmath}
usepackage[italic]{mathastext}
MTsetmathskips{f}{5mu}{1mu} # add space to compensate for the large f-italic in fbb
Answered by Johan Larsson on June 25, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP