TEXstudio 是唯一一款 MAC 软件(尽管最初不是为 MAC 设计的),它有一个 PDF 查看器,可以完美呈现用 tikz 绘制的虚线和阴影线。TEXstudio 有什么功能是其他所有软件(TEXshop、TEXnicle、Preview、Acrobat Reader)都无法做到的?TEXstudio 是否自带完美的 PDF 编码?tikz 是否发送了模棱两可的 PDF 指令?
\documentclass[]{article}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usepackage[most]{tcolorbox}
% code taken from Arberto Sartori: http://www.albertosartori.it/latexother.php
\makeatletter
\pgfdeclarepatternformonly[\LineSpace,\LineWidth]{my north east lines}
{\pgfqpoint{-\LineWidth}{-\LineWidth}}{\pgfqpoint{\LineSpace}{\LineSpace}}
{\pgfqpoint{\LineSpace}{\LineSpace}}%
{
\pgfsetcolor{\tikz@pattern@color}
\pgfsetlinewidth{\LineWidth}
\pgfpathmoveto{\pgfqpoint{-\LineWidth}{-\LineWidth}}
\pgfpathlineto{\pgfqpoint{\LineSpace + 0.1pt}{\LineSpace + 0.1pt}}
\pgfusepath{stroke}
}
\makeatother
\newdimen\LineSpace
\newdimen\PointSize
\newdimen\LineWidth
\tikzset{
line space/.code={\LineSpace=#1},
line space=3pt
}
\tikzset{
point size/.code={\PointSize=#1},
point size=.5pt
}
\tikzset{
pattern line width/.code={\LineWidth=#1},
pattern line width=.4pt
}
\tcbset{dash/.style={%
enhanced,%
frame style={pattern=my north east lines,pattern color=blue!80!white,
line space=9pt,pattern line width=3pt,dashed},%
leftrule=5mm,rightrule=5mm,toprule=5mm,bottomrule=0.3mm}} %
\tcbset{hatch/.style={%
enhanced,%
frame style={pattern=my north east lines,pattern color=red!80!white,
line space=9pt,pattern line width=3pt},%
leftrule=5mm,rightrule=5mm,toprule=5mm,bottomrule=0.3mm}} %
\begin{document}
\begin{tcolorbox}[dash]
North east DASHED lines
\end{tcolorbox}
\begin{tcolorbox}[hatch]
North east HATCHED lines
\end{tcolorbox}
\end{document}
在 TEXStudio 中查看完美的 PDF 结果(不缩放):
TEXshop / 故障冲刺 + 孵化: 3
TEXshop / 放大 / 破折号失败,但孵化正常:
TEXnicle/故障破折号+舱口:
TEXnicle / 放大 / 故障破折号 + 舱口:
预览 (OS 10.10) / 与 TEXnicle 相同的结果 / 失败破折号 + 阴影:
预览 (OS 10.10) / 放大 / 与 TEXnicle 相同的结果 / 失败破折号 + 阴影线:
Acrobat Reader 11.0.09/ 破折号失败,但舱口正常
Acrobat Reader 11.0.09 / 放大 / 破折号失败,但舱口正常