Tag Info

New answers tagged

1

Here is my version also using tikz-cd: % arara: pdflatex \documentclass{article} \usepackage{tikz-cd} \begin{document} \[\begin{tikzcd} C \ar[shift left=7pt, ""{name=UL, below}]{r}{S} \ar[shift right=7pt, ""name=LL]{r}[swap]{T\vphantom{'}} & B \ar[shift left=7pt, ""{name=UR, below}]{r}{S'} \ar[shift right=7pt, ""name=LR]{r}[swap]{T'} & A\\ ...


3

With stacks. \documentclass{article} \usepackage{graphicx} \usepackage[usestackEOL]{stackengine} \stackMath \def\xtnd{-\kern-5pt-\kern-5pt} \setstackgap{L}{.45\baselineskip} \begin{document} \[C \mathop{\raisebox{1pt}{\Centerstack{ S\\ \xtnd\rightarrow\\ \raisebox{.5pt}{$\scalebox{.8}{$\downarrow$}\scriptstyle\tau$}\\ \xtnd\rightarrow\\ T}}} B ...


3

A solution using MetaPost could look something like this: u:=1.8cm; % Horizontal scale s:=6pt; % shift from letters h:=10pt; % height label(btex $C$ etex, (0,0)); label(btex $B$ etex, (u,0)); label(btex $A$ etex, (2u,0)); drawarrow ((s,0)--(u-s,0)) shifted (0,-h); drawarrow ((s,0)--(u-s,0)) shifted (0,h); drawarrow ((u+s,0)--(2u-s,0)) shifted (0,-h); ...


3

I think you can use tikz-cd for this kind of diagrams. For example, use \documentclass[preview,border=1pt]{standalone} \usepackage{tikz} \usepackage{tikz-cd} \begin{document} %% Hint for the positions: L=left, R=right, U=up D=down \begin{tikzcd} C \arrow[bend left=80]{r}[name=LUU, below]{} \arrow{r}[name=LUD]{} \arrow[swap]{r}[name=LDU]{} ...


2

I think you will have the easiest starting if you use TikZ for this. The manual already shows some examples for such things. You will have no problems in finding the packages on CTAN or with choosing the TeX-compiler. As mentioned by percusse, there is already a TikZ front-end for Euclidean geometry which is called tkz-euclide. Here are three examples I ...


1

% arara: pdflatex \documentclass{article} \usepackage[all,cmtip,2cell]{xy} \usepackage{mathtools} \usepackage{tikz-cd} \begin{document} \UseTwocells \[ \xymatrix{z & y\ltwocell_{f}^{g}{^\alpha} & x\ltwocell_{f'}^{g'}{^\beta}} = \xymatrix{z & & y\lltwocell_{f\cdot f'}^{g\cdot g'}{^\mathrlap{\alpha\circ\beta}}} \] \[ \begin{tikzcd} z ...


3

This one goes by macro that takes 5 arguments, especially the L shape can have different vertical and horizontal lengths, which are controlled by #2 (negiative for going down) and #3. The text is defined by a stuff style that has a fixed length. #1=starting point, #2=vertically down length, #3=length of L, #4=end point, #5=stuff label. Code ...


11

Concision at the expense of clarity and/or generalisability (if that is actually a word): \documentclass[tikz,border=5]{standalone} \begin{document} \begin{tikzpicture}[>=stealth,every node/.style={text depth=0cm}, every label/.style={label distance=0.75cm, text=red, inner sep=1cm/16}] \foreach \i [count=\j, count=\k from 0] in {5,7,9,11}{ \node ...


9

I would go with a matrix. \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \tikzset{ table/.style={ matrix of nodes, row sep=-\pgflinewidth, column sep=-\pgflinewidth, nodes={rectangle,text width=4.5em,align=center,inner sep=0pt}, text depth=1.25ex, text height=2.5ex, nodes in empty cells }, } \begin{document} ...


2

Another way is to use the psmatrix environment, from pst-node. The objects are firstdescribed as nodes in a matrix, then the arrows are described. In this description, nodes can be given a name, or are described by their pair of indices i, j in the matrix. See documentation of pst-node for details on how to connect nodes or more generally how to fine-tune ...


3

This should do: \documentclass[border=5mm,tikz]{standalone} \usepackage{tikz} \usetikzlibrary{calc,positioning} \begin{document} \begin{tikzpicture}[ x={(5cm,0cm)},y={(2cm,-1.4cm)},z={(2.2cm,3.1cm)},scale=0.8, Dot/.style={circle,fill=black,inner sep=2pt, pin distance=0pt}, ...


0

Just for fun with TikZ. \documentclass[tikz,border=12pt,12pt]{standalone} \begin{document} \begin{tikzpicture} \draw (-3,0) -- (-3,-5) (3,0) -- (3,-5); \node at (-3,.3) {Client}; \node at (3,.3) {Server}; \draw[->] (-3,-1) -- node[midway,above] {Hey} (3,-1); \draw[<-] (-3,-2) -- node[midway,above] {You} (3,-2); \end{tikzpicture} ...


0

A PSTricks solution: \documentclass{article} \usepackage{pstricks-add} \begin{document} \begin{pspicture}(4.85,6.4) \psline(0.4,0)(0.4,6) \uput[90](0.40,6){client} \psline(4.4,0)(4.4,6) \uput[90](4.4,6){server} \psline{->}(0.4,5)(4.4,5) \uput[90](2.4,5){TextA} \psline{<-}(0.4,4)(4.4,4) \uput[90](2.4,4){TextB} \end{pspicture} ...


2

You can use a second \addplot+ command to add a second meta entry. Use color=black istead only draw=black to get black stars and error bars. Use ymax=1.05 to enlarge the y axis a little bit. \documentclass[margin=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \usepackage{filecontents} \begin{filecontents}{data1.dat} X Y Y_error Label ...


8

Next time please provide a minimal working example (MWE). This should be the starting point. \documentclass[tikz]{standalone} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \coordinate (a) at (0,0); \coordinate (b) at (0,1); \coordinate (c) at (1,0); \coordinate (d) at (1,1); \draw (a) -- (b)node[pos=1.1,scale=0.25]{Client} ...


3

The short answer is that if you add baseline=(current bounding box.center) to your tikzpicture environments then they will be vertically centered around their midpoint with the result that your equation should be properly aligned. In fact, with your example this does not quite work because you are typsetting this in an unusual way. First, displayed ...


2

By defining a basic block style and using nodes alignment, this is one possibility. Code \documentclass[border=15pt]{standalone} \usepackage{tikz} \usepackage{graphicx} \usetikzlibrary{positioning,arrows,calc} \tikzset{block/.style = {rectangle, draw,fill=blue!10, text width=5cm, minimum height=0.5cm}, } \begin{document} \begin{tikzpicture} \path (0,0) ...


3

Just to recapitulate the discussion that arose underneath Thruston's answer, here's a somewhat hacky approach to drawing momentum arrows next to lines in Feynman diagrams. The command \marrow, essentially a combination of \fmfcmd (definition of a new style) and fmf (drawing an arrow with this style) is defined with 5 arguments: ...


7

Ornament Just for fun with PSTricks. The package psvectorian is not included in TeXLive so you need to download it from http://melusine.eu.org/syracuse/pstricks/vectorian/ and install it. Unfortunately, the manual in English is not available. \documentclass[pstricks,border=12pt]{standalone} \usepackage{psvectorian} ...


3

If you don't mind switching to plain Metapost syntax, and making your graphic into an external file, you can import the feynmp definitions and use them in a regular MP diagram. This provides a simple way to do diagrams with layouts that the standard bits of feynmf don't support. Here's my first attempt at what you describe above. which was produced ...


4

This is another attempt. CODE \documentclass[border=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{shapes.multipart,arrows, fit,positioning} \tikzset{block/.style = {rectangle, draw, text width=4cm, text centered, rounded corners, minimum height=2.5cm}, block2/.style = {rectangle, draw, text width=4cm, text centered, minimum height=2.5cm}, ...


5

Maybe this will help you. This is the most flexible way to do it. Probably there are many TikZ packages for drawing diagrams like this that require less code, but you won't have this flexibility. Here you can change everything (coordinates, shapes, arrow types, colors, positions, ...). Most of the code is just copy/paste/change attributes. ...


0

As proposed by egreg, a more modern package would much easier for such things. The currently best package to learn should be tikz-cd (my recommendation). Here is your diagram using this. % arara: pdflatex \documentclass{article} \usepackage{tikz-cd} \usepackage{amsfonts} \begin{document} \begin{tikzcd} ...


1

Just for completeness, with the venerable picture mode (no extra packages required): \documentclass{article} \usepackage{amssymb} \newcommand\mycenter[1]{\makebox[0pt][c]{#1}} \newcommand\mylabel[1]{\parbox[c][1cm][c]{3cm}{#1\strut}} \begin{document} \setlength{\unitlength}{1cm} \begin{picture}(8.5,3)(-1,0) \put(0,1){\line(0,1){1}} ...


1

A PSTricks solution: \documentclass{article} \usepackage{amssymb} \usepackage{pstricks} \def\Prime#1{\mathfrak{#1}} \def\something(#1)#2#3[#4,#5]{ \psline(#1,0)(#1,2) \uput[270](#1,0){$#2$} \uput[90](#1,2){$#3$} \uput[0](#1,1){\shortstack[l]{#4\strut\\[-0.75ex] #5\strut}} } \begin{document} \begin{pspicture}(-0.1,-0.5)(7,2.5) ...


2

A tikz-cd solution: % arara: pdflatex \documentclass{article} \usepackage{tikz-cd} \usepackage{amsfonts} \usepackage{mathtools} \begin{document} \begin{tikzcd}[every arrow/.append style={dash}, row sep = 8ex, column sep = {6em,between origins}] L \arrow{d}{\text{\oalign{finite\cr extension}}}& \mathfrak{P} ...


1

In addition to egregs answer, one could use the package tikz-cd for this: % arara: pdflatex \documentclass{article} \usepackage{tikz-cd} \begin{document} \[ \begin{tikzcd} W \arrow{r}{\phi} \arrow[shift right, swap]{d}{a}& X \arrow[shift right, swap]{d}{c}\\ Y \arrow{r}{\phi} \arrow[shift right, swap]{u}{b} & Z \arrow[shift right, swap]{u}{d} ...


4

In Metapost, you can shade an annulus by filling the outer circle with the shade and then filling the inner circle with the background. Here's an attempt at your figure, which might give you a starting point. prologues := 3; outputtemplate := "%j%c.eps"; beginfig(1); path c, d, r, h; p = 89; q = 34; c = fullcircle xscaled p yscaled q; d = c scaled ...


6

Something like \documentclass{article} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{positioning,arrows.meta,calc} \begin{document} \begin{tikzpicture}[>=Latex] \begin{scope} \node[circle,draw] (A) at (0,0) {A}; \node[right=7mm of A,circle,draw] (C) {C}; \node[right=7mm of C,circle,draw] (E) {E}; \node[below=12mm of C,draw,inner sep=1ex] (Twin ...


3

You can use \tikzset{inststyle/.append style={ drop shadow={top color=gray, bottom color=white}, rounded corners=2.0ex } to change the style of the \newinst. Here it is shown applied only to the Browser: Notes: I don't know the official pgf-umlsd way to wrap the text, but using a \parbox sure works. I added the \tikzset within a ...


5

You can add preaction={draw=white, line width=5pt} to the \addplot [...] options to get a white outline: \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ ybar, axis background/.style={fill=gray}, axis on top ] \addplot [fill=yellow, draw=black, very thick, preaction={draw=white, ...


11

Illustrating the "multiple arrows" requirement by exploiting the show path construction decoration and the calc library: \documentclass[tikz, border=5]{standalone} \usetikzlibrary{decorations.pathreplacing,calc,arrows.meta,angles,quotes} \tikzset{% multi arrows/.style args={#1 with #2 sep}{ decoration={show path construction, lineto code={ ...


10

This is one possible solution. Code \documentclass[border=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{quotes,angles,shapes,arrows,positioning,} \begin{document} \tikzset{>=triangle 45} \begin{tikzpicture} \draw[dashed] (-3,3) coordinate (a) node[right] {a} -- coordinate[pos=0.2,left](p1) (0,0) coordinate (b) node [left] {} ...


5

Only new thing is the use of bending library to have bent arrow head. \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{decorations.markings} \usetikzlibrary{arrows.meta,bending} \begin{document} \begin{tikzpicture} \draw[dotted] (-4,-3) grid (4,7); \draw[thick] (0,0) ellipse (2cm and 0.5cm); ...


3

An easy way to plot a spiral is to use parametric equations, i.e., t = [0..2*n*pi] x = sin(t) y = cos(t) z = t Very naively speaking, in this form, n indicated the number of spiral rounds and x,y coordinate is actually a circle. By providing some coefficient to the equation one can make conical spirals or generate clockwise/counter-clockwise spirals. I ...


1

A PSTricks solution, combined with expl3: \documentclass{article} \usepackage{pstricks-add} \usepackage{expl3} \ExplSyntaxOn \cs_new_eq:NN \calc \fp_eval:n \ExplSyntaxOff \begin{document} \def\Horizontal{5} % length of the horizontal line segments \def\Vertical{3} % length of the vertical line segment \def\Indent{0.5} % indentation of the arrow ...


4

Is this the desired result: Notes: If you don't want arrow heads on the end of lines, either change the style to every path/.style={-} or simply eliminate that option as I have done below. Lines do not get arrow heads be default. The style of the arrow that you desire is -latex. So, just add that option when needed (as is the case for the orange line). ...


2

Here is an alternative solution with TikZ but without PGFPlots. The basic idea is the same as in Fritz's answer: rotate and shift. The parametrization is such that the user specifies the ratio of a to c (\acRatio), where c is half the distance between the foci and a is half the fixed difference of distances from a given point of the hyperbola to the two ...


4

There is actually a (more or less) easy way to do this. You simply take the standard parametrization of a hyperbola which is centered around the origin and then rotate and shift it so that the foci lie in the desired position. The only problem is that applying affine transformations on PGFplots coordinates is not build in, but thankfully the question How ...



Top 50 recent answers are included