PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
266 stars 208 forks source link

pgf-tikz shading, standalone, xelatex #157

Closed rbeezer closed 3 years ago

rbeezer commented 9 years ago

Tom Judson and I went round-and-round on this one a while back. I'm collecting few facts from https://groups.google.com/forum/#!topic/mathbook-xml-support/Bqd87biU83Y:

  1. Alex Jordan proposes employing using the mbx script to use pdflatex to make the images and then incorporate them as file-includes for PDF output.
  2. http://tex.stackexchange.com/questions/151524/tikz-3-0-0-release-produces-strange-shadings-if-used-with-xelatex-and-standalo
  3. Test case from A. Pereira:
\documentclass{standalone}
%\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{adjustbox}
\usepackage{tikz}
\usetikzlibrary{
automata
,arrows
%   ,decorations.pathreplacing
,shapes
%   ,shapes.multipart
%   ,arrows
,matrix
%   ,calc
%   ,chains
,positioning
%   ,fit
,decorations.pathmorphing
%   ,intersections
} 
\providecommand\scaleFactor{1.2}
\begin{document}
\begin{adjustbox}{scale=\scaleFactor}
\begin{tikzpicture}
\node[matrix of math nodes, nodes={draw, top color=white, bottom color=blue!30, minimum width=25pt, minimum height=30pt}] (l)
{ |[draw, top color=white, bottom color=blue!30, minimum width=25pt, minimum height=30pt]| Z \\
 |[draw, top color=white, bottom color=blue!30, minimum width=25pt, minimum height=60pt]| \vdots \\
};
\node[node distance=2cm,matrix of math nodes,base right=of l] (r)
{|[draw, top color=white, bottom color=blue!30, minimum width=25pt, minimum height=40pt]| \gamma_i \\
|[draw, top color=white, bottom color=blue!30, minimum width=25pt, minimum height=60pt]|\vdots\\
};

\path[->,shorten >=5pt, shorten <=5pt,ultra thick] 
(l-2-1.north east) edge node[above] {$\gamma_i \in \Gamma^+$}(r-2-1.north west)
;
\end{tikzpicture}
\end{adjustbox}
\end{document}
Alex-Jordan commented 3 years ago

It seems that the underlying XeLaTeX/tikz bug has been fixed by the current release of LaTeX. This sample build fine for me with xelatex and pdflatex. And so does the example in the tex.se link. The issue could be closed.