# Tag Info

0

I found the solution by removing pdftex and draft from documentclass. \documentclass[12pt,a4paper]{article}

3

You're stating too big a bounding box for the picture; moreover you're forgetting the empty argument for the empty boxes. Note that \Large doesn't take an argument. \documentclass{article} \usepackage{pict2e} \begin{document} \begin{figure} \centering \begin{picture}(90,90) \put(0,0){\framebox(30,30){}} \put(30,0){\framebox(30,30){}} ...

2

Put the picture inside a minipage. This will allow it to be included in a figure environment, which will therefore allow a \caption. \documentclass{article} \usepackage{lipsum} \begin{document} \lipsum[1] \begin{figure}[ht] \centering \begin{minipage}{1.3in} \begin{picture}(185,90) \put(0,0){\framebox(30,30)} \put(30,0){\framebox(30,30)} ...

6

None of the answers here capture the hand drawn look of the original. Here is a Metapost solution that uses mp-sketch to get the hand drawn look. I also use Comic Neue and Euler fonts. Here is the result: \usetypescriptfile[euler] \definetypeface[mainfont][rm][specserif][ComicNeue][default] \definetypeface[mainfont][mm][math] ...

3

And in Metapost, using the subpath operation and the fact that a fullcircle path has 8 "points" on it. prologues := 3; outputtemplate := "%j%c.eps"; beginfig(1); draw (left--right) scaled 1in withcolor .8 white; path c; c = fullcircle scaled 1in; draw subpath (1,3) of c withcolor blue+red; draw subpath (3,5) of c withcolor red; draw subpath (5,7) of c ...

5

It's not possible to change line color in the middle of a line, so four arcs are necessary. \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[very thick,<->] (-6,0) -- (6,0)node[anchor=north west] {$x$}; \foreach \i/\j in {-45/green, 45/purple, 135/red, 225/blue} \draw[very thick,\j] (\i:2cm) arc [start ...

2

To easily get the precise relative positions (which is often quite tedious) and to generate LaTeX code automatically for such example as shown below, you could use the new web-based LaTeX Overlay Generator, which I built for such cases. This is just a small interactive tool, which helps you to find the right locations without using a manual grid-based ...

8

This is not very elegant, but I think it gives the result you are after: \documentclass{standalone} \usepackage{xcolor} \usepackage{tikz} \begin{document} \begin{tikzpicture} \newcommand\rad{2} % circle radius \draw[very thick,<->] (-3,0) -- (3,0)node[anchor=north west] {$x$}; % red \draw[red,thick] (-\rad,0) arc (180:135:\rad); \draw[red,thick] ...

9

