Would it be off-topic to have a question where people can showcase good preambles for some specific purpose (like assignments, books, lecture notes, letters, articles etc.)? I am thinking about a topic like Showcase of beautiful typography done in TeX & friends, but where you can show off concrete preambles that are useful for this and that particular purpose (obviously, we would need different questions for each purpose). I am not thinking about a topic like Best practice on organising your preamble, which is more concerned with the theory of overall preamble design. Also, What packages do people load by default in LaTeX? is not what I am thinking of either, since it is for showcasing individual packages, not full preambles. There is currently (as far as I can see) no topic here that matches my suggestion, which might be because it would be considered opinion-based.
I expect a lot of comments arguing that it is impossible to create one preamble that solves all problems, that it is better if people sit down and learn TeX themselves and find out which packages they need. The reality is that many people never learn to write proper TeX at all, precisely because they are left alone in the vast jungle of classes and packages, many of which are obsolete, poorly written, unnecessary, do not work together, or break core functionality. Furthermore, there is an equally outdated collection of manuals on the Internet that promote bad coding practice and wrong solutions. As a result, a lot of people get started on TeX by taking over preambles from others, which are filled with precisely the mentioned kind of packages. For instance, I have found LaTeX preambles on the Internet that still use \documentstyle
.
In my opinion, a lot of people would benefit from a topic on this page that showed up-to-date, well-written and well-documented preambles, created and maintained by some of the TeX oracles in here. They cannot and should not contain solutions to all problems, but should include the standard packages that many people will need in this particular situation. The usual Stack Exchange voting system would naturally regulate such a topic, the best preambles coming out on top.
fontenc
,inputenc
and switch to fontspec alsomicrotype
causes problems in certain cases.babel
works butpolyglossia
sometimes a better choice. What aboutmathtools
instead ofamsmath
. Even the location where you placehyperref
is an art. Hence, it is not that straightforward to say this is an ideal preamble and works under every condition. It will work only specific to that particular preamble.mathtools
loadsamsmath
already so you don't need to load it. See what I mean?amsmath
, norsiunitx
, nor any other package. Nor any other package.amsmath
andmathtools
.mathtools
loadsamsmath
, and if you want to add an option toamsmath
(such asfleqn
), and you happen to loadamsmath
aftermathtools
, you won't get the result you expect. if you're a newbie, that can be extremely confusing. what is needed instead, is a good tutorial on how to load packages -- what they do, which are interrelated, and what is the benefit of a over b. oh, what is really needed are users who read documentation and don't expect to find ready-made preambles.cleveref
with all its bells and whistles and still writesee equation (4) in Theorem 3
out by hand. So a skilfully crafted preamble (percusse is absolutely right, writing one is an art) is not the solution to the problem.pgfplots
if you don't need to plot anything, and if you don't write maths you probably don't needmathtools
. Another problem is that sometimes (often) there are more packages for one job, and an in-depth discussion about the (dis)advantages is needed to decide which one to use.\ifluatex
, if that is what you suggested above (I'm not entirely sure). A user should understand the preamble and every line should actually do something. You run the risk of amassing a huge preamble with all sort of logic and branching that it hard to suss out. Finally, I would like to repeat the point of my first comment: Just because you load a package that doesn't mean you know how to use it. An example preamble would need to also come with a showcase document that shows how you use all the fancy stuff you have requested.hyperref
shows in the pdf are not printed. ;-)