Add LaTeX batch mode flags.

Add the following flags.
    -interaction nonstopmode
        This ensures LaTeX quits if a dependency (.sty) is missing.
    -halt-on-error
        This makes LaTeX quit on the first error instead of wasting
        time continuing to render a broken document. Note that this
        alone will stop the compiler on a syntax error but not on a
        missing .sty file.

To see what this commit does, go find studentschedule.tex, replace
"fullpage" with a nonexistent package name, and try to run
    python2 manage.py test modules
(really just the testSchedules programprintables test).
Before this commit, it should stop and wait for user input.
After this commit, it should just error out and move on.

On that note, maybe we should consider replacing os.system with
something like subprocess.check_call--to let us know immediately when
latex fails, rather than later on when we can't find the dvi file it
was supposed to produce.

Fixes #263.
Restore dvips landscape options for ps and svg.

This restores changes from 956521f3699de0bb5978bf36579523d513eef337
clobbered in the merge 7dcf5546fae6bae2bcb77bfa5cc96434eda0ffef
(mit-working into main).

The commit being restored was made in the main branch; its state prior
to the merge can be seen in 510b8d2fecba54e38259e4be6596f54d72823c62.
Partial restoration was previously done in
ea23ef2a46a8e26ca35d6488fd2c91c66a3e3b5a and
a32cb0cded41ecaecaf638370990ebb0bff3368b.

It is my guess that the clobbering was unintentional. So this commit
restores the flags passed to dvips to suppor rendering .ps and .svg
files in landscape mode. (It seems the ps and svg formats were
approximately never requested in landscape mode anyway.)
LaTeX: change os.system to subprocess.check_call.

subprocess.check_call throws an exception upon seeing a nonzero (i.e.
abnormal) exit value. For the price of a little verbosity, we get to
see when one of the commands fails *before* we attempt to run the next
command on its nonexistent output.

Occurrences of os.system in esp/esp/gen_media/inlinelatex.py are left
untouched since with those, we already check the exit value explicitly
and supply a custom message in case of error.
Make texescape safe to run on '\n'.

If x = '\n', then {{ x|texescape }} in its own paragraph causes
some problems because you get an isolated \\. LaTeX complains
at you that "There's no line here to end."

So cheat by putting a ~ (non-stretching, non-line-breaking space)
before every generated newline.

Side effect: generated newlines are no longer idempotent. I refrain
from making any claims about the correctness or desirability of this
side effect.
Fix completion certificates.

* Turn off HTML autoescaping. This is a LaTeX document!
* Replace \\ with ~\\ in case of empty class descriptions or such.
* Refer to parent_class for class descriptions and such.
Completion certs: Allow >1 page of descriptions.

Old method: Set zero margins in order to fit letterhead on the page.
Then enclose class descriptions in a minibox to give them margins.

Side effect: If class descriptions go over a page, LaTeX fails to
break the minibox across multiple pages, cutting off all but the first
four or so classes.

New method: Use a different hack to fit the letterhead on the page,
and set sane margins. (The 0.2-inch difference is what our 0.5cm top
margin used to be.)

[Other notes]
* The template program/modules/programprintables/refund_receipt.tex
  may be affected, but it seems not adversely; and we haven't used it
  since MIT was using OMARS for payments.
* I don't understand why \noindent wasn't necessary before. I hope it's
  not relevant.
Merge pull request #673 from pteromys/latex-fixes

Latex fixes