Quantcast
Channel: Question and Answer » tikz-pgf
Viewing all 959 articles
Browse latest View live

TikZ: using the -latex arrow head in decorations.markings

$
0
0

Is there a way to get -latex arrow heads to work when using decorations.markings?

documentclass[convert = false, border = 1cm]{standalone}
usepackage{tikz}
usetikzlibrary{calc, arrows, decorations.markings}
begin{document}
begin{tikzpicture}[decoration = {markings,
    mark = at position 0.5 with {arrow{-latex}}
  }
  ]
  draw[postaction = decorate] (0, 0) circle [radius = 2cm];
end{tikzpicture}
end{document}

I have also tried with {-latex} but that doesn’t work either.


Adding dimensions to TikZ pictures

$
0
0

How do you add dimension labels to TikZ pictures? Ideally, it would look something like this:

|<----- dimension ----->|

I would like to do this to show the measurement of both straight lines (i.e. sides of a polygon) and curved lines (i.e. circumference/arc length on a circle). Thanks in advance for your help!

How can I draw a TikZ element multiple times against a shaded background?

$
0
0

If I have two tikzpictures drawn:

documentclass{article}
usepackage[margin = 1in]{geometry}
usepackage{tikz}
usetikzlibrary{decorations.pathmorphing,calc,shapes,shapes.geometric,patterns}
begin{document}

tikzset{treetop/.style = {decoration={random steps, segment length=0.4mm},decorate},trunk/.style = {decoration={random steps, segment length=2mm, amplitude=0.2mm},decorate}}

begin{tikzpicture}
foreach w/f in {0.3/30,0.2/50,0.1/70} {
fill [brown!f!black, trunk] (0,0) ++(-w/2,0) rectangle +(w,-3);
}
foreach n/f in {1.4/40,1.2/50,1/60,0.8/70,0.6/80,0.4/90} {
   fill [green!f!black, treetop] ellipse (n/1.5 and n);
}
end{tikzpicture}

begin{tikzpicture}
shade[bottom color=cyan!60!black, top color=blue!20!white] (0,0) rectangle (10,10);
end{tikzpicture}

end{document}

enter image description here

How could I use the first tikz picture within the second? Can I define the first picture as some variable and then place this variable within the second picture and have the option of defining its exact location (x,y) and its size? For example, if I wanted to place the tree in the middle of the rectangle (5,5) but make the size of the tree half its current size. How would I do this

Tikz flow chart and beamer

$
0
0

I am creating a beamer presentation. I have following tikz flow chart. The problem is the chart appears to be cluttered and is not accomodated on a single slide.

Here is the code

documentclass[12pt,a4paper]{beamer}
usepackage[latin1]{inputenc}
usepackage[english]{babel}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{amssymb}
usepackage{makeidx}
usepackage{graphicx}
usepackage{lmodern}
usetheme{CambridgeUS}
usefonttheme{professionalfonts}
usepackage{tikz}
%usetheme{AnnArbor}
author{Dr Vaibhav Banait}
title{Dysphagia - a serious symptom}
begin{document}
begin{frame}
maketitle
end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
begin{frame}{Dysphagia}
begin{center}

% Define block styles
tikzstyle{block} = [rectangle, draw, fill=blue!20, 
    text width=5em, text centered, rounded corners, minimum height=4em]

begin{tikzpicture}[scale=0.15, node distance=2cm, auto]
    % Place nodes
    node [] (Dysphagia) {Food sticks in chest after swallowing};
    node [ below of=Dysphagia] (Esophageal){Esophageal dysphagia};
   node [ below left  of=Esophageal] (Mechanical) {Solids only };
 node [ below of = Mechanical](Mechanical1){Mechanical};
    node [ below left of =Mechanical1](Intermittent){Intermittent};
    node [ below right of =Mechanical1](Progressive){Progressive};
    node [ below left of =Progressive](heartburn){Chronic heart burn};
