Tag Info

Hot answers tagged

10

Here's another option using decorations to produce the two requested styles: \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.markings} \def\MarkLt{6pt} \def\MarkSep{3pt} \tikzset{ TwoMarks/.style={ postaction={decorate, decoration={ markings, mark=at position #1 with { ...


8

A sloped node could be used with white background and the symbol as contents you want to use: \documentclass{article} \usepackage{tikz} \tikzstyle{cont} = [ sloped, node contents={//}, fill=white, inner xsep=.1em, inner ysep=0pt, ] \begin{document} \begin{tikzpicture} \draw (0, 0) -- node[pos=.5, cont] {} (2, 2) (0, 0) -- node[pos=.5, ...


5

Either use a third variable, as Sigur suggested, or use an ifcase construction: Code \documentclass[tikz,border=2mm]{standalone} \begin{document} \begin{tikzpicture} [ scale=0.8, auto=left, every node/.style={circle,fill=blue!20}, lnode/.style={rectangle,fill=none}, ] \node (n6) at (1,10) {6}; \node (n4) at (4,8) {4}; \node (n5) at ...


4

A simple solution with @HeikoOberdiek's idea in mind: \documentclass[border=4pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[par/.style={sloped,fill=white,inner sep=-.6ex}] \draw (0, 0) -- node[par]{//} (2, 2) (0, 0) -- node[par]{//} ++(2, 0) -- node[sloped]{\textbar} ++(0, 2) -- node[sloped]{\textbar} ++(-2, 0) ...


4

All the hard work is done by Gonzalo already. You have to just change the part to chap and PART to SOLUTION in his code. \documentclass{book} \usepackage{fourier}% change to lmodern if fourier is no available \usepackage{tikz} \usepackage[explicit]{titlesec} \definecolor{mybluei}{RGB}{0,173,239} \definecolor{myblueii}{RGB}{63,200,244} ...


4

I'd suggest to use positioning library which can help you to place nodes beside/above/below others. \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning, fit} \begin{document} \begin{tikzpicture}[ mytext/.style={ draw, text width=#1, align=center, minimum height=1.5cm }, ar/.style={ ->, >=latex } ] ...


3

\tikzset recieves a comma separated list of options as argument. In the simpler form, those options are lists of comma-separated pairs of the form key = value, for example: \tikzset{>=latex,shorten >= 4pt} but in more elaborate situations you can also have styles, pic paths and other stuff in the argument of \tikzset; in any case, one of the ...


3

Update Here's another option producing an isometric view; the squares in the top layer can be easily labelled since the four corners can be accessed using (t-#), (l-#), (b-#), and (r-#) (see code below): The code: \documentclass[tikz,border=5]{standalone} \def\Side{0.5cm} \newcounter{mycube} \tikzset{ cube/.style={ thin, fill opacity=.5, ...


2

You can name the label and add to the fit list. \node[obj,label={[name=id1-l]below:Outside}] (id1) at (2,2) {}; \begin{pgfonlayer}{background} \node[surround] (background) [fit = (id1)(id1-l)] {}; \end{pgfonlayer} If you are going to use this often times then making a style out of it might be a good idea.


2

Next code shows a solution for your first problem. You want similar fitting nodes, then if you build them with similar inner nodes, they will have same size. As an example \node[surround, fit = (id1)(id3.east|-id1.center)] {}; will build a node big enough for id1 (which fixes height and western border) but it will also encompass coordinate ...


2

You can use the in=<angle>, out=<angle> options together with the looseness and/or distance (family of) keys. A little complete example: \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows,positioning} \begin{document} \begin{tikzpicture}[every node/.append style={circle,draw}] \path node (1) {1} node (2) [left=of 1] {2} ...


1

You only have to change the options of the nodes to: \node[pos=<..>,above] The pos value is included between 0 and 1, where 0 corresponds to the beginning of the arrow and 1 to the end of it. The complete code is: \documentclass[crop=true,border=2cm (all sides) i]{standalone} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{calc} ...


1

This is not a complete answer for your problem (i.e. and it is my first answer in this community for tikz. :)) however, once you draw the shape, you need to multiply each vertex with the transformation matrix. I've modified this code and added the spheres. The result is For rotation around z-axis, this is the result (i.e. the rotation order zyz but you ...



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