Tag Info

New answers tagged

8

This is an attempts where pics skill is used, requiring tikz 3.0 Code \documentclass[border=10pt]{standalone}%[12pt,twoside,a4paper]{book} \usepackage{graphicx,wrapfig,tikz} \usetikzlibrary{positioning,shapes} \tikzset{myarrow/.pic = { \begin{scope}[rotate=-90,scale=0.5] \draw[fill=black] (-0.5,0) -- (0,0.5)--(0.5,0)--(0.5,1)-- ...


1

This demonstrates left and right shifted images with captions aligned with both the text and with the images. \documentclass{scrartcl} \usepackage{scrextend} \usepackage{geometry} \geometry{ top=3.5cm, bottom=3.5cm, outer=6cm, inner=2cm, heightrounded, marginparsep=0.8cm, marginparwidth=4.7cm, twoside=true, ...


0

I finally came up using the following code with some examples how to set up the pictures and captions: \documentclass{scrartcl} \usepackage{scrextend} \usepackage{geometry} \geometry{ top=3.5cm, bottom=3.5cm, outer=6cm, inner=2cm, heightrounded, marginparsep=0.8cm, marginparwidth=4.7cm, twoside=true, hmarginratio=1:1 } ...


6

You can prepare your diagrams using TikZ, but you ought to convert them to EPS afterwards. It's best to have them as seperate standalone files. For more information, see: Export eps figures from TikZ 'Standalone' TikZ pictures But the basic idea is the following: Prepare your figures using the standalone class, for example: ...


2

Nice work on your solution! Someone may come along with a better way to do this, but I've taken your code, added the page numbers, and solved the page height problem. I also added a conditional for the last page, to check if it was already printed as part of the last double-page spread. For my example, I used the biblatex manual which should be available ...


9

The following is intentionally made simple without labels just for fun with PSTricks. \documentclass[pstricks,border=12pt,12pt]{standalone} \usepackage{pst-eucl,pst-plot} \pstVerb{realtime srand} \psset { algebraic, saveNodeCoors, NodeCoorPrefix=N, PointName=none, PointSymbol=none, } ...


19

I decided to post this answer for several reasons: This picture gives me the opportunity to show some useful options for users of TikZ. I defined customizable macros for: Dimensions of the tank \tankwidth, \tankheight and \waterheight. This allows to change them without affect the picture (without exaggeration); I defined a color for the water to allow ...


20

\documentclass[tikz,border=5]{standalone} \usetikzlibrary{decorations.pathmorphing} \usepackage[detect-all]{siunitx} \tikzset{ ragged border/.style={ decoration={random steps, segment length=1mm, amplitude=0.5mm}, decorate, } } \begin{document} \begin{tikzpicture} \fill[cyan!30] decorate[ragged border]{ (0,2) -- (6,2) ...


1

Here's an attempt in plain Metapost, using two of the built-in transformation commands: rotated t and reflectedabout(p,q). prologues := 3; outputtemplate := "%j%c.eps"; beginfig(1); % define the image of the F to transform s = 16; picture f; f = image(fill fullcircle scaled s; label("F" infont "cmss10" scaled 1.2,origin) withcolor white;); % define ...


6

And just for comparison, here is a version in Metapost, using the boxes library, as described in Drawing Boxes with Metapost. The main item of interest here is how to get the boxes drawn with white text on a blue background: you can't use the provided drawboxed command, because this does not let you specify a colour, so I've used the bpath and pic commands ...


13

On the one hand, TikZ is very powerful and comprehensive, on the other hand, it is very hard to find solutions for concrete tasks. In addition, there are often many ways to realize graphics. I tried to use you existing code and added the code you need to draw the given graphic. Most things should be clear. Maybe I am wrong, but it seems that you don't have ...


2

A free of charge answer with PSTricks. Compile it with xelatex for your convenience or with latex->dvips->ps2pdf for my convenience. Option 1 \documentclass[pstricks,border=12pt,12pt]{standalone} \usepackage{pst-eucl} \begin{document} \begin{pspicture}(-5,-5)(5,5) \psline(-5,0)(5,0) \psline(0,-5)(0,5) ...


3

Try this quick solution: \documentclass[12pt,border=0.125cm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[line width=0.7pt,p/.style={circle,fill,inner sep=1.5pt}] \draw (1,0)node[yshift=-1cm]{$\mathcal{R}(A)$} -- (9,0)node[yshift=1cm,left]{$Ax_{1s}$} (5,4)--(5,-4) (1,-2)--(9,2); \draw [dashed](7,1)node[p]{}--node[right]{$r$} ...


4

I don't know what kind of a surface rendition you have in mind but you can do it in pgfplots, say, via surfaces. \documentclass[border=2mm]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[domain=0:1, y domain=0:1,samples=20,no marks] \addplot3+[surf,colormap/blackwhite](x,y,{(x < y^2?1:0)}); \end{axis} ...


3

This one is just a modification of percusse's answer, to use loops instead of having big chunks of code: \documentclass[border=3mm]{standalone} \usepackage{pgfplots} % Unit circle plot style \pgfplotsset{unit circle/.style={width=4cm,height=4cm,axis lines=middle,xtick=\empty,ytick=\empty,axis ...


4

Unit balls so why not pgfplots? \documentclass[border=3mm]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[axis lines=middle,xtick=\empty,ytick=\empty,axis equal,enlargelimits,xmax=1,ymax=1,xmin=-1,ymin=-1] %p=0.5 \begin{scope}[very thick,dotted,orange,domain=0:pi,samples=50] \addplot[] ({(cos(deg(x)))^(4},{ ...


7

This is another boring after noon with some free time. To explain code, it will be terribly boring though! \documentclass[tikz,border=3mm]{standalone} \begin{document} \begin{tikzpicture} \draw [<->] (-4,0)--(4,0); \draw [<->] (0,-4)--(0,4); \draw[blue] (-3,0) -- (0,3) -- (3,0) -- (0,-3) -- (-3,0); \node at (0,-4.5) {$p=1$}; \end{tikzpicture} ...


5

Each directory path should be in its own set of braces. But what you seem to have done here is put each part of the path in its own set, which won't work. Assuming you want to set one directory which is C:/Users/Me/Desktop/ then your command should be \graphicspath{{C:/Users/Me/Desktop/}}.


3

If you put this line between two blocks of code \tikzset{every node/.style={draw}} this is what you would see You can see that all of them have extra spacing around the math text inside them. This is because the tikzpicture options you have provided minimum width = 3em, minimum height = 3em applies to everything unless you override them. One option ...


6

You have set a node size with a minimum of 3ems in both width and height within the whole tikzpicture environment while this should only be associated with the main node/.style. Here is what I mean: \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows} \begin{document} \begin{tikzpicture}[>=stealth',shorten >=1pt,auto, thick, main ...


1

it works better with: \node at (0,0) {\includegraphics[width=2cm]{your picture}};


2

This is an attempt where matrix of nodes is used. The text may need some corrections because some of them are hard to read. Code \documentclass[tikz,border=1cm]{standalone} \usetikzlibrary{matrix, shapes, arrows,calc, positioning} \begin{document} %\begin{figure} %\begin{center} \tikzset{% blockA/.style = {rectangle, draw, text width=6cm, ...


2

You can do it with pgfplots. Here is an example: \documentclass{article} \usepackage{pgfplots,siunitx} \pgfplotsset{width=7cm,compat=1.10} \begin{document} \begin{tikzpicture} \begin{axis}[enlargelimits=false,axis on top,xlabel = Displacement (\si{\milli\meter}), ylabel = Load (\si{\kilo\newton})] \addplot graphics ...


2

As @OSjerick suggested in the comments, do have a look at the LaTeX templates for that sort of task. If though you insist on 'doing things yourself', take this as a guide: \documentclass[12pt]{article} \usepackage{graphicx} \usepackage{hyperref} \usepackage{mwe} \begin{document} \begin{figure}[htbp] \begin{minipage}[c]{0.6\textwidth} ...


2

My own attempt After some trial and error, this is my current attempt so far: \documentclass{article} \usepackage[a4paper,margin=2cm]{geometry} \usepackage{graphicx} \usepackage{multido} \def\filename{test.pdf} \def\scale{.05} \pdfximage{\filename} \newcount\N % counter for the last doublepage spread \N=\pdflastximagepages\relax \advance\N by -1\relax ...


3

I shamelessly stole from esdd's answer and just changed the design a little bit to make it look less cluttered. \documentclass[margin=10pt]{standalone} \usepackage{amsmath} \usepackage{pgfplots} \pgfplotsset{compat=1.3} \newcommand\clipright[1][white]{ \fill[#1](current axis.south east)rectangle(current axis.north-|current axis.outer east); ...


3

My suggestion is Code: \documentclass[margin=10pt]{standalone} \usepackage{amsmath} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \newcommand\clipright[1][white]{ \fill[#1](current axis.south east)rectangle(current axis.north-|current axis.outer east); \pgfresetboundingbox \useasboundingbox(current axis.outer south ...


3

If I understand it correctly the histogram bins are overlapping and you want to fix that. My solution is to adjust spacing of each symbolic coordinate rather than adjusting the bin width. One solution is to use the x=<dimension> key. It requires some fiddling around with the appropriate dimension; most histograms in fact don't use this compact way of ...


1

And here's a simple approach with Metapost to extend the set of solutions. prologues := 3; outputtemplate := "%j%c.eps"; beginfig(1); % define a unit size u := 1cm; % define the paths and point we need % the y = sqrt(x) curve path f; f = (origin for x=0.1 step 0.1 until 6: .. (x,sqrt(x)) endfor) scaled u; % the axes path xx, yy; xx = (0,-u/2+ypart ...


1

Since inkscape can export figures as .tex file, it has to put all relevant drawing information as \LaTeX commands, such it needs additional packages as xcolor etc. Since this exported figure can be included basically anywhere inside of a document via \input, the relevant packages must be loaded of course in the preamble of the document, not in the document ...


7

Here are some definitions of three different node set styles to get the aspect of the images you posted: The code: \documentclass[varwidth]{standalone} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{% decorations.pathreplacing,% decorations.pathmorphing,% arrows, arrows.meta, positioning, shapes, shadows, ...


9

An option using the tikzmark library: The code: \documentclass{article} \usepackage{xparse} \usepackage{tikz} \usetikzlibrary{tikzmark} \usepackage{amsmath} \NewDocumentCommand\MyInfo{O{(0,0)}O{}mmm}{ \begin{tikzpicture}[remember picture,overlay,#2] \node[pin=#4:{\parbox{5cm}{\raggedright #5}}] at ([shift={#1}]pic cs:#3) {}; \end{tikzpicture}% } ...


9

Just a template with PSTricks. The remaining trivial parts are intentionally left as your exercise. \documentclass[preview,border=12pt,12pt]{standalone} \usepackage{pst-node} \usepackage{amsmath} \newsavebox\IBox \savebox\IBox{\psscalebox{2}{\raisebox{\depth}[\totalheight]{$ ...


6

An easy-to-customize template with PSTricks. \documentclass[pstricks,border=0pt,12pt,dvipsnames]{standalone} \usepackage{amsmath} \usepackage{pst-plot,pst-eucl} \usepackage[nomessages]{fp} \FPeval\XMin{0} \FPeval\XMax{9} \FPeval\YMin{0} \FPeval\YMax{4} \FPeval\XOL{0-1/2} % of DeltaX \FPeval\XOR{1/2} % of DeltaX \FPeval\YOB{0-1/2} % of DeltaY ...


2

Just for typing exercise with PSTricks. Option 1 \documentclass[pstricks,border=12pt,12pt,dvipsnames]{standalone} \usepackage{pgfmath} \usepackage{pst-node} \psset{unit=5mm,dimen=m,shortput=nab,arrows=|*-|*} \begin{document} \begin{pspicture}[showgrid=false](-2,-2)(15,12) \psframe(15,10) \pcline[offset=-1](0,0)(15,0)\ncput*{$15$} ...


9

Use pgfplots: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines=middle, clip=false, ymin=0, xticklabels=\empty, yticklabels=\empty, legend pos=north west ] \addplot+[mark=none,samples=200,unbounded coords=jump] {sqrt(x)}; \legend{$y=\sqrt{x}$} \draw[fill] (axis cs:4,0) circle ...


3

One possibility: The code: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[x=.5cm,y=0.5cm,>=latex] \def\RWd{15} \def\RHt{10} \def\CutSide{30pt} \draw (0,0) rectangle (\RWd,\RHt); \path[draw,fill=cyan] (0,0) rectangle ++(\CutSide,\CutSide) (\RWd,0) rectangle ++(-\CutSide,\CutSide) (0,\RHt) rectangle ...


5

A recommended solution (by me) with PSTricks. \documentclass[pstricks,border=12pt,dvipsnames]{standalone} \usepackage{pst-eucl} \begin{document} \begin{pspicture}[showgrid=false](-5,-2)(5,5) \pstGeonode[PosAngle=-90] (0,0){O} (5,0){A} (-5,0){B} (-2,0){P} \begingroup \psset{PointName=none,PointSymbol=none} ...


6

No arcs but with circles and clip. \documentclass[tikz,border=5mm]{standalone} \begin{document} \begin{tikzpicture}[font=\footnotesize] \begin{scope} \clip (-3.1,-0.5\pgflinewidth) rectangle (3,3.1); \filldraw[fill=blue] (0,0) circle (3cm); \filldraw[fill=white] (1,0) circle (2cm); \filldraw[fill=white] (-2,0) circle (1cm); \end{scope} \draw ...


14

You can also draw that path at one go so you don't need to fill white to restrict the fill if you have something else underneath it. And while you are at it you can also place the labels and coordinates too. \documentclass[tikz,border=5mm]{standalone} \usetikzlibrary{decorations.pathreplacing} \begin{document} \begin{tikzpicture} \filldraw[fill=blue] (0,0) ...


9

Here is a quick attempt: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[fill=blue] (0,0)node[below]{$A$} arc (0:180:6) node[below]{$B$}; \draw (-12,0) - -(0,0); \draw[fill=white] (-8,0) arc (0:180:2); \draw[fill=white] (0,0) arc (0:180:4)node[below]{$P$}; \draw (-6,-0.1) -- node[below]{$O$} (-6,0.1); ...


2

In phasors, the electrical quantities are represented by a magnitude and an angle. The symbol for the angle is not the same as the inline traditional division symbol, but \angle is used in math mode for this. For example for an R-L circuit with V and I can be expressed as follows: \documentclass[12pt,a4paper]{article} \usepackage{amsmath} ...


3

If it is simply a diagram, you can use a tabular. \documentclass{article} \newcommand\Phasor[2]{% \setlength\tabcolsep{2pt} %% change 2pt suitably \begin{tabular}{c|c} #1 & #2 \\\cline{2-2} \end{tabular} } \begin{document} This is \Phasor{a}{b} well a phasor. \end{document} Certainly one can use tikz but, for a change, I would not present ...


0

Here's a Metapost approach. There are no path morphing "decorations" defined in plain MP, so I've supplied a function called sinuous that returns a sine-wavy copy of a given path. It should work nicely on curved paths too. prologues := 3; outputtemplate := "%j%c.eps"; s_lambda = 6; % the length of the waves s_amplitude = 2; % their height vardef ...


0

Here's a simple approach in plain Metapost using the convenient direction .. of .. construction. To get an ellipse I've used fullcircle xscaled xx yscaled yy, and I've exploited the fact that there are 8 points on its path (with point 0 at 3 o'clock and point 4 at 9 o'clock). I have defined four ellipses, but two of them are left invisible. prologues ...


1

Another solution with tikz, as requested. The problem with the linked answer is that the arguments to the atan function in the pgf low-level layer have been reversed. Switching the arguments inside the wavy semicircle definition solves that issue. Code for the styles borrowed from here. \documentclass{standalone} \usepackage{tikz} ...


2

Asymptote MWE The endpoints p and q are defined as points on the bottom and top curve located at a fraction of the total curve length (arclength) along the curve, then the function drawEll is used to transform the unitcircle in order to place it between p and q. el.asy: import graph; import fontsize; size(6cm); defaultpen(fontsize(9pt)); pen ...


2

A non-GUI option is GLE. It can be a little hard to use but for publication-quality data-driven graphs you can't really beat it. Here's a motivating example. I'm not sure how you'd create something like this that looks as good in any other package. It's possible in IPE but it can be tedious if you change the data and have to manually update the graph; with ...


6

This an attempt with tikz skills --- \draw let ... in ... command. The tube is constructed via 2 segements(blue and red) through [bend left] and [bend right] curves. Use pos=xx to determined the ellipse contact points, which is labelled as (a) and (b) respectively, then compute the distance to determine the long radius, the short one is 0.3 times the ...


5

To get a better result, the major axes of the ellipse must be normal to both curves. Here I used Mathematica to find numerically the coordinates. F[x_] := x^3/4 + 1; G[x_] := (x - 1/2)^3/5 + 1/6; Plot[{F[x], G[x]}, {x, -2, 4}] Solve[{F'[a] == G'[b], F'[a] == (b - a)/(F[a] - G[b])}, {a, b}] // N Maximal Working Example ...



Top 50 recent answers are included