Search Results

Search found 22 results on 1 pages for 'tikz'.

Page 1/1 | 1 

  • tikz: set appropriate x value for a node

    - by basweber
    This question resulted from the question here I want to produce a curly brace which spans some lines of text. The problem is that I have to align the x coordinate manually, which is not a clean solution. Currently I use \begin{frame}{Example} \begin{itemize} \item The long Issue 1 \tikz[remember picture] \node[coordinate,yshift=0.7em] (n1) {}; \\ spanning 2 lines \item Issue 2 \tikz[remember picture] \node[coordinate, xshift=1.597cm] (n2) {}; \item Issue 3 \end{itemize} \visible<2->{ \begin{tikzpicture}[overlay,remember picture] \draw[thick,decorate,decoration={brace,amplitude=5pt}] (n1) -- (n2) node[midway, right=4pt] {One and two are cool}; \end{tikzpicture} } % end visible \end{frame} which produces the desired result: The unsatisfying thing is, that I had to figure out the xshift value of 1.597cm by trial and error (more or less) Without xshift argument the result is: I guess there is an elegant way to avoid the explicit xshift value. The best way would it imho be to calculate the maximum x value of two nodes and use this, (as already suggested by Geoff) But it would already be very handy to be able to explicitly define the absolute xvalues of both nodes while keeping their current y values. This would avoid the fiddly procedure of adapting the third post decimal position to ensure that the brace looks vertical.

    Read the article

  • Standalone diagrams with TikZ?

    - by Qiaochu Yuan
    I'm using TikZ to draw diagrams in LaTeX that I then want to isolate as image files to put online. My guess is there is a way to extract these diagrams directly without having to tease them out of the finished .pdf file. How would I go about doing that? (If it matters, I'm using TeXnicCenter.)

    Read the article

  • How to only round selected corners in a fancytitle box with Tikz

    - by Christian Jonassen
    If you take a look at http://www.texample.net/tikz/examples/boxes-with-text-and-math/ the boxes there are with rounded corners. In the examples, both the box itself and the title is a box. I want the title box to not have the bottom corners rounded. On page 120 in the manual, there is a description of how to draw with and without rounded corners. However, I want to use this in a fancytitle. It looks a bit silly to have the fancytitle as a box where all corners are rounded when it is as wide as the box itself. \begin{tikzpicture}[baseline=-2cm] \node [mybox] (box){ \begin{minipage}[t!]{0.50\textwidth} Help, I'm a box \end{minipage} }; \node[fancytitle, text width=0.5423\textwidth, text centered, rounded corners] at (box.north) {Help, I'm a title}; \end{tikzpicture} The style I use is this \tikzstyle{mybox} = [draw=red, fill=blue!20, very thick, rectangle, rounded corners, inner sep=10pt, inner ysep=20pt] \tikzstyle{fancytitle} = [fill=red, text=white]

    Read the article

  • pgf/tikz: String Symbols as Input Coordinates

    - by red_lynx
    Hi all, I'm new to pgf so i was trying out some examples from the pgfplot manual. One example is especially relevant for my current task but, alas, it would not compile. Here is the code: \documentclass[11pt]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[symbolic x coords={a,b,c,d,e,f,g,h,i}] \addplot+[smooth] coordinates { (a,42) (b,50) (c,80) (f,60) (g,62) (i,90)}; \end{axis} \end{tikzpicture} \end{document} the compiler quits with the following error: ! Package PGF Math Error: Could not parse input 'a' as a floating point number, sorry. The unreadable part was near 'a'.. I have no clue how to correct this behavior. Other plots (smooth, scatter, bar), which contain only numerical data compile fine. Could anybody give me a hint? Cheers K.

    Read the article

  • Trees and macros with tikz

    - by Tsf
    I am trying to build my trees using macros but I don't get the result I want. Here is a minimal example: \documentclass{article} \usepackage{tikz} \usetikzlibrary{trees} \newcommand{\LeafNode}[1]{% child {node {#1}} } \newcommand{\InnerNode}[3]{% child {node {#3} #1 #2 } } \begin{document} \begin{tikzpicture} \node (A) {A} \LeafNode{B} \LeafNode{C} ; \end{tikzpicture}% \hspace{2cm}% \begin{tikzpicture} \node (A) {A} \InnerNode{\LeafNode{D}}{\LeafNode{E}}{B} \LeafNode{C} ; \end{tikzpicture} \end{document} I expected this to produce two trees: A A / \ / \ B C B C / \ D E but I am getting: A | A B | | B D | | C C Am I missing something or there is no way to do it? BTW, if I omit the label on my root node, I get a PGF error: ! Package pgf Error: No shape named is known. -- Tsf

    Read the article

  • How to Find Intersections with Ellipses in PGF/TikZ

    - by infblnpf
    Hello, I am trying to display a sphere in PGF/TikZ to illustrate the idea of great circles. The code for my current result is: \begin{tikzpicture} \tikzfading[name=fade right, left color=transparent!20, right color=transparent!90] \tikzfading[name=fade out, inner color=transparent!100, outer color=transparent!10] \tikzfading[name=fade right gc, left color=transparent!0, right color=transparent!70] \draw [<->, dashed] (0,-5) -- (0,5); % y-axis \draw [->, dashed] (0, 0) -- (20:5); % x-axis \draw [->, dashed] (0, 0) -- (200:5); % x-axis \draw [->, dashed] (0, 0) -- (340:5); % z-axis \draw [->, dashed] (0, 0) -- (160:5); % z-axis \fill [color=cyan, opacity=0.15, path fading=fade out] (0,0) circle (4cm); % bounding circle \fill [color=cyan, opacity=0.25, path fading=fade right, fading angle=90] (0,0) ellipse (4cm and 1cm); % x-y-axis area % great circle 1 \draw [rotate=-40, color=red, path fading=fade right gc, fading angle=40] (0,0) ellipse (4cm and 1cm); % great circle 2 \draw[rotate=5, color=red, path fading=fade right gc, fading angle=5] (0,0) ellipse (1.5cm and 4cm); \end{tikzpicture} How do I find the two points of intersection of the two red ellipses (commented as great circle 1 and 2), find the point of intersection of a line (originating at the center (0,0)) with a ellipse, and place a little circle or rectangle there? Placing a little circle or rectangle there is not an issue. Thank you very much!

    Read the article

  • Tikz: horizontal centering of group of nodes

    - by mindhex
    Hi, I need to align each row of the graph to the center. I am trying to do it with xshift. Here the code: \begin{tikzpicture}[node distance=1.5cm, auto, text centered] \tikzstyle{every node}=[draw,ball,align=center]; \begin{scope}[xshift=1.5cm] \node (A) {A}; \node [right of=A] (B) {B}; \node [right of=B] (C) {C}; \node [right of=C] (D) {D}; \end{scope} \begin{scope}[yshift=-1.5cm] \node (AB) {AB}; \node [right of=AB] (AC) {AC}; \node [right of=AC] (AD) {AD}; \node [right of=AD] (BC) {BC}; \node [right of=BC] (BD) {BD}; \node [right of=BD] (CD) {CD}; \end{scope} \begin{scope}[yshift=-3cm,node distance=2cm,xshift=1cm] \node (ABC) {ABC}; \node [right of=ABC] (ABD) {ABD}; \node [right of=ABD] (ACD) {ACD}; \node [right of=ACD] (BCD) {BCD}; \end{scope} \begin{scope}[xshift=4cm, yshift=-4.5cm, node distance=2cm] \node (ABCD) {ABCD}; \end{scope} \end{tikzpicture} Is there any other way to do it? Do not like to change xshift values every time.

    Read the article

  • How can I apply a style to existing tikz node on specific slides

    - by Eugene Pimenov
    This is what I'm trying to do \begin{tikzpicture} [node distance = 1cm, auto,font=\footnotesize, % STYLES every node/.style={node distance=1.3cm}, comment/.style={rectangle, inner sep= 5pt, text width=4cm, node distance=0.25cm, font=}, module/.style={rectangle, drop shadow, draw, fill=black!10, inner sep=5pt, text width=3cm, text badly centered, minimum height=0.8cm, font=\bfseries\footnotesize\sffamily,rounded corners}, selected/.style={fill=red!40}] \node [module] (nodeA) {node A}; \node [module, below of=nodeA] (nodeA) {node B}; \only<1>{ \node [comment, text width=6cm, right=0.25 of nodeA] {short description of Node A}; \node [comment, text width=6cm, right=0.25 of nodeB] {short description of Node B}; } \only<2>{ \node [selected] (nodeA) {}; \node [comment, text width=6cm, right=0.25 of nodeA] {long description of node A}; } \only<3>{ \node [selected] (nodeB) {}; \node [comment, text width=6cm, right=0.25 of nodeA] {long description of node B}; } \end{tikzpicture} The problem is \node [selected] (nodeB) {}; creates a new node, but I want it to apply the style for the existing node. Is there any way to do so? Of course I could have copies of every node in selected state and not-selected state, but I really want to have a normal solution.

    Read the article

  • How can I include a .eps figure within a Tikz simple flow chart?

    - by Jan
    Hi, I would like to create a simple flow chart in latex with the TikZ package similar to the following example http://www.texample.net/tikz/examples/simple-flow-chart/ However I would like to include figures (a time series plot created in R, as eps or something else) within the flowchart (e.g. for example within a {block}? \documentclass{article} \usepackage[latin1]{inputenc} \usepackage{tikz} \usetikzlibrary{shapes,arrows} \begin{document} \pagestyle{empty} % Define block styles \tikzstyle{decision} = [diamond, draw, fill=blue!20, text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt] \tikzstyle{block} = [rectangle, draw, fill=blue!20, text width=5em, text centered, rounded corners, minimum height=4em] \tikzstyle{line} = [draw, -latex'] \tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm, minimum height=2em] \begin{tikzpicture}[node distance = 2cm, auto] % Place nodes \node [block] (init) {initialize model}; \node [cloud, left of=init] (expert) {expert}; \node [cloud, right of=init] (system) {system}; \node [block, below of=init] (identify) {identify candidate models}; \node [block, below of=identify] (evaluate) {evaluate candidate models}; \node [block, left of=evaluate, node distance=3cm] (update) {update model}; \node [decision, below of=evaluate] (decide) {is best candidate better?}; \node [block, below of=decide, node distance=3cm] (stop) {stop}; % Draw edges \path [line] (init) -- (identify); \path [line] (identify) -- (evaluate); \path [line] (evaluate) -- (decide); \path [line] (decide) -| node [near start] {yes} (update); \path [line] (update) |- (identify); \path [line] (decide) -- node {no}(stop); \path [line,dashed] (expert) -- (init); \path [line,dashed] (system) -- (init); \path [line,dashed] (system) |- (evaluate); \end{tikzpicture} \end{document} Thanks, Jan

    Read the article

  • fresh installation of PGF/TikZ crashes, why?

    - by Vincenzo
    I have a clean CentOS 5.5 machine with tetex installed. Next, I installed PGF/TikZ: wget http://media.texample.net/pgf/builds/pgfCVS2010-06-02_TDS.zip unzip pgfCVS2010-06-02_TDS.zip \cp -r tex /usr/share/texmf texhash I'm trying to compile a simple document and this is what I'm getting: $ latex test.tex This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) entering extended mode (./test.tex LaTeX2e <2003/12/01> .. skipped .. (/usr/share/texmf/tex/latex/pgf/frontendlayer/tikz.sty (/usr/share/texmf/tex/latex/pgf/pgf.sty (/usr/share/texmf/tex/latex/graphics/graphicx.sty (/usr/share/texmf/tex/latex/graphics/graphics.sty (/usr/share/texmf/tex/latex/graphics/trig.sty) (/usr/share/texmf/tex/latex/graphics/graphics.cfg)))) (/usr/share/texmf/tex/latex/pgf/utilities/pgffor.sty (/usr/share/texmf/tex/latex/pgf/utilities/pgfrcs.sty (/usr/share/texmf/tex/generic/pgf/utilities/pgfutil-common.tex) (/usr/share/texmf/tex/generic/pgf/utilities/pgfutil-latex.def) (/usr/share/texmf/tex/generic/pgf/utilities/pgfrcs.code.tex)) (/usr/share/texmf/tex/latex/pgf/utilities/pgfkeys.sty (/usr/share/texmf/tex/generic/pgf/utilities/pgfkeys.code.tex (/usr/share/texmf/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex))) (/usr/share/texmf/tex/generic/pgf/utilities/pgffor.code.tex)) (/usr/share/texmf/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex (/usr/share/texmf/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex ! Undefined control sequence. \pgfsetplottension ...ttension {\pgf@sys@tonumber \pgf@x } l.104 \pgfsetplottension{0.5} ? I failed to find any clues in the net about this problem. On other servers I don't such a problem. Could anyone help please? Thanks! ps. Btw, I tried another build of PGF/TikZ, the older one, no luck :(

    Read the article

  • What are the ways to create draw data structures for latex?

    - by alicephacker
    I tried tikz/pgf a bit but have not had much luck creating a nice diagram to visualize bitfields or byte fields of packed data structures (i.e. in memory). Essentially I want a set of rectangles representing ranges of bits with labels inside, and offsets along the top. There should be multiple rows for each word of the data structure. This is similar to most of the diagrams in most processor manuals labeling opcode encoding etc. Has anyone else tried to do this using latex or is there a package for this?

    Read the article

  • Latex: stretchable curly braces outside math

    - by basweber
    Hi, I am producing some latex beamer slides (but I think it is not a beamer specific question per se). I have the following: \begin{itemize} \item Issue1 \item Issue2 \item Issue3 \end{itemize} Now, I want to have a right curly brace (i.e. '}') behind the items spreading over issue1 and issue2. And of course I want to write something behind that curly brace. In a perfect world I would write something like: \begin{itemize} \left . \item Issue1 \item Issue2 \right \} One and Two are cool \item Issue3 \end{itemize} This does not work because I am not in a math environment and I can not put the whole snippet inside a math environment because itemize would not work in that case. Is there a clean solution or a hack to produce my desired result? Regards, Bastian.

    Read the article

  • How to create diagrams for papers.

    - by Simon
    I want to create some diagrams for some papers. Diagrams will contain some text, e.g. some console output. I need images for using also in html files. There is TikZ so can create images like this: http://www.texample.net/tikz/examples/boxes-with-text-and-math/ http://www.texample.net/tikz/examples/rule-based-diagram/ http://www.texample.net/tikz/examples/scenario-tree/ but as a result I get some ps/pdf files, not images. What's more I want to generate the pictures from text files as I want to track changes in some VCS, any binary files are not suitable for that.

    Read the article

  • How can I correctly display my AVL Tree in LaTex? A solo left-child hangs straight down....

    - by cb
    The below code almost works perfectly, however the child of 9, 7, hangs straight down instead of as a left-child. How can I correct this? \usepackage{tikz} \usepackage{xytree} \begin{tikzpicture}[level/.style={sibling distance=60mm/#1}] \node [circle,draw] {4} child { node [circle,draw] {2} child {node [circle,draw] {1} } child { node [circle,draw]{3} } } child {node [circle,draw] {6} child {node [circle,draw] {5} } child {node [circle,draw] {9} child {node [circle, draw] {7}} } }; \end{tikzpicture}} Thanks, CB

    Read the article

  • What would be a good opensource software for graphing circles, circular regions, and regions bounded by curves and/or arcs?

    - by Michael Dykes
    Hullo all. I have just started s job with Chegg, and my 1st assignment has me writign solutions for Stewart's Essential Calculus. I am dealing with the chapter on multiple integration, and need a good open-source software that I can easily use to draw regions (domains) that would require multiple integrals: i.e. circular regions, portions of circles, regions bounded by curves and/or arcs, and at some point 3D pictures. In most of these cases, I am not working with an exact equation or perhaps need to draw the region bounded by r (radius) between 1 and 2, and the angle theta bounded between pi/4 and 3 pi/4. I am not too terribly familiar with programs like Corel Draw, but the documents I have from this company suggest Corel Draw. So I think I am looking for an open-source free program like Corel Draw or something similar. Any additional suggestions would also be appreciated. I know I can do most, if not all of this using TikZ, but the learning curve is a bit steep, and at the moment I an on a time constraint. Thanks.

    Read the article

  • The way to find out whole picture width in PGF (Latex)

    - by drasto
    I've got a latex macro that draws a picture using PGF and Tikz according to given parameters. The width of picture drawn depends on these parameters. PGF automatically calculates the resulting width of any picture drawn so the user does not have to set it explicitly(like for example when using latex build in picture environment). However I need to know the width of picture that will be drawn. Of cause I could calculate it as the PGF does but this is going to be quite some work(a lot of if statements...). Is there a way to ask PGF what is the width of picture that is to be drawn (some command I expect)? Either inside tikzpicture environment or just after it? Thanks for help.

    Read the article

  • Problem with pgfplot label

    - by harper
    I want to draw an x-y-diagram with axis labels. Unfortunately the ylabel is misplaced. It looks as depending on the actual data. When the other data line in the sample below is used instead of the upper line, it looks better. How can I move the label to the left or (more desirable) how can I tell pgfplot to do it corectly? % !TEX TS-program = pdflatex % !TEX encoding = UTF-8 Unicode \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[width=13cm,height=8cm, xlabel={I in mA}, ylabel={U in mV}] \addplot[only marks,mark=star] coordinates { % (1.36, -0.0177) (45.38, 0.0273) (74.19, 0.0413) (100.88, 0.0533) (134.80, 0.0683) (195.27, 0.1073) }; \end{axis} \end{tikzpicture} \end{document}

    Read the article

  • How to transform a csv to combine matching rows?

    - by Christian Wolf
    I have a CSV file with some transaction data. Let's say date, volume, price and direction (sell/buy). Additionally there is a ID for each transaction and on each closing transaction (the newer one) there is a reference to the corresponding transaction. Classical database referencing. Now I want to do some statistics and draw some plots. This could be done via Octave, LaTeX/TikZ, Gnuplot or whatever. To do this I need both buy and sell price in one row. My thought was to preprocess the CSV to get another CSV containing the needed information and then to do the statistics. In the end I'd like to have a solution based on scripts and not on a spreadsheet as data might change often (exported from online DB). My actual solution (see http://paste.ubuntu.com/6262822/ ) is a bash script that parses the CSV line by line and checks if there exists a corresponding transaction. If found, a new row is written to the destination CSV. If not a warning is printed. The bad news: For each row in the source file I have to read the whole file a few times. This causes long running times of 10sec for 300 lines. As the line number might rise soon (10k lines), this is not perfect. I am aware, that there are many shells to be opened in the script which might cause the performance problems. Now my questions: Is bash/awk/sed/.... a good way to do things? Should I first import all data into a "real" local database to use SQL? Is there an easy way to achieve the desired results?

    Read the article

  • Latex: Listings with monospace fonts

    - by Nils
    This is what the code looks in Xcode. And this in my listing created with texlive. And yes I used basicstyle=\ttfamily . Having looked at the manual of listings I haven't found anything about fixed-with or monospace fonts.. Example to reproduce \documentclass[ article, a4paper, a4wide, %draft, smallheadings ]{book} % Packages below \usepackage{graphicx} \usepackage{verbatim} % used to display code \usepackage{hyperref} \usepackage{fullpage} \usepackage[ansinew]{inputenc} % german umlauts \usepackage[usenames,dvipsnames]{color} \usepackage{float} \usepackage{subfig} \usepackage{tikz} \usetikzlibrary{calc,through,backgrounds} \usepackage{fancyvrb} \usepackage{acronym} \usepackage{amsthm} % Uuhhh yet another package \VerbatimFootnotes % Required, otherwise verbatim does not work in footnotes! \usepackage{listings} \definecolor{Brown}{cmyk}{0,0.81,1,0.60} \definecolor{OliveGreen}{cmyk}{0.64,0,0.95,0.40} \definecolor{CadetBlue}{cmyk}{0.62,0.57,0.23,0} \definecolor{lightlightgray}{gray}{0.9} \begin{document} \lstset{ language=C, % Code langugage basicstyle=\ttfamily, % Code font, Examples: \footnotesize, \ttfamily keywordstyle=\color{OliveGreen}, % Keywords font ('*' = uppercase) commentstyle=\color{gray}, % Comments font numbers=left, % Line nums position numberstyle=\tiny, % Line-numbers fonts stepnumber=1, % Step between two line-numbers numbersep=5pt, % How far are line-numbers from code backgroundcolor=\color{lightlightgray}, % Choose background color frame=none, % A frame around the code tabsize=2, % Default tab size captionpos=b, % Caption-position = bottom breaklines=true, % Automatic line breaking? breakatwhitespace=false, % Automatic breaks only at whitespace? showspaces=false, % Dont make spaces visible showtabs=false, % Dont make tabls visible columns=flexible, % Column format morekeywords={__global__, __device__}, % CUDA specific keywords } \begin{lstlisting} As[threadRow][threadCol] = A[ threadCol + threadRow * Awidth // Adress of the thread in the current block + i * BLOCK_SIZE // Pick a block further left for i+1 + blockRow * BLOCK_SIZE * Awidth // for blockRow +1 go one blockRow down ]; \end{lstlisting} \end{document}

    Read the article

1