Tag Info

New answers tagged

1

The picture environment exported from jPicEdt is really peculiar, as it builds a line by placing multiple short segments next to each other; the result is a jagged line. You can resize your picture by changing \unitlength: \documentclass[12pt]{article} \begin{document} \begin{figure}[htbp] \centering \setlength{\unitlength}{2pt} % double the size ...


0

To be honest, I don't know, what is happening with your approach, but would this image be ok for you? % arara: pdflatex \documentclass{standalone} \usepackage[all]{xy} \xyoption{pdf} \begin{document} \xymatrix@!R@!C { & & & & {\bullet} & & & & \\ \\ {\bullet} & & & & {\bullet} & & & & ...


9

Basically, this is using the example of the stackengine documentation, adapted for use in math mode with the addition of \stackMath in the preamble. The routine you want is \stackinset which has 6 arguments, \stackinset{H-anchor}{H-offset}{V-anchor}{V-offset}{inset}{underlying anchor image}. As shown here, it can be nested and the insets themselves can be ...


1

Here's a simple version in plain Metapost. The units are PostScript points: 72 = 1in, 28.35=1cm. prologues := 3; outputtemplate := "%j%c.eps"; input boxes; beginfig(1); % define the boxes boxit.n("Noise"); boxit.f("F0"); boxit.v("VT"); boxit.o("Out"); % place the centres of all the boxes, v.c = origin by implication v.c + 20 up + 75 left = n.c; v.c + ...


2

You can use adjustbox package and its adjustbox environment and to get a caption, use a figure environment: \begin{figure}[htbp] \begin{adjustbox}{max height=0.9\textheight,center} %% adjust max height your tikz code \end{adjustbox} \caption{This is my flow chart} \end{figure} Full code: \documentclass[a4paper,10pt]{article} ...


2

