14

I'm working on a TikZ illustration to visually represent the squeeze theorem (also known as the sandwich theorem or two police officers theorem (in Italy "dei due carabinieri") in the context of sequences, with a playful metaphor: imagining the bounding sequences aₙ and bₙ as two "carabinieri" (police officers) guiding or squeezing the sequence cₙ.

My idea is to visually depict the two sequences aₙ and bₙ as two human-like figures (the "carabinieri"), possibly wearing slightly modified uniforms that distinguish them from real police officers (for appropriateness), here a photo (the link is put looking the edit from this question):

https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.centrostudimida.it%2Fpost%2Fla-divisa-dei-carabinieri-caratteristiche-e-distinzioni&psig=AOvVaw3ckOW2xF7lfdR7nveiF2j9&ust=1750287467393000&source=images&cd=vfe&opi=89978449&ved=0CBQQjRxqFwoTCOCXh6jH-Y0DFQAAAAAdAAAAABAE

but still conveying the idea of symmetric bounding or convergence.

I'd like to adapt their appearance to suggest authority or structure (maybe uniforms in different colors or styles).

I would like to have, using tikzpeople package, a uniform that looks like that of a "carabiniere" by using the clothing of other people (e.g. uniform elements, hats, colors, etc.) adapting it to my case.

My MWE:

enter image description here

\documentclass[tikz]{standalone}
\usepackage{tikz}
\usepackage{tikzpeople}

\begin{document}
\begin{tikzpicture}[]
\node[police,label=$a_n$, minimum size=1.5cm] (T) at (-1.5,0) {};
\node[criminal,  label=$c_n$, minimum size=1.5cm] (S) at (0,0) {};
\node[police, label=$b_n$, mirrored,minimum size=1.5cm] (N) at (1.5,0) {};
\end{tikzpicture}
\end{document}
9
  • 4
    what exactly do you want to change and how have you attempted to change it? obviously, it is not realistic to give people a photo of coppers and expect them to transform tikzpeople into simulacra? have you tried changes supported by the package e.g. colours etc. should be straightforward? Commented Jun 17, 2025 at 23:19
  • 4
    off-topic: this does not strike me as a helpful analogy, regardless of how things maybe called ... Commented Jun 17, 2025 at 23:21
  • 4
    A more entertaining alternative tex.stackexchange.com/a/507182/245790, and don’t forget the tikzducks (where you can draw said stripe in the foreground layer using tikz), the marmot etc. E.g. the ducks are veeery flexible in terms of drawing // See ctan.org/topic/amusements Commented Jun 18, 2025 at 5:29
  • 2
    Those are some poor disfigured carabinieri. Commented Jun 18, 2025 at 7:26
  • 2
    @Sebastiano I figured as much, 'twas merely a joke. Commented Jun 18, 2025 at 11:04

3 Answers 3

22

Here are your carabinieri (based on the conductor with one of the stripes of the graduate) ...

The colors can be changed according to the style of the conductor. The color of the bandolier can be changed using the key bandolier.

This approach may look a bit complicated, but it has the advantage that it adheres to the overall style of the package especially when it comes to the subtle gradients.

\documentclass{standalone}
\usepackage{tikzpeople}

\begin{filecontents}{tikzpeople.shape.carabiniere.sty}
\tikzpeople@addcolorkey{hatshield}
\tikzpeople@addcolorkey{hatbadge}
\tikzpeople@addcolorkey{badge}
\tikzpeople@addcolorkey{bandolier}

\newcommand{\tikzpeople@carabiniere@paint}{
    \tikzpeople@person@paintshirt
    \tikzpeople@conductor@paintshirtdetails
    \tikzpeople@person@paintrighthorn
    \tikzpeople@person@painthead
    \tikzpeople@person@painthairstyletwo
    \tikzpeople@conductor@painthat
    \tikzpeople@person@paintgoatee
    \tikzpeople@person@paintlefthorn
    \tikzpeople@person@painthalo
    \tikzpeople@carabiniere@paintbandolier
}

