What are the new features in TikZ/pgf 3.0?
Some of the new features have already been shown on the site.
I report some examples (in alphabetical order):
angles
- Label angle with tikz
- Improvement of PSTricks code for drawing of balls in a triangular box
- How do I draw a little red square to label my right triangle?
arrows.meta
- Partial triangular arrows with TikZ/PGF
- Custom Tikz arrowhead with bar before triangle 45
- Tikz drawing different type of arrows
- TikZ: configuring arrow tip appearance not working according to documentation
- How to draw shape as 'curved arrows' with text (with tikz)
babel
- Problem with babel and tikz using \draw
- tikz declare function and babel french option
- Tikz shortandoff-on newcommand problem
datavisualization
- Making bold tick labels in tikz
- TikZ datavisualization example fails
- pgfplots: mark max/min value of a function
graphdrawing
- How can I make the diamond-e framework in TikZ?
- Overlap in graphing TikZ picture
- TikZ graph with interesting vertices
- Chapter Dependency Diagram in Latex
- drawing tree using tikz, child overlap
pics
- How can I draw a TikZ element multiple times against a shaded background?
- How can I rotate and mirror a tikz picture in latex
quotes
- Label angle with tikz
- Use \usetikzlibrary{quotes} with \MakeOuterQuote{"} from csquots
- How do I draw a little red square to label my right triangle?
With TikZ 3.0, you can use blend modes.
A blend mode specifies how colors mix when you paint on a canvas. Normally, if you paint a red box on a green circle, the red color will completely replace the green circle. However, in some situations you might also wish the red color to somehow "mix" or "blend" with the green circle. We already saw that, using transparency, we can draw something without completely obscuring the background. Blending is a similar operation, only here we mix colors in more complicated ways.
Note: Blending is a rather "advanced" feature of PDF. Most renderers, let alone printers, will have trouble rendering blending correctly.
Below is an example of screen
blend mode (there are 16 modes: normal
, multiply
, screen
, overlay
, darken
, lighten
, color dodge
, color burn
, hard light
, soft light
, difference
, exclusion
, hue
, saturation
, color
, luminosity
).
\documentclass[tikz]{standalone}
\begin{document}
\tikz [blend group=screen] {
\fill[red!90!black] ( 90:.6) circle (1);
\fill[green!80!black] (210:.6) circle (1);
\fill[blue!90!black] (330:.6) circle (1);
}
\end{document}
With TikZ 3.0 arrives math
library.
This library defines a simple mathematical language to define simple functions and perform sequences of basic mathematical operations.
Here is a code from the manual (p.629), slightly modified to include function use.
\documentclass[varwidth,border=50]{standalone}
\usepackage{tikz}
\usetikzlibrary{math}
\tikzmath{
function step(\n){ return 45/\n; };
function first(\n){ return step(\n)/2; };
function next(\n){ return first(\n)+2*step(\n); };
function testcircle(\a){
real \s; \s = step(\a);
for \k in {first(\a),next(\a),...,360}{
% set the color
if \k>270 then { let \c = orange; } else {
if \k>180 then { let \c = blue; } else {
if \k>90 then { let \c = red; } else {
let \c = green;
};
};
};
{ % "print" the path command
\path[fill=\c!50, draw=\c] (\k:0.5cm) -- (\k:1cm) --
(\k+\s:1cm) -- (\k+\s:0.5cm) -- cycle;
};
}; % end for loop
}; % end test circle
}
\begin{document}
\begin{tikzpicture}
\tikzmath{testcircle(4);}
\begin{scope}[scale=-2.1]
\tikzmath{testcircle(13);}
\end{scope}
\end{tikzpicture}
\end{document}