Essential LaTeX packages
howtotex.com
howtotex.com
It only has one tiny aim - to deal with spaces after commands.
Given: \newcommand{\S}{Bob} then \S is \S. expands to:
Bobis Bob.
While: Given: \newcommand{\S}{Bob } expands to Bob is Bob .
One can write: \newcommand{\prog}{\textsc{prog}\xspace}. Then we get: Bob is Bob.Input with "\newcommand{\gb}{Great Britain\xspace}":
\gb is a very nice place to live.\\
\gb, a small island off the coast of France.\\
\gb\footnote{The small island off the coast of France.}
is a very nice place to live.
Results in the output Great Britain is a very nice place to live.
Great Britain, a small island o the coast of France.
Great Britain[^1] is a very nice place to live.So now I have my template repository (https://github.com/x3ro/x3-latex) which has a very basic init script, which I call like this:
x3-init x3-paper some/folder/
And it creates a complete skeleton for the document, including a tiny build script that transforms the main text body written in markdown to LaTeX (because who really wants to write LaTeX lists and stuff, right?).
My point is that I find such a list of "essential LaTeX packages" quite pointless, especially if it's only ten or so of them. It's like writing a post on the "10 best parts of a motorcycle" or something. There are thousands of awesome packages out there, and creating a repertoire and putting everything together takes time. I'd welcome it if somebody came up with a really nice template repository style thing for LaTeX, though.
PS: My favorite LaTeX package is definitely minted (http://stackoverflow.com/a/1985330/124257) for syntax highlighting.
> There are thousands of awesome packages out there
Statements like this are terrible for latex adoption and with all due respect an exaggeration bordering on bullshit. "OMG, I need to learn about thousands of packages to write my paper? Screw that I am using LibreOffice or Word."I doubt you can come up with a list of 2,000 awesome packages. It looks like CTAN has 1500 packages and a lot of those are obsolete, redundant and/or just plain "not awesome." More importantly I would be willing to bet that the overwhelming majority of users can get by with less than 50 packages. A quick grep of you x3-paper repo and it seems that all of your use cases combined also fall under the 50 packages mark. A new user can get started and produce quality documents with far less than 50 packages.
I might have gone overboard with "thousands of _awesome_ packages", but the CTAN I'm looking at lists 4706 packages from around 2000 authors. I'm not sure how you determined that most of these are redundant and/or obsolete. At least MacTex seems to ship with quite a lot of them (2.3G with 600M optionals).
> I would be willing to bet that the overwhelming majority of users can get by with less than 50 packages.
When did I claim that this is not the case? Less then 50 packages yes, but not the same packages for all users.. Many packages for many different use-cases.
> Statements like this are terrible for latex adoption
Yeah sure, because the people here at HN will think "Oh no if there are thousands of packages I will need to learn _all of them_ before writing my first document.
I'd say that what's terrible for LaTeX adoption is that it's terrible annoying to write...
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
Then alongside microtype the package upquote is useful too
(for correct quotes inside verbatim): \usepackage{upquote}
If you want to include source code then listings is nice: \usepackage{listings}
Also when creating PDF I always check with pdffonts that all the fonts really are Type1. It can happen that you don't have a package installed (such as cm-super), and if you use the default fonts you may end up with a bitmap font embedded.I've always wished it were easier to define new environments with arbitrary syntax that gets passed to external programs for conversion to LaTeX code while LaTeX is running. A package called dot2texi has that ability for dot code snippets (i.e., AT&T graph visualization tools, dot etc.), and the dot2texi source code shows how to do it in general.
I agree with the comments that Tikz is an amazing package, and I didn't realize until recently that it includes many state of the art graph layout algorithms that are as good or better than dot, with highly customizable features such as allowing the user to specify absolute positions of some of the nodes and letting the algorithm place the rest. It seems the whole section of the Tikz manual pertaining to automated graph drawing is omitted if it's built on a system that doesn't have LuaTeX installed, which is how I must have missed it.
There's issues - for instance figure updates don't cause a recompile.
I love that TikZ lets you embed graphics right in your document without external dependencies on PDF figures, but I've never been able to build anything non-trivial without quite a lot of effort.
If the OmniGraffle people are listening, I've been buying your product every release since I think about 2003 or 2004. I would love to see clean, approximate TiKZ export (where possible with simple geometries) with janky, verbose PGF as a fallback option when an exact complicated reproduction is required.
TikZ is not different that LaTeX in general. It has a hard learning curve, but you gain long term on reuse, structure, versioning.
Also slides in Beamer are a mess at the beginning, but maintaining/sharing/co-working... I personally think it's way easier than with ppt.
$ nano mydoc.md ; pandoc -t latex -S -o mydoc.tex mydoc.md
Pandoc drastically reduces the initial learning curve for latex and beamer.That being said tikz was one of the packages I thought was noticeably absent from the nine listed packages. The other package that I would add was fontspec, in fact I was shocked to see microtype and not see fontspec mentioned next.
I usually try to not worry about fine-tuning at all until the document is done, otherwise the whole point of latex is lost to me.
EDIT: Forgot link to Crémer's guide: http://cremeronline.com/LaTeX/minimaltikz.pdf
LaTeX' page-breaking algorithm gets it right most of the time but sometimes a bit of help makes it even better, i.e. a
\needspace{4\baselineskip}
\subsection{Something}
Lorem ipsum ...
tells TeX to insert a pagebreak here if there's fewer than 4 lines of text left on the page, otherwise just carry on. Unlike \pagebreak[n], this is not optional.\usepackage{refcheck} belongs in everyone's toolbox as well.
It seems that there isn't an online editor that currently supports versioning through git/hg, which is too bad
XeLaTeX allows you to use TTF fonts in your LaTeX document and minted allows you to syntax highlight code. For books/articles, especially by those in the software industry, it'll certainly come in handy!
I wrote about Syntax highlighting in LaTeX
https://sites.google.com/site/jestinjoy/academic/latex/highl...