6 tex-latex snippets

Tweak letter spacing in TeX/LaTeX

Using the microtype package:

\usepackage{microtype}
%% [...]
Normal Text
\textls[-40]{Condensed Text}
\textls[140]{Expanded Text}
Published 8 Feb 2014
Tagged tex-latex and design.

 

Avoiding naming collisions in TeX/LaTeX

Both the pifont and marvosym package define a macro named cross, so a simple \usepackage pair like:

\usepackage{pifont}
\usepackage{marvosym}

generates an error. The savesym package is here to save the day:

\usepackage{savesym}
\usepackage{pifont}
\savesymbol{cross}
\usepackage{marvosym}
\restoresymbol{PIF}{cross}

Now both packages are loaded safely (and the pifont \cross macro is now available under the name \PIFcross).

Published 8 Feb 2014
Tagged tex-latex.

 

Setting page margins in TeX/LaTeX

Use the geometry package. For example:

\usepackage[top=0.75in,left=0.75in,right=0.75in,bottom=0.75in]{geometry}
Published 8 Feb 2014
Tagged tex-latex and design.

 

Tab-like alignment in TeX/LaTeX using \hfill

To right-align text:

\null\hfill Lorem Ipsum

Left and right aligned text:

Lorem \hfill Ipsum

Multiple columns:

Left \hfill Center \hfill Right

or

Left \hfill Center-Left \hfill Center-Right \hfill Right

etc.

Published 8 Feb 2014
Tagged tex-latex and design.

 

TeX/LaTeX Font Sizes

To change the font size of text in a TeX/LaTeX document, use:

{\size Text to change the size of.}

where \size is one of:

\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large
\Large
\LARGE
\huge
\Huge

Also see http://en.wikibooks.org/wiki/LaTeX/Fonts#Sizing_text for font size metrics and other details.

Published 8 Feb 2014
Tagged tex-latex and design.

 

breaking non-space (zero-width space)

To insert a zero-width space character (as a hint to the layout engine that it could insert a line break here) in HTML:

​

Or in Latex:

\hspace{0pt}
Published 6 Apr 2014
Tagged html, tex-latex and web.

 

This page was generated at 9:56 PM on 15 Jan 2016.
Copyright © 1999 - 2016 Rodney Waldhoff.