Latex document class file


















Note: To learn how to generate the output file see our article on compiling. Open an example in Overleaf. The part of your. In the preamble, you define the type of document you are writing and the language, load extra packages you will need, and set several parameters.

For instance, a normal document preamble would look like this:. The next three lines are self-descriptive. Anyway, you can see a description of what they actually do in the next section. To display the title of your document you have to declare its components in the preamble and then use some additional code:. There is a block with three lines in the preamble that defines the information to be included on the title page.

Once you have that in the preamble now in the body of your document you can use the next commands for the information to be printed. In scientific documents, it's a common practice to include a brief overview of the main subject of the paper. In L a T e X , the abstract environment is for this purpose. The abstract environment will put the text in a special format at the top of your document.

When writing the contents of your document, if you need to start a new paragraph you must hit the "Enter" key twice to insert a double blank line. This class is used to make traditional letters, the ones that are put in an envelope and mailed, a somewhat obsolete way of communication since the email was invented and generalized but still used in certain official matters.

Although the class was designed for traditional letters, still today there are certain documents that have the structure of a letter such as:.

These declarations are usually put in the preamble because they are common to all letters, but they are normal declarations with the customary scoping rules and can appear anywhere in the document. In particular, this means that you can change the return address and signature at any point. Each letter is produced by a separate letter environment, having the name and address of the recipient as its mandatory argument. These may seem a lot of commands, but they are all very easy to use, and also very powerful since LaTeX automatically will take care of the formatting of the letter, without you having to worry about it at all.

In case you are not convinced yet, let me show you a clarifying example where all the commands are put into practice so that you can use it as a template for your letters:. You can see the letter generated in Figure 2. Note how LaTeX automatically formates everything, and even inserts the current date without you asking for it.

I find generating letters with LaTeX easier than doing it by hand! For example:. This declaration can either be used on the preamble, to affect all letters or inside a certain letter environment, to only affect that letter.

Here we are going to explain these options:. The options 10pt, 11pt, and 12pt choose the normal type size of the document. The default value is 10pt. This option is not recognized by the slides class. The landscape option causes the output to be formatted for landscape printing on the selected paper size. Effectively, this option interchanges the width and the height dimensions of the paper size. The draft option causes such lines to be marked by black boxes in the output.

The final option, which does not mark these lines, is the default. The oneside and twoside options format the output to be printed on one side or both sides of a page, respectively.

The default is oneside, except for the book class, for which it is twoside. To change the default behavior, the option is provided as an optional parameter to the documentclass command. Other global and local font sizes are available through various packages.

The following example sets the global document font size to 12pt. The picture below compares the three LaTeX standard font sizes. The geometry package provides similar options and additional flexibility for paper size and margins.

Setting the draft option will speed up typesetting, because figures are not loaded, just indicated by a frame.

LaTeX will also display hyphenation Overfull hbox warning and justification problems with a small black square. Delete the draft option or replace it with final in the final document version. By default, text is typeset in a single column onecolumn. LaTeX provides an easy way to switch to two columns through the document-class option twocolumn. The multicol package allows creating more than two columns globally as well as locally. These are two independent options manipulating the alignment and label position of formulas.

The top figure illustrates the default case with neither option set. The bottom figure shows how formulas are typeset when both options, fleqn and leqno , are set. The landscape option changes the page layout to landscape mode. This, however, does not change the page margins accordingly first page in figure , which is why for landscape documents with landscape content the pdflscape or geometry packages second page in figure and code are more suitable.

In single-sided documents oneside , the left and right margins are symmetric and headers are exactly the same on every page. In other words, the document does not distinguish between inner and outer margin. Twoside, on the other hand, generates double-sided content.

The outer margin even page: left; odd page: right is wider by default see figure below. The twoside option is usually set for bound texts such as theses or books. The titlepage option is quivalent to:. Finally, the option openright always starts a chapter on the right odd pages , leaving one page blank in case the last paragraph of the previous chapter ended on an odd page. It only works and makes sense with the twoside option set.

The openany option starts the chapter on the next page even or odd. February at Very interesting post!



0コメント

  • 1000 / 1000