Time to use pic \documentclass{article} %\usepackage{xcolor,pict2e}% to allow any radius \usepackage{tikz} \tikzset{pics/myarc/.style args={inner #1 and outer #2}{ code={ \draw[very thick,dashed, #1] (1,0) arc (0:90:1cm); \draw[very thick] (0,1) -- (0,2); \draw[very thick,dashed, #2] (0,2) arc (90:0:2cm); \draw[very thick] (2,0) -- (1,0); ...

9

For whom it may interest, here is a solution with MetaPost and the MetaObj package, inside a LuaLaTeX program. It is based on the s and m parameters which allow to locate the “System” and “Model” boxes, respectively centered at points (s,0) and (s, m). \documentclass[border=2mm]{standalone} \usepackage{luamplib} \mplibtextextlabel{enable} \begin{document} ...

3

Thank you, I ended up mixing both answers from Ignasi and Alenanno as follows: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{arrows, positioning, patterns, calc, decorations.pathmorphing} \begin{document} \tikzstyle{block} = [draw, rectangle, inner sep=6pt, minimum width=2cm, minimum height=1cm, align=center] \tikzstyle{joint} = ...

9

Is this what you were looking for? Fixes: Added a node Measurement positioning it halfway between the nodes System and Model using this syntax: \node ... at ($(system)!.5!(model)$) {};. This requires calc to be added to the Tikz libraries. Changed your diagonal path to \draw [->] (outfork) -| (sum.north) node [very near end] {$$t$$}; so that the node ...

8

You almost did it!. What I've changed from your code: 1- Used \coordinate instead of \node[coordinate]. It's shorter. 2- Used perpendicular coordinates |- -| to better align outputs and also for drawing the perpendicular line from sum. 3- Added + and - as labels to sum. 4- measurement node added at central position from a path starting at symbol and ...

3

Start reading pgfplots manual Section 4.5 \documentclass[tikz]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \addplot[ycomb,scatter] table[x=x,y=y]{ y x 0 0 10 3 20 3 40 8 30 6 }; \end{axis} \end{tikzpicture} \end{document}

2

Two different maneers of doing it with MetaPost, using the boxes and MetaObj package respectively, and producing the same result. Included in a LuaLaTeX program via the luamplib package for typesetting convenience. \documentclass[border=2mm, multi=mplibcode]{standalone} \usepackage{luamplib} \mplibtextextlabel{enable} \begin{document} ...

2

Arrows are optional. Don't forget the cmtip option, as the standard arrow tips of Xy-pic are really horrible. \documentclass{article} \usepackage{amsmath} \usepackage[all,cmtip]{xy} \begin{document} \begin{gather} \begin{gathered} \xymatrix{ V \ar[d] \ar[r] & W \ar[d] \\ \mathcal{C}(G,K)^m \ar[r] & \mathcal{C}(G,K)^n } ...

3

Here are two possibilities, with pst-node and with tikz-cd: \documentclass[pdf]{article} \usepackage{mathtools} \usepackage{pst-node} \usepackage{tikz-cd} \newcommand{\dvarprojlim}[1]{\mathop{\mathstrut\varprojlim\limits_{#1}}} \begin{document} \texttt{psmatrix solution: } $\psset{arrows=->, arrowinset=0.25, linewidth=0.6pt, nodesep=3pt,mnode =R, ... 2 Or like this: % arara: pdflatex \documentclass{article} \usepackage{tikz-cd} \begin{document} \[ \begin{tikzcd} A \arrow{rr}\arrow[loop left, "G_1"] & & B \arrow[loop right, "G_2"] \\ & C \arrow{ul} \arrow{ur} \arrow[loop below, "G_3"] & \end{tikzcd}$ \end{document}

2

Something like this? (With help of this documentation, p. 4, since I'm not very proficient in xy-pic.) \documentclass{article} \usepackage[all,cmtip]{xy} \begin{document} $\xymatrix{ A \ar@(dl,ul)[]^{G_1} \ar[rr] & & B \ar@(dr,ur)[]_{G_2} \\ & C \ar@(dl,dr)[]_{G_3}\ar[ul] \ar[ur] & }$ \end{document} Edit: following ...

3

Here's a solution using TiKZ instead of xypics. The arrows are drawn as circular arcs with modifiable parameters; the location and style for the labels of the group actions can also be varied. Some particular remarks on the code: The group actions are denoted by nearly complete circles (omitting 45° of the turn), whose orientations can be modified by ...

3

You can find a comparison between packages for commutative diagrams in a very nice paper by Gabriel Vicente Feruglio on TUGboat, issued in 1994. According to the bibliography, the first available package (besides using directly picture mode) was the one by John Reynolds, diagmac.sty issued in 1987 and still available as diagmac2 (some patches were ...

7

Just for fun, with Plain TeX: \obeylines\obeyspaces\let =\ \tt\catcode`\_=11 lol _________ c ____________ | |---------------------------->| | | lol | ______ | lol2 |----> thanks! | |-----------> | lol3|-------->| | |________| |_____| ...

4

The final diagram poses no real problem: there are just a few patterns that I called \qL (left), \qR (right), \qM (middle), \qC and \qCC (center); also the modules are denoted with an abbreviation for smallmatrix. \documentclass{standalone} \usepackage{amsmath} \usepackage{tikz-cd} \newcommand{\ind}[2]{% \begin{smallmatrix}#1\\#2\end{smallmatrix}% } ...

9

Try to understand this one. It's just one possibility. \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{positioning,arrows.meta} \begin{document} \begin{tikzpicture}[block1/.style={draw, minimum width=3cm, minimum height=1.8cm}, block2/.style={draw, minimum width=1cm, minimum height=.8cm}, >=Stealth] ...

8

Here's one I made earlier in Metapost. (This was originally written in raw PostScript years ago when my children were learning to tell the time). I've updated it with optional roman numbers. Use it like this to get a stamp of the current time: beginfig(1) draw clock(hour,minute) endfig; or like this to get a page of random clocks for your learner to ...

5

Here's an attempt from the procrastination team in Metapost. It actually turned out to be quite an nice diagram to draw; you just need to specify ell and theta and the radius of the screen as a proportion of ell and the program calculates the other angle required, using a combination of sind, angle and the Pythagorean subtraction operator +-+. I was not ...

5

I'll give you a minimum working example (MWE) because the TeX people might think this is a physics problem :). \documentclass{article} \usepackage{tikz} \usepackage{siunitx} \usepackage{geometry} \geometry{margin=0.75in} \usepackage{nopageno} %The 0.25 is simply a scale factor to make the levels fit. %\n is the level quantum number, \x is a variable whose ...

3

Go colourful with smartdiagram: \documentclass[margin=2mm]{standalone} \usepackage{smartdiagram} \smartdiagramset{circular distance=4cm, font=\normalsize, text width=2.5cm, arrow line width=0.2cm } \newsavebox{\mybox} \savebox{\mybox}{% \smartdiagram[circular diagram]{Insured \\ policy holder,Insurer \\ company} } \begin{document} \begin{tikzpicture} ...

5

Here is something to get you started: Steps: Place the nodes: \node [align=left] (LEFT NODE) at (0,0) {Left \\ Text}; \node [align=left] (RIGHT NODE) at (7,0) {Right \\ Text}; This creates two nodes named (LEFT NODE) and (RIGHT NODE). I used absolute positioning, but for more complicated figures you should use relative positioning. Each \node placed ...

3

JPEG is a quite worse format for drawings. Therefore it is better to redraw the image. The following example uses TikZ. The function is strictly drawn using the parameters f, c, α (\fHeight, \cWidth, \alphaAngle). \documentclass{article} %\usepackage{graphicx} \usepackage{tikz} \usetikzlibrary{arrows.meta} \usetikzlibrary{bending} \pagestyle{empty} ...

17

I like to use styles and the key system of PGF as much as I can, so I made this little solution. I added the PGFmath functions croman and cRoman that take an integer number and output a string (i.e. it can't be used as a mathematical input to another function) in Roman numerals. The c denotes the fact that "IIII" is used instead of "IV". As PGFmath ...

5

This demonstrates how to add labels to lines and how to get the dashed line in the right place. Note that (6.5pt,0.5pt) is not generally the same as (6.5,0.5)! I've also simplified your path specification a bit and removed the non-working option to tikzpicture. midway puts the label halfway, which is wanted for the f and c. pos=.95 puts the label 95% of ...

26

Not claiming to add much in terms of functionality, but just more of an "icon" style clock: \documentclass[tikz, border=5]{standalone} \usetikzlibrary{shadows} \tikzset{shaded/.style args={#1:#2:#3 @ #4}{ left color=#1, right color=#3, middle color=#2, shading angle=#4 }} \tikzset{pics/.cd, clock/.style args={#1:#2:#3}{code={ \tikzset{x=1ex, y=1ex, every ...

14

A try with MetaPost, without much frills, but the result indicates the hour (in roman numerics), minute and second as required :-). Hour, minute and second are given by the user as the three parameters of the clock macro, which draws the analog clock and a rudimentary numeric clock below it. This macro makes use of the freelabel instruction from the ...

33

There is a much simpler sans-seconds solution given in Reproducing an analog clock similar to the one provided by the ifsym package But without bling what does a TikZ answer do good for anyways? \documentclass[border=5mm,tikz]{standalone} \usepackage{PTSansNarrow} \usepackage[T1]{fontenc} \usetikzlibrary{shadows,arrows.meta} \begin{document} ...

29

The hour values are written inside a loop: \foreach \angle / \label in { 0/3, 30/2, 60/1, 90/12, 120/11, 150/10, 180/9, 210/8, 240/7, 270/6, 300/5, 330/4 }{ % ... \draw (\angle:1.4cm) node[scale=#1]{% \textsf{\label}% }; } Macro \label contains the hour number, it can be converted via \romannumeral to lowercase roman numbers and with ...

17

Add these: \foreach \angle [count=\label] in {84,78,...,-270} { \draw[line width=1pt] (\angle:1.9cm) -- (\angle:2cm); \draw (\angle:1.7cm) node[scale=0.25]{\textsf{\label}}; } Full code: \documentclass[dvipsnames]{article} \usepackage{tikz} \begin{document} \newcommand\clock[3]{% \begin{tikzpicture}[line cap=round,line width=3pt] \filldraw ...

5

There are two resources for this that I am aware of, both provided by the TeX Users Group (TUG). The first is their TeX Consulting and Production Services page. There, numerous organizations/individuals have listed themselves as providers of TeX-related services. There is a nominal fee due to TUG in order to be placed on the list. While none of the listings ...

14

A trick which seems to work here: searching the intersection of the curve… and its reverse. Applied with MetaPost. u := 3cm; path curve[]; curve1 = ((0,0)--(3,0)--(2,1)--(1,-1)) scaled u; curve2 = ((0,0) .. controls (5,1) and (0,3) .. (2,-1)) scaled u; def self_intersection(expr curve) = draw curve; drawdot curve intersectionpoint reverse curve ...

1

% arara: pdflatex \documentclass{article} \usepackage{tikz-cd} \usepackage{amsfonts} \begin{document} \begin{tikzcd} & & 0 \arrow{d} & 0 \arrow{d} & \\ 0 \arrow{r} & L(-D) \arrow{r}\arrow[equal]{d} & L ...

3

Here's what I came up with. \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning,shapes,arrows} \begin{document} \centering \begin{tikzpicture}[sharp corners=2pt,inner sep=7pt,node distance=.8cm,every text node part/.style={align=center}] % Draw rectangular nodes (switch sharp to smooth for different corners) \node[draw] (state0){Lecture ...

3

A simple use of the tabbing environment would suffice: \documentclass{article} \begin{document} \begin{tabbing} $X_0_$ \= $\longrightarrow$ \= $X_1$ \= $\longrightarrow$ \= $X_2$ \= \ldots \\ $\downarrow$ \> \> $\downarrow$ \> \> $\downarrow$\\ $Y_0_$ \> \> $Y_1$ \> \> $Y_2$ \= \ldots \\ \end{tabbing} \end{document} This produces: ...

4

With matrix and a horizontal spacing close to the normal one: $$\begin{matrix} X_0 & \hskip-7pt\rightarrow \hskip-7pt& X_1 & \hskip-7pt\rightarrow\hskip-7pt &X_2 & \hskip-7pt\cdots\\ \downarrow & &\downarrow & &\downarrow \\ Y_0 & &Y_1 & &Y_2 & \hskip-7pt\cdots \end{matrix}$$

11

For simple diagrams like these you can use the amscd environment: \documentclass{article} \usepackage{amscd} \begin{document} $\begin{CD} X_0 @>>> X_1 @>>> X_2 @>>> \dots \\ @VVV @VVV @VVV \\ Y_0 @. Y_1 @. Y_2 @. \dots \end{CD}$ \end{document} Right, left, down and up arrows are denoted by @>>>, @<<<, @VVV ...

13

You can use an array, e.g. \begin{array}{ccccccc} X_0 & \to & X_1 & \to & X_2 & \to & \dots \\ \downarrow && \downarrow && \downarrow \\ Y_0 & & Y_1 & & Y_2 & & \dots \end{array} Testing this on http://cdn.mathjax.org/mathjax/latest/test/sample-dynamic.html gives

1

I really haven't a clue what you're after, but here's my best attempt at interpreting: \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}[anchor=north west] \draw (0,0) coordinate (ll1) rectangle ++(3,3) coordinate (ur1); \node[rotate=90] at (ll1) {something up}; \node[rotate=-90] at (ur1) {something down}; \draw (4,2) coordinate ...

4

You can use tikz matrix library. \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \newcommand{\graphics}[1]{\includegraphics[width=2cm]{#1}} \begin{document} \begin{tikzpicture}[ mygrid/.style={matrix of nodes, row sep=-\pgflinewidth, column sep=-\pgflinewidth, nodes={minimum size=1cm}, nodes in empty cells}, ] \matrix ...

Top 50 recent answers are included