A MathWikiből


Introduction to Latex

First LaTeX file

  • Copy the following code into an empty file! Save it as template1.tex! It's important to have the file in utf-8 encoding, since we specify that it in the \usepackage[utf8]{inputenc} line.
\usepackage[T1]{fontenc}     % internal encoding
\usepackage[utf8]{inputenc}  % input encoding
\usepackage[english]{babel}   % language
\usepackage{amsmath,amssymb} % math packages
\usepackage{graphicx}        % for embedding pictures
\date{}                      % this can be left empty
  • Duplicate the template1.tex into another file named latex1.tex and in this new one fill the empty blocks (Lorem Ipsum, if you have no inspiration), compile the code, and then view it with the following command:
 pdflatex latex1
 xpdf latex1.pdf &


  • We highly recommend using a latex editor from now on. TexMaker is a platform independent editor, you can compile the edited file with the F1 button.
  • If everything went smoothly up until this point, then put a few errors in the code and then try to compile it again. (You'll see red error messages at the bottom of TexMaker.)
  • Try to write a few formulas, you can use the help here, it's in hungarian, but the formulas are universal.
  • Reproduce your current or last week's homework in latex.

LaTeX practice

  • Try the different font styles (textt, textsf, uppercase, textbf, textit, emph, textsl, etc.)! Change the size of the text: tiny, normalsize, large etc.!
  • Create lists (enumerate, itemize, description, nested)! Change the numbering of enumerate to roman numerals!
  • Create a table with the tabular environment. Try to aligh the text left/right/center! Use the \hline and \vline commands!
  • Math environments:
    • Try inline and display style environments as well
    • Fractions, roots, superscripts, subscripts (\left és \right)
    • Equations (equation, eqnarray, align)
    • Theorem, definition, lemma (numbering, reference)
  • References, bibliography

Help yourself

Személyes eszközök