TEXstudio is the only MAC software (although not originally designed for MAC) that has a PDF viewer that renders perfectly well dashed and hatched lines drawn with tikz. What does TEXstudio do that all the other softwares (TEXshop, TEXnicle, Preview, Acrobat Reader) don't do ? Does TEXstudio bring with it the perfect PDF encoding ? Is tikz sending ambiguous PDF instructions ?
\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}
Perfect PDF result viewed (zoom-independent) in TEXStudio:
TEXshop / failure dash + hatch: 3
TEXshop / zoom on / failure dash, but OK hatch:
TEXnicle / failure dash + hatch:
TEXnicle / zoom-on / failure dash + hatch:
Preview (OS 10.10) / same result as TEXnicle / failure dash + hatch:
Preview (OS 10.10) / zoom on / same result as TEXnicle / failure dash + hatch:
Acrobat Reader 11.0.09/ failure dash, but hatch OK
Acrobat Reader 11.0.09 / zoom on / failure dash, but hatch OK
evince
, I mean identical to TEXstudio.hatch
beforedash
all is red. Looks like in TeXStudio with TeXworks viewer. Doesn't work with SumatraPDF and PDFX-change viewer.