4

The following output has no correct paragraph indentation after incorporating standalone documentclass or preview package.

enter image description here

\documentclass[border=12pt,preview]{standalone}
\parindent=12pt% does not work!

\begin{document}
The position of a particle moving along the $x$-axis is given as
\[
s_t=s_0+v_0t+\frac 1 2 at^2
\]
where $s_0$, $v_0$, $a$, and $t$ represent the initial position, initial speed, acceleration, and the time, respectively.
Even though you are not interested in physics, please be quiet.

And now \ldots
\end{document}

How to solve this issue?

1 Answer 1

8

The preview environment uses \@arrayparboxrestore that kills the parindent, just like it happens in minipage and in \parbox.

You can restore the normal parindent by patching \preview:

\documentclass[border=12pt,preview]{standalone}

\usepackage{etoolbox}
\edef\keptparindent{\the\parindent}
\patchcmd{\preview}
  {\ignorespaces} %%% \preview ends with \ignorespaces
  {\parindent\keptparindent\ignorespaces}
  {}{}

\begin{document}
\begin{preview}
The position of a particle moving along the $x$-axis is given as
\[
s_t=s_0+v_0t+\frac 1 2 at^2
\]
where $s_0$, $v_0$, $a$, and $t$ represent the initial position, 
initial speed, acceleration, and the time, respectively.
Even though you are not interested in physics, please be quiet.

And now \ldots
\end{preview}
\end{document}

enter image description here

5
  • It should be regarded as a bug that have to be fixed for the next build. :-) Feb 14, 2013 at 14:12
  • @GarbageCollector I don't think so. However preview and standalone should at least document it.
    – egreg
    Feb 14, 2013 at 14:17
  • Why did the author design minipage and parbox without preserving \parindent? Feb 14, 2013 at 14:23
  • 1
    @GarbageCollector Ask Leslie Lamport. ;-) The idea is, I believe, to start in a well determined status.
    – egreg
    Feb 14, 2013 at 14:25
  • Then it should be a bug. :-) Feb 14, 2013 at 14:27

You must log in to answer this question.

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