\newcommand{\tikzpeople@carabiniere@paintbandolier}{
    \begin{scope}
        \clip 
            (-4.0pt,-8.0pt) .. controls (-2pt,-10pt) and ( 3pt,-9pt) .. 
            ( 5.0pt,-7.0pt) .. controls ( 5pt,  0pt) and (-5pt, 0pt) .. 
            (-4.0pt,-8.0pt);
        \draw[bandolier] 
            (1.5pt,-9.5pt) .. controls (0.7pt,-6pt) and (-1pt,-4pt) .. 
            (-2.5pt,-2pt) -- (-3.8pt,-2pt) .. controls (-3.2pt,-4pt) and 
            (-0.7pt,-6pt) .. (0pt,-9.5pt) -- cycle;
    \end{scope}
}

\newcommand{\tikzpeople@carabiniere@definecolors}{
    \definecolor{shirt}{rgb}{0.1,0.1,0.1}
    \definecolor{hat}{rgb}{0.1,0.1,0.1}
    \definecolor{hair}{rgb}{0,0,0}
    \definecolor{badge}{rgb}{0.851,0.1,0.1}
    \definecolor{hatbadge}{rgb}{0.85,0.85,0.85}
    \definecolor{hatshield}{rgb}{0.1,0.1,0.1}
    \definecolor{undershirt}{RGB}{232,232,232}
    \definecolor{tie}{rgb}{0.1,0.1,0.1}
    \definecolor{bandolier}{rgb}{0.95,0.95,0.95}
}
\newcommand{\tikzpeople@carabiniere@definestyles}{
    \if@tikzpeople@saturated
        \tikzset{
            shirt/.style    ={color=\tikzpeople@shirt!90,top color=\tikzpeople@shirt!90, bottom color=\tikzpeople@shirt,shading angle=45},
            hattop/.style   ={color=\tikzpeople@hat!90,top color=\tikzpeople@hat!90, bottom color=\tikzpeople@hat,shading angle=45},
            hatbottom/.style={color=\tikzpeople@hatshield,top color=\tikzpeople@hatshield!80, bottom color=\tikzpeople@hatshield,shading angle=45},
            badge/.style    ={color=\tikzpeople@badge,top color=\tikzpeople@badge!70, bottom color=\tikzpeople@badge,shading angle=45},
            hatbadge/.style ={color=\tikzpeople@hatbadge,top color=\tikzpeople@hatbadge!70, bottom color=\tikzpeople@hatbadge,shading angle=45},
            tie/.style      ={color=\tikzpeople@tie,top color=\tikzpeople@tie!70, bottom color=\tikzpeople@tie,shading angle=45},
            bandolier/.style={color=\tikzpeople@bandolier,top color=\tikzpeople@bandolier!70, bottom color=\tikzpeople@bandolier,shading angle=45}
        }
    \else
        \tikzset{
            shirt/.style    ={color=\tikzpeople@shirt!80,top color=\tikzpeople@shirt!80, bottom color=\tikzpeople@shirt,shading angle=45},
            hattop/.style   ={color=\tikzpeople@hat!80,top color=\tikzpeople@hat!80, bottom color=\tikzpeople@hat,shading angle=45},
            hatbottom/.style={color=\tikzpeople@hatshield!80,top color=\tikzpeople@hatshield!60, bottom color=\tikzpeople@hatshield!90,shading angle=45},
            badge/.style    ={color=\tikzpeople@badge!80,top color=\tikzpeople@badge!40, bottom color=\tikzpeople@badge!80,shading angle=45},
            hatbadge/.style ={color=\tikzpeople@hatbadge!80,top color=\tikzpeople@hatbadge!40, bottom color=\tikzpeople@hatbadge!80,shading angle=45},
            tie/.style      ={color=\tikzpeople@tie!80,top color=\tikzpeople@tie!40, bottom color=\tikzpeople@tie!80,shading angle=45},
            bandolier/.style={color=\tikzpeople@bandolier,top color=\tikzpeople@bandolier!70, bottom color=\tikzpeople@bandolier,shading angle=45}
        }
    \fi
}

\newcommand{\tikzpeople@carabiniere@colors}{
    shirt/190/{-.8/-.5},    hat/140/{-.6/1.5}, hair/175/{-.75/.8}, skin/10/{.5/.6}, 
    badge/210/{-.25/-1.25}, hatshield/155/{.15/.85}, hatbadge/30/{.4/1.3}, 
    undershirt/350/{.3/-.15}, tie/330/{.35/-.8}, bandolier/340/{.8/-.7,0/-1.3}%
}
\end{filecontents}