node [below of=heartburn](peptic){Peptic stricture};
node[below right of =Progressive](age){Age more than50};
   node[below of =age](ca){Ca Esophagus }; 
node [below of =Intermittent](Web){Esophageal web };
node [below right of=Esophageal](Solidliquids){Solid and liquids=motor };

node[below right of =Solidliquids](Intermittent1){Intermittent };
node[below left of =Solidliquids](Progressive1){Progressive};
node [below of =Intermittent1](chestpain){Chest Pain};
node [below of =chestpain ](DES){Diffuse esophageal spasm};
node [below left of = Progressive1](heartburn1){Chronic heart burn};
node [below of =heartburn1](scleroderma){Scleroderma};
node [below right of = Progressive1](resp){Respiratory symptoms};
node[below of =resp](achalasia){achalasia};
    % Draw edges
 path [draw] (Dysphagia)--(Esophageal);
path [draw] (Esophageal)--(Mechanical);
path[draw](Esophageal)--(Solidliquids);
path[draw](Mechanical)--(Mechanical1);
path[draw](Mechanical1)--(Progressive);
path[draw](Mechanical1)--(Intermittent);
path[draw](Progressive)--(heartburn);
path[draw](Progressive)--(age);
path[draw](heartburn)--(peptic);
path[draw](age)--(ca);
path[draw](Intermittent)--(Web);
path[draw](Solidliquids)--(Intermittent1);
path[draw](Solidliquids)--(Progressive1);
path[draw](Intermittent1)--(chestpain);
path[draw](Intermittent1)--(DES);
path[draw](Progressive1)--(resp);
path[draw](resp)--(achalasia);
path[draw](Progressive1)--(heartburn1);
path[draw](heartburn1)--(scleroderma);
   % path [line] (Vaibhav) -- (Vibhor);

end{tikzpicture}




end{center}


end{frame}

end{document}

Upside down tikz-qtree with concentrated edges

$
0
0

I would like to create an upside down tree with concentrate edges and labels inside the nodes as labels above them.

desired result

Right now I’ve come so far. But I still need the edges to concentrate/combine and put the labels + and * next to the overlapping bit. And I need to add the extra labels x, y, and z to the top nodes.

current situation

How do I get the tree from the first image? (The corners do not need to be rounded.) It is not absolutely necessary to use tikz-qtree.

tikzstyle{var} = [draw,shape=rectangle,minimum size=2em,
                        inner sep=2pt,fill=white!20]
tikzstyle{operator} = [draw=none,fill=none,minimum size=2em,
                        inner sep=2pt,fill=white!20]
begin{tikzpicture}[grow'=up,level distance=1.25cm,sibling distance=1cm,]
  tikzset{every node/.style={var}}
  Tree [.7 edge node[auto=right,style={operator}] {$+$};
            [.6 edge node[auto=right,style={operator}] {$*$};
                [.2 ] [.3 ] ]
                      [.1 ] ]
end{tikzpicture}

Tikz surrounding box with automatically drawn border “ports”

$
0
0

I’d like to have Tikz automatically draw a “bounding box” around some nodes, which can have an arbitrary number of “ports” on the left and right sides that should be given anchors, so that edges of the contained nodes can connect to the ports on the boundaries.

An example: Example

I’d like the boundary ports to be evenly spaced automatically, and don’t want to have to specify them one-by-one!

For example, I’d like to somehow say something like this:

documentclass[tikz]{standalone}
begin{document}
begin{tikzpicture} [node distance=2cm]
    tikzstyle{foo}=[draw,circle,inner sep=0.4cm]
    tikzstyle{arr}=[->, >=latex, shorten >=1pt, semithick]
    node[foo] (a) {};
    node[foo] (b) [right of=a] {};
    node[fill] (l1) [above left of=a] {}; % I don't want to specify these 3!
    node[fill] (l2) [below left of=a] {};
    node[fill] (r1) [right of=b] {};
    draw (a.east) edge[arr] (b.west);
    draw (l1) edge[arr] (a.west); % But I would like l1, l2, r1 to exist!
    draw (l2) edge[arr] (a.west);
    draw (b.east) edge[arr] (r1);
end{tikzpicture}
end{document}

But without manually specifying l1,l2,r1 (I’d rather pass parameters of 2/1 to say 2 ports on the left and 1 on the right). Also, I don’t know how do get the surrounding rectangle to be drawn automatically (with some “padding” between the nodes and the rectangle).

EDIT:

Kevin C’s answer is very nice, but it seems the bounding box takes account of labels (I’d rather it didn’t), and asking for 0 boundary ports, spuriously adds one at the top and bottom of the edge. E.g.

begin{document}
begin{tikzpicture}
    tikzset{
        foo/.style={draw,circle,inner sep=0.4cm},
        arr/.style={->, >=latex, shorten >=1pt, semithick},
        }
    node[foo] (a) [label=above:$a$]{};

    anchorbound{0}{1}

    draw[arr] (a.east) to node[above] {$alpha$}  (r1);
end{tikzpicture}
end{document}

Looks a bit strange (the a node is relatively lower than I’d like). Can I somehow tell tikz to ignore the labels in the bounding box calculation?

enter image description here


Positioning one tikz with regard to another tikz nodes

$
0
0

I have two tikzpicture within a figure and I would like to place one tikz relatively to the other tikz nodes. I tried below of= with no success. The two tikz have different arrows and layouts. Here is the code where I need to place the second tikz under the ABC node.

    begin{figure}[H]
    centering
    begin{tikzpicture}[node distance=4cm]
    node (1){$ABC$};
    node (2)[right of=1]{$CD$};
    path (1) edge (2);
    end{tikzpicture}

    begin{tikzpicture}
    [->,>=stealth',shorten >=1pt,auto,node distance=1cm,semithick,scale=-.2]

    node (236) {$236$};
    node (136) [below left of=236]{$136$};
    node (246) [below of=236]{$246$};
    node (235) [below right of=236]{$235$};

    path (236) edge (136)  edge (246) edge(235);

    end{tikzpicture}

    caption{Example}
    label{example}
    end{figure}

How can I place the second tikz under the first one’s ABC node?

TikZ: using name intersections to define a node

$
0
0

Two questions:

  1. What is going wrong with these nodes that are defined from the intersections?
  2. Can this be automated with foreach syntax to find the other vectors for the 2nd point? I couldn’t figure that out.

documentclass[tikz]{standalone}
usepackage{amsmath}

usetikzlibrary{intersections}
usetikzlibrary{calc}

%  Used for both ellipses and circles                                               
tikzset{%                                                                          
  partial ellipse/.style args = {#1:#2:#3}{%                                        
    insert path = {+ (#1:#3) arc (#1:#2:#3)}
  }
}

%  unit vectors                                                                     
newcommand{unit}[1]{hat{mathbf{#1}}}

begin{document}
begin{tikzpicture}
  coordinate (O) at (0, 0);

  draw[-latex] (O) -- (4, 0) node[pos = 1.1, font = scriptsize] {(x)};
  draw[-latex] (O) -- (0, 4) node[pos = 1.1, font = scriptsize] {(y)};
  draw[blue, name path = arc] (O) [partial ellipse = -15:75:3];


  foreach i/angle in {1/60, 2/30}{
    path[name path global = linei] (O) -- (angle:3.5);
    path[name intersections = {of = arc and linei, by = Pi}];
    path[name path global = circi] (Pi) circle[radius = 1bp];

    filldraw[black] (Pi) circle[radius = .025cm];
  }

  node[coordinate, name intersections = {of = circ1 and arc}] (A1) at
  (intersection-1) {};
  node[coordinate, name intersections = {of = circ1 and arc}] (A2) at
  (intersection-2) {};
  draw[name intersections = {of = circ1 and arc}, -latex] (P1) --
  ($(A2)!.75cm!(A1)$) node[pos = 1.125, font = tiny] {(unit{u})} coordinate
  (B1);

  draw[-latex] (P1) -- ($(P1)!.75cm!-270:(B1)$) node[pos = 1.125,
  font = tiny] {(unit{n})};
end{tikzpicture}
end{document}

From the image, we see that first point is drawing correctly it just has associated errors with it.

enter image description here


Randomized coordinates in TikZ

$
0
0

I need to draw a number of `bacteria’ in TikZ. Their coordinates and orientation needs to be random within a pre-defined scope.

I have randomized the orientation successfully, but not the location of each bacterium.

Here is what I have:

documentclass{article}  
usepackage{pgfplots}  
pgfplotsset{compat=newest}  
usetikzlibrary{calc,decorations,decorations.pathreplacing}  
begin{document}  
    newcommand{bacterium}[3]{scalebox{#2}{tikz[rotate=#3]{
    coordinate (A) at (#1);  
    shadedraw[shading=ball,ball color=yellow!75, white,rounded corners=10](A) rectangle++(1.5,.65);  
    draw[decorate,decoration={snake,amplitude=1mm}](A)++(0,.75*.5)--++(-1,0);}}}


begin{tikzpicture}  
    foreach x in {1,2,...,10}{
    bacterium{rand*10,rand*10}{.2}{rand*360}}  
end{tikzpicture}  
end{document}

This results in the bacteria orienting randomly but lining up along the x-axis.
enter image description here

How to redirect associations in the tikz-uml package?

$
0
0

I am using the tikz-uml package to model a class diagram.

The code snippet is placed in the examples sub-directory of the downloaded tikz-uml package.

Here is the code:

documentclass[a4paper,11pt, svgnames]{article}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[french]{babel}
usepackage{listings}

usepackage{../tikz-uml}

textwidth 18.5cm
textheight 25.5cm
hoffset=-2.9cm
voffset=-2.9cm

sloppy
hyphenpenalty 10000000

date{}
title{}
author{}

begin{document}

begin{tikzpicture}
    begin{umlpackage}{First}
        begin{umlpackage}{Second}
            umlemptyclass[type=abstract]{F}
            umlemptyclass[y=-3, type=abstract]{M}
            umlimpl{M}{F}

            umlemptyclass[y=-3, x = 6]{P}
            umlemptyclass[y=-6, x = 6]{H}
            umlimpl{P}{M}
            umlunicompo[pos1=1.9, pos2=0.2]{P}{M}
            umlinherit{H}{P}
        end{umlpackage}
    end{umlpackage}
end{tikzpicture}

end{document}

and it results with the following diagram:

Composition and implementation

The association lines between P and M are overlapping.
I would like to redirect the composition line (black diamond) between P and M, so that the line is parallel to the implementation line (empty arrow), only placed above it. I tried reading the documentation, but whatever I do fails. Any help?

How to adjust the y-axis of pgfplots

$
0
0

In the right pgfplots, I hope that it could have
(0, 10000,20000,30000,40000,50000)[in normal scale], rather than (1000,10000) [in log scale] now, how should I do that?
enter image description here

This the the code

begin{minipage}{0.5linewidth}
centering
scriptsize
 begin{tikzpicture}[font=sffamily]
begin{semilogyaxis}[title=Random Dataset,
                legend pos=outer north east,
                legend style={draw=none},
                xtick={1,2,...,9}, % new bit
                scaled ticks=false,
                log ticks with fixed point={1000 sep=},
                axis x line=bottom,
                axis y line=left,
                axis line style=-,
                minor tick style={draw=none},
                enlargelimits,
                ylabel = Solving Time (ms),
                xlabel = Number of Constraints,
                every axis legend/.append style={xshift=-10pt}
                ]
addplot+[mark=triangle] plot coordinates{(1,7112)(2,11330)(3,4574)(4,5036)(5,14003)(6,11445)(7,7478)(8,8973)(9,10895)};
addplot plot coordinates{(1,4499)(2,4816)(3,3201)(4,2903)(5,5912)(6,4896)(7,7536)(8,6998)(9,4786)};
addplot+[draw opacity=0.5, thick, mark=square] plot coordinates{(1,78)(2,62)(3,41)(4,44)(5,120)(6,96)(7,133)(8,133)(9,91)};
%addplot plot coordinates{(1,81)(2,62)(3,48)(4,47)(5,101)(6,90)(7,129)(8,159)(9,168)};
%legend{$exact$,$kmeansskyline$,$DROO$,$DROSkyline$}
legend{$exact$,$kmeans$,$DROO$}
end{semilogyaxis}
end{tikzpicture}
end{minipage}% new bit
begin{minipage}{0.5linewidth}
centering
scriptsize
 begin{tikzpicture}[font=sffamily]
begin{semilogyaxis}[title=Random Dataset,
                legend pos=outer north east,
                legend style={draw=none},
                xtick={500,1500,...,5000}, % new bit
                scaled ticks=false,
                log ticks with fixed point={1000 sep=},
                axis x line=bottom,
                axis y line=left,
                axis line style=-,
                minor tick style={draw=none},
                enlargelimits,
                ylabel = Solving Time (ms),
                xlabel = Service Class Size,
                every axis legend/.append style={xshift=-10pt}
                ]
addplot+[mark=triangle] plot coordinates{(500,1518)(1000,1431)(1500,1459)(2000,1346)(2500,1381)(3000,1474)(3500,1425)(4000,1508)(4500,1460)(5000,1389)};
addplot plot coordinates{(500,37318)(1000,42496)(1500,38965)(2000,38415)(2500,34268)(3000,32102)(3500,30805)(4000,29453)(4500,33075)(5000,46871)};
addplot+[draw opacity=0.5, thick, mark=square] plot coordinates{(500,8798)(1000,9953)(1500,13899)(2000,10810)(2500,11588)(3000,10397)(3500,9437)(4000,8202)(4500,6698)(5000,5635)};
%addplot plot coordinates{(500,61)(1000,105)(1500,89)(2000,107)(2500,86)(3000,64)(3500,102)(4000,80)(4500,85)(5000,128)};
%legend{$exact$,$kmeansskyline$,$DRONP$,$DROSkyline$}
legend{$exact$,$kmeans$,$DRO$}
end{semilogyaxis}
end{tikzpicture}
end{minipage}

Tikz picture, align left in column using beamer

$
0
0

I’m currently struggling with aligning a tikzpicture, within a figure environment, at the left of a column. It seems like the figure is always align centre, or right

Using beamer, for a presentation.

    begin{column}{0.5textwidth}
        begin{figure}
            input{pics/tikzpicture.tex}
        end{figure}
    end{column}

Reduce white space above TikZ label

$
0
0

I’m new to TikZ, and have drawn the following picture,

documentclass[12pt,a4paper]{article}
usepackage{tikz}
usetikzlibrary{trees,arrows}
begin{document}

begin{tikzpicture}[every node/.style={draw,shape=circle,inner sep=2pt,fill=black}]
    node [label=above:$a$]{}
        child {node[label=above:$b$,label=below:$pland q$]{}}
        child {node[label=above:$c$,label=below:$pland lnot q$]{}}
;
end{tikzpicture}

end{document}

enter image description here

But there’s too much space above the propositional formula on the right, is there any way I can decrease the amount of whitespace to be closer to the amount of whitespace for the labels a, b, c?

[edit] Jesse linked me to a way of adjusting the position of the label manually, but a way to align both labels without fine tuning would be nice.

tick mark/range problem on graph generated using TikZ

$
0
0

I’m having a little difficulty getting a tick mark on a graph generated using TikZ to appear correctly. The code is below and the problem can be seen in the vertical axis of the second graph (b). How could I fix this little problem?

begin{figure}
    centering
    subfigure[hard limiter]{
        begin{tikzpicture}[font=scriptsize]
            begin{axis}[
                xtick=empty,
                ytick={-1, 0, 1},
                xlabel=${x}$,
                ylabel=${f_{h}left(xright)}$,
                width=150 pt]
                addplot+[mark=none, black]
                    coordinates{
                        (-1, -1)
                        (0, -1)
                        (0, 1)
                        (1, 1)
                    };
            end{axis}
        end{tikzpicture}
        label{figure:hard_limiter_1}
    }
    \
    subfigure[threshold logic]{
        begin{tikzpicture}[font=scriptsize]
            begin{axis}[
                ymin=-1,
                xtick=empty,
                ytick={-1, 0, 1},
                xlabel=${x}$,
                ylabel=${f_{t}left(xright)}$,
                width=150 pt]
                addplot+[mark=none, black]
                    coordinates{
                        (-1, 0)
                        (0, 0)
                        (1, 1)
                    };
            end{axis}
        end{tikzpicture}
        label{figure:threshold_logic_1}
    }
    subfigure[sigmoid]{
        begin{tikzpicture}[font=scriptsize]
            begin{axis}
                [
                    xtick=empty,
                    ytick={-1, 0, 1},
                    xlabel=${x}$,
                    ylabel=${f_{s}left(xright)}$,
                    width=150 pt
                ]
                addplot+[mark=none, smooth, black] {2/(1+e^(-x))-1};
            end{axis}
        end{tikzpicture}
        label{figure:sigmoid_1}
    }
    caption{three representative nonlinearities}
    label{figure:three_representative_nonlinearities_1}
end{figure}

Creating table using TikZ matrix

$
0
0

I’m trying to create a table in TikZ with

  1. the first column right-aligned, and the texts in each cell on the same line
  2. the rest of the columns center-aligned, and each has width of 1cm

My attempt is as follows:

documentclass{article}
usepackage{tikz}
usetikzlibrary{matrix}

begin{document}

begin{tikzpicture}
  matrix(dict)[matrix of nodes,below=of game,
    nodes={align=center,text width=1cm},
    row 1/.style={anchor=south},
    column 1/.style={text width=2cm,align=right},
  ]{
    meaning & $b_1$ & $b_2$ & $b_3$ & $b_1b_2$ & $b_1b_3$ & $b_2b_3$ & $b_1b_2b_3$\
    common list \
    private list\
  };
  draw(dict-1-1.south west)--(dict-1-8.south east);
  draw(dict-1-1.north east)--(dict-3-1.south east);
end{tikzpicture}

end{document}

enter image description here

The output is not as desired, since the texts in cells dict-2-1 and dict-3-1 spread over two lines. Also, texts in column 1 is not right aligned, despite column 1/.style being specified after node/.style.

What should I do?


TikZ Matrix 'draw' alignment

$
0
0

Apologies if this has already been asked – I could not find it.

The following is an example of what goes wrong:
enter image description here

In this example I would like it to look just like a regular 2×3 table, but I think the problem is that draw starts from the end of the math, not the end of the cell. (I’d prefer to not just use tabular as I will be arrows between columns ultimately)

begin{tikzpicture}
matrix[matrix of math nodes,nodes in empty cells,nodes={anchor=center},text depth=0.5ex,text height=2ex,inner sep=2pt,row sep=1.5em,column sep=1.5em,] (M)
{
0 & 0 & 0 \
a+b+c+d+e & a+b+c+d+e & a+b+c+d+e \
}    ;
draw[] (M-1-1.north west) -- (M-1-3.north east);
draw[] (M-2-1.north west) -- (M-2-3.north east);
draw[] (M-2-1.south west) -- (M-2-3.south east);
draw[] (M-1-1.north east) -- (M-2-1.south east);
draw[] (M-1-2.north east) -- (M-2-2.south east);
draw[] (M-1-3.north east) -- (M-2-3.south east);

end{tikzpicture}

Additional vertical space resulting from TikZ image/macro

$
0
0

I am creating a document with a header image created in TikZ. I have encountered an unusual behaviour that is frustrating my attempts to control the positioning.

If the header is left out (for instance by commenting out header in the code below, the first section begins hard up against the top of the page (in this example). However, with the header image included, called with the macro header, the first section begins lower. The amount it drops down is greater than the separation between the sections.

What is this spacing? Where does it come from? Is there a defined length controlling it?

Ideally I would like to compensate for it in the definition of header in an associated class file and control precisely where the text will begin below the header.

documentclass{article}

usepackage[top=0mm, bottom=30mm, left=20mm, right=20mm, nohead, nofoot]{geometry}
usepackage{tikz}

newcommand{header}{
begin{tikzpicture}[remember picture,overlay]
node [rectangle, fill=black!40, anchor=north, minimum width=paperwidth, minimum height=4cm] (box) at (current page.north){};
end{tikzpicture}}

begin{document}

header

section{The First}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ipsum ipsum, porta eget rutrum et, scelerisque at tortor. Donec adipiscing est sed odio congue, quis pulvinar leo semper. Sed euismod ut augue a imperdiet. Ut et enim quam. Nam id hendrerit mi, sed pretium tortor. 
section{The Second}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ipsum ipsum, porta eget rutrum et, scelerisque at tortor. Donec adipiscing est sed odio congue, quis pulvinar leo semper. Sed euismod ut augue a imperdiet. Ut et enim quam. Nam id hendrerit mi, sed pretium tortor. 

end{document}

Many thanks

Tex Custom Arrow with oplus symbol

$
0
0

I’d like to create the kind of arrow that shows inner classes in UML, that is, an arrow that starts with an oplus symbol as it can be seen here: http://myumlnotes.blogspot.com.es/2007/01/inner-class.html with Tikz.

enter image description here

Anyone could help me define that arrow?
Something like pgfarrowsdeclare{OPLUS arrow}{OPLUS arrow}
could be perfect

Wrong scaling in xyz coordinate systems

$
0
0

As stated in the Manual in section 10.2.1 “the default z-vector points to (-sqrt(2), -sqrt(2)).
But when I draw:

documentclass{article}
usepackage{tikz}
begin{document}
begin{tikzpicture}[axis/.style={thick,->}]
    coordinate (O) at (0, 0, 0);
    draw[axis] (O) -- +(1, 0, 0) node [right] {$X$};
    draw[axis] (O) -- +(0, 1, 0) node [right] {$Y$};
    draw[axis] (O) -- +(0, 0, 1) node [above] {$Z$};
    draw[red, thick]   (O) -- +(-0.70710678, -0.70710678);
end{tikzpicture}
end{document}

I get this:

TikZ output

As you can see: the red line is clearily longer than the z-axis, whereas it should be equal in length.
Can someone point me to the right direction?

During my investigations I found another strange behaviour:

documentclass[11pt]{minimal}
usepackage{tikz}
begin{document}
begin{tikzpicture}
    draw[red]          (-2cm,-2cm) grid (3,2cm);
    coordinate         (O) at (0, 0, 0);
    draw[blue]         (O) -- +(0, 1cm, 0);
end{tikzpicture}
end{document}

Yields two pages: the first one is empty, and the second one looks like:

output

This is the whole page, I didn’t clip anything.

I am totally confused.

Draw a picture of primes ideal lying over a prime ideal

$
0
0

Let $K$ be a number field and $L$ be a finite extension of $K$. Then, let $mathfrak{p}$ be a prime in $K$ and $mathfrak{P}$ be a prime lying over $mathfrak{p}$. I would like to draw the following picture:

      L              mathfrak{P}             R_L/mathfrak{P}
      |finite             |unramified                 |extension of
      |extension          |prime                      |finite fields
      K              mathfrak{p}             R_K/mathfrak{p}

How should I go about it? Can I do it with use amscd or tikz? Or must I use fancier packages?

Viewing all 959 articles
Browse latest View live