[Tex/LaTex] High level macros and environments based on Tikz

beamergraphicspresentationstikz-pgf

I was browsing the tikz examples that I found this wonderful example. The example uses tikz to create a tex environment to produce a framed text. The result looks like this:

TikZ framed text example

The underlying process may look too complicated for someone unfamiliar with tikz, but it is quite simple to use the environment:

\begin{parchment}[Paragraph Title]
    The main text goes here ...
\end{parchment}

Then, it came to my mind that it would be great to have some high level tex macros or environments to produce such fancy figures or plots. Something like SmartArt graphics in microsoft office. For instance, use something like this:

\begin{env-name}[Discipline]
    \usecolorpallet{pallet-name}
    \item Love
    \item Trust
    \item Self-control
    \item Journey
    \item Obedience
\end{env-name}

to produce figures like this or this. I think, these kind of high level environments, in addition to hiding the details of tikz, provides some novel ideas for making much more elegant slides and documents with tex.

So my question is: Is there any tex package that has such a functionality? If not, do you know any idea/example like the ones that I described, with available source code?

Best Answer

Not exactly what you want ( high level environments) but I propose a macro. I made this macro very quicly, so it's possible to make something better. We can add styles etc.

\documentclass[11pt]{scrartcl}
\usepackage[utf8]{inputenc}  
\usepackage{tikz}

\makeatletter 
\@namedef{color@1}{red!40}
\@namedef{color@2}{green!40}   
\@namedef{color@3}{blue!40} 
\@namedef{color@4}{cyan!40}  
\@namedef{color@5}{magenta!40} 
\@namedef{color@6}{yellow!40}    

\newcommand{\graphitemize}[2]{%
\begin{tikzpicture}[every node/.style={align=center}]  
  \node[minimum size=5cm,circle,fill=gray!40,font=\Large,outer sep=1cm,inner sep=.5cm](ce){#1};  
\foreach \gritem [count=\xi] in {#2}
{\global\let\maxgritem\xi}  
\foreach \gritem [count=\xi] in {#2}
{% 
\pgfmathtruncatemacro{\angle}{360/\maxgritem*\xi}
\edef\col{\@nameuse{color@\xi}}
\node[circle,
     ultra thick,
     draw=white,
     fill opacity=.5,
     fill=\col,        
     minimum size=3cm] at (ce.\angle) {\gritem };}%
\end{tikzpicture}  
}%

\begin{document}

\graphitemize{Discipline}{Love,Trust,Self-\\control,Journey,Obedience}

\graphitemize{Mathématiques}{Algèbre,Géométrie,Analyse}
\end{document} 

enter image description here

Update

I added a new style, now it's possible to create some keys to chooose the style

\documentclass[11pt]{scrartcl}
\usepackage[utf8]{inputenc}  
\usepackage{tikz}
\usetikzlibrary{calc} 
\makeatletter 
\@namedef{color@1}{red!40}
\@namedef{color@2}{green!40}   
\@namedef{color@3}{blue!40} 
\@namedef{color@4}{cyan!40}  
\@namedef{color@5}{magenta!40} 
\@namedef{color@6}{yellow!40}    

\newcommand{\graphitemize}[2]{%
\begin{tikzpicture}[every node/.style={align=center}]  
  \node[minimum size=4cm,circle,fill=gray!40,font=\Large,outer sep =.25cm,inner sep=.5cm](ce){#1};  
\foreach \gritem [count=\xi] in {#2}  {\global\let\maxgritem\xi}  

\foreach \gritem [count=\xi] in {#2}
{% 
\pgfmathtruncatemacro{\angle}{360/\maxgritem*\xi}
\edef\col{\@nameuse{color@\xi}}
\node[circle,
     ultra thick,
     draw=white,
     fill opacity=.5,
     fill=\col,outer sep=0.25cm,        
     minimum size=2cm] (satellite-\xi) at (\angle:5cm) {\gritem };
     \draw[line width=0.5cm,->,\col] (ce) -- (satellite-\xi);
     }%
\end{tikzpicture}  
}%

\begin{document}

\graphitemize{Discipline}{Love,Trust,Self-\\control,Journey,Obedience}

\graphitemize{Mathématiques}{Algèbre,Géométrie,Analyse}
\end{document} 

enter image description here