7

I want to draw the following pyramid in latex (preferably Tikz as I am somewhat familiar with it)

enter image description here

I have found This topic that explains how to do a nice pyramid, but with my longer text I cannot adapt it easily

So here is the best I have :

\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{fullpage}
\usepackage{listings}   
\usepackage{booktabs}
\usepackage{colortbl}
\usepackage{longtable}
\usepackage{tikz-cd}
\usepackage{lscape}
\usetikzlibrary{shapes,arrows,intersections}
\usetikzlibrary{matrix,fit,calc,trees,positioning,arrows,chains,shapes.geometric,shapes}
\usepackage{setspace}
\onehalfspacing
\setcounter{secnumdepth}{3}    % Number subsubsections in the chapters
\setcounter{tocdepth}{5}       % Put subparagraph in the table of contents
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}

\begin{figure}[htp]
\centering
\begin{tikzpicture}
\coordinate (A) at (-5,0) {};
\coordinate (B) at ( 5,0) {};
\coordinate (C) at (0,7) {};
\draw[name path=AC] (A) -- (C);
\draw[name path=BC] (B) -- (C);
\foreach \y/\A in {0/Autres actes administratifs (circulaires et directives) ,1/Règlements (décrèts et arrêtés),2/Principes généraux du droit,3/bloc de légalité,4/Bloc de conventionalité ,5/Bloc de Constitutionnalité} {
    \path[name path=horiz] (A|-0,\y) -- (B|-0,\y);
    \draw[name intersections={of=AC and horiz,by=P},
          name intersections={of=BC and horiz,by=Q}] (P) -- (Q)
          node[midway,above] {\A};
}
\end{tikzpicture}
\end{figure}
\end{document}

that yields

enter image description here

5

2 Answers 2

6
\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[condensed,math]{iwona}
\usepackage[T1]{fontenc}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{graphicx}
\usepackage[usenames,svgnames]{xcolor}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{fullpage}
\usepackage{listings}   
\usepackage{booktabs}
\usepackage{colortbl}
\usepackage{longtable}
\usepackage{tikz-cd}
\usepackage{lscape}
\usetikzlibrary{shapes,arrows,intersections}
\usetikzlibrary{matrix,fit,calc,trees,positioning,arrows,chains,shapes.geometric,shapes}
\usepackage{setspace}
\onehalfspacing
\setcounter{secnumdepth}{3}    % Number subsubsections in the chapters
\setcounter{tocdepth}{5}       % Put subparagraph in the table of contents
\usepackage{tikz}
\usetikzlibrary{intersections}

\begin{document}

\begin{figure}[htp]
\centering
\begin{tikzpicture}
\coordinate (A) at (-4.5,0) {};
\coordinate (B) at ( 4.5,0) {};
\coordinate (C) at (0,8) {};
\path[name path=AC,draw=none] (A) -- (C);
\path[name path=BC,draw=none] (B) -- (C);
\filldraw[draw=Purple, ultra thick,fill=Purple!10] (A) -- (B) -- (C) -- cycle ;

\foreach \y/\A in {0/{Autres actes administratifs \small\upshape\mdseries(circulaires et directives)},
                   1/{Règlements \small\upshape\mdseries(décrèts et arrêtés)},
                   2/Principes généraux du droit,
                   3/Bloc de légalité,
                   4/Bloc de conventionalité,
                   5/\parbox{3cm}{\centering Bloc de\\ Constitutionnalité}} {
    \path[draw=none, very thick, dashed, name path=horiz] (A|-0,\y) -- (B|-0,\y);
    \draw[draw=Purple, very thick, dashed, 
          name intersections={of=AC and horiz,by=P},
          name intersections={of=BC and horiz,by=Q}] (P) -- (Q)
          node[midway,above,font=\bfseries\scshape,color=red!60!Brown] {\A};
}
\end{tikzpicture}
\end{figure}
\end{document}

I've added in the preamble the package xcolor (for some colors) and iwona (for the font).

enter image description here

1
  • 1
    @Aerandal I've edited to improve formatting.
    – Astrinus
    Dec 12, 2014 at 10:09
4

enter image description here

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{intersections}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\begin{document}

\begin{figure}[htp]
\centering
\begin{tikzpicture}
\coordinate (A) at (-5,0) {};
\coordinate (B) at ( 5,0) {};
\coordinate (C) at (0,7) {};
\draw[name path=AC] (A) -- (C);
\draw[name path=BC] (B) -- (C);
\foreach \y/\A in {
0/Autres actes administratifs (circulaires et directives) ,
1/Règlements (décrèts et arrêtés),
2/Principes généraux du droit,
3/bloc de légalité,
4/Bloc de conventionalité ,
5/Bloc\\ de Constitutionnalité} {
    \path[name path=horiz] (A|-0,\y) -- (B|-0,\y);
    \draw[name intersections={of=AC and horiz,by=P},
          name intersections={of=BC and horiz,by=Q}] (P) -- (Q)
          node[midway,above,align=center,text width=
\dimexpr(6em-\y em)*5\relax] {\A};
}
\end{tikzpicture}
\end{figure}
\end{document}
2
  • That helps, thanks. I guess I would rather have a bigger pyramid with a less cut text (like one line with "bloc de" and one with "constitutionnalité" ; and "bloc de conventionnalité" on one. Besides, why does a new line command \\ works with your example but not is I just add it in my mwe ? Dec 12, 2014 at 9:53
  • 2
    Because he has added align and text width attributes to the node.
    – Astrinus
    Dec 12, 2014 at 10:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .