
O código tikz quiver a seguir parece muito grande quando compilado em látex. Existe uma maneira de reduzi-lo?
Obrigado
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\[\begin{tikzcd}[cramped]
&&&&&&&&&&& {v_7} \\
\\
&&&&&&&&&&& {v_1} \\
\\
&&&&&&&&&&& {v_4} \\
\\
&&&&&&&&&&& {v_{10}} \\
\\
&&&&&&&&& {v_{11}} &&&& {v_{12}} \\
&&&&&& {v_5} &&&&&&&&&& {v_6} \\
&&& {v_2} &&&&&&&&&&&&&&&& {v_3} \\
{v_8} &&&&&&&&&&&&&&&&&&&&&& {v_9}
\arrow[no head, from=7-12, to=9-10]
\arrow[no head, from=7-12, to=9-14]
\arrow[no head, from=9-10, to=9-14]
\arrow[no head, from=5-12, to=10-7]
\arrow[no head, from=5-12, to=10-17]
\arrow[no head, from=10-7, to=10-17]
\arrow[no head, from=3-12, to=11-4]
\arrow[no head, from=3-12, to=11-20]
\arrow[no head, from=11-4, to=11-20]
\arrow[no head, from=1-12, to=12-23]
\arrow[no head, from=1-12, to=12-1]
\arrow[no head, from=12-1, to=12-23]
\end{tikzcd}\]
\end{document}
Responder1
\documentclass[tikz, border=1cm]{standalone}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[cramped, sep=tiny]
&&&&&&&&&&& {v_7} \\
\\
&&&&&&&&&&& {v_1} \\
\\
&&&&&&&&&&& {v_4} \\
\\
&&&&&&&&&&& {v_{10}} \\
\\
&&&&&&&&& {v_{11}} &&&& {v_{12}} \\
&&&&&& {v_5} &&&&&&&&&& {v_6} \\
&&& {v_2} &&&&&&&&&&&&&&&& {v_3} \\
{v_8} &&&&&&&&&&&&&&&&&&&&&& {v_9}
\arrow[no head, from=7-12, to=9-10]
\arrow[no head, from=7-12, to=9-14]
\arrow[no head, from=9-10, to=9-14]
\arrow[no head, from=5-12, to=10-7]
\arrow[no head, from=5-12, to=10-17]
\arrow[no head, from=10-7, to=10-17]
\arrow[no head, from=3-12, to=11-4]
\arrow[no head, from=3-12, to=11-20]
\arrow[no head, from=11-4, to=11-20]
\arrow[no head, from=1-12, to=12-23]
\arrow[no head, from=1-12, to=12-1]
\arrow[no head, from=12-1, to=12-23]
\end{tikzcd}
\end{document}
Responder2
Aqui está outra maneira de fazer isso.
O código no final mostra apenas um triângulo, que funcionaria se você o usasse em um tikzpicture
ambiente:
% ~~~ just one triangle ~~~~~~~~~~~~~~~~~~~~~~~
\draw ( 90:1) node[txt]{$v_1$} --
(200:2) node[txt]{$v_2$} --
(340:2) node[txt]{$v_3$} -- cycle;
- usar coordenadas polares
- desenhe de (90:1) para (200:2) para (340:2) e feche e termine (
;
) este caminho - coloque um
node
cada vez que estiver na próxima posição (observe a falta\
) - use um estilo para este nó, que apenas preencha um pouco de cor branca
- coloque algum texto, aqui no modo matemático
$ .. $
Desenhar um segundo E pensar em termos de refatoração, usar uma macro TeX parece razoável:
Tikz
tende a favorecer\def
,\newcommand
certamente por uma razão- para manter as coisas bastante simples, apenas passo o comprimento vertical e 3 índices (isso certamente poderia ser refinado ainda mais)
- que abstrai o mesmo triângulo em:
\def\triag#1#2#3#4{% y-length, 3 indices
\draw ( 90:#1 ) node[txt]{$v_{#2}$} -- %
(200:2*#1) node[txt]{$v_{#3}$} -- %
(340:2*#1) node[txt]{$v_{#4}$} -- cycle;}%
Por fim, basta fazer quantas chamadas quiser para esses triângulos dentro de um tikzpicture
ambiente, que se expande em uma série de \draw ... ;
caminhos:
\documentclass[10pt,border=3mm,tikz]{standalone}
\def\triag#1#2#3#4{% y-length, 3 indices
\draw ( 90:#1 ) node[txt]{$v_{#2}$} -- %
(200:2*#1) node[txt]{$v_{#3}$} -- %
(340:2*#1) node[txt]{$v_{#4}$} -- cycle;}%
\begin{document}
\begin{tikzpicture}[
txt/.style={fill=white},
]
\triag{.5}{10}{11}{12}
\triag{1 }{4}{5}{6}
\triag{1.5}{1}{2}{3}
\triag{2 }{7}{8}{9}
\end{tikzpicture}
\end{document}
% ~~~ just one triangle ~~~~~~~~~~~~~~~~~~~~~~~
% \draw ( 90:1) node[txt]{$v_1$} --
% (200:2) node[txt]{$v_2$} --
% (340:2) node[txt]{$v_3$} -- cycle;
% ~~~ later refactored using a TeX macro \triag ~~~