Does anyone know how to code this in LaTex? I'm trying to learn the program I know I need to use the Tikz. If anyone knows how to make this, please do share your input. Thanks for any help!
-
3To get started with TikZ, check out Cremer's A very minimal introduction to TikZ. The PGF and TikZ examples gallery is also useful, if sometimes overwhelming.– vonbrandAug 15, 2020 at 3:44
-
1Can you give more background info, for example which type dose that diagram belong to? Also you can attach links to or images of similar drawn diagrams.– muzimuzhi ZAug 15, 2020 at 4:53
-
3Something like this? code, screenshot– Henri MenkeAug 15, 2020 at 5:10
-
4Welcome to TeX.SX! Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document.– TobiBSAug 15, 2020 at 9:58
-
close voters, please since this question has an answer, leave it open.– AndréCAug 15, 2020 at 20:33
1 Answer
You could use a TikZ-matrix. Then something like that:
\documentclass[margin=5mm, tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix}
\usetikzlibrary{backgrounds}
\begin{document}
\pgfmathsetlengthmacro\eradius{0.65ex}
\begin{tikzpicture}[
si/.style={circle, draw, fill=white},
]
\matrix (m) [matrix of nodes, nodes in empty cells,
nodes={inner sep=1ex, anchor=center},
column sep=2em, row sep=2em,
]{
& & & & & & \\
& |[si]|Si & & |[si]|Si & & |[si]|Si & \\
& & & & & & \\
& |[si]|Si & & |[si]|Si & & |[si]|Si & \\
& & & & & & \\
%1 & 2 & 3 & 4 & 5 & 6 & 7 \\
};
% Annotations
\foreach \y in {1,3,5}{
\foreach \x in {2,4,6}{
\fill[] ([yshift=0.2*\eradius]m-\y-\x.north) circle[radius=\eradius];
\fill[] ([yshift=-0.2*\eradius]m-\y-\x.south) circle[radius=\eradius];
}}
\foreach \y in {2,4}{
\foreach \x in {1,3,5,7}{
\fill[] ([xshift=0.2*\eradius]m-\y-\x.east) circle[radius=\eradius];
\fill[] ([xshift=-0.2*\eradius]m-\y-\x.west) circle[radius=\eradius];
}}
\begin{scope}[on background layer]
\foreach \y in {2,4}{
\draw[transform canvas={yshift=1ex},
shorten >=-1.5ex, shorten <=-1.5ex
] (m-\y-1.north west) -- (m-\y-7.north east);
\draw[transform canvas={yshift=-1ex},
shorten >=-1.5ex, shorten <=-1.5ex
] (m-\y-1.south west) -- (m-\y-7.south east);
}
\foreach \x in {2,4,6}{
\draw[transform canvas={xshift=-0.7ex},
shorten >=-1.5ex, shorten <=-1.5ex
] (m-1-\x.north west) -- (m-5-\x.south west);
\draw[transform canvas={xshift=0.7ex},
shorten >=-1.5ex, shorten <=-1.5ex
] (m-1-\x.north east) -- (m-5-\x.south east);
}
\end{scope}
\end{tikzpicture}
\end{document}
-
2