Hot answers tagged


This is what the last example in section 13.5.4 The Syntax of Distance Modifiers of the pgfmanual v 3.1.4 does. By nesting the calc syntax you can combine the directives used there to one. \documentclass[tikz]{standalone} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \coordinate (a) at (1,0); \coordinate (b) at (3,1); \draw (a) -- (b); \...


Change the color inside the node's text with \textcolor (thanks to TeXnician): \documentclass[tikz,border=2mm]{standalone} \begin{document} \begin{tikzpicture} \node[text=red]{bl\textcolor{blue}{ah}}; \end{tikzpicture} \end{document}


Basically, I added node[near end, left]{} and node[near end, right]{} to insert the labels and fixed the values of xshift to be symetric, eg, +/- 3ex. \documentclass[border=1mm]{standalone} \usepackage{amsthm,amsmath,amssymb,amsfonts} \usepackage{tikz-cd} \begin{document} \begin{tikzcd}[row sep = 1.4cm, column sep = 1.4cm] F(c) \arrow[lddr, to path=...


In your ode, the label "x2" is so far away because you are probably using a version of circuitikz before the fix for labels in scaled environments was introduced (that is, previous to 0.9.0). To put the "test" label into the amp, you can use the t= key, but you have to un-flip the text (the amp is drawn from left to right, so it's rotated 180 degrees): \...


One way is to name the node and place the label later. \documentclass[border=10pt]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz} [scale=2] \draw[color=red] (0,0) to [amp,name=opamp] ++(2,0); \node[red,anchor=west] at (opamp.west) {$\times 2$}; \end{circuitikz} \end{document}


This solution does not rely on arc, but may be helpful for people looking for a simple solution to draw a curved line with a centered label. \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \path[->] (1,0) edge [bend left=20] node[above] {$30$} (2,0); \end{tikzpicture} \end{document} Changing "left bend" allows you to ...

Only top voted, non community-wiki answers of a minimum length are eligible