重要编辑:此类输出在 Adobe Acrobat 和 TeXworks (0.6.3) 中呈现。
如果仔细查看输出,你会发现右边框缺失或与左边框相比几乎看不见。这可能是什么?(在另一个窗口中打开图片网址以放大查看)
\documentclass{standalone}
\usepackage{tikz}
\usepackage{varwidth}
\pagecolor{black}
\color{white}
\begin{document}
\begin{varwidth}{150pt}
\begin{tikzpicture}
% change line width to 1pt and it will still be slightly narrower on the right side
\path node[draw=red,line width=0.01pt,inner sep=0,outer sep=0]
{\begin{varwidth}{140pt}This is sentence 1. This is sentence 2. This is sentence 3. This is sentence 4. This is sentence 5. This is sentence 6. This is sentence 7. This is sentence 8.\end{varwidth}};
\end{tikzpicture}
% you can disable following line with following varwidth environment but the border will still be cropped due to varwidth environment inside the node
\the\textwidth
\end{varwidth}
\end{document}
编辑:事实证明,当你varwidth
全部删除时,不仅右边框会消失,而且底部边框也会消失(我删除了第二句之后的所有句子,否则节点会太长):
答案1
使用最新的 TeXLive 2019 我无法看到它:
我的文件列表:
*File List*
standalone.cls 2018/03/26 v1.3a Class to compile TeX sub-files standalone
shellesc.sty 2016/06/07 v0.02a unified shell escape interface for LaTeX
ifluatex.sty 2016/05/16 v1.4 Provides the ifluatex switch (HO)
ifpdf.sty 2018/09/07 v3.3 Provides the ifpdf switch
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
xkeyval.sty 2014/12/03 v2.7a package option processing (HA)
xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
standalone.cfg 2018/03/26 v1.3a Default configuration file for 'standalone'
class
article.cls 2018/09/03 v1.4i Standard LaTeX document class
size10.clo 2018/09/03 v1.4i Standard LaTeX file (size option)
tikz.sty 2019/02/02 v3.1.1 (3.1.1)
pgf.sty 2019/02/02 v3.1.1 (3.1.1)
pgfrcs.sty 2019/02/02 v3.1.1 (3.1.1)
everyshi.sty 2001/05/15 v3.00 EveryShipout Package (MS)
pgfrcs.code.tex
pgfcore.sty 2019/02/02 v3.1.1 (3.1.1)
graphicx.sty 2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR)
trig.sty 2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg 2016/06/04 v1.11 sample graphics configuration
xetex.def 2017/06/24 v5.0h Graphics/color driver for xetex
pgfsys.sty 2019/02/02 v3.1.1 (3.1.1)
pgfsys.code.tex
pgfsyssoftpath.code.tex 2019/02/02 v3.1.1 (3.1.1)
pgfsysprotocol.code.tex 2019/02/02 v3.1.1 (3.1.1)
xcolor.sty 2016/05/11 v2.12 LaTeX color extensions (UK)
color.cfg 2016/01/02 v1.6 sample color configuration
pgfcore.code.tex
pgfcomp-version-0-65.sty 2019/02/02 v3.1.1 (3.1.1)
pgfcomp-version-1-18.sty 2019/02/02 v3.1.1 (3.1.1)
pgffor.sty 2019/02/02 v3.1.1 (3.1.1)
pgfkeys.sty
pgfkeys.code.tex
pgfmath.sty
pgfmath.code.tex
pgffor.code.tex
tikz.code.tex
varwidth.sty 2009/03/30 ver 0.92; Variable-width minipages
***********