I have the problem that before and after a tikzpicture plot the distance is much higher than it should be  \documentclass[BCOR=3mm,11pt,headsepline,footsepline]{scrbook} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} \usepackage{multirow} \usepackage{pgf,tikz} \usepackage[framemethod=tikz]{mdframed} \usepackage{amssymb} \usepackage{amsmath} \usepackage[dvipdfm]{geometry} \usepackage{tabulary} \usepackage{subfigure} \usetikzlibrary{arrows} \usetikzlibrary{shapes,snakes} \usepackage{ntheorem} \geometry{    inner=2cm,    outer=2cm,    top=2cm,    bottom=2.5cm,    head=2cm,    footnotesep=1cm, %   bindingoffset=1cm,    }  \mdtheorem[% apptotikzsetting={\tikzset{mdfbackground/.append style=% {top color=white, bottom color=white}, mdfframetitlebackground/.append style =% {top color=gray!10!white, bottom color=gray!10!white} }}, ,roundcorner=10pt,middlelinewidth=1.3pt, frametitlerule=true,frametitlerulewidth=1.3pt, innertopmargin=10pt,% ]{wissen}{Fehlerschwerpunkt} \begin{document} \subsection*{Aufgabe 5}  \begin{itemize} \item[•] $\displaystyle\lim\limits_{x\to 1} \ \frac{4x^2-3x-1}{x^2-1}=\lim\limits_{x\to 1} \ \frac{8x-3}{2x}=2,5$\\[3mm] Die Regel von L'Hospital darf angewendet werden, weil der Ausdruck $\frac{0}{0}$ entsteht \clearpage \begin{center} \begin{tikzpicture}[scale=0.6, &gt;=latex,y=.5cm,x=1.7cm] \draw[-angle 45,line width = 0.8pt] (-4,0) -- (4,0) node[right] {\scriptsize $x$}; \draw[-angle 45,line width = 0.8pt] (0,-5) -- (0,14) node[above] {\scriptsize $y$}; \foreach \x in {-3,...,-1,1,2,3} \draw (\x, 3pt) -- (\x,-3pt) node[anchor=north] {\tiny \x}; \foreach \y in {-4,-2,2,4,6,8,10,12} \draw (3pt,\y) -- (-3pt,\y) node[anchor=east] {\tiny \y}; \draw[color=red, line width = 1pt, domain=-0.6:4, samples=100]     plot (\x,{(4*(\x)^2-3*(\x)-1)/((\x)^2-1)}); \draw[color=red, line width = 1pt, domain=-4:-1.3, samples=100]   plot (\x,{(4*(\x)^2-3*(\x)-1)/((\x)^2-1)}); \draw [red] (1,2.5) circle (4pt); \end{tikzpicture} \end{center} \item[•] $\displaystyle\lim\limits_{x\to 0} \ \frac{e^x-1}{4x}=\lim\limits_{x\to 0} \ \frac{e^x}{4}=0,25$\\[3mm] Die Regel von L'Hospital darf angewendet werden, weil der Ausdruck $\frac{0}{0}$ entsteht \begin{center} \begin{tikzpicture}[scale=0.6, &gt;=latex,y=1.5cm,x=1.7cm] \draw[-angle 45,line width = 0.8pt] (-4,0) -- (4,0) node[right] {\scriptsize $x$}; \draw[-angle 45,line width = 0.8pt] (0,-1) -- (0,4) node[above] {\scriptsize $y$}; \foreach \x in {-3,...,-1,1,2,3} \draw (\x, 3pt) -- (\x,-3pt) node[anchor=north] {\tiny \x}; \foreach \y in {1,2,3} \draw (3pt,\y) -- (-3pt,\y) node[anchor=east] {\tiny \y}; \draw[color=red, line width = 1pt, domain=-4:-0.001, samples=100]     plot (\x,{(exp(\x)-1)/(4*(\x))}); \draw[color=red, line width = 1pt, domain=0.001:4, samples=100]     plot (\x,{(exp(\x)-1)/(4*(\x))}); \draw [red] (0,0.25) circle (4pt); \end{tikzpicture} \end{center} \end{itemize}  \end{document}
32505
After reading this question , I want to know the answer of the following.  When should we use \begin{center} instead of \centering?  For example, should we use this one?  {% \centering &lt;other contents&gt; }   or this one?  \begin{center} &lt;other contents&gt; \end{center}
83123
I plot tabular data wherein none of the y-values of the data go above 1.0. In the resulting plot, however, there are a couple of peaks that go beyond 1.0, giving a false impression about those data points:   This is not visible when I plot with marks, but I need to use "no marks" because it is otherwise far too busy (80 points in a small plot).   How can I prevent this?  Update: Per Jake's request, here's a minimal example that shows the described behaviour:  \documentclass{article} \usepackage{pgfplots} \begin{document}     \begin{figure}[ht]         \begin{tikzpicture}             \begin{axis}[no markers, grid=major]                 \addplot coordinates{(0, 0.0000000000)                                      (1, 0.8823529412)                                      (2, 0.8750000000)                                       (3, 1.0000000000)                                       (4, 0.8666666667)                                      (80, 0.0000000000)}[thick];             \end{axis}         \end{tikzpicture}     \end{figure} \end{document}   The problem is less pronounced when I don't make my lines thick, but it is still there (and I want thick lines).
9436
I want to put my tikzpicture nicely between paragraphs. How do I do that? I do not want  to put it in a picture environment because than there is extra space underneath.  \documentclass[11pt,a4paper,addpoints]{exam} \unframedsolutions %\printanswers \usepackage{tikz} \usepackage{graphicx} \usepackage{geometry} \usepackage{calc}  \newgeometry{left=2cm,top=2cm,right=2cm,bottom=2cm}  \begin{document} \begin{questions}   Line above tikzpicture.  \begin{tikzpicture}[rounded corners=5mm] \path node[rectangle,draw=green,fill=green!8,inner sep=.70cm] {\parbox{\textwidth-1.4cm-\fboxrule}{  \question[2] What is the first question? \begin{solutionorlines}[4cm] This box is smaller than when the solutions are not printed. How do I make this the same dimension as when answers are not printed? \end{solutionorlines} }}; \end{tikzpicture}  Line under tikzpicture. I don't want this. I want the tikzpicture between paragraphs.  \end{questions} \end{document}
72669
I try to adapt this solution  to my needs.  But I have a width problem 1\tabcolsep is too short, but anything longer is too long, should be 2\tabcolsep.    \documentclass[10pt]{article} \usepackage[T1]{fontenc}  \usepackage{array} \usepackage{tabularx} \usepackage{ragged2e}  \newcolumntype{C}[1]{&gt;{\Centering}p{#1}} \usepackage{tikz}  \newcommand\Tdiag[4]{%     \multicolumn{1}{|p{#2}|}{\hskip-\tabcolsep     \begin{tikzpicture}[%                 baseline={(0,-.25\baselineskip)},                 every node/.style={outer sep=0pt,inner sep=#1}]     \node[minimum width={#2+1\tabcolsep-\pgflinewidth},         minimum height=2\baselineskip-\pgflinewidth+\extrarowheight,         use as bounding box] (box) {};     \draw[line cap=round] (box.north west) -- (box.south east);     \node[anchor=south west,text width=.75*#2,align=left] at (box.south west) {#3};     \node[anchor=north east,text width=.75*#2,align=right] at (box.north east) {#4}; \end{tikzpicture}\hskip-\tabcolsep}}  \begin{document}  \begin{tabular}{|C{1.2cm}*{3}{|c}|}\hline \Tdiag{.2em}{1.2cm}{\^Age}{Sexe}&amp; Féminin &amp; Masculin &amp; Totaux  \\\hline 15 ans&amp;&amp;1&amp;\\\hline 16 ans &amp; 16 &amp; &amp;  \\\hline 17 ans &amp; 3 &amp; &amp;  \\\hline Totaux &amp; &amp; &amp; 36  \\\hline \end{tabular}   \end{document}
99660
Here is an example:  \documentclass{article} \usepackage{tikz}  \begin{document}  \begin{figure}\centering  \begin{tikzpicture}[extended line/.style={shorten &gt;=-#1,shorten &lt;=-#1}] \draw [very thick, extended line=1cm] (0,0) -- (0,1); \end{tikzpicture}  \caption{This is a test caption.} \end{figure}  \end{document}   and its outcome:    How can I move the tikzpicture above the caption?
99007
For an example relation R: A -> B, I have the following TikZ code:  \documentclass[tikz]{standalone} \usepackage{tikz} \usetikzlibrary{shapes,backgrounds,decorations.text,patterns} \usetikzlibrary{plotmarks}  \begin{document} \begin{tikzpicture}   \begin{scope}[mark=*,mark size=1pt] % sets A &amp; B   \draw (0,0) node[ellipse, minimum height=50pt,minimum width=30pt,draw,label=above:A]{};   \draw (2,0) node[ellipse, minimum height=50pt,minimum width=30pt,draw,label=above:B]{}; % draw line and label origin a to c   \draw[-&gt;] plot coordinates {(0,10pt)} (0,10pt) node[above]{a} -- (1.9,16pt); % add end point   \node at (2,16pt) {\pgfuseplotmark{*}}; % add end label   \node[above] at (2,16pt) {c}; % draw line and label origin a to e   \draw[-&gt;] plot coordinates {(0,10pt)} (0,10pt) node[above]{a} -- (1.9,-15pt); % add end point   \node at (2,-15pt) {\pgfuseplotmark{*}}; % add end label   \node[above] at (2,-15pt) {e}; % draw line and label origin b to d   \draw[-&gt;] plot coordinates {(0,-10pt)} (0,-10pt) node[above]{b} -- (1.6,2pt);  % add end point   \node at (1.7,2pt) {\pgfuseplotmark{*}}; % add end label   \node[above] at (1.7,2pt) {d};   \end{scope} \end{tikzpicture} \end{document}   Produces:    Is there a simpler way of accomplishing this in TikZ?  It seems like a lot of work.
70957
I have the following TikZ code which draws a grid and shows the coordinates.  To display the coordinates I am using the loop foreach.  \documentclass[12pt]{article} \usepackage{tikz}  \begin{document} \begin{tikzpicture} \draw[help lines,step=.2] (-2,-2) grid (7,4); \draw[help lines,line width=.6pt,step=1] (-2,-2) grid (7,4); \foreach \x in {-2,-1,0,1,2,3,4,5,6,7}  \node[anchor=north] at (\x,-2) {\x}; \foreach \y in {-2,-1,0,1,2,3,4}  \node[anchor=east] at (-2,\y) {\y}; \end{tikzpicture} \end{document}   Is there a way do simplify the code in this way that I have a key like show coordinates (maybe step coordinates/.initial=step ):  \draw[help lines,step=.2,show coordinates=true] (-2,-2) grid (7,4);   Or a modification of the command grid like  \draw[help lines,step=.5] (-2,-2) gridwithcoordinates (7,4);     By using pstricks it is very simple with the command \psgrid  \documentclass[12pt]{article} \usepackage{pstricks}  \begin{document} \begin{pspicture}(-2,-2)(7,4) \psgrid \end{pspicture} \end{document}   Bonus: How can I set a larger line width for the help lines at the integer coordinates (see picture above)?  (I don't know the correct words ;-) )
43216
I have the following tikz code  % compilation command: pdflatex --jobname=Diag-f1 Diag.tex \documentclass{book} \usepackage{tikz} \pgfrealjobname{Diag} \begin{document} \beginpgfgraphicnamed{Diag-f1} \begin{tikzpicture}[node distance=3em] \node(G)[rectangle,fill=red!5,draw=red,text width=5cm]{}; \node(H)[below of=G]{H}; \node(H1)[left of=H]{H1}; \node(H2)[right of=H]{H2}; \draw[-&gt;](G.south)-|(H1.north); \draw[-&gt;](G.south)--(H.north); \draw[-&gt;](G.south)-|(H2.north); \end{tikzpicture} \endpgfgraphicnamed \end{document}     but I am not happy with the two arrows going from G.south to H1.north and H2.north. Because of the -| command, there is a spurious horizontal line. How can I achieve the same result without this annoying horizontal line? \draw[-&gt;](G.south)--(H1.north); is not a solution. There are available tricks but I may have missed an obvious solution here.
11547
\begin{tikzpicture} \node [draw=black, anchor=south west] (label) at (0,0){\includegraphics[width=300mm]{th.jpg}}; \coordinate (ZX) at (157mm,104mm); \coordinate (YB) at (249mm,39mm); \coordinate (YY) at ($(ZX)!1.5!(YB)$); \coordinate (ZZ) at ($(YB)!2.5!(ZX)$); \draw[blue!20,very thick] (ZZ)--(YY); \draw[red!20,very thick, rotate around={90:(ZX)}] (157mm,104mm)--(249mm,39mm);%It works \draw[red!20,very thick, rotate around={-90:(ZX)}] (ZX)--(YB);%It doesn't work \filldraw[white] (ZX) circle (2mm); \filldraw[white] (YB) circle (2mm); \end{tikzpicture}   a working example       \documentclass{minimal} \usepackage{tikz,tikz-3dplot}  \begin{document}    \tdplotsetmaincoords{70}{115}    \begin{tikzpicture}[scale=4,tdplot_main_coords] \pgfmathsetmacro{\rvec}{.8} \pgfmathsetmacro{\thetavec}{30} \pgfmathsetmacro{\phivec}{60}  \tdplotsetrotatedcoords{\phivec}{\thetavec}{0}   \coordinate (O) at (1,1,1);   %these 2 lines overlap \draw[thick,-&gt;] (O) -- (0,.5,0); \draw[thick,tdplot_rotated_coords,-&gt;] (O) -- (0,.5,0);   %these 2 lines dont overlap \draw[thick,-&gt;] (1,1,1) -- (0,.5,0); \draw[thick,tdplot_rotated_coords,-&gt;] (1,1,1) -- (0,.5,0); \end{tikzpicture} \end{document}
36744
How can I edit the distance between footnote and the line above it?
107533
Consider the following MWE  \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}  \draw (0,0)--(1,1) node[auto,midway] {$A$}  -- (2,0) node[auto,midway] {$B$}; \end{tikzpicture} \end{document}   I am using auto here to get automatic left/right positioning. However, I am not satisfied with the distance between the edge labels and the edge itself, which is a bit too large (my real example is a picture with much more nodes in it, so there is room for confusion if they are not very close).  Is there a way to alter this distance? I tried adding node distance=something almost everywhere, but it seems to be ignored.
92083
I am using the following commands to have half-open interval in a real line:   \begin{tikzpicture}[scale=7] \draw[-&gt;, thick] (-0.1,0) -- (1.7,0); \foreach \x/\xtext in {0/8,0.2/$S_1$,0.4/$T_4$,0.6/$S_3$,0.8/$T_2$,1/$S_3$,1.2/14,1.4/$S_3$,1.6/16}     \draw[thick] (\x,0.5pt) -- (\x,-0.5pt) node[below] {\xtext}; \draw (0.2,0.5pt) node[above] {$c$}; \draw[[-), ultra thick, blue] (0.2,.01) -- (.4,0.01); \draw[(-, ultra thick, green] (0.6,.02) -- (1,0.02); \end{tikzpicture}   Now, I need to have an open-close interval, but I am not able to have that close interval at the end, using the following command:  \begin{tikzpicture}[scale=7] \draw[-&gt;, thick] (-0.1,0) -- (1.7,0); \foreach \x/\xtext in {0/8,0.2/$S_1$,0.4/$T_4$,0.6/$S_3$,0.8/$T_2$,1/$S_3$,1.2/14,1.4/$S_3$,1.6/16}     \draw[thick] (\x,0.5pt) -- (\x,-0.5pt) node[below] {\xtext}; \draw (0.2,0.5pt) node[above] {$c$}; \draw[(-], ultra thick, green] (0.6,.02) -- (1,0.02); \end{tikzpicture}   May I ask for anybody help?
123344
\documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.15}  \begin{document}     \newcommand{\xmax}{14}     \newcommand{\fmin}{(pi/3)}     \newcommand{\fmax}{(2*pi)} \begin{tikzpicture}[domain=0:\xmax, samples=500]  \draw[ultra thick, red] plot (\x, {sin(deg(exp(ln(\fmin)+\x/\xmax*(ln(\fmax)-ln(\fmin)))*\x))} );  \end{tikzpicture} \end{document}   I would understand if LaTeX repeat the code below this statement many times.
103740
I'm trying to visualize some data with TikZ datavisualization library. Given foo.tex  \documentclass{article} \usepackage{tikz} \usetikzlibrary{datavisualization}  \begin{document} \begin{tikzpicture}   \datavisualization [ scientific axes, visualize as scatter ] data [ read from file=foo.dat ]; \end{tikzpicture} \end{document}   and foo.dat:  x, y 1, 2 3, 4 5, 6   It fails with the following error (repeated multiple times):  ! Package PGF Math Error: Sorry, an internal routine of the floating point unit got an ill-formatted floating point number `'. The unreadable part was near ''..  See the PGF Math package documentation for explanation. Type  H &lt;return&gt;  for immediate help.  ...                                                l.7 ... scatter ] data [ read from file=foo.dat ];   If I'd rather include data from foo.dat inline the document compiles normally.  What am I missing and how can I fix the problem?  I'm running TeXLive 2014 on Windows 7. All files use Unix line ending.  EDIT: I've removed all commas in my data file and explicitly set separator to \space, now it works.  One more quertion: TikZ documentation says:     /pgf/data/separator=&lt;character&gt; (no default, initially ,)   What does this mean? What is the difference between initial value and default value?
62263
I am a tikz beginning. Here is a figure I am working on. I cannot avoid the "Dimension too large" error.  \documentclass{standalone} \usepackage{tikz} \usepackage{tkz-euclide} \usetkzobj{all} \begin{document}   \begin{tikzpicture}[x=2cm,y=2cm,scale=0.75]     \coordinate [label=below:$O$](O) at (0,0);      \coordinate [label=below:$A$](A) at (0,-1);      \coordinate [label=below:$D$](D) at (-1.1,-1);      \coordinate [label=below:$E$] (E) at (1,-1);      \coordinate [label=0:$B$](B) at (15:1);      \coordinate [label=180:$C$](C) at (140:1);     \draw (0,0) circle (1); \draw (C) -- (O) -- (B);     \draw (C) -- (A) -- (B);     \draw (D) -- (E);     \tkzMarkAngle[label=$124^{\circ}$,dist=0.35,arc=l,size=0.2,color=black,fill=none](B,O,C)     \tkzMarkAngle[arc=l,size=0.3,color=black](A,C,O)   \end{tikzpicture} \end{document}   I find it works if I change "scale=0.75" to "scale=1". But I want to keep the figure small.
24960
This is what I want to achieve    and this:    But all I've been able to make with tikz-qtree is the following:  \documentclass[12pt,a4]{article} \usepackage[utf8]{inputenc} \usepackage{tipa,tikz,tikz-qtree} \begin{document}  \begin{tikzpicture} [baseline] \tikzset{frontier/.style={distance from root=90pt}} \Tree [.$\sigma$ [.O [ p ] ] [.R [.$\mu$ a ] [.$\mu$ : ] ] ] \end{tikzpicture} \begin{tikzpicture} [baseline] \tikzset{frontier/.style={distance from root=90pt}} \Tree [.$\sigma$ [.O [ p ] ] [.R [.$\mu$ a ]  ] ] \end{tikzpicture}   And this:  \begin{tikzpicture}[baseline] \tikzset{frontier/.style={distance from root=90pt}} \Tree [.$\sigma$ [.O [ l ] ] [.R [.$\mu$ a ] [.$\mu$ l ] ] ] \end{tikzpicture} \begin{tikzpicture} [baseline] \tikzset{frontier/.style={distance from root=90pt}} \Tree [.$\sigma$ [.O [ : ] ] [.R [.$\mu$ a ] [ l ] ] ] \end{tikzpicture} \end{document}   Which renders:    and    The important part here is the linking from the leaves to more than one parent (it would be nice if I had the option of making the line dashed too). Now, pst-asr doesn't quite achieve what I want it to. It's important that I have the moras ('mu's). (Also it's a pstricks package, which means I must typeset it in DVIPSPDF.) I have tried a bit of the forest-package (especially forest-GP1), but I can't make that work as I want either. Lastly, some have recommended xyling, but I find that package very difficult to use.  Any recommendations?  Thanks.
53081
I have the following code  \documentclass[tikz]{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{filecontents}  \begin{filecontents}{testdata.dat}   -3.316988309367815e-07 0.07000000000000001   -1.948815911147526e-08 0.13   7.15864175355987e-08 0   1.799432483450127e-07 0   0.0002850606647384129 0   0.0009429559686380238 0.08999999999999997   0.00157188462064142 0   0.005259918700865051 0   0.01739392641273605 0.18   0.06208364670743995 0.55   68.69485148165926 6.970000000000001   31.217611224923 79.12   0 12.89 \end{filecontents}  \pgfplotsset{compat=newest} \pgfplotstableread{testdata.dat}\datatable  \begin{document} \begin{tikzpicture} \begin{axis}[   ybar interval,   width=10cm,   height=5cm,   enlargelimits=false,    xtick=data,   ymin=0, ymax=100,   xticklabels={0 -- 0.063,0.063 -- 0.125,0.125 -- 0.25,0.25 -- 0.5,0.5 -- 1,                1 -- 2,2 -- 4,4 -- 5.6,5.6 -- 8,                8 -- 11.2,11.2 -- 16,16 -- 22.4,22.4 -- 31.5},   x tick label style={rotate=60,anchor=east}   ]   \addplot table[x expr=\coordindex,y=0]{\datatable};   \addplot table[x expr=\coordindex,y=1]{\datatable};  \end{axis} \end{tikzpicture} \end{document}   and the output looks like this:    But the command ybar interval does skip the last value. It should look like:    I prefer to have the last value to show up in the interval 22.4 -- 31.5. How do I achieve this without inserting a row of zeros to my table?