Tag Info

New answers tagged

5

For simple, non "graphical" tree you can use the dirtree package: \documentclass{article} \usepackage{dirtree} \begin{document} \dirtree{% .1 debug. .2 filename. .2 modules. .3 module. .3 module. .3 module. .2 level. } \end{document}


1

forest is not really designed for this kind of graph but it can still do quite well with a little patience. The best way to specify the tree is not, however, semantically expressive: the relations specified in drawing the tree do not represent the relations illustrated by the diagram. This uses an experimental package, justtrees. There is a copy around ...


3

Here is another possibility using the new genealogytree package. To visualize the secondary wife relation, I added two styles secondary wife and secondary family to change the node color and draw the edges dashed. These can be used separately. The diagram is build with two \genealogytree structures. The first one is for the main graph. The second one adds ...


4

Another way with TikZ, where the structure is built manually. Wrapped it in a macro for convenience, the width of the second column is set to that of the widest entry in the column. \documentclass[border=3mm]{standalone} \usepackage{tikz} \usetikzlibrary{positioning,fit,backgrounds} \newcommand\someboxthingy[3]{ ...


4

A solution via a table with the advantage that the width is set automatically to the needed space: \documentclass{article} \usepackage{array} \usepackage{booktabs} \usepackage[table]{xcolor} \begin{document} \setlength{\fboxrule}{1pt} \setlength{\fboxsep}{\tabcolsep} \setlength{\arrayrulewidth}{1pt} \fcolorbox{black}{lightgray}{% ...


4

You can try with a matrix which serve as filled background nodes while inner nodes are drawn or filled according your taste. \documentclass[tikz, border=2mm]{standalone} \usetikzlibrary{matrix} \begin{document} \begin{tikzpicture}[field/.style={draw, fill=white, minimum height=1cm, text width= 5cm, align=left}] \matrix (card) [matrix of ...


1

This is a forest solution which involves a little less typing than some other possibilities. The basic idea is to see the diagram as a tree with an invisible root note on the far right. This has two children: the final and the detached third place match. To avoid affecting the main tree, the detached node is drawn after all of the other nodes are typeset ...


9

Here is one possible TikZ solution : \documentclass[tikz,border=7mm]{standalone} \usetikzlibrary{calc} \begin{document} % create \n random points around the circle with radious 5 \def\n{50} \xdef\pts{} \foreach \i in {1,...,\n}{ \xdef\pts{\pts ({\i/\n*360}:{5+rnd})} } \begin{tikzpicture} %draw random curve with some tension ...


18

Squiggle The following example draws the squiggle with randomness in the polar coordinate system. It draws twelve circles with 500 points. Each point is specified as polar coordinates. The radius is allowed in the range half to one and a half radius. The angle can up to ten degrees in the forward or backward direction. Changing the parameters allow the ...


13

This doesn't use Tikz, but here is a solution in asymptote. unitsize(1inch); int numPoints = 150; path p; for (int i = 0; i < numPoints; ++i) { p = p..dir(i*360.0/numPoints)+scale(0.25)*(unitrand()-0.5, unitrand()-0.5); } p = p..cycle; dot((0,0), 4+black); draw(unitcircle, 1+green); draw(p); dot(p, 2+red);


1

A variation on Gonzalo Medina's answer which does not require manually adjusting the horizontal placement of one of the nodes: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{arrows.meta} \usepackage[utf8]{inputenc} \usepackage{forest} \begin{document} \begin{forest} for tree={ font=\sffamily, grow'=0, anchor=west, ...


3

Since it's a tree, I'd suggest you the forest package (adjust the settings according to your needs): \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{forest} \begin{document} \begin{forest} for tree={ grow'=east, l sep=2cm, child anchor=west, parent anchor=east, edge={->,>=latex}} [E [{Finita (Señal de energía $P=0$)}, ] ...


2

The package file diagrams.sty, found on the webpage, does not define \*Link commands, therefore I have used \*Line instead (\dLine and \rdLine). Analyzing the package is a very time consuming task, because the author obfuscated the internal macros. But it seems that the approach of package luacolor works here. It does not insert specials, but sets the ...


1

For those who do not want to use tikz-cd, psmatrix from the pst-node package works fine. An example : \documentclass{article} \usepackage{pst-node} \usepackage{wasysym} \begin{document} $$ \begin{psmatrix}[nodesep = 10pt, colsep=3cm, rowsep=3cm] % % % % \CIRCLE & \CIRCLE\\ \CIRCLE & \CIRCLE % % % % ...


2

TiKZ, of course, is a better solution: Here I use a simple approach with positioning library to automatically place your figure elements. To create the dashed box, fit library again is the best choice. \documentclass{article} \usepackage{amsmath,tikz} \usetikzlibrary{fit,positioning,arrows} \begin{document} \begin{tikzpicture}[>=latex',node ...


2

Two approaches: The first one uses your code (slightly modified) and the tikzmark library from TikZ to place some marks in the diagram; those marks are then used to draw the dashed box (the document needs to be processed twice to stabilize). The whole diagram is drawn using TikZ; I used a chain, but other approaches are possible, of course. Then the fit ...


7

Of course, this diagram is simple enough to be drawn with LaTeX's picture environment without any additional packages: \documentclass{article} \begin{document} \begin{picture}(250, 60)(0, -30) \put(0, 0){\line(1, 0){30}} \put(15, 2){\makebox(0, 0)[b]{$x(n)$}} \put(30, -20){\line(0, 1){40}} \put(30, -20){\line(1, 0){20}} \put(30, 20){\line(1, ...


4

I'd suggest you to switch to the powerful tikz-cd package which was built upon TikZ specifically for commutative diagrams. You can easily control the attributes for every element of yout diagrams: \documentclass{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd} \bullet\ar[d,dash]\ar[dr,red,dash] & \bullet \\ \bullet & \bullet ...


1

Here is a little example, using pgfplots package, you can check the following in the package documentation: Line styles p165, 4.7.2 Line Styles; Nodes p190, 4.9 Axis Description; \documentclass{memoir} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[a4paper]{geometry} \usepackage{pgfplots} \usepackage{vmargin} ...


0

Maybe this helps a little: \documentclass[12pt]{article} \usepackage{newicktree} \begin{document} \begin{figure}[h!] \centering \begin{newicktree} \setunitlength{4cm} \nobranchlengths \nodelabelformat{} \contemporarytips[30] \drawtree{ (((A,B)X,C)Y,D)Z;} \end{newicktree} \caption{Example of phylogenetic tree.} \label{fig:phyltree} ...


2

One line TikZ solution : \documentclass[tikz,border=7mm]{standalone} \usetikzlibrary{graphs} \begin{document} \tikz\graph[nodes=draw, grow right=14mm] { "$g(t)$" -- "System" -- "$y(t)$"}; \end{document}


1

A MetaPost solution, for whom it may interest: input boxes beginfig(1); boxjoin(b.w - a.e = (3cm, 0)); boxit.g(btex $g(t)$ etex); boxit.sys(btex System etex); boxit.y(btex $y(t)$ etex); defaultdx := .75cm; defaultdy := .5cm; drawboxed(g, sys, y); drawarrow g.e -- sys.w; drawarrow sys.e -- y.w; endfig; end.


0

With tikz-cd: % arara: pdflatex \documentclass{article} \usepackage{tikz-cd} \usepackage{mathtools} \begin{document} \[ \begin{tikzcd}[% ,every arrow/.append style=dash ,cells={% nodes={% ,draw ,minimum width = 1.45cm % optional if you want squares ,minimum height= 1.45cm % optional if you want squares ...


2

You can draw this with TikZ as well. Drawing large block diagrams with TikZ is fairly straightforward, moreso than using LaTeX native structures. \documentclass{book} \usepackage{tikz} \usetikzlibrary{calc} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \begin{document} \begin{tikzpicture} \node (g) [draw, minimum ...


9

Below I present three possibilities Using basic boxes: \parboxes and \fbox (without color) or \fcolorbox (with color) nad \hline. Using tikz and chains. Drawing the diagram as a tree with forest. The code A TikZ-free solution: \documentclass{article} \usepackage{amsmath} \newcommand\MBox[2][2em]{% \fbox{\parbox[c][2em][c]{#1}{\centering#2}% }% } ...


2

In case you change your opinion towards TikZ: % arara: pdflatex \documentclass{article} \usepackage{tikz-cd} \begin{document} \[ \begin{tikzcd} G_1 \ar[hook]{rd} & & G_2 \ar[hook]{ld} \ar[hook]{rd} & & G_1 \ar[hook]{ld} \\ & \ar{ld}{a_1} X_1 \ar{rd}{b_1} & & \ar{ld}{a_2} X_2 \ar{rd}{b_2} & \\ A & & B ...


4

Text can not be scaled, consequently it can happens that at scaling which shrink the picture texts will overlapping. A possible solution is that texts a, top pieces and b merge in one node. Nodes with fill will hide dashed lines: \documentclass{article} \usepackage{tikz} \usepackage[active,floats,tightpage]{preview}%for showing just a picture ...


8

Another late addition to the TikZ class. It defines a new plot handler so that you can use the typical TikZ syntax as you have in the question. Hence the syntax goes like \draw plot[convex hull,mark=*] coordinates {(1,1)(2,2)(1,2)(3,3)(4,2)(2,3)(3,2)}; or \draw plot[convex hull,mark=*] plot(\x,{0.05*exp(\x)}); That being said, for some reason, if I ...


1

The \only<>{} command should be followed by a %-sign if you which to hit enter for a new line. A new line is interpreted as a white space in LaTeX. This white space was set in front of your numbers and therefore moved them out of the centre. % arara: pdflatex \documentclass{beamer} \usetheme{Frankfurt} \usepackage{tikz} ...


5

American Institute of Physics journals (I assume JMP means Journal of Mathematical Physics, after google-stalking you) require that graphics submissions be included as separate image files and not inline as TiKZ. If your diagrams are graphics you can follow the advice here; basically you separate out the TikZ part of the document, compile it separately ...


0

Based on @LaRiFaRi answer, however with small differences (to show another possible code): I move tikzset in tikzpicture common features of node I collect in every node/.style instead of fill color white!30 I use white (by the way, what color is white!30?) I reduce node distance to 1cm I add option aspect to diamond shape for reducing it height and brock ...


2

You should use the library positioning and the syntax below = of .... You had some error with the references for the node placement. The figure does not fit on one page, but here you are: % arara: pdflatex \documentclass[12pt]{article} \usepackage[a4paper, margin=1 in]{geometry} \usepackage{tikz} \usetikzlibrary{shapes.geometric, positioning} \tikzset{% ...


1

The TikZ version of the diagram using package pgfplots, which is based on TikZ. Then pdfTeX in PDF mode can also be used to compile the document. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ xmin=-3, xmax=6.5, ymin=-3, ymax=6.5, ...


3

You can compile directly via pdflatex provided: 1) you add the pdf option to the document class (it says to pstricks to load auto-pst-pdf; the pstricks option isn't useful, as the package is loaded by pst-plot; 2) you enclose the pstricks code in a postscript environment (there seems to be some problems with the psgraph environment); 3) you launch pdflatex ...


3

The relative positioning (#3.south east+3mm,#3.south east+3mm) to (#3.north west+3mm,#3.north west+3mm) exists but your syntax is wrong. It should be like this for one coordinate: ($(#3.south east)+(3mm,3mm)$)` and so on. But I'd use only the horizontal shifting, since the vertical will make the arrow look weird. Some notes: Use \newcommand rather than ...


2

You can get a better version of the cooler and heater by introducing an invisible outer circle, and drawing the curved line to the outside of it: \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \tikzset{HeatEx/.style={draw=black,fill=white,thick,circle,minimum width=1cm}} \def\COOLER#1#2#3{\node[HeatEx,right=#1 of ...


8

Using R-knitr with LaTeX to generate convex hulls. \documentclass{article} %% Reference: % https://chitchatr.wordpress.com/2011/12/30/convex-hull-around-scatter-plot-in-r/ % for the R code which is now linked to LaTeX with knitr \begin{document} <<>>= ### Plotting function to plot convex hulls ### Filename: Plot_ConvexHull.R ### Notes: ...


16

Robert Sedgewick's Algorithms in C has a whole chapter on convex hulls; here is the algorithm that he calls "package wrapping" implemented in Metapost. prologues := 3; outputtemplate := "%j%c.eps"; % following Sedgwick, "Algorithms in C", p.364 % make the first M points the hull of the first N points vardef wrap(expr N) = save theta, eta, tx, ty, ...


2

You have some errors in your WME. I only correct them and use article and instead of tufte-handout (I havent instaled it in my MikTeX). Also I comment the babel for the same reason: \documentclass[twoside,symmetric]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} %\usepackage[spanish,mexico]{babel} \usepackage{array} \begin{document} ...


14

TikZ and TeX and something called Graham Scan. The macro \CH does all the stuff but the drawing. You can give it a set of coordinates with the coordinates key which will create named coordinates with the prefix ConvexHullPoint- and saves the number of the coordinate that lies on the hull in \outerPoints, all other are stored in \innerPoints: ...


11

Here's a LaTeX3 and TikZ implementation of Graham's Scan algorithm: \documentclass[tikz]{standalone} \usepackage{xparse,l3sort} \ExplSyntaxOn \seq_new:N \g_convexhull_input_seq \seq_new:N \g_convexhull_hull_seq \int_new:N \g_convexhull_k_int \int_new:N \g_convexhull_l_int \bool_new:N \g_convexhull_stop_bool \cs_generate_variant:Nn \seq_put_right:Nn { Nf ...


15

Here is a TikZ kind of solution. The idea is to obtain cliped region (approximately) equal to the convex hull. For this I rotate the points (the precision is of 1°) and clip the bounding box. \documentclass[tikz,border=5]{standalone} \usetikzlibrary{calc} \tikzset{ point/.style={insert path={node[scale=3,#1]{.}}} } \newcommand\inconvexhull[2]{ ...


3

In the second brace you used these coordinates: (100,80) -- (0,178) But the second couple should be inverted, because in this case it will be 0 on the X axis, and 178 on the Y axis, while it should be 0 on the Y and 178 on the X. Also, remove these options in the braces: mirror, auto, swap, and fix the shifts. In order to change the labels for the extra ...


15

I implemented a convex hull generator in asymptote a while back. It uses the gift wrapping algorithm. As the hull is being generated, the function improves performance by eliminating points that are already inside the hull. path convexHull(pair[] in_pset) { pair[] pset = copy(in_pset); if (pset.length == 0) { path hull; return hull; } { // ...


13

The pst-intersect package does such calculations internally (using the Postscript procedures from http://www.math.ubc.ca/~cass/graphics/text/www/). They can be wrapped inside an own macro \convexhull as follows: \documentclass[margin=12pt,pstricks]{standalone} \usepackage{pst-intersect} \makeatletter \def\convexhull{\pst@object{convexhull}} ...


0

There are many ways to do this. It only gets tricky when the images are not the same size or scale. \documentclass[twocolumn]{article} \usepackage{graphicx} \usepackage{mwe} \begin{document} \begin{figure*}[h] \centering \includegraphics[width=0.47\linewidth]{example-image}\hfil \includegraphics[width=0.47\linewidth]{example-image-a}\par\medskip ...


0

After searching for a very long time, I found out a simple solution using multicols. \usepackage{multicol} \usepackage{graphicx} \begin{document} \begin{figure*} \begin{multicols}{2} \includegraphics[width=\linewidth]{figure name}\par \includegraphics[width=\linewidth]{figure name}\par \end{multicols} \begin{multicols}{2} ...


2

Maybe this? % arara: pdflatex \documentclass[a4paper,12pt]{amsart} \usepackage{tikz-cd} \begin{document} \[ \begin{tikzcd}[row sep=-5pt, column sep=10pt,cells={nodes={draw, circle,font=\tiny, inner sep=2pt, minimum size=24pt}}] 1 \arrow[dash]{dr} \arrow[dashed,bend left=25]{rrr} & &[.8cm] & \ell-1 \arrow[dashed, rounded corners, to ...


3

If you want to get the whole arrow dashed, you will have to switch to tikz-cd: % arara: pdflatex \documentclass{article} \usepackage{tikz-cd} \begin{document} \[ \begin{tikzcd}[every arrow/.append style={dash}] 0 \arrow{dr} & &[.8cm] & 1 \\ & a \arrow{r}[description]{\ldots} & b \arrow{ur}\arrow{dr} & \\ 2 \arrow{ur} & & ...


4

Redox reactions can be typeset using the chemmacros package. The manual has a number of examples. Here is a quick try: \documentclass{article} \usepackage{chemmacros} \begin{document} \ch{ "\OX{o1,Zn}" \sld{} + "\OX{r1,Cu}" {}^2+ \aq -> "\OX{r2,Cu}" \sld{} + "\OX{o2,Zn}" {}^2+ \aq } \redox(o1,o2)[->]{\small oxidation (2 electrons lost)} ...



Top 50 recent answers are included