New answers tagged

1

Answering this just in case someone would need it: \newcommand\colorTiles[3]{ \begin{tikzpicture} \draw[ultra thick](0,0) rectangle (2,0.5); \draw[fill = red](0, 0) rectangle (#1 * 2, 0.5); \draw[fill = green](#1 * 2, 0) rectangle (#2 * 2 + #1 * 2, 0.5); \draw[fill = purple](#2 * 2 + #1 * 2, 0) rectangle(#3 * 2 + #2 * 2 + #1 * 2, 0.5); ...


5

Try: \draw [->,thick] (n3.east|-n4.west) -- (n4.west); \draw [->,thick] (n3.east|-n5.west) -- (n5.west);


0

|- will draw a line which consists of vertical and horizontal segments only. The vertical segment at the start will vanish behind the boarder of the node, so only the horizontal segment is visible. \documentclass[preview,border=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{center} \begin{small} \begin{...


0

This solution uses a savebox. Interestingly, the \savebox macro didn't work, even though it should be equivalent. Note that \box automatically empties the contents, while \usebox preserves them. \documentclass{article} \usepackage{tikz-cd} \newsavebox{\tempbox} \begin{document} \[\begin{tikzcd}A&B\\C&D\end{tikzcd}\] \setbox\tempbox=\hbox{\...


1

You can use shorten > as an option or in a style. \documentclass[tikz,border=5mm]{standalone} \begin{document} \begin{tikzpicture} \foreach \i in {0,...,5} \fill (60*\i:2) circle(2pt) coordinate (A\i); \draw (A0)--(A1)--(A2)--(A3)--(A4); \draw[-stealth, shorten >=3pt] (A4)--(A5); \draw[-stealth, shorten >=3pt] (A5)--(A0); \end{tikzpicture} \begin{...


1

With use regular polygon for determining coordinates of bullets (named dot in MWE below) and loops for drawing lines in sub figure b. Styles for arrows and nodes' shapes are common for both picture. Arrows are defined by arr/.style = {-{Stealth[length=2mm, width=2mm]},shorten >=1pt}, MWE: \documentclass{article} \usepackage{tikz} \usetikzlibrary{...


4

You should include myarrow/.style inside the first square brackets in order to define the style. In the style you can specify the arrow tip distance from the node with the sep=1pt option as in the example below. If the myarrow style is to be used in multiple tikzpicture environments, you can define the style in the preamble with \tikzset{myarrow/.style={...}...


3

Define a macro for the complicated thing: \documentclass{article} \usepackage{amsmath} \usepackage{tikz-cd} \newcommand{\funcdef}[5]{% \mbox{\scriptsize$ \begin{aligned} #1\colon #2 & \longrightarrow #3 \\[-1ex] #4 &\longmapsto #5 \end{aligned} $}% } \begin{document} \begin{tikzcd}[column sep=8em] & N \arrow[twoheadrightarrow,d,"\pi"]\...


2

For fun, a solution with the psmatrix environment, from pstricks: \documentclass{article} \usepackage{amsmath} \usepackage{pst-node} \begin{document} % \[ \everypsbox{\scriptstyle} \psset{arrows=->, arrowinset=0.15, linewidth=0.4pt, nodesep=3pt, labelsep=2pt, rowsep=1.2cm, colsep=1.5cm, shortput=nab} \begin{psmatrix} %%%nodes & [name=N] N \\% ...


1

I draw by this simple way: \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \path (0,0) node (top) {TOP} ++(-90:1) node (pdiff) {PDIFF} +(-130:1.5) node (diff) {DIFF} +(-50:1.5) node (pl) {PL}; \draw (top)--(pdiff)--(diff) (pdiff)--(pl) node[midway,sloped,above,yscale=.6]{$\sim$}; \end{tikzpicture} \end{document}


1

Here another proposal using tikz-cd package: \documentclass[a4paper,12pt]{article} \usepackage{amsmath,amssymb} \usepackage{newtxtext,newtxmath} \usepackage{tikz-cd} \tikzset{close/.style={outer sep=-7pt}} \usepackage{graphicx} \begin{document} \begin{tikzcd}[column sep=0cm] & \text{TOP} \arrow[d, no head] &\\ & \text{PDIFF} \arrow[ld, no head]...


0

A possible another approach is direct drawing of hooked arrow with Tikz using arc. For double arrow, use the node anchors. \documentclass{article} \usepackage{tikz} \begin{document} \begin{center} \begin{tikzpicture} \node[inner sep=0pt,minimum size=4pt] (e) at (0,2) {$E$}; \node[inner sep=0pt,minimum size=4pt] (a) at (2,2) {$A$}; ...


1

An approach with tikz and arrows. Place right hook before -stealth. With some position adjustment you can also place two parallel arrows, see the path command. Output: Code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows} \begin{document} \begin{center} \begin{tikzpicture} \node[inner sep=0pt,minimum size=4pt] (e) at (0,2) {$E$...


6

With crossing over, arrows that are drawn later, erase part of the arrows they cross. \documentclass{article} \usepackage{geometry} \usepackage{amsmath} \usepackage{tikz-cd} \newcommand{\level}{\mathrm{Level}} \begin{document} \begin{tikzcd}[column sep=1.5em,row sep=large,arrows={crossing over}] && \level(1,3) \\ \\ & \level(2,2) \arrow[uur] ...


Top 50 recent answers are included