Step 1: Preamble
Now before we start writing, each document that you make should have its own folder on your computer, in this folder all the files associated with your document will be kept here, such as pictures and whatnot.
When writing in texmaker, its a good idea to seperate your code with comments. Comments are made in latex using the '%' symbol and only cover one line, for example;
%This is a comment
This is not
So then to start a document we need to tell latex what type of document it is by using the following command;
\documentclass[ ]{ }
This command and most of the commands in latex are initated using the backslash '\' character, and generally follow the same template: \command[Options]{Parameters}
latex built-in document classes are as follows;
*article
*report
*letter
*book
*proc
*slides
There are others such as a meeting minutes class, but these need googling to understand.
So we need to tell latex several things; paper size, font size, document class, and any other options such as double sided, two columns, etc.
For this instructable we will use a4paper, 11pt font, and report. These are inputted as follows;
\documentclass[11pt, a4paper]{report}
All the options go between the square brackets and the document class goes between the parentheses (curly) bracket.
After the document class comes the additional packages that you might need. There are loads of packages, and I'm not going to list any useful ones incase I start an arguement, however a general package I've found to be extremely useful is todo notes. To use a package we simply enter them in after the document class line;
\usepackage[options]{package name}
so for todo notes;
\usepackage{todonotes}
(todo notes is a bad example in hindsight as it doesn't have any options...) If the package you're using doesn't have any options associated with it you can safely delete the square brackets.
Finally the last piece of the preamble puzzle is the start of the document;
\begin{document}
this will add a \end{document} line underneath it, and your writing should be between these two.
See the picture for a sample preamble.
When writing in texmaker, its a good idea to seperate your code with comments. Comments are made in latex using the '%' symbol and only cover one line, for example;
%This is a comment
This is not
So then to start a document we need to tell latex what type of document it is by using the following command;
\documentclass[ ]{ }
This command and most of the commands in latex are initated using the backslash '\' character, and generally follow the same template: \command[Options]{Parameters}
latex built-in document classes are as follows;
*article
*report
*letter
*book
*proc
*slides
There are others such as a meeting minutes class, but these need googling to understand.
So we need to tell latex several things; paper size, font size, document class, and any other options such as double sided, two columns, etc.
For this instructable we will use a4paper, 11pt font, and report. These are inputted as follows;
\documentclass[11pt, a4paper]{report}
All the options go between the square brackets and the document class goes between the parentheses (curly) bracket.
After the document class comes the additional packages that you might need. There are loads of packages, and I'm not going to list any useful ones incase I start an arguement, however a general package I've found to be extremely useful is todo notes. To use a package we simply enter them in after the document class line;
\usepackage[options]{package name}
so for todo notes;
\usepackage{todonotes}
(todo notes is a bad example in hindsight as it doesn't have any options...) If the package you're using doesn't have any options associated with it you can safely delete the square brackets.
Finally the last piece of the preamble puzzle is the start of the document;
\begin{document}
this will add a \end{document} line underneath it, and your writing should be between these two.
See the picture for a sample preamble.
No comments:
Post a Comment