Tag Info

New answers tagged

0

Right click and "Run as an administrator" will resolve the issue.


3

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)-- ...


0

You could also define an \Arrow command of fixed width and variable style and let the \matrix manage the alignment and column widths instead of doing it manually: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix, arrows} \usepackage{amssymb} \newcommand{\Arrow}[2][->]{% \tikz[baseline=-0.7ex, x=2cm, #1] \path (0,0) edge node ...


3

You are clearly a mathematician or something pretty close since your sentences are always inverted in an (ε, δ) way. You have to read the math backwards but the sentence forwards to decode :P \documentclass[]{article} \usepackage{pgfplotstable} \pgfplotsset{compat=1.10, perf name table/.default=mytable} \pgfplotstableread{ ode23 ode45 ...


1

Thanks to @percusse for pointing me in the right direction to find the solution. Styling column by column is a solution to this problem (altought not as elegant as I expected). The point is to modify each column definition to obtain what I want, so for example column 2/.style={nodes={text width=1.5cm, align=center}} The final code is the following ...


2

You have to use the positioning-library of tikz to position nodes relative to each other. Try the follwing: \documentclass[tikz, border=5mm]{standalone} \usetikzlibrary{calc, positioning} \begin{document} \begin{tikzpicture} \node (p4) {$\hat{4}$}; \node[below=1cm of p4] (p3) {$3$}; \node[right=3cm of p4] (p1) {$\hat{1}$}; \node[below=1cm of p1] ...


2

You must: Add the positioning library. Use \pgfmathparse to calculate the 1/sqrt(2) expresion. Use \pgfmathresult where is the result of calculation. \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc,positioning} \begin{document} \begin{tikzpicture} \node (p4) {$\hat{4}$} ; \node[below=1cm of p4] (p3) {$3$} ; \node[right=3cm of p4] (p1) ...


3

Not sure this is quite what you want, and it is not very friendly looking in some places but most of the parameters (number of tables and seats) are derived automatically from a list of children. It also will not easily generalize to other table layouts, and some "fooling around" will probably be required if the sizes are changed. But anyway... ...


1

When Claudio postet his comment yesterday i tried to reproduce the error at home. I noticed, that the error seems to be related to the software/OS: On Mac OS 10.9 Mavericks with Skim everything looks fine, on 10.10 Yosemite Beta 1, also using Skim, it looks the following when opening the same PDF (compiled on Yosemite) Noticing this, i think it's a ...


4

The more technical explanation is that your step size - the decimal number 0.1 - has no exact binary representation. In binary it has the infinite representation 0.0001100110011..., similar to 1/3 == 0.3333... in decimal. So if you represent 0.1 using a finite number of bits, there is always an error. And that is what you are seeing here. As percusse said, ...


7

It's because whenever you use the ... notation, TikZ performs calculations such as what is the second number 0.2 and what is the first one; 0.1 so what is the step size... Then it does 0.2-0.1 operation to obtain the step size and TeX precision contaminates this result. After that TikZ starts adding the contaminated 0.1 to 0.2 (not 0.1 because these are ...


3

Using fit and backgrounds for avoiding nested tikzpicture. The Zarko's answer is easier than mine but i wanted to illustrate this option. It can be useful in other contexts. \documentclass[tikz]{standalone} \usetikzlibrary{fit,backgrounds} % <- added \begin{document} \begin{tikzpicture}[ inner/.style={draw,fill=blue!5,thick,inner sep=3pt,minimum ...


4

Try: \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}[ inner/.style={draw, solid,% <-- added fill=blue!5,thick,inner sep=3pt,minimum width=8em}, outer/.style={draw=gray,dashed,fill=green!1,thick,inner sep=5pt} ] \node[outer] (A) { \begin{tikzpicture}[node distance=1cm,outer ...


4

And just for comparison, with Metapost. Not a sine or a cosine in sight! prologues := 3; outputtemplate := "%j%c.eps"; beginfig(1); a = 1.414cm; % this controls the scale of the whole figure pi = 3.14159265359; % define the cycloid path c; c = origin rotatedabout((0,a),100) shifted (a*-100/180*pi,0) for t=-99 upto 460: -- origin ...


2

Since the axis environment is postponing evaluation of some things until \end{axis}, the variables \temps and \angle don't exist anymore by then. In that case, you can use \pgfplotsinvokeforeach that immediately substitutes the loop counter for any #1 given in the loop body. The only drawback is that it doesn't support multiple loop variables, so you have to ...


3

This is a solution. Use \tikzset{style files} instead of old fashion \tikzsyle definition. antiwindwp symbol is defined by in a tikz draw macro. D control is added since only PI controllers were shown. Some code lines are removed. UPDATE A quick note. Thanks to Claudio Fiandrino for the 2nd alternative: Use of tikz 3.0 and the following setup ...


3

You can use rounded corners: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} %axes \draw[very thick] (0,0)--(8,0); \draw[very thick] (0,0)--(0,5) coordinate (y); \draw (8,0) node[below] {Energy}; \node [draw=none,rotate=90, yshift=0.3cm] at (0,5) {Counts}; %1st peak \draw[thick,blue,rounded corners=4mm] ...


2

I'm not quite sure what you mean with "extend the two perpendicular to the x-axis lines" but at least drawing a smooth line can be achieved with Bezier curves. On a straight line like (a) -- (b) you can add (multiple) control point(s) x to create a smooth curve with (a) .. controls (x) .. (b) (Taken from here) EDIT: Thanks for editing your question :) let ...


0

TikZ has a relatively new library for drawing graphs and using graph layout algorithms to automatically position the nodes. It includes options for styling the nodes and their labels. Here is a small example. The PGF/TikZ manual has more information. A small tutorial can be found here and a very succinct presentation by Till Tantau here.


7

Here is one attempt using hobby. \documentclass[tikz]{standalone} \usetikzlibrary{hobby,patterns} \begin{document} \begin{tikzpicture} \draw[thick,->] (52,0) -- (60,0) node[anchor=north west] {$x'$}; \draw[thick,->] (56,-04) -- (56,04) node[anchor=south east] {$x_N$}; \node[draw=red,dashed,thick,circle,minimum width=4cm] (n) at (56,0) {}; ...


2

It is not so difficult to create shortcuts for such recurring commands. And you can create and recreate the same color, here is a quick mock-up; you can get the setting you are trying push rgb syntax to and read off the argument of the assignment and place it to a temporary color name. Then use it for the setting of that key. I don't know how often you ...


7

One of the things \ExplSyntaxOn does is giving the colon category code 11 (letter) so it can be used as part of macro names. In coordinates TikZ however expects a colon with category code 12 (other). One solution that works is defining a token list that contains only a : with category code 12 \tl_const:Nx \c_edu_colon_tl { \token_to_str:N : } and then ...


3

Thanks for questioning. Just for fun with PSTricks. \documentclass[pstricks,border=15pt,12pt]{standalone} \usepackage{fp} \FPeval\XMin{0-1} \FPeval\XMax{2*pi+1} \usepackage{pst-plot,pst-node} \psset { algebraic, linejoin=1, labels=none, ticks=none, dimen=m, linecolor=lightgray, linewidth=2\pslinewidth, } \def\x{(t-sin(t))} ...


4

I would definitely stay away from such usage but here the problem is that \pgfmathresult defintion does not survive that long. So its current value needs to be used quickly. Because many drawing commands also use it internally. \pgfmathsetmacro\mytemp{ifthenelse(1,"0.5*",)}; \draw[blue] (0,0)--++(\mytemp1,0); works. Instead much more intuitive and also ...


7

Assuming the parallel lines are orthogonal to the "detector" then the projection modifiers can be used (see "The Syntax of Projection Modifiers" in the manual), which are drawn in blue below. I've left the original dashed lines in for comparison. \documentclass[tikz,border=5]{standalone} \usetikzlibrary{calc} \begin{document} ...


5

For a dirty and quick fix, I would suggest using polar coordinates to keep the lines parallel. Then you can use the second parameter to approximate the needed length to hit the detector: \begin{tikzpicture}[scale=0.5] %target \draw[fill=gray!30,gray!30] (0,3)rectangle(2,-3); %tracks \draw[->,thick] (-2,2)--(0,2); ...


3

I get the same output files with the following test.tex file: \documentclass[]{article} \usepackage{tikz} \usetikzlibrary{arrows,shapes,snakes,automata,backgrounds,fit} \usepackage[pgf]{dot2texi} \newtoks\dtttoks \begin{document} \begingroup \global\dtttoks={} \foreach \x / \y in {0/1,1/2,2/3}{ \edef\temp{a\x\space -> a\y\space [label = ...


9

You have to remove the option overlay from \tikzmark definition first. And second, alter the definition to take the same argument as label and content. Also, if you want circles to have same radius, fix some value for minimum width key. With these it becomes, \newcommand{\mathtikzmark}[1]{\tikz[baseline={(#1.base)},remember picture] \node[draw,circle,inner ...


12

Edit Sorry, I misread the question and thought that you wanted to circle the exponents. Modifying my first solution you can circle the coefficients with: \documentclass{article} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{decorations.text} \newcommand{\tikzmark}[2]{% \tikz[remember picture,baseline=-2pt] ...


7

Since you are getting experienced with TikZ, here is the curve, the rest is up to you \begin{tikzpicture} \draw[->] (0,0) -- (0,3); \draw[->] (0,0) -- (2.6*pi,0); \draw[red,domain=-0.5*pi:2.5*pi,samples=50] plot ({\x - sin(\x r)},{1 - cos(\x r)}); \end{tikzpicture}


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 ...


3

If you add the lines axis on top,% Question 2 axis line style = {very thick,shorten <=-0.5\pgflinewidth}, %Question 1 in your %Axis option section, then you are done.


7

This is now fixed in the version of hobby on CTAN and the change has propagated to TeXLive 14 (I can't say for MikTeX). If you have an older version, see egreg's post.


3

Here is an example with pgfplots. Since v1.10 it provides the fillbetween library, which can be used to fill the area between curves. Since v1.11 you don't need to say axis cs: anymore, for custom annotations such as here. I just use it to fill an area below the ln curve with white, so removing that part from a filled rectangular area to get the desired ...


1

After Mark Wibrows answer i found 3 possible (easy) solutions for my problem: % 1. \node [minimum width=(\col{1})*1cm] {}; % 2. \newcommand{\helper}[1]{(#1)*1cm} \node [minimum width=\helper{\col{1}}] {}; % 3. \tikzset{% minimum widthCM/.style={minimum width=(#1)*1cm} } \node [minimum widthCM=\col{1}] {};


7

Not 100% sure that I understand the intended application but the following (which defines alternative minimum width keys) may be of use: \documentclass[tikz,border=5]{standalone} \tikzset{% minimum width'/.code={% % Only advisable when x and y are orthogonal \pgfpointxy{#1}{0}% \tikzset{minimum width/.expanded=\the\csname pgf@x\endcsname}% ...


6

Use pgfmath and do like this: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[x=1cm,y=1cm] \pgfmathsetmacro{\mw}{1+1} \node [draw,minimum width=\mw cm] {}; \pgfmathsetmacro{\mw}{2+2} \node [draw,minimum width=\mw cm,yshift=1cm] {}; \end{tikzpicture} \end{document} This is for the edit: ...


3

One option is \edef\mw{\number\numexpr 1+1\relax} as in: \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}[x=1cm,y=1cm] \edef\mw{\number\numexpr1+1\relax} \node [minimum width=\mw cm] {}; \end{tikzpicture} \end{document} \edef stands for expandable macro definition, therefore the contents is expananded as \mw is defined. ...


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, } ...


4

A solution with PGFPlots. I made the parameters similar to Paul's post, the differences are I showed \pgfplotsinvokeforeach which is capable of expanding it's argument, not needed here but good to know for the case \foreach would not work \addplot instead of plot directly working with radian instead of multiplying a 180/pi factor, a new feature of pgfplots ...


0

The code below solves the OPs problem. The trick is to let tikz place the nodes and then to add the labels for the nodes afterwards. To place the nodes in the requested order I use the datatool package to sort the nodes according to height before printing their labels. For the OP's two examples the output is: As I understand the question, the labels in ...


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

\documentclass[tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usetikzlibrary{plotmarks, calc, intersections} \usepackage{amsmath} \newlength{\radius} \begin{document} \begin{tikzpicture} \begin{axis}[% width=10cm, height=10cm, axis x line = middle, axis y line = middle, scale only axis, xlabel={x [mm]}, ...


3

Comparison matplotlib's PGF backend Plots will be saved as PGF commands, which are lower-level and thus less suitable for manual editing. This only really matters if you aren't going to go back to Python when you need to change things. (You can also save plots directly to PDF instead.) The layout will be (more or less) what the matplotlib developers ...


0

In this particular case is possible to build everything as a tree with an empty root. Next code shows how to do it with forest. There is a problem with this solution which is the space occupied by the phantom root node. \documentclass[border=2mm]{standalone} \usepackage{forest} \begin{document} \begin{forest} for tree={edge={draw,blue!80,thick,->}} [, ...


4

Here's a quick bash script to check for instances of RGB colors: #!/bin/sh pdftops $1.pdf -eps $1.eps status=$(grep -o "RGB" $1.eps | wc -l) echo "$status instance(s) of RGB colorspaces found in file $1.eps" exit $status And a .bat version for Windows: @echo off pdftops %1.pdf -eps %1.eps type %1.eps | find "RGB" /c > __my%1.tmp set /p ...


5

Something like this is made with the libraries decorations.text and arrows.meta together with the correspondent options \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.text,calc,arrows.meta} \begin{document} \begin{tikzpicture} \coordinate (O) at (0,0); \draw (O) circle (2.5); \draw (O) circle (1.5); \draw (O) circle (0.5); ...


6

As Paul Gessler has commented, you can put every thing in one tabular environment with two p columns each having a width of >{\raggedright\arraybackslash}p{\dimexpr0.5\textwidth-2\tabcolsep-2\arrayrulewidth\relax} minipages are not needed any way. You can further use enumitem package and its resume option to continue numbering. I have also aligned ...


3

Here is a beginning which demonstrates 2 ways to fill the spaces between the circles and one way to curve text around the circles. One basically fills the circles in reverse order of size so that the fill for smaller circles overrides the fill from earlier circles. The other uses the 'even odd rule' for a single fill between two circles. The ...



Top 50 recent answers are included