Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.