cfiandra” post=84295Ah beh.. se c’è una soluzione con [tt]\ooalign[/tt] mi sento quasi in dovere di dare una soluzione con TikZ 😉 `
\documentclass{article}
\usepackage{amssymb,tikz}
\usetikzlibrary{calc,fadings}\def\mark{mark}
\def\nomark{no mark}\begin{tikzfadingfrompicture}[name=tikz]
\node [text=transparent!5]{$\checkmark$};
\end{tikzfadingfrompicture}\tikzset{box/.style={
rectangle,
draw,
minimum size=0.225cm,
inner sep=1pt,
},
insert mark/.style={
append after command={%
\pgfextra{%
\begin{pgfinterruptpath}
\shade[path fading=tikz,
fit fading=false,
mark style]
($(\tikzlastnode.south east)-(0,0.0075)$)
rectangle ($(\tikzlastnode.north west)-(0,0.0075)$)
;%
\end{pgfinterruptpath}
}%
}
},
mark style/.style={
left color=black,
right color=black
},
}\newcommand{\marksetstyle}[1]{
\tikzset{mark style/.append style={#1}}
}\newcommand{\tikzcheckmark}[1][mark]{%
\def\check{#1}%
\ifx\check\mark%
\tikz[baseline=-0.5ex]\node[box,insert mark]{};%
\fi%
\ifx\check\nomark%
\tikz[baseline=-0.5ex]\node[box]{};%
\fi%
}\begin{document}
\tikzcheckmark\quad\tikzcheckmark[no mark]\par
\vspace{1ex}
\marksetstyle{top color=orange, bottom color=blue!80!cyan}
\tikzcheckmark\quad\tikzcheckmark[no mark]\par\vspace{1ex}
\marksetstyle{top color=red,bottom color=yellow!60!orange}
\tikzcheckmark\quad\tikzcheckmark[no mark]\vspace{1ex}
\marksetstyle{left color=green,right color=red,middle color=white}
\tikzcheckmark\quad\tikzcheckmark[no mark]\vspace{1ex}
\marksetstyle{top color=magenta!60!red,bottom color=blue}
\tikzcheckmark\quad\tikzcheckmark[no mark]\vspace{1ex}
\marksetstyle{inner color=yellow!60!orange,outer color=magenta!50!blue}
\tikzcheckmark\quad\tikzcheckmark[no mark]
\end{document}
` Il risultato:[attachment=671]Senzanome_2013-04-15.jpg[/attachment]
Ovviamente è del tutto superfulo usare TikZ per uno scopo del genere, a meno che non si vogliano ottenere quei particolari effetti “sfumando” il colore della spunta.
Ciao
Claudio
Una dritta. Invece di [tt]\ifx\check\mark[/tt] puoi dire
`\ifnum\pdfstrcmp{#1}{mark}=0`
Se vuoi un codice che non dipenda da pdftex, basta caricare pdftexcmds e puoi usare
`\ifnum\pdf@strcmp{#1}{mark}=\z@`
(naturalmente occorre [tt]\makeatletter[/tt]). In questo modo funziona con pdftex, xetex e luatex (grazie al solito Heiko Oberdiek).
Ciao
Enrico