I have a rather lengthy post on Math SE at the following link.


Now I'd like to be able to compile the code I've written for this post into a PDF math document for my pupils, most of whom don't have access to the Internet and so are in need of this material in a PDF file to be shared with them through a USB data traveler.

I'm running WinEdit + MikeTex on a Windows 8.1 (64 bit) platform.

However, when I copy the code from the above post into a WinEdit file based on the AMS Article template and try to compile, there are plenty of errors, which necessitate a lot of modification.

Is there a way out with my current software?

Here is what the preamble of my template reads.

% ----------------------------------------------------------------
% Article Class (This is a LaTeX2e document)  ********************
% ----------------------------------------------------------------
% THEOREMS -------------------------------------------------------
% ----------------------------------------------------------------

1 Answer 1


MathJax promotes bad LaTeX practice. This is a fact, not an opinion.

MathJax side

  1. You should never use \matrix{...}, but \begin{matrix}...\end{matrix}. Better, instead of



  2. Never use $$\begin{align}...\end{align}$$; MathJax accepts it without $$ fore and aft.

  3. Never use \\ inside a $$...$$ construction, but \begin{gather}...\end{gather}

  4. \tag belongs in align.

Conversion to LaTeX

When you want to convert the code to a LaTeX document,

  1. change $$...$$ into \begin{equation*}...\end{equation*}

  2. change {align} into {align*}

  3. change {gather} into {gather*}

  4. convert Markdown markup into LaTeX; for instance _words_ into \emph{words}

LaTeX style

You abuse \left and \right; for instance,

\left[x \right]_E

should simply by [x]_E. Also B' is much simpler than B^\prime. So

$E^\prime = \left( e_1^\prime, \ldots, e_n^\prime \right)$

is much better input as

$E' = ( e_1', \dots, e_n' )$

Note \dots and not \ldots.

  • 1
    Great advice but I think OP will not appreciate it. Most users want it to Just Work ™. Jun 15, 2017 at 23:05
  • 1
    @HenriMenke My MathJax essentially does that. ;-)
    – egreg
    Jun 15, 2017 at 23:08
  • @egreg thanks. But from your answer, I gather that there is no solution other than editing my Mathjax source to make a lot of modifications. Jun 15, 2017 at 23:43
  • @egreg isn't there any software for compiling Mathjax directly into a PDF document? Jun 15, 2017 at 23:44
  • @SaaqibMahmuud Use Google Chrome and press Ctrl+P to display Print Preview. Select Save as PDF. MathJax is a web technology so you need to use web browser unless you are prepared to do the full conversion manually. Dec 14, 2017 at 19:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .