Tag Info

New answers tagged

1

This basic sequence is how to proceed in general and it worked for me for the file in question: Download the file into some directory searched by TeX and not under the control of a package manager (for example, $TEXMFHOME for TeX Live). Try to maintain a structure consistent with the main installation tree. For example, for this file, I'd place it at ...


3

It is easy using y index with pgfplots. \documentclass{article} \usepackage{pgfplotstable} \pgfplotstableread{ x y1 y2 y3 y4 0 3 4 13 14 1 5 6 15 16 2 2 3 12 13 3 4 8 14 18 4 6 9 26 19 5 8 1 18 11 6 10 2 12 12 }\mytable \usepackage{pgfplots} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} ...


4

You can use the anchors to position your arrows, and, as @Ignasi suggests, specify coordinates in terms angles. MWE \documentclass[border=2pt]{standalone} \usepackage{tikz} \usetikzlibrary{shapes.geometric} \begin{document} \begin{tikzpicture} \node(add)[regular polygon,regular polygon sides=3,draw,very thick,minimum size=2cm]{+}; ...


5

For the record I post also my final version. Instead of rotating the additional layers as suggested by JLDiaz I decided to scale them. Here is the result. CODE: \begin{tikzpicture}[scale=.5] \coordinate (origin) at (-4.5,-1.3); \coordinate (observer) at (-3,2.7); \coordinate (x) at ($(origin) + (1,0,0)$); \coordinate (y) at ($(origin) + (0,1,0)$); ...


2

EDITED to handle diacritic tabs. Here's the fix using your existing fancy interface, rather than the home-brew concoction of my other answer. Let me show the changes: Initializations: \def\thumbnew{} \def\thumbold{} If there are no new thumbs on a page, use the last of the old thumbs \usepackage{everypage} ...


6

One way, with the arrows.meta library of pgf/TikZ v3.0. See Section 16.5 of the pgf manual for a full listing of available arrow tips and options. \documentclass[tikz]{standalone} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture} \draw[-{Latex[left]}] (0,0) -- (1,1); \draw[-{Latex[right]}] (0,1) -- (1,0); \draw[-{Diamond[left]}] (0,0.5) ...


3

A simple calculation shows that the radius (you called it diameter) has to be 1/2(\marginparwidth-\sqrt{3}\padding), so \documentclass[nofonts]{tufte-handout} \usepackage{showframe} \usepackage{tikz} \usetikzlibrary{shapes,backgrounds} \newcommand\panning{0.5} \newlength\diameter \pgfmathsetlength{\diameter}{0.5*\marginparwidth-0.5*sqrt(3)*\panning cm} ...


4

I don't use fancy, but rather a home-brewed concoction. I EDITED to excise the unneeded fancy and tikz calls. Also, I did not employ your colors, but used an algorithm for varying the colors. Finally, this only works for ascii \lettergroups at present, so no umlauted e's will get a tab. I use everypage as the vehicle, employing logic similar to my answer ...


1

So, just specify the coordinate to insert the root for the second tree. For example \node at (7,0) [arn_r] {47} ps. I suggest you to read tikz-qtree documentation.


3

With stacks. \documentclass{article} \usepackage{stackengine,scalerel} \def\stackalignment{l} \def\stacktype{L} \begin{document} \stackunder{Universal}{% Individual\hspace{1in}\scalerel[2.3ex]{\{\ }{\stackanchor{General} {Particular\hspace{1in}\smash{% \scalerel[2.3ex]{\{\ }{\stackanchor{Collective}{Singular}}}} }}\par\bigskip\medskip ...


1

Use \clip <path>; as the first command inside a scope environment containing the content to be clipped away (in this case, the circles). The clipping path can be an arbitrary path, but it cannot have any additional style options set, which is why we cannot re-use the colored rectangle drawn elsewhere. \documentclass[tikz,border=2pt]{standalone} ...


1

The order of package loading is important here: load xcolor and pstricks (if you really need both TikZ and PStricks) before loading tikz, as in \usepackage[usenames,dvipsnames]{xcolor} \usepackage[usenames,dvipsnames]{pstricks} \usepackage{tikz,pgfplots} A better approach here would be to pass usenames and dvipsnames as class options, so they will be ...


3

You were using (possibly (ab)using) the grid to draw the censoring points, and each grid (major and minor) has one style; it cannot be changed for only a part of the grid. The initial possibility is to use xtick for one censoring point and extra x ticks for the other. One can use major grid style and the other an independently-set minor grid style. But ...


4

This is an easy job for the fillbetween library from pgfplots. A simple example: The code: \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ xmin=100, xmax=800, ymin=0, ymax=600, domain=100:800 ] % The main line (the graph of the ...


2

As @Gonzalo Medina suggested, I turned my comment into an answer. When you setup a matrix in Tikz and use nodes={...} as an option for the matrix itself, you specify the default behavior of the nodes. If you want to change the appearance of a single node, just put your specifications inside two vertical bars |...|: this notation accepts the specifications ...


5

Building upon Maarten's answer, and using the \foreach, \pgfmathparse{} and \ifnum\pgfmathresult constructs, the answer could be much shorter. \documentclass[border=1mm]{standalone} \usepackage{tikz} \newcommand{\drawbox}[4]{ \draw[fill=#4] ({#1-1+(#2-1)*2/3*cos(30)},{(#2-1)*2/3*sin(30)+#3-1}) -- ({#1-1+(#2-1)*2/3*cos(30)+1},{(#2-1)*2/3*sin(30)+#3-1}) -- ...


2

A tree abhors a vacuum. You cannot leave blank lines like that in the middle of the tree. Also, you need a semicolon to finish the path, and you need to change the sibling distance to prevent the upper and lower branches from overlapping each other. I've also removed packages not needed in your MWE (but obviously you will want them in your document) and ...


7

If you create a new command to draw a cube, you can use them as building blocks. Here is an example: \newcommand{\drawbox}[4]{ \pgfmathsetmacro \angle {30} \pgfmathsetmacro \xd {{2/3*cos(\angle)}} \pgfmathsetmacro \yd {{2/3*sin(\angle)}} \pgfmathsetmacro \x {{#1-1+(#2-1)*(\xd)}} \pgfmathsetmacro \y {{#3-1+(#2-1)*(\yd)}} ...


2

Stuff defined using \newcommand is always going to be problematic inside a TikZ path because of the way TikZ parses path commands. In this case I think the best way forward is to use keys and in particular the insert path key: \documentclass[tikz, border=5]{standalone} \tikzset{% test 1/.style args={#1#2#3}{insert path={ node[pos={#1}, above] {#2} ...


8

This is very raw code but it colors \documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture}[on grid] \draw[yslant=-0.5,] (0,0) rectangle +(3,3); \draw[yslant=-0.5] (0,0) grid (3,3); \foreach \x in {0,2}{ \foreach \y in {0,2}{ \fill[yslant=-0.5, blue] (\x,\y) rectangle +(1,1); }} ...


3

In this case it is not possible to use the macros \pgfmathrnd, \pgfmathrand or \pgfmathrandom otherwise the result is not in the appropriate form to be parsed. The correct way is to use directly the functions rnd, rand or random: \pgfpoint{rnd*.25cm}{rnd*.25cm}}{.4pt}


4

\documentclass{article} \begin{document} \newcommand{\sub}[2]{\begin{tabular}{p{3.9cm}}#1 \\ #2 \end{tabular} } \newcommand{\psub}[2]{\(\biggl\{\)\sub{#1}{#2}} \begin{tabular}{p{4cm}p{4cm}p{4cm}} \sub{Universal}{Individual} & \psub{General}{Particular} & \psub{Collective}{Singular} \\ \rule{\textwidth}{2pt} \\[8pt] Universal & \psub{The ...


5

You can put the boxes one per frame by \only<slide number>. If you don't know the slide number in a large presentation, but want to display them one by one, then use \only<+>. like in \documentclass{beamer} \usepackage{tikz} \begin{document} \begin{frame} \begin{overprint} \begin{tikzpicture}[ every pin edge/.style={thick,blue!50},pin ...


0

Something likes this! Since it is a node structure, the proposal is to assign a internal label and use \path (a)--node[sloped, <pos>, <above,below>]{<text>}(b); Code \documentclass[12pt,letter,oneside]{book} \usepackage{tikz} \usetikzlibrary{shapes.geometric,arrows} \usetikzlibrary{mindmap,backgrounds,positioning} \begin{document} ...


2

You can put math in node's contents. In this case you need in line math so \path [line] (L) -- node[above] {Blinks $< 3$}(N); will work. On the other hand, if you are loading amsmath package, you can also use \path [line] (L) -- node[above] {$\text{Blinks} < 3$}(N); Remember that \text macro is defined by amsmath to put text in math mode. MWE: ...


2

For better or for worse, this is currently a feature. From Section 12.2.1 of pgfmanual: At the end of the environment, pgf tries to make a good guess at the size of a bounding box of the graphic and then resizes the picture box such that the box has this size. To “make its guess,” everytime pgf encounters a coordinate, it updates the bounding ...


4

When you use \addplot [...] function {...} it uses gnuplot on the terminal, which uses radians for trigonometric functions, as noted in Section 4.3.5 of the pgfplots manual. To use the pgf computation engine, remove the word function (or replace it with expression): \documentclass{standalone} \usepackage{pgfplots,siunitx} \pgfplotsset{compat=1.11} ...


5

This is an old post, but I think the answers do not underline strongly enough that sometimes, Asymptote cannot be avoided, because of the lack of real 3D support, as indicated by Count Zero. More precisely, if I am not mistaken, tikz-3dplot and other LaTeX packages adds elements as they appear in the code. What if one element should sometimes be in the ...


11

I would suggest to use Lua for all the calculations and also to create the relevant LaTeX code. Of course as Dave suggested use string.format('% .2f','number') to format the number. Two decimal places would be more than adequate for plotting. \documentclass[tikz]{standalone} \usepackage{luacode} \begin{document} \begin{luacode} local function G (x) ...


1

A PSTricks solution: \documentclass{article} \usepackage{pstricks} % parameter \def\point{0.8 } \begin{document} \begin{pspicture}(-4,-2.5)(4,2.5) % ellipse \psellipse(0,0)(2,0.8) \rput(0,-0.1){\shortstack[c]{% \textsc{Automatic Teller}\strut\\[-0.75ex] \textsc{Machine}\strut}} \psset{arrows = ->} % left \psline(-2,0)(-3,0) ...


3

You can plot those circles like \begin{axis}[ axis y line*={right}, axis x line={none}, ymin={1}, ymax={5}, width={8cm}, height={5cm}, ylabel style={xshift=0.60em}, ylabel={units}, ] \addplot[only marks,mark=*,mark size=3pt,green, nodes near coords = \rotatebox{90}{{\pgfmathprintnumber[fixed zerofill, ...


0

Too long for a comment. I do not see an additional "1": \documentclass{article} \usepackage{tikz} \usetikzlibrary{intersections} \usetikzlibrary{positioning} \usepackage{algorithm} \usepackage{algorithmic} \providecommand\progHeader{} \begin{document} \begin{algorithm}[t] \centering \small \resizebox{\linewidth}{!}{ \begin{tikzpicture}[baseline=0] ...


12

If you modify the function to \pgfmathdeclarefunction{G}{1}{% \edef\pgfmathresult{\directlua{tex.print("" .. G(#1))}}% \show\pgfmathresult \edef\pgfmathresult{1}% } then the plot plots the (wrong:-) function without error but you get to see what you were plotting. The first few values are OK but then: > \pgfmathresult=macro: ->-9.5052e-06. ...


1

You can control the postion of legend by at key as in legend style={at={(0.5,1)},anchor=north,draw=none,nodes={inner sep=3pt}}, %% changed here Adjust values in (0.5,1) as you wish. You are missing the comma , as the separator in xticklabels = { \strut Read 0, %% you need comma (,) at the end here and next 2 lines \strut ...


4

This is one possibility where scope environment with shift and rotate options are used to place the small triangles Code \documentclass[border=0.5cm,varwidth]{standalone} \usepackage{xcolor,amsmath,amssymb} \usepackage{tikz} \usetikzlibrary{positioning,calc,intersections} \begin{document} \begin{tikzpicture}[scale=0.8] \begin{scope} \draw[gray,shade, ...


2

You can use \fontsize{50}{60} in font=\fontsize{40}{48}\bfseries, with a scalable font (\selectfont is needed if no \bfseries is used.). With \usepackage{lmodern} you get \documentclass[12pt,ngerman]{scrartcl} \usepackage[left=1cm,right=1cm,top=1.5cm,bottom=0.5cm,a4paper]{geometry} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{babel} ...


4

The legend image code for ybar legend is defined as (page 212 chapter 4) \pgfplotsset{ /pgfplots/ybar legend/.style={ /pgfplots/legend image code/.code={% \draw[##1,/tikz/.cd,bar width=3pt,yshift=-0.2em,bar shift=0pt] plot coordinates {(0cm,0.8em) (2*\pgfplotbarwidth,0.6em)};}, }, It is nothing but a bar plot with two coordinates, so you get two bars. By ...


1

CW from the comments: Use the mirror key as part of decoration to mirror the decoration along the path. The result here produces an ugly shortened brace, but I'm assuming the actual use case has more content so this problem goes away. \documentclass[french]{beamer} \usepackage{tikz} \usetikzlibrary{fit,calc,positioning,decorations.pathreplacing,matrix} ...


3

Change \pgf@anchor@mux4to1@D0 % to \csname pgf@anchor@mux4to1@D0\endcsname % The code: \documentclass[twoside,a4paper,12pt,headsepline]{scrbook} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[USenglish]{babel} \usepackage{tikz} \usetikzlibrary{positioning,shapes,arrows.meta} \makeatletter % multiplexer shape ...


5

You have, at least, three options: You can use the "angle" anchors for a ņode: \draw [->] (trainingExamples) to [bend right] (learningAlgorithm.170); \draw [->] (hypothesisSet) to [bend left] (learningAlgorithm.190); You can use the calc library and a partway modifier to avoid manual calculations: \draw [->] (trainingExamples) to [bend right] ...


2

I'd recommend a combination of tools: Inkscape svg2tikz Once you install Inkscape, you can put svg2tikz in your ./config/inkscape/extensions directory and restart the program to get this functionality. Now, you just need to convert the bitmap to a vector. Inkscape has this functionality built-in (version 0.48). Step-by-step instructions: Import ...


3

If I understand properly, you may use shadings library and say \shade[lower left=blue, upper right=red] (0.5,0,0) -- (0.5,2,0) -- (0.5,2,-2) -- (0.5,0,-2) -- cycle; I have chosen red just to make it conspicuous. \documentclass[varwidth, border=5pt]{standalone} \usepackage{tikz} \usepackage{tikz-3dplot} \usetikzlibrary{3d,shadings} \begin{document} ...


2

May be you should use native beamer columns instead of minipages. This is just for illustration: \documentclass{beamer} \usepackage{tikz} \begin{document} \begin{frame} \frametitle{Characteristics of ABCDE} \begin{columns} \column{0.5\linewidth} \begin{itemize} \item AAAAAAA \item BBBBBBBBBB \item CCCCCCCCCC \item DDDDDDDDDDDD \item EEEEEEEEE \end{itemize} ...


3

I've edited and changed your code a little bit. Mainly, a \node was missing around the \includepicture. Is the following what you want to have? \documentclass{beamer} \usepackage{tikz} \begin{document} \begin{frame} \frametitle{Characteristics of ABCDE} \begin{minipage}{.5\linewidth} \begin{itemize} \item AAAAAAA \item BBBBBBBBBB \item CCCCCCCCCC ...


1

Is it like this? This is obtained with \path [line] (A.220) |- (C); \path [line] (A.140) |- (D); \path [line] (A.310) |- (F); \path [line] (A.50) |- (G); Your full code: \documentclass{article} \usepackage{tikz} \begin{document} \usetikzlibrary{shapes,arrows,calc} % Define block styles \tikzstyle{block} = [rectangle, draw, fill=white, text ...


3

Both of them should be inside the same tikzpicture environment. \documentclass[12pt]{standalone} \usepackage[x11names]{xcolor} \usepackage{tikz} \usepackage{pgfplots,pgfplotstable} \usepgfplotslibrary{polar} \pgfplotstableread{ t u 0 1 20 2 40 3 60 4 100 5 130 4 160 3 180 2 220 2 240 3 260 3 290 3 300 1 320 1 360 1 360 10 360 1 }{\data} ...


3

\documentclass[tikz,border=2mm]{standalone} \begin{document} \begin{tikzpicture} \foreach \i in {-2,-1,...,3} \draw (\i,0,-3)--(\i,0,2); \foreach \i in {-3,-2,...,2} \draw (-2,0,\i)--(3,0,\i); \draw[fill=white] (0,1,0)--(0,1,1)--(1,1,1)--(1,1,0)--cycle; \draw[fill=black] (0,0,1)--(1,0,1)--(1,1,1)--(0,1,1)--cycle; \draw[fill=black] ...


2

This is not an answer, but I didn't know how to include \\ inside a comment. I've inserted \\ before \end{TheMatrix} in last example and worked. Why? I've no idea, just luck. \documentclass{article} \usepackage{environ} \usepackage{filecontents} \usepackage{csvsimple} \usepackage{tikz} \begin{filecontents*}{mystuff.csv} mynode;mytext n1;Hello n2;World ...


1

Here is a CSV approach with some trickery. The CSV file is read and its content put inside a macro \BODY. This \BODY is used inside the matrix later. This may not work, if the CSV content contains macros or umlauts since everything is expanded before it is added to \BODY. \documentclass{article} \usepackage{environ} \usepackage{filecontents} ...


2

As suggested by Ignasi, you should use grow'=right instead of grow right. grow', when used, arranges the children in the opposite order. Further, you may like to add some inner separation to all nodes and split long nodes using align=left as I did. I have also adjusted the level distance in the code to adjust the distance between levels. ...



Top 50 recent answers are included