Postby Stefan Kottwitz » Thu Jan 31, 2013 10:17 am
vejn wrote:main.tex needs other thesis.cls, .sty, Bibliography.bib ... files.
Is this "dress code" when creating books/articles ?
Why there is not one single .tex ?
LaTeX is a modular system. This has many advantages, for example you can seperate functionality, it can be better maintained, code can be reused. LaTeX, classes and packages are developed and maintained by hundreds or even more than a thousand authors. Authors usually maintain one or several packages, so it's good to have them seperate.
As an author, you can chose between dozens of classes and many hundreds of package. Just specify which to use by a command.
Would you really like to have a single .tex file, where a class, packages, bibliography etc. are integrated? What if you decide to change the class or packages?
In case you are not convinced yet, the best way to learn what is better: try working with one big file. Copy class and package codes into the file, and work with this document. It would be great if you would tell us your personal opinion then.
For the class file itself: I actually made my own class file (adapted from the class file) to format my homework the way I wanted. It is here, if you're interested in trying it or fiddling with it:
You supply it with and in the preamble, and it automatically uses today's date.
This file is used by inserting at the beginning of a document.
The standard formatting for a problem looks like this:
It creates a new page for every problem. Also, if a problem has multiple "parts" the formatting might look like this
The will use letters (a), (b), etc. And will use (a), then (b), etc.
An example page (from a real homework assignment) looks like this
If you want to try it out, download it, put it in your folder and run (if you're on a UNIX based system).
There are definitely things in this class file that are automated that people would want more control over, so I suggest fiddling around to find what works best for you.
For syntax highlighting: Werner's answer mentioning the package for syntax highlighting and code is great. (That style file could be used with this class file.)