\makeatletter
\tikzpeople@declareshape{carabiniere}
\makeatother

\begin{document}
\begin{tikzpicture}[]
\node[carabiniere, label=$a_n$, minimum size=1.5cm] (T) at (-1.5,0) {};
\node[criminal, label=$c_n$, minimum size=1.5cm] (S) at (0,0) {};
\node[carabiniere, label=$b_n$, mirrored, minimum size=1.5cm] (N) at (1.5,0) {};
\end{tikzpicture}
\end{document}

output of above code

2
  • 2
    I thank you immensely. I was not skilled at colouring clothes differently to make them look like “carabinieri”. Your work is immense and very well done. Thank you very much again. Commented Jun 18, 2025 at 8:34
  • 4
    @Sebastiano Well the key part was to change police to conductor for the better-suited dress. Then, I essentially just changed most colors to black (or a very dark gray). =) Commented Jun 18, 2025 at 9:09
14

If you like it a bit more abstracted, while still being humanized, here is a way using package tikz-among-us. Its advantage: you can assemble the basic figures as you like and put some extras, like the belt.

Scene:

scene

Remarks:

  • carabinieri: \newcommand\amongUsCaraI[5]{ %#1:body, #2:eye, #3:belt, #4:stripe, #5: emblem
  • criminal: \newcommand\amongUsCrimI[2]{ %#1:body, #2:eye
  • tikz-shortcuts for male, female and criminal:
 \begin{tikzpicture}[
    % ~~~ shortcuts ~~~~~~~~~~~~~~~~~~~~~~
    mcara/.pic={\amongUsCaraI{black}{cyan}{white}{red}{yellow}},
    fcara/.pic={\amongUsCaraI{black}{magenta}{white}{red}{yellow}},
    crim/.pic ={\amongUsCrimI{pink}{green}},
    mtxt/.style={font=\Huge},
 ]

Using \pic makes it easier to place them compared to scope being used in the manual.

Advancing the code below a bit further would pass one parameter to the pics, containing the text on top, i.e. you no longer would have to care about its coordinates. It's not difficult to do, but obscures the code more than needed here.


\documentclass[10pt,border=3mm,tikz]{standalone}
\usepackage{tikz-among-us}

\newcommand\amongUsCaraI[5]{ %#1:body, #2:eye, #3:belt, #4:stripe, #5: emblem
 \amongUsBackpackI{#1}                      % backpack
 \amongUsBodyI{#1}                          % body
 \amongUsEyesAngryI{#2}                     % expression
 \draw[#3,line width=4mm,line cap=round]    % belt
    (0.2,4.2) to[out=-50,in=150] +(3.1,-2);
 \draw [#4,line width=2.3mm]                % stripe
    (0.5,0) -- +(0,1.5);
 % ~~~                                        emblem
 \draw[fill=#5,draw=#5] (2.2,5) circle[radius=1.2mm];
 \draw[fill=#5,draw=#5] (2.3,5.2) circle[x radius=4mm,y radius=2mm];
}

\newcommand\amongUsCrimI[2]{ %#1:body, #2:eye
 \amongUsBackpackI{#1}                      % backpack
 \amongUsBodyI{#1}                          % body
 \amongUsEyesScaredI{#2}                    % expression
}


% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{document}
 \begin{tikzpicture}[
    % ~~~ shortcuts ~~~~~~~~~~~~~~~~~~~~~~
    mcara/.pic={\amongUsCaraI{black}{cyan}{white}{red}{yellow}},
    fcara/.pic={\amongUsCaraI{black}{magenta}{white}{red}{yellow}},
    crim/.pic ={\amongUsCrimI{pink}{green}},
    mtxt/.style={font=\Huge},
 ]
    % ~~~ scene ~~~~~~~~~~~~~~~~~~
    \pic at ( 0,0) {mcara};
    \pic at ( 5,0) {crim};
    \pic at (10,0) {fcara};
    
    % ~~~ arrested ~~~~~~~~~~~
    \amongUsHandsB[shift={(4,2)}]{cyan}
    \amongUsHandsB[shift={(9.5,.4)},xscale=-1]{magenta}
    
    % ~~~ text ~~~~~~~~~~~~~~~
    \node[mtxt] at ( 1.5,6.3){$a_n$};
    \node[mtxt] at ( 6.5,6.3){$c_n$};
    \node[mtxt] at (11.5,6.3){$b_n$};

 \end{tikzpicture}
\end{document}

P.S.: After having demonstrated the basic approach, I became aware of two minor glitches:

  • the white belt is worn on the other side
  • thumb directions don't match color/persona (corrected in arrested section)

For the belt sequence and values chaged inside the \newcommand:

 \amongUsBodyI{#1}                          % body
 \draw[#3,line width=4mm,line cap=round]    % belt
    (4,4.3) to[out=230,in=10] (0.2,2.2);
 \amongUsEyesAngryI{#2}                     % expression

result2

About passing parameters to a \pic, kindly see my other answer using tikzpeople.

\documentclass[10pt,border=3mm,tikz]{standalone}
\usepackage{tikz-among-us}

\newcommand\amongUsCaraI[5]{ %#1:body, #2:eye, #3:belt, #4:stripe, #5: emblem
 \amongUsBackpackI{#1}                      % backpack
 \amongUsBodyI{#1}                          % body
 \draw[#3,line width=4mm,line cap=round]    % belt
    (4,4.3) to[out=230,in=10] (0.2,2.2);
 \amongUsEyesAngryI{#2}                     % expression
 \draw [#4,line width=2.3mm]                % stripe
    (0.5,0) -- +(0,1.5);
 % ~~~                                        emblem
 \draw[fill=#5,draw=#5] (2.2,5) circle[radius=1.2mm];
 \draw[fill=#5,draw=#5] (2.3,5.2) circle[x radius=4mm,y radius=2mm];
}

\newcommand\amongUsCrimI[2]{ %#1:body, #2:eye
 \amongUsBackpackI{#1}                      % backpack
 \amongUsBodyI{#1}                          % body
 \amongUsEyesScaredI{#2}                    % expression
}


% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{document}
 \begin{tikzpicture}[
    % ~~~ shortcuts ~~~~~~~~~~~~~~~~~~~~~~
    mcara/.pic={\amongUsCaraI{black}{cyan}{white}{red}{yellow}},
    fcara/.pic={\amongUsCaraI{black}{magenta}{white}{red}{yellow}},
    crim/.pic ={\amongUsCrimI{pink}{green}},
    mtxt/.style={font=\Huge},
 ]
    % ~~~ scene ~~~~~~~~~~~~~~~~~~
    \pic at ( 0,0) {mcara};
    \pic at ( 5,0) {crim};
    \pic at (10,0) {fcara};
    
    % ~~~ arrested ~~~~~~~~~~~
    \amongUsHandsB[shift={(5.5,2)},xscale=-1]{cyan!80!black!100}
    \amongUsHandsB[shift={(8.5,.4)}]{magenta!80!black!100}
    
    % ~~~ text ~~~~~~~~~~~~~~~
    \node[mtxt] at ( 1.5,6.3){$a_n$};
    \node[mtxt] at ( 6.5,6.3){$c_n$};
    \node[mtxt] at (11.5,6.3){$b_n$};

 \end{tikzpicture}
\end{document}
4
  • 2
    Thank you very much for your idea. Thank you again for your cooperation and idea. A great job. Thank you again. Commented Jun 18, 2025 at 8:37
  • 3
    I like the red stripes! Sadly, I can't implement this with tikzpeople as the trousers are not shown =( Commented Jun 18, 2025 at 9:10
  • @JasperHabicht: Thank you. But you could do sth with the emblem, which comes in many different shapes and colors: i.sstatic.net/JBvd5e2C.jpg // Select image search: google.com/search?q=carabinieri+emblem+hat Commented Jun 18, 2025 at 9:22
  • 1
    @MS-SPO Ohoo! Indeed =D Commented Jun 18, 2025 at 9:23
11

Here is yet an other approach, which avoids recreating code from tikz-people, using:

  • package tikzpeople
  • drawing over it (belt, emblem)
  • abstracting into a \pic element
  • passing two parameter to the \pic: #1: people options, #2: top text

If you like this carabinieri with a femal touch ...

result

Details

Defining styles and \pic cara and crim:

    pol/.style={police, minimum size=1.5cm, 
                badge=black,shirt=black,
                hat=black,hatbadge=black},
    blt/.style={white, line width=2mm},
    emb/.style={fill=yellow,draw=yellow},
...
    pics/cara/.style n args={2}{ % #1: police options, #2: top text
     code={ ... }
     },
    crm/.style={criminal, minimum size=1.5cm},
    pics/crim/.style n args={2}{% #1: criminal options, #2: top text
     code={ ... }
     },

This simplifies placement and manipulation of cara and crim:

  • leave { } open, if nothing is passed
  • add people options to the first, text to the second
...
    \pic at                             (0,0) {cara={}{$a_n$}};                             
    \pic at (4,0) {cara={female,hair=magenta,mirrored}{$b_n$}};                                                         
    \pic                            at  (2,0) {crim={hat=brown,skin=lightgray}{$c_n$}};

 \end{tikzpicture}

Residual problems

The belt is not clipped: you would see it against a background in the drawing.

Mirroring isn't perfect, yet. However, you can, e.g.:

  • perceive this incapability being a design feature
  • improve code, e.g. by some if-clause or a modified text node
  • define one more dedicated \pic, which accounts for mirroring
  • etc.

The badge could be changed.


\documentclass[10pt,border=3mm,tikz]{standalone}
\usepackage{tikzpeople}


% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{document}
 \begin{tikzpicture}[
    pol/.style={police, minimum size=1.5cm, 
                badge=black,shirt=black,
                hat=black,hatbadge=black},
    blt/.style={white, line width=2mm},
    emb/.style={fill=yellow,draw=yellow},
    % 
    % carabinieri, with parameters
    pics/cara/.style n args={2}{ % #1: police options, #2: top text
     code={
        % ~~~ police ~~~~~~~~~~~~~~~~~~~~~
        \node[pol,#1] (P) {};
        % ~~~ belt (unclipped) ~~~~~~~~~~~~~~~~
        \draw[blt] ([shift=(180:.55)]P.center) 
                     to[out=-50,in=150]
                    ([shift=(-40:1)]P.center);
        % ~~~ emblem ~~~~~~~~~~~~~~~~~~~~~~~~~~~
        \draw[emb] ([shift=(74:.75)]P.center) circle[radius=.5mm];
        \draw[emb] ([shift=(73:.85)]P.center) circle[x radius=1.5mm,
                                                     y radius=.8mm,rotate=-10];
        % ~~~ top text ~~~~~~~~~~~~~~~~~~
        \node at ([yshift=5mm]P.north) {#2};
        }
     },
    crm/.style={criminal, minimum size=1.5cm},
    pics/crim/.style n args={2}{% #1: criminal options, #2: top text
     code={
        % ~~~ criminal ~~~~~~~~~
        \node[crm,#1] (P) {};
        % ~~~ top text ~~~~~~~~~~~~~~~~~~
        \node at ([yshift=5mm]P.north) {#2};
     }
    },   
    ]
    
    \pic at (0,0) {cara={}{$a_n$}};                             
    \pic at (4,0) {cara={female,hair=magenta,mirrored}{$b_n$}};                             

    \pic at (2,0) {crim={hat=brown,skin=lightgray}{$c_n$}};
 \end{tikzpicture}
\end{document}
4
  • 1
    🤩🤩🤩🤩🤩 "Bellissimo": wowwwwwwwwwwwwwwwwww. Grazieeeeeeeeeeeeeeeee ancoraaaaaa. Commented Jun 18, 2025 at 16:22
  • 1
    @Sebastiano, thank you: YOU are welcome :) Commented Jun 18, 2025 at 16:24
  • In the second frieze of the yellow-colored woman should be shifted toward the center. I think there is a remnant of the old frieze always of the woman's cap that should be removed. Commented Jun 18, 2025 at 20:45
  • Have you the same error using beamer into a \begin{frame}? Commented Jun 20, 2025 at 21:15

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.