How to create Simplical complexes of Betti Diagrams in Tikz?

I want to learn to create Betti diagrams and their simplical complexes such as

where I need to learn to align the text properly (see Trial 1) and

where I need to learn coloring surfaces and add single black points. The Betti diagrams are on the page 30 of the book The Geometry of Syzygies A Second Course in Algebraic Geometry and Commutative Algebra.

TRIALS

Trial 1: $x_1x_2x_3$ badly in the middle of the node, not on the side, align option?

Trial 2: anchors without the text on the right of the node coordinate

where the goal is to have the text on the right of the node.

Trial 3: the edges not connected (fail)

Generic MWE: with anchor fail with non-connected edges (Trial 3) that can easily be changed to other trials.

\documentclass[english]{article}
\usepackage{tikz}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\draw (0,0) node(1){$x_1$};
\draw (1,-1) node(123){};%$x_1x_2x_3$
\draw (2,0) node(2){$x_2$};
\draw (1,-2) node(3){$x_3$};
\draw (1)--(123)--(2);
\draw (3)--(123);
\node [anchor=west] (n123) at (123){$x_1x_2x_3$};
\end{tikzpicture}

\end{document}


How to create the simplical complexes of the Betti diagrams in Tikz?

• Please post the code, together with a preamble, as text. – Alenanno Jun 11 '16 at 0:40
• Just in case, please see this meta question and answers. – cfr Jun 11 '16 at 1:08
• @Alenanno MWE updated to Q. – hhh Jun 11 '16 at 1:11
• Note that you should be asking a single, specific question. For example, how can I put a label to the right of the point where these lines meet? Or how can I avoid the gap between these lines? A question isn't intended to be a laundry list of everything you want done in order to complete a project, especially not if you keep throwing additional items in the wash after people have got the washing in off the line. – cfr Jun 11 '16 at 1:11

If you want a node to be located "elsewhere" from the coordinate, you could use anchors. Regardless of how your diagrams could be more efficiently done, you could for example write:

\node[anchor=west] (n123) at (1,-1) {$x_{1}x_{2}x_{3}$};


This will make the node appear on the right of the coordinate (1,-1).

• Trial 3 and its MWE updated to Q, edges not connected fail. After this, surfaces to be colored and invidual bolded vertices for Bettis. – hhh Jun 11 '16 at 1:10
• @hhh That is not how this site works. Please take a look at the guidance on asking questions. If you have to keep updating questions because people's answers don't do what you really want, you need to spend more time thinking your questions through before asking them. But, mostly, you probably need to break your questions down into single steps you want help with. Right now, your questions are like shifting sands and answering them is a waste of everybody's time. – cfr Jun 11 '16 at 1:14

Simplical complexes of Betti Diagrams with Tikz

I suggest the primitives coordinate, node and draw instead of doing everything with draw and node. First of Example 1 demonstrate the former while Second of Example 1 demonstrate the latter. The colored area can be done with primitives such as fill, draw and pattern where the last requires \usetikzlibrary{patterns}. Example 2 demonstrates different varieties about the colored areas. Lastly, the Tikz manual 4.2.1 and 15.4 are useful to understand better the techniques. Section 21 (manual 2 while section 23 in manual 3.0.1) covers transparancy: have the command opacity=0.5 in the fill or pattern.

Examples about Betti diagrams with bolded-point, shaded area, edges connected and labels not over edges

Example 1.

Example 2.

MWE

\documentclass[english]{article}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}[x=2cm, y=2cm]
\coordinate [label=left:$x_1$] (1) at (0,0);
\coordinate [label=right:$x_1x_2$] (2) at (2,0);
\coordinate [label=below:$x_3$] (3) at (1,-2);
\coordinate [label=right:$x_1x_2x_3$] (123) at (1,-1);
\node [fill=red,inner sep=2pt] (11) at (1){};
\draw [pattern color=blue, pattern=fivepointed stars] (1)--(123)--(2)--(1);
\draw (3)--(123);
\end{tikzpicture}

\begin{tikzpicture}[x=2cm, y=2cm]
\coordinate [label=left:$x_1$] (1) at (0,0);
\coordinate [label=right:$x_1x_2$] (2) at (2,0);
\coordinate [label=below:$x_3$] (3) at (1,-2);
\coordinate [label=right:$x_1x_2x_3$] (123) at (1,-1);
\node [fill=red,inner sep=2pt] (11) at (1){};
\draw [fill=blue] (1)--(123)--(2)--(1);
\fill (1)--(123)--(3)--(1);
\draw (3)--(123);
\end{tikzpicture}

\end{document}


Tikz manual 2.10 and the newest manual 3.0.1 from the Sourceforge have unchanged sections 4.2.1 and 15.4. The transparency section is 23, instead of 21 as in 2.10, for the manual 3.0.1. Relevant parts as pictures here and here.