standalone
合并文档类或preview
包后,以下输出没有正确的段落缩进。
\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}
如何解决这个问题?
答案1
环境preview
使用\@arrayparboxrestore
杀死父母,就像在minipage
和中发生的那样\parbox
。
您可以通过修补来恢复正常的 parindent \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}