5

I was asked to use LaTeX (on math stack exchange), and I downloaded a large number of files (called Miktex).

However all the tutorials seem to assume that you have already started a a document of some sort.

Where is that document?

1 Answers1

2

Miktex holds your packages for compiling LaTeX documents. You can either write you .tex files in a plain tex editor or from programs such as Emacs, Vim, Texnic Center, etc list of tex editors. You need to start a document called name.tex in either one of those programs or a plain tex editor.

Now you are ready write a LaTeX document. At this point, you set up what you need.

\documentclass{article}
\usepackage{packages you will use to compile your file(this what miktex has)}
\begin{document}
body
\end{document}

Here is my preamble as an example:

\documentclass[11pt, dvipsnames]{article}

\usepackage{amsmath, amssymb, eucal, pxfonts, setspace, enumerate, amscd,           
  dsfont, wasysym, tikz, tikz-qtree, mathtools, kurier, pgfplots, listings,         
  etoolbox, tikz-3dplot, float, wrapfig, multirow, array, tkz-fct, graphicx,        
  datetime, fancyhdr, amsfonts, xcolor, microtype, marvosym,       
  starfont}
\usepackage[margin=0.75in]{geometry}
\usepackage[caption = false]{subfig}
\usepackage[all]{hypcap}

Annotations:

11pt is the size of the font

dvipsnames allow you use extended color names such as Cyan, Aquamarine, etc

The tikz and pgf packages are need for creating graphics so that doesn't need to be a standard setup

wasysym, starfont, marvosym produce symbols for planets so this isn't a package that needs to be loaded unless you are working in orbital mechanics or aero engineering.

enumerate is useful for numbering since the program will keep track for you when you use \item

dustin
  • 18,617
  • 23
  • 99
  • 204
  • 6
    You should be ready for questions like: Why do you load mathtools and amsmath? mathtools loads amsmath by default. Why load xcolor and color? xcolor loads color by default... Also, is this your preamble for everything you use? What about enumitem over enumerate? Why do you load hyperref so early? ... – Werner May 30 '13 at 19:21
  • @Werner not for everything. I load enumerate over enumitem do to a question that David Carlisle helped resolved with numberings. I didn't know xcolor loaded color so I can make that correction now. I haven't noticed any issues with that placement of hyperref but I am not opposed to moving it. – dustin May 30 '13 at 19:30
  • 3
    @dustin: For hyperref-related loading dependencies, see Which packages should be loaded after hyperref instead of before? – Werner May 30 '13 at 19:35
  • I have edited the name.txt but what happens next? – Mikael Jensen May 30 '13 at 19:35
  • 6
    The reason for asking these questions is based on the original post. A newbie without knowledge of (La)TeX sees your answer and assumes it's the correct way of starting every document, and therefore loads things as is. However, it's perhaps not optimal, nor would it suit the needs of everyone. Sure you mention it as "an example", but you should at least explain this in more detail so the OP can understand. For example, what's 11pt,dvipsnames doing in your example when it's not included in your "basic structure"? – Werner May 30 '13 at 19:37
  • I assume I should activate some program to get started, the name.txt doesn't do anything by itself. – Mikael Jensen May 30 '13 at 19:45
  • @user31517 You have to run pdflatex; typically there is an editor button or shortcut for this. This will create a PDF document from your .tex file. – marczellm May 30 '13 at 19:54
  • I couldn't paste directly to a file edited by the dos editor so I tried a word file which I later saved in .txt form. I found the pdflatex which opens a black window, but i don't know what to do with that. I assume that sowhere there is a more advanced and hopefully userfriendly editor. – Mikael Jensen May 30 '13 at 20:00
  • @user31517 the file needs to be saved as .tex does your dos editor not support this? If it does, can you do latex to pdf with a dos editor? If the answer are no, you will need to get an editor that supports this file type and compilation. – dustin May 30 '13 at 20:04
  • I think that is what I need, where could I get it? – Mikael Jensen May 30 '13 at 20:05
  • 1
    @user31517 look here to find one that you may like. – dustin May 30 '13 at 20:08
  • @Werner I tested one of my files and if I only load mathtools without amsmath, it wont compile so I need both. How can that be if mathtools is supposed to improve on amsmath? – dustin May 30 '13 at 20:13
  • @user31517 don't just try the first one. There is a whole list. Read about them before you pick one. – dustin May 30 '13 at 20:14
  • 1
    @dustin For a first time user,the preamble above is more overwhelming and Note: Although \usepackage{bunch of list} works, it will be difficult when you have to debug during errors and package conflicts hack down or hackup for a MWE creation. It is not recommended practice in my view. – texenthusiast May 30 '13 at 20:24
  • @texenthusiast you are more than welcome to edit the preamble and make it simpler for a first time user. I really don't know what the user will need as for packages. – dustin May 30 '13 at 20:27
  • 1
    @dustin: The line \RequirePackage{amsmath}[2000/07/18] inside mathtools.dtx leads me to believe that you're doing something else as well. – Werner May 30 '13 at 20:38
  • 1
    @dustin Is it possible to cleanup the comments and absorb the knowledge via comments inside answer to keep Q & A nice and standalone. I prefer not to edit any answer too much except a few tweaks unless it's community wiki. I have left a comment to OP in any case. – texenthusiast May 30 '13 at 21:03