background preloader

LaTeX

Facebook Twitter

LaTeX/Page Layout. LaTeX and the document class will normally take care of page layout issues for you. For submission to an academic publication, this entire topic will be out of your hands, as the publishers want to control the presentation. However, for your own documents, there are some obvious settings that you may wish to change: margins, page orientation and columns, to name but three. The purpose of this tutorial is to show you how to configure your pages. We will often have to deal with TeX lengths in this chapter.

You should have a look at Lengths for comprehensive details on the topic. Two-sided documents[edit] Documents can be either one- or two-sided. Many commands and variables in LaTeX take this concept into account. Page dimensions[edit] A page in LaTeX is defined by many internal parameters. The current details plus the layout shape can be printed from a LaTeX document itself. To render a frame marking the margins of a document you are currently working on, add to the document. Page size[edit] PhdWiki - tips til det praktiske arbejde med ph.d.-afhandlinger | Jura-monografi / Jura-monografi. TeX Live. TeX Live is an easy way to get up and running with the TeX document production system. It provides a comprehensive TeX system with binaries for most flavors of Unix, including GNU/Linux, and also Windows.

It includes all the major TeX-related programs, macro packages, and fonts that are free software, including support for many languages around the world. Some starting points for actually using TeX are in this introduction to the TeX world. TeX Live has been developed since 1996 by collaboration between the TeX user groups. LaTeX Utilities - BibTeX Style Examples. It can be difficult to decide which of the large range of style files is closest to the format needed. The following provides examples using a variety of public-domain files that can be downloadeded from CTAN (Comprehensive TeX Archive Network). For example, consult the CTAN UK Mirror. Some of the styles below require auxiliary styles, so their representation here is only approximate. In each case, citations are given as they would appear in the body of a document. BibTeX Style Examples. The following examples use these entries: LaTeX/Document Structure. The main point of writing a text is to convey ideas, information, or knowledge to the reader.

The reader will understand the text better if these ideas are well-structured, and will see and feel this structure much better if the typographical form reflects the logical and semantic structure of the content. LaTeX is different from other typesetting systems in that you just have to tell it the logical and semantical structure of a text. It then derives the typographical form of the text according to the “rules” given in the document class file and in various style files.

LaTeX allows users to structure their documents with a variety of hierarchical constructs, including chapters, sections, subsections and paragraphs. Global structure[edit] When LaTeX processes an input file, it expects it to follow a certain structure. The area between \documentclass{...} and \begin{document} is called the preamble. You would put your text where the dots are.

Preamble[edit] Document classes[edit] Depth[edit] Books. Using colours in LaTeX - ShareLaTeX, Online LaTeX Editor. There are several elements in LaTeX whose colour can be changed to improve the appearance of the document. Colours can be manually defined to a desired tone using several models, this article explains how.

[edit] Introduction The simplest manner to use colours in your LaTeX document is by importing the package color or xcolor. Both packages provide a common set of commands for colour manipulation, but the latter is more flexible and supports a larger number of colour models. Below an example: \documentclass{article}\usepackage[utf8]{inputenc}\usepackage[english]{babel} \usepackage{color} \begin{document} This example shows different examples on how to use the \texttt{color} package to change the colour of elements in \LaTeX.

Note: In all the examples the package xcolor can be used instead of color In this example, the package color is imported with then the command \color{blue} sets the blue colour for the current block of text. Open an example of the color package in ShareLaTeX. Conditionals - Logical String Length. TeX Frequently Asked Questions -- question label "hash" The way to think of this is that ## gets replaced by # in just the same way that #1 gets replaced by ‘whatever is the first argument’. So if you define a macro: \newcommand\a[1]{+#1+#1+#1+} or (using the TeX primitive \def): \def\a#1{+#1+#1+#1+} and use it as \a{b}, the macro expansion produces ‘+b+b+b+’, as most people would expect. However, if we now replace part of the macro: \newcommand\a[1]{+#1+\newcommand\x[1]{xxx#1}} then \a{b} will give us the rather odd +b+\newcommand{x}[1]{xxxb} so that the new \x ignores its argument.

If we use the TeX primitive: \def\a#1{+#1+\def\x #1{xxx#1}} \a{b} will expand to ‘+b+\def\x b{xxxb}’. Actually, to define \x to take an argument, we need \newcommand\a[1]{+#1+\newcommand\x[1]{xxx##1}} or, using the TeX primitive definition: \def\a#1{+#1+\def\x ##1{xxx##1}} and \a{b} will expand to +b+\def\x #1{xxx#1} because #1 gets replaced by ‘b’ and ## gets replaced by #. TeX Frequently Asked Questions -- question label "ltxhash" LaTeX command definition is significantly different from the TeX primitive form discussed in an earlier question about definitions within macros. In most ways, the LaTeX situation is simpler (at least in part because it imposes more restrictions on the user); however, defining a command within a command still requires some care. The earlier question said you have to double the # signs in command definitions: in fact, the same rule holds, except that LaTeX already takes care of some of the issues, by generating argument lists for you.

The basic problem is that: \newcommand{\abc}[1]{joy, oh #1! % \newcommand{\ghi}[1]{gloom, oh #1!} Followed by a call: \cmdinvoke{abc}{joy} typesets “joy, oh joy!” And (as you will probably guess, if you’ve read the earlier question) the definition: \newcommand{\abc}[1]{joy, oh #1! Does what is required, and \ghi{gloom} will expand to “gloom, oh gloom!” The doubling is needed whether or not the enclosing command has an argument, so: \newcommand{\abc}{joy, oh joy!