Tired of that “TeX” look?

TeX has been using computer modern (CM) font since its inception. But that “TeX” look may become a bit tiring. Of course, TeX is a typesetting engine, it is not limited to CM fonts. On the other hand, there aren’t so many fonts around for both the text and the math. (If you have no math,  xeTex makes it easy to use most fonts you can imagine, including the Microsoft and google families).

I found a very clear review of existing alternatives at the Font usage post, by Ryosuke Iritani (入谷 亮介). I have taken his suggestions and created a gallery, with a simple sample of text and equations.

More elegant Palatino

\usepackage[sc]{mathpazo}
\linespread{1.05} % Palladio needs more leading (space between lines)
\usepackage[T1]{fontenc}

mathpazo.png

Kpfonts (Palatino-like)

\usepackage{kpfonts}

mathpazo

Libertine

Used e.g. in Wikipedia on each sectioning

\usepackage{libertine}
\usepackage{libertinust1math}
\usepackage[T1]{fontenc}

libertine.png

STIX

Scientific and Technical Information Exchange; Times-based but much more elegant than txfonts package.

\usepackage[T1]{fontenc}
\usepackage{stix}

styx

Garamond

It’s a bit thin and less friendly

\usepackage[urw-garamond]{mathdesign}
\usepackage[T1]{fontenc}

garamond.png

Utopia (Adobe)

\usepackage[adobe-utopia]{mathdesign}
\usepackage[T1]{fontenc}

utopia.png

Charter

\usepackage[charter]{mathdesign}

charter.png

Crimson (with math support)

\usepackage[T1]{fontenc}
\usepackage{cochineal}
\usepackage[cochineal,varg]{newtxmath}

crimson.png

Baskervald

Baskerville-based, thicker font

\usepackage[lf]{Baskervaldx} % lining figures
\usepackage[bigdelims,vvarbb]{newtxmath} % math italic letters from Nimbus Roman
\usepackage[cal=boondoxo]{mathalfa} % mathcal from STIX, unslanted a bit
\renewcommand*\oldstylenums[1]{\textosf{#1}}

baskervald

Helvetica

So far, the only font not included the Iritani’s Font usage post!

\usepackage{helvet}
\usepackage{sansmath}

\usepackage{titlesec}  % this enforces helvetica in section and chapter titles
\titleformat{\chapter}[display]
  {\normalfont\sffamily\huge\bfseries}
  {\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titleformat{\section}
  {\normalfont\sffamily\Large\bfseries}
  {\thesection}{1em}{}

% In main text, at the beginning:
\fontfamily{phv}\selectfont

% before the first equation:
\sansmath

helvetica

The code

All the above was produced with variations of this file. I just run latex on it, then dvips to get a ps file, which I then crop and export as PNG using the GIMP. Of course, depending on the system, some LaTeX packages may be needed, as well as fonts (I had to install urw-garamond on my arch linux system, for example.)

 

\documentclass{article}

\newcommand{\bfr}{\mathbf{r}}
\newcommand{\bfu}{\mathbf{u}}
\newcommand{\bfq}{\mathbf{q}}

\usepackage{amsmath}

\usepackage{libertine}
\usepackage{libertinust1math}
\usepackage[T1]{fontenc}

\usepackage{lipsum}% for filler text

\begin{document}

\section{A section}

\lipsum[10]

Equations:

\begin{equation}
\frac{d \mathbf{u}}{d t} = - \nabla p + \nu \nabla^2 \mathbf{u},
\end{equation}

\begin{equation}
\begin{split}
E &= m c^{2},\\
T &= 2\pi \sqrt{\frac{m}{k}}
\end{split}
\end{equation}

\begin{equation}
\iint \phi = - \oint p
\end{equation}
\end{document}

Advertisements

A markdown test

This is a test of markdown blog writing. The writing comes straight from my website on CFD methods. These were written in markdown under reveal.js, for quick and nice lecture slides. Some changes had to be made:

  • LaTeX must start as “dollar sign latex” … “dollar”
  • Links to local files (such as pictures) don’t work
  • Lists (such as this one) do not seem to work well

 

 

 

 

Muy a menudo, se parte de las EDPs, conocidas, por ejempo:

\frac{\partial u}{\partial t} + c \frac{\partial u}{\partial x} = 0

Estas se discretizan: sustituyendo las derivadas por diferencias.

Sin embargo, este es un proceso de ida y vuelta, porque
las EDPs se deducen a nivel discreto.

Deducción

 

 

Se suponen cambios de un campo u sólo
en la dirección x

Esquema de convección en 1D

 

Esquema de convección en 1D

conveccion_1d

parts_bw_values_250

 

El cambio en la cantidad total A \Delta x \, u_i será:

\frac{d }{d t} (A \Delta x \, u_i ) = \Phi_{i-1/2} - \Phi_{i+1/2}

Flujos, convección

Antes los flujos por las caras venían dados por:

\Phi_{i-1/2} = A c \, u_{i-1/2}

\Phi_{i+1/2} = A c \, u_{i+1/2}

\frac{d }{d t} (A \Delta x \, u_i ) = A c \, u_{i-1/2} - A c \, u_{i+1/2}

Fancy headers in LaTeX books

First in a series of notes on book formating under LaTeX. This is the header.tex file that defines the format for the headers and footers for each page. It’s pretty standard, as described in e.g. the Page Layout chapter of the wikibook on LaTeX. The only trick is taken from Mark Schenk’s page about his MSc Thesis: this piece of code makes empty pages (typically, the ones on even pages across the first pages of some chapters) completely and immaculately empty.

Continue reading

Curriculum del Ministerio

Tres horribles palabras. Para cada convocatoria de cualquier proyecto se suele exigir en España un CV normalizado del Ministerio. (Bueno, son cuatro palabras.)

Una solución a la perspectiva de tener que actualizar a mano un documento (generalmente, con word) es la siguiente:

  • Utilizar el servicio de almacenamiento de CVs del Ministerio. Es un poco primitivo (intentar ordenar una lista larga puede ser frustrante), pero al menos es accesible desde cualquier sitio y cualquier convocatoria.
  • Ojo, hay campos opcionales que hay que rellenar: poner “0 investigadores” en un proyecto o da un error.
  • También está disponible en formae una versión offline en java de la herramienta.
  • Pedir una conversión a rtf. O, mejor, a LaTeX.
  • Corregirla:  ordenando listas de manera adecuada, borrando campos absurdos o vacíos (0 investigadores), poniendo bonita la parte de “Otros méritos” (con itemizes).
  • Compilar. El comando “\textbf{\hline}” que genera la apliación funciona, pero LaTeX se queja cada vez. Se puede sustituir por “\hbox to \textwidth{\hrulefill}”, que no da errores.

New LaTeX directions

Prompted by my friend Jan Hlavacek, I have compiled a list of recent and exciting developments in the TeX world. Good reads inculde

The list:

  • beamer (see post)
  • posters (see post)
  • XeTeX (see post)
  • LaTeX markup in wikipedia and google docs (see  post)
  • luatex, combining the lua language and TeX
  • pgf, a TeX macro package for generating graphics
  • The LaTeX3 project, a long-term research project to develop the next version of the LaTeX typesetting system (currently at LaTeX2e).
  • Support for BiBTeX in some journals (e.g., the APS, the AMS). And, on the WoK, which must be quite recent (I have just noticed).
  • mplib (Mmmh, couldn’t find anything about this…).

Update:

Prompted by Jan:

  • luatex has a (shortish) wikipedia entry.
  • MPLib is an extended MetaPost library module. There is some info at the luatex site, but a wikipedia entry has not been written (go write one yourself!). MetaPost does have an entry.
  • Very exciting developments in fonts (both related to luatex):
    • latin modern, “derived from the famous Computer Modern fonts designed by Donald E. Knuth
    • TeX gyre fonts, “an extensive remake and extension of the freely available 35 base PostScript fonts distributed with Ghostscript ver. 4.00”. (I love the word gyre, too. See ocean gyres.)
  • The Ipe drawing editor. Looks very nice – to tell the truth, I am still struggling with inkscape, which looks incredibly powerful.

And, some stuff I’ve discovered on my own:

  • BibTeX tools for microsoft word: Bibshare (made in Spain).
  • LaTeX markup in google docs (ok, I had another entry on this).
  • LaTeX typing in MathType.
  • LaTeX into power point: TexPoint and TeX4PPT.