I'm using some almost trivially simple LaTeX code, running it through xelatex:
\documentclass[border=2pt]{standalone}
\begin{document}
\[
B'(1)_n = B'(0)_{n+1}
\]
\end{document}
However, this generates the odd error:
! Missing $ inserted.
<inserted text>
$
l.4 B'(1)_
n = B'(0)_{n+1}
?
There are no opening $ in my source that need closing, and the log seems to break the code at what should be perfectly normal subscript notation.
If I try to force math mode by using \ensuremath or I replace the \[ and \] with explicit \begin{equasion} and \end{equasion} I still get this error, so I'm pretty sure I'm missing something super obvious but a decent amount of googling doesn't yield any information I can use to make this error disappear.


standalonedocument type purely because examples on the web for "fitting the document to the content" say to use that package, without any mention of a preview option, and no mention anywhere in those tutorials and guides thatstandalonebreaks math mode. – Mike 'Pomax' Kamermans Feb 26 '17 at 21:34previewoption, you shouldn't use a display-math environment such as\[ ... \]. Instead, write$\displaystyle B'(1)_n = B'(0)_{n+1}$between\begin{document}and\end{document}. – Mico Feb 26 '17 at 21:36standalonedon't mention it, it would be quite helpful to me -and presumably others who find this question in the future- if the answer contained a bit more details in terms of why this works, rather than just "that" it works. – Mike 'Pomax' Kamermans Feb 26 '17 at 21:38previewpackage. It makes no sense to crop a displayed math expression. This is the reason whystandalonedoesn't support display math environments wit the defaultcropoption. – Feb 26 '17 at 21:49