This is a possible solution where a couple of styles is defined for ease of tikz drawing. Code \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning,calc} \usetikzlibrary{decorations.markings,shapes,arrows} \begin{document} \begin{tikzpicture}[->,auto,node distance=3cm,scale=1] \tikzset{point/.style={coordinate}, block/.style ={draw, ...


1

I have added the majority of TeXLive to TeX Writer and with that then the following compile: \documentclass{article} \usepackage[all]{xy} \begin{document} \xymatrix{ A &*+[F]{\sum_{i=n}^m {i^2}} \\ & {\bullet} & D \ar[ul] } \end{document} and \documentclass[10pt, draft]{amsart} \usepackage{pgf} \usepackage{tikz} \usepackage{tikz-cd} ...


6

An attempt where foreach loop to draw lines is used if possible. a line style is newly added. Code \documentclass[a4paper,10pt]{article} \usepackage[margin=1cm]{geometry} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{matrix,shapes,arrows,positioning,chains,calc} \begin{document} % Define block styles \tikzset{ desicion/.style={ ...


3

Asymptote can plot an implicitly defined surface if you insist on doing it that way: settings.outformat = "png"; settings.render = 16; size(8cm); import contour3; currentprojection=perspective(3*(4,-6,3)); real f(real v, real u, real x) { return 4x^3 + 2u*x + v; } draw(surface(contour3(f, (-2,-2,-2), (2,2,2), nx=40)), ...


4

\documentclass[pstricks]{standalone} \usepackage{pst-solides3d} \begin{document} \begin{pspicture}(-4,-6)(5,9) \psset{viewpoint=100 30 40 rtp2xyz,lightsrc=viewpoint, Decran=120} \psSurface[ngrid=.15 .15,incolor=yellow,hue=0 1,linewidth=0.1\pslinewidth, algebraic,axesboxed](-1,-2)(1,2){ 4*x^3 - 2*y*x} \end{pspicture} \end{document} The z max/min ...


8

With help of calc package, make a box of width B with left alignment and put B\cup_A C inside. Do the same for B'\cup_{A'}C'. Here these two quantities protrude to the right, but I hope that is OK. \documentclass{article} \usepackage{xypic,calc} \begin{document} \[ \xymatrix{ & B \ar[rr] \ar'[d][dd]^(.45)\simeq && ...


7

You can actually do this via pgfplots but to make it a little nicer you have to switch to LuaLaTeX since PDFLaTeX chokes up on memory limitations (due to many samples per axis. You don't need that much but why not :P). \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \begin{document} \begin{tikzpicture} \begin{axis}[y domain=-4:4, ...


5

I think what you are asking for it is precisely in ePiX's, (http://bay.uchicago.edu/tex-archive/graphics/epix/samples/butterfly.xp) examples. If I understand the code, the strategy is to draw the surface in three patches. It would be fun to translate this into pgfplots and asymptote. Maybe asymptote can even define this curve implicitly (it is very good at ...


5

With pgfplots and diffrent styles for different sets of numbers \documentclass{report} \usepackage{pgfplots} \pgfplotsset{width=5.5in,compat=1.10} \begin{document} \begin{tikzpicture} \begin{axis}[axis lines=middle, xlabel = $x$, x label style={at={(1.04,0.5)}}, ylabel = $y$, y label ...


2

A PSTricks solution. Run it with xelatex \documentclass[pstricks]{standalone} \usepackage{pst-plot} \begin{document} \begin{pspicture}(-6.2,-5.1)(7,6) \psaxes[dx=2,Dx=200,dy=2,Dy=2000]{->}(0,0)(-6,-5)(6.5,5.5)[$x$,0][$y$,90] \pslistplot[xunit=0.01,yunit=0.001,plotstyle=dots,dotstyle=square*,linecolor=red]{ 100 2000 200 3000 -400 2500 500 ...


4

Another solution for fun with tkz-euclide package: \documentclass{report} \usepackage{tkz-euclide} \begin{document} \begin{tikzpicture} \tkzInit[xmin=-600,xmax=600, xstep=100, ymin=-5000, ymax=5000,ystep=1000] \tkzAxeXY \tkzDefSetOfPoints[prefix=P]{% 100/2000, 200/3000, -400/2500, 500/4200, 200/-1000, ...


1

MetaPost and Asymptote are also very good at this sort of drawing. Here is an attempt with MetaPost, which uses the Metafun format. I've tried to reproduce the initial picture as far as possible, and to make it easy to adapt its parametrization at need. It's to be processed with mpost --mem=metafun --tex=latex file.mp (at least on Unix systems). input ...


3

For example: \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{matrix,shapes,arrows,positioning,chains} \begin{document} % Define block styles \tikzset{ desicion/.style={ diamond, draw, text width=4em, text badly centered, inner sep=0pt }, block/.style={ rectangle, draw, ...


7

\documentclass{article} \usepackage{pst-3dplot} \begin{document} \def\radius{4 }\def\PhiI{20 }\def\PhiII{50 } \def\RadIs{\radius \PhiI sin mul} \def\RadIc{\radius \PhiI cos mul} \begin{pspicture}(-4,-4)(4,5) \psset{Alpha=45,Beta=30,linestyle=dashed} \pstThreeDSphere[linecolor=black!15](0,0,0){4} ...


3

Here's a quick start. It uses the fit library and the node layering styles provided in Andrew Stacey's excellent answer here. The styles lvl1, lvl2, etc. were created quickly (i.e., not matching your example) and can easily be modified to your tastes. Code \documentclass[border=5pt]{standalone} \usepackage{tikz} \usetikzlibrary{fit,positioning} ...


7

Just for fun as usual with PSTricks. \documentclass[pstricks,border=12pt,12pt]{standalone} \usepackage{pst-plot,pst-eucl} \def\f(#1){((#1-1)^2+5)/5} \def\L#1#2#3{\psCoordinates[linestyle=dashed](#1)\uput[-90](#1|0,0){$#2\mathstrut$}\uput[180](0,0|#1){$#3$}} \begin{document} \begin{pspicture}[algebraic,saveNodeCoors,NodeCoorPrefix=N](-2,-1)(7,5) ...


10

My attempt with TikZ. Note that the code can probably be made more compact, but in an attempt to make it as simple to understand as possible, I chose to make it a little verbose. \documentclass[tikz]{standalone} \usepackage{tikz} \usetikzlibrary{arrows} \begin{document} \begin{tikzpicture}[>=stealth', ...


2

An Asymptote solution, that exploits a simpler case of unitcircle as a basis to get the tangential points to the ellipse. The procedure getTangentPoints calculates two tangent points using two input parameters: transform tr, which is used to transform a unitcircle at the origin into the ellipse, and a pair T - coordinates of the point. % % ell.tex : % ...


10

With TikZ it is really easy. I used Plain TeX, so you will need to \input tikz.tex instead of \usepackage{tikz} and instead of \begin{document}...\end{document} you issue \bye at the end of your document. Typeset the following code with pdftex \input tikz.tex \nopagenumbers% for cropping \usetikzlibrary{arrows,intersections} \tikzpicture[ thick, ...


2

A MetaPost example. Much lengthier than it could have been, because I couldn't resist the very attractive challenge of creating macro(s) for drawing the tangents to an ellipse from a given point: unlike for PStricks, these macros are not part of standard MetaPost. Fortunately, programming in MetaPost is easy once you've learned the basics. I've tried to ...


3

Another solution with PSTricks. Just for the sake of reducing the number of keystrokes used in the other existing answers. Features: You can change the number of cells just by changing the number 4 to any positive integer. The code uses minimal number of keystrokes to save more bytes. Go green! The used algorithm is easy to understand but it does not hurt ...


1

A simple tabular: \documentclass{article} \usepackage{array} \begin{document} {\tabcolsep=0pt \begin{tabular}{|*{8}{>{\rule{0pt}{1cm}\rule{1cm}{0pt}}c|}}\cline{2-8} \multicolumn{1}{c|}{}&&&&&&& \\\hline &&&&&&& \\\hline &&&&&&& \\\hline ...


4

A PSTricks solution: \documentclass{article} \usepackage{multido} \usepackage{pstricks} \def\boardsize{8 } % a space after the number is required \begin{document} \begin{pspicture}(\boardsize,\boardsize) \psset{dimen = middel} \multido{\iA = 0+1}{\numexpr\boardsize-1}{% \multido{\iB = 0+1}{\numexpr\boardsize-1}{\psframe(\iB,\iA)(!\iB\space 1 add ...


8

This is easily done with \foreach; see section 56 of the TikZ/PGF manual. \documentclass{article} \usepackage{tikz} \tikzset{chessboard/.style={thick}}% \begin{document} \begin{tikzpicture} \newif\iffirstdiag % Switch to control which corners are ommitted. \firstdiagtrue % (flip the switch here) % \pgfmathtruncatemacro\N{8} ...


5

This solution draw the diagram via tikz. Two styles are defined for blocks and lines respectively. To draw a line, label.anchor is used where anchor=north, south, east, and west. Code \documentclass[border=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{positioning,arrows} \tikzset{ block/.style={ draw, rectangle, minimum height=1.5cm, ...


3

Here is a way to do it "manually." \documentclass{article} \usepackage{amsbsy} \newcommand*{\clap}[1]{\hbox to 0pt{\hss#1\hss}} \newcommand*{\mat}[1]{\boldsymbol{\mathrm{#1}}} \newcommand*{\subdims}[3]{\clap{\raisebox{#1}[0pt][0pt]{$\scriptstyle(#2 \times #3)$}}} \fboxrule=1pt \begin{document} \Huge \[ ...


7

Here I do it with stacks, setting the indices below the boxes. The primary macro is \matbox{rows}{columns}{row index}{column index}{matrix name}. A helper macro is \raiserows, which is like a \raisebox, except that the "length" is specified in rows, not actual length. Note that in the MWE, because X has 7 rows, while P^T only has 2 rows, P^T must be ...


2

This is one possible solution via amsmath package. Code \documentclass[12pt]{article} \usepackage[margin=1cm,paper size={20cm,5cm}]{geometry} \usepackage{amsmath,amssymb} \thispagestyle{empty} \begin{document} \[ {\begin{pmatrix} & & \\ & X &\\ & & \end{pmatrix} \mkern-10mu}_{I \times J}= {\begin{pmatrix} ...


2

A simple solution, using my package xpicture: \documentclass{standalone} \usepackage{xpicture} \begin{document} \setlength{\unitlength}{1cm} \begin{Picture}(-8,-8)(8,8) \cartesiangrid(-7,-7)(7,7) \pictcolor{blue}\Ellipse{2}{3} \pictcolor{red}\Put(3,4){\Ellipse{4}{2}} \pictcolor{green}\Put(-3.5,0){\Ellipse{3.5}{7}} ...


4

With tikz \documentclass[svgnames,tikz,border=10pt]{standalone} \begin{document} \begin{tikzpicture} \draw[very thick, -stealth] (-6,0) -- (6,0); \foreach \x in {-5,-4,-3,-2,-1,1,2,3,4,5}{ \draw (\x,0.2) -- (\x,-0.2) node[below] {\x}; } \draw[very thick, -stealth] (0,-6) -- (0,6); \foreach \y in {-5,-4,-3,-2,-1,1,2,3,4,5}{ ...


3

A similar solution but with fewer packages loaded: \documentclass{article} \usepackage{pstricks-add} \begin{document} \begin{pspicture}(-4.2,-2.2)(4.85,5.7) \psaxes{->}(0,0)(-4.2,-2.2)(4.5,5.3)[$x$,0][$y$,90] \psdot(2,4) \psellipse(0,0)(3,1.5) \psEllipseTangents(0,0)(3,1.5)(2,4) \psset{nodesep = -1cm, linecolor = blue} ...


4

With the powerful forest package: \documentclass{article} \usepackage{forest} \begin{document} \begin{forest} for tree={parent anchor=south, child anchor=north}, s sep=30pt, [ [,draw,text width=3cm,edge label={node[midway,left=4pt]{$0$}}] [,shape=coordinate,edge label={node[midway,right]{$1$}} [,draw,text width=2cm,edge ...


5

With pstricks, quite easily: \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \pagestyle{empty} \usepackage[pdf, svgnames]{pstricks}% \usepackage{pstricks-add} \begin{document} \begin{pspicture} \psaxes{->}(0,0)(-6,-5)(7,5) \psclip{ ...


2

You can do this very simply in plain Metapost. The arrowhead macro takes an arbitrary path as an argument, and returns the path of an arrowhead at the end of the given path. Using appropriate subpath commands you can position an arrowhead anywhere you like along a path. The standard arrowhead produces a rather solid looking arrow, so you might prefer ...


2

Same idea as @Gonzalo, slightly different implementation, and with labels and the ellipsis. \documentclass{standalone} \usepackage{tikz,amssymb} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} %% Horizontal sections % Bottom section \node (-t) at (0,0) {$-t$}; \node (t1) at (6,0) {$t+1$}; \draw (0,.3)--(0,.8) (6,.3)--(6,.8); \draw ...


3

One option: \documentclass{article} \usepackage{amssymb} \usepackage{tikz} \newlength\mylen \setlength\mylen{3pt} \newcommand\Mdot{% \hspace*{2pt}\rule{1pt}{.4pt}\hspace*{2pt}} \newcommand\Mrule[1]{\rule{#1}{0.4pt}} \newcommand\MDot{\Mdot\Mrule{\mylen}\Mdot} \newcommand\MSet{% \rule[-4pt]{.4pt}{8pt}% \MDot\Mrule{3\mylen}% \MDot\Mrule{9\mylen}% ...


5

If you remove the node, you also need to change the paths using that node, so you cannot longer use \draw [->] (y) |- (measurements); \draw [->] (measurements) -| node[pos=0.99] {$-$} node [near end] {$y_m$} (sum); but you can use something like \draw [->] (y) -- ++(0,-2cm) -| node[pos=0.99] {$-$} node [near end] {$y_m$} (sum); The code: ...


6

If I may, given Gonzalo Medina's solution, this proposal provides a complement solution where clip technique within scope environment is used. Note: For those without updated version of the pgfplots package. Code \documentclass[border=10pt]{standalone}%{article} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \pgfmathdeclarefunction{gauss}{2}{% ...


13

One possibility using TikZ for the first row and pgfplots together with its fillbetween library (requires an updated version of the package) for the second row. The third column is left as an exercise: \documentclass{article} \usepackage{pgfplots} \usepackage{subcaption} \pgfplotsset{compat=1.10} \usepgfplotslibrary{fillbetween} ...



Top 50 recent answers are included