Typography in LaTeX

[ Saturday, 2 February 2008, TLu ]


In the previous article regarding writing a dissertation we omitted the problem of typography and focused chiefly on the structure of the text and its elements. With this article we will complete our course on LaTeX. Since the previous article had a lot of illustrative examples of how to use LaTeX to typeset the text, we will also employ some of these instances today.

Dragonia Magazine

Spaces in the text

Monosyllable conjunctions at the end of a line are generally not desired and should be gotten rid of. LaTeX does not move them to the next line automatically since it cannot analyze the context. Therefore, we need to help it with the interpretation. While writing the text, a non-breaking space can be inserted with a tilde `~`, for instance:

so~it was

Double spaces are not particularly appealing, either. In this case, however, TeX knows what to do and no matter how many spaces we type it will render just one. A mark ending a line is also considered to be a space.

The feature of adding comments is also remarkable. A line beginning with “\%” is treated as a comment and is not being processed. Therefore

We can write	as we like
no matter what TeX will
compile the text %look! a comment!
the right way
with~one character   spacing between the words.

An empty line — that is, two newline characters — marks an ending of a paragraph and a beginning of a new one.

Enumerations

LaTeX supports three kinds of enumerations: numbered, not numbered and description. The first two are the ‘enumerate’ and ‘itemize’ environments which we know already. The last one is a variant of the not numbered enumeration. In this case, a description is used instead of a symbol. Each enumeration begins with an item command.

Numbered enumeration:

\\begin{enumerate}
\\item One
\\item Two
\\item Three
\\end{enumerate}

Not numbered enumeration:

\\begin{itemize}
\\item One
\\item Two
\\item Three
\\end{itemize}

The default enumeration character depends on the document’s class and can be easily changed.

Description enumeration:

\\begin{description}
\\item[Iron] -- an element
\\item[Steel] -- an alloy
\\item[Caffe latte] -- a mixture
\\end{description}

Horizontal lines.

The keyboard allows us to enter only two types of dashes directly — a hyphen and an underscore. LaTeX, however, delivers the following horizontal lines:

  • hyphen: "-" to join words, i.e daughter-in-law
  • en-dash: "--" to join digits, i.e 1937--2007
  • em-dash: "---" to denote a pause, i.e yes --- or no?
  • underscore to join file names: "\_"

In practice, we use just the hyphen and en-dash; mathematical expressions are a good material for a separate article.

Special characters

LaTeX uses some special characters which cannot be used directly since they have certain meaning; for example, they may define a mathematical environment or a command. The table below lists these characters along with their respective notation.

Symbol \ % $ & # [] {} _ ^ ~
Notation \textbackslash \% \$ \& \# {[}{]} \{\} \_ \^ \~

Font size

Default font size can be defined in the document’s class options and can range from 10pt to 12pt. The font sizes in the document can then be adjusted in relation to the default size with respective commands:

\tiny latex
\scriptsize latex
\footsize latex
\small latex
\normalsize latex
\large latex
\Large latex
\LARGE latex
\huge latex
\Huge latex

Typefaces and styles

Apart from the font size we can also define:

  • - font family
    • serif latex \textrm{Queen Margot}
    • sans-serif latex \textsf{Queen Margot}
    • typewriter latex \texttt{Queen Margot}
    • i

  • - series
    • bold face latex \textbf{Queen Margot}
  • - shape
    • upright latex \textup{Queen Margot}
    • italics latex \textit{Queen Margot}
    • slanted latex \textsl{Queen Margot}
    • small caps latex \textsc{Queen Margot}

The default font is upright and serif.

Depending on the chosen font some series or shapes may not exist.

The commands can be nested:

\textbf{\textit{Queen Margot}} latex

The commands changing the typeface or the style of emphasis start with \text and accept one argument in the curly brackets. The argument can be comprised of only one paragraph.

Emphasized words

In printed text, words are emphasized by typesetting them in italic or using a different font family (e.g. sans-serif).

Underlining words should be avoided because it makes the text more difficult to read by crossing the parts of glyphs descending below the baseline of a letter. The custom of underlining text dates back to the times of typewriters which had just one typeface.

Likewise, the text should not be emphasized with bold font since a black element in a grey rectangle of text draws reader’s attention and disturbs the rhythm of reading.

Quotation marks

The popular ” quotation marks are not suitable for publishing. To make a quotation in LaTeX you should use two ` (grave accent) for opening quotation marks and two ‘ (vertical quote) for closing the quotation. For nested quotations use one of each instead:

``Please click `accept' button''. latex

Footnotes

A footnote is a convenient way of providing additional information which we do not want to include in brackets. A footnote at the foot of the current page can be inserted with main \footnote{footnote} text.

latex

The final word

We hope that collecting all information about typography in one article will be a helpful supplement to the series of articles regarding writing a dissertation with LaTeX.


Warning: include_once(/sites/polishlinux.org/wp-content/themes/jakilinuxorg/google_article_inside.php): failed to open stream: No such file or directory in /sites/polishlinux.org/wp-content/themes/jakilinuxorg/single.php on line 48

Warning: include_once(): Failed opening '/sites/polishlinux.org/wp-content/themes/jakilinuxorg/google_article_inside.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /sites/polishlinux.org/wp-content/themes/jakilinuxorg/single.php on line 48

Subscribe to RSS feed for this article!

1 Comment

fold this thread finferflu  Sunday, 3 February 2008 o godz. 10:56 am #  Add karma Subtract karma  +0

Let me add something which I think is pertinent.
LaTeX uses by default Type3 fonts when converting to PDF, which are of a much lower quality than Type1. So in order to have a high quality looking paper, just add these lines in the preamble:

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

Just try it, and look at the difference. I haven’t read the other article entirely, so I’m not sure you already pointed this out. Worth a try anyway :P

(Comments wont nest below this level)
 
Name (required)
E-mail (required - never shown publicly)
URI

Adjust field size: shrink | enlarge)


You can use simple HTML in your comments. Some examples are as follows:
  • A hyperlink: <a href="polishlinux.org">GNU/Linux for everyone!</a>,
  • Strong text: <strong>Strong text</strong>,
  • Italic text: <em>italic text</em>,
  • Strike: <strike>strike</strike>,
  • Code: <code>printf("hello world");</code>,
  • Block quote: <blockquote>Block quote</blockquote>

About the Author

Tomasz Łuczak

TeaM-TL developer, Dragonia Magazine's editor, TeX and Tcl/Tk enthusiast. Lives in Katowice, Poland.

New AdTaily ads!

Are you a film buff?

film buffs community, movie recommendations and reviews

RSS: Comments

You can follow the comments to this article through a special channel RSS 2.0 .

Related articles: Tex

 more »

PolishLinux Top Content


Become our fan on Facebook!

PolishLinux.org on Facebook

Follow PolishLinux on Twitter!

Follow polishlinux on Twitter

Google Ads