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

empty space under the drawing

$
0
0

this is my tikz code:

usepackage{tikz, tikz-3dplot}

begin{figure}[ht!]
        centering
        tdplotsetmaincoords{45}{110}
        begin{tikzpicture}[scale=8, tdplot_main_coords]
            tdplotsinandcos{sintheta}{costheta}{75}
            tdplotdrawarc{(0,0,sintheta)}{costheta}{0}{360}{}{}
            foreach angle in {0,15,...,360} {
                tdplotsetthetaplanecoords{angle};
                tdplotdrawarc[tdplot_rotated_coords]{(0,0,0)}{1}{0}{15}{}{}
            }
        end{tikzpicture}
        caption{Top row.}
        label{top_row}
end{figure}

And this is the outcome.

enter image description here

May I kindly ask you to explain me where does that gap between drawing and caption comes from?


Help creating quite complex Tikz figure

$
0
0

I would like to creat the attached figure in Tikz.

As i am quite new to tikz i do not know what to use and how to start.enter image description here

As it has some intricate lines and arrows.
Any suggestion is welcome

How to keep the line cap when clipping a path?

$
0
0

This question is kind of the opposite of Disable "clip" and "use as bounding box" in TikZ. Is it posisble to clip a path but let the line caps lokk as the path would end at the clipping area.

basic example

documentclass[border=10mm]{standalone}

usepackage{tikz}

tikzset{line/.style={blue,line width=10mm}}

begin{document}
begin{tikzpicture}
    draw (0,0) grid (5,5);
    clip (0,0) rectangle (5,5);
    draw [line] (0,1)  -- (5,4);
end{tikzpicture}
end{document}

With the output

output

but the desired output is

desired output

I want to clip a plot in this way and I cannot specify it in a way that the domain equals the clip box, so I must use a clip box, but I don’t want to loose the regular line caps …

more realistic example

Case 1: I want to set the yrange of the two plots according to the y axis, but gnuplot writes all data points to the table file, even if they are out of range (they are marked with an o in a third column, whereas i indicates that the point is in range). It is possible to set xrange in a way that the plots start at the same y value but this is a lot of try and error, since the xrange mus be found individual for every plot.

Case 2: I got a curve that is define by some points an the first and the last of them must be roots, i.e. y = 0. The problem is that the second root lies out of the axes bounds … I guess I could use the (coord)!pos!(coord) syntax but this is try and error again to let this curve end at the same x value as the plots.

documentclass[border=10mm]{standalone}

usepackage{tikz}

tikzset{line/.style={blue,line width=10mm}}

begin{document}
begin{tikzpicture}
    defyzoom{50}% needed to prevent overflow
    % Axes
    draw [<->] (0,0.07*yzoom) |- (10.5,0);
    % Clip
    clip (0,0) rectangle (10,0.07*yzoom);
% CASE I
    % Plots
    draw [line width=2pt,line cap=round]
        plot [smooth,raw gnuplot, id=jobname-plot] function {%
            set xrange [1.4:10];
            set yrange [0:0.06*yzoom];
            set samples 100;
            f(x) = yzoom*(0.26/(x-1) - 1/(x**2));
            plot f(x);
        };
    draw [line width=2pt,line cap=round]
        plot [smooth,raw gnuplot, id=jobname-plot] function {%
            set xrange [1:10];
            set yrange [0:0.06*yzoom];
            set samples 100;
            f(x) = yzoom*(0.28/(x-1) - 1/(x**2));
            plot f(x);
        };
% CASE II
    % Curve, defined by three points.
    % P1 and P3 must have y=0
    draw plot coordinates {(2,0) (5,2) (18,0)};
end{tikzpicture}
end{document}

Unclipped output:

realistic example, normal output

Clipped output but the round caps are missing …

realistic example, clipped output

Fixed Point Arithmetic: Why does the fp work sometimes but others it errors?

$
0
0

Why does fixed point arithmetic like to error on parts of the code that aren’t doing any math?

I am using the package to improve the calculation of some angles I have it printing out, but it is evaluating a node that is just a number and returning an error:

ERROR: FP error: Illegal character c@pgf@counta  found in float number!.

--- TeX said ---
FP@errmessage #1->errmessage {FP error: #1!}

l.13   {};

--- HELP ---
From the .log file...

This error message was generated by an errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.

documentclass[convert = false, tikz]{standalone}
usepackage{fp}
usetikzlibrary{fixedpointarithmetic}
begin{document}
begin{tikzpicture}[fixed point arithmetic]
  node[label = x] {};
end{tikzpicture}
end{document}

From the code above, we see that fp has an issue with this node. If I remove fp, there isn’t a problem, but I want the package to be used later on in the code where there is an actual calculation.

How to gradually unveil a tikz node from its background

$
0
0

I would like to gradually unveil a tikz node from its background (like an animation, from un-noticable to gradually clear). One strategy could be to gradually reduce the opacity level of the node, through a foreach. I am not sure if is the right approach as it is still rather discrete and non-smooth.

Tikz + Verbatim + Sphinx , output drawn twice with slight offset. Works great Tikz + Verbatim

$
0
0

I’m working on a piece of software that outputs IPython Notebooks as tex documents. One of my requirements is to be able to draw code input output blocks that look like the Notebook’s UI.

Disclaimer:
For a long time I was using MDFRAMED to draw the cells. Unfortunately the vertical spacing of the MDFRAMED differs between versions, and I absolutely cannot force users to use a specific version of MDFRAMED. I looked into distributing MDFRAMED along with the software and found that it could not be done without modifications to MDFRAMED

So I bit the bullet and started writing my own custom framing logic in TIKz. My only requirements were to have rounded edges, a small border, support for multiple pages, and support for pygments output (fancyvrb Verbatim).

After a couple hours, I had completely met my goal:

goodoutput

BUT! When I try to use the Sphinx templates to produce my output:

badoutput

The majority of the tikz code is this http://www.texample.net/tikz/examples/framed-tikz/ example modified

EDIT: After David’s suggestion:

closer

EDIT: MWE, with suggested solution(s). Produces same output as above.

% Make sure that the sphinx doc style knows who it inherits from.
defsphinxdocclass{article}

% Declare the document class
documentclass[letterpaper,10pt,english]{/usr/local/lib/python2.7/dist-packages/Sphinx-1.2predev_20130207-py2.7.egg/sphinx/texinputs/sphinxhowto}



usepackage[Bjarne]{/usr/local/lib/python2.7/dist-packages/Sphinx-1.2predev_20130207-py2.7.egg/sphinx/texinputs/fncychap}


usepackage{/usr/local/lib/python2.7/dist-packages/Sphinx-1.2predev_20130207-py2.7.egg/sphinx/texinputs/sphinx}



usepackage{graphicx} % Used to insert images
usepackage{adjustbox} % Used to constrain images to a maximum size 
usepackage{color} % Allow colors to be defined
usepackage{enumerate} % Needed for markdown enumerations to work
usepackage{geometry} % Used to adjust the document margins
usepackage{amsmath} % Equations
usepackage{amssymb} % Equations
usepackage[utf8]{inputenc} % Allow utf-8 characters in the tex document
usepackage{ucs} % Extended unicode (utf-8) support
usepackage{fancyvrb} % verbatim replacement that allows latex
usepackage{grffile} % extends the file name processing of package graphics 
                 %to support a larger range 

% The hyperref package gives us a pdf with properly built
% internal navigation ('pdf bookmarks' for the table of contents,
% internal cross-reference links, web links for URLs, etc.)
usepackage{hyperref}


usepackage{tikz} % Needed to box output/input
usepackage{scrextend} % Used to indent output
usepackage{needspace} % Make prompts follow contents
usepackage{framed} % Used to draw output that spans multiple pages





definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
definecolor{darkorange}{rgb}{.71,0.21,0.01}
definecolor{darkgreen}{rgb}{.12,.54,.11}
definecolor{myteal}{rgb}{.26, .44, .56}
definecolor{gray}{gray}{0.45}
definecolor{lightgray}{gray}{.95}
definecolor{mediumgray}{gray}{.8}
definecolor{inputbackground}{rgb}{.95, .95, .85}
definecolor{outputbackground}{rgb}{.95, .95, .95}
definecolor{traceback}{rgb}{1, .95, .95}

% new ansi colors
definecolor{brown}{rgb}{0.54,0.27,0.07}
definecolor{purple}{rgb}{0.5,0.0,0.5}
definecolor{darkgray}{gray}{0.25}
definecolor{lightred}{rgb}{1.0,0.39,0.28}
definecolor{lightgreen}{rgb}{0.48,0.99,0.0}
definecolor{lightblue}{rgb}{0.53,0.81,0.92}
definecolor{lightpurple}{rgb}{0.87,0.63,0.87}
definecolor{lightcyan}{rgb}{0.5,1.0,0.83}

% Define a nice break command that doesn't care if a line doesn't already
% exist.
defbr{hspace*{fill} \* }

% Document parameters
title{simpletest}




% Pygments definitions

makeatletter
defPY@reset{letPY@it=relax letPY@bf=relax%
    letPY@ul=relax letPY@tc=relax%
    letPY@bc=relax letPY@ff=relax}
defPY@tok#1{csname PY@tok@#1endcsname}
defPY@toks#1+{ifxrelax#1emptyelse%
    PY@tok{#1}expandafterPY@toksfi}
defPY@do#1{PY@bc{PY@tc{PY@ul{%
    PY@it{PY@bf{PY@ff{#1}}}}}}}
defPY#1#2{PY@resetPY@toks#1+relax+PY@do{#2}}

expandafterdefcsname PY@tok@gdendcsname{defPY@tc##1{textcolor[rgb]{0.63,0.00,0.00}{##1}}}
expandafterdefcsname PY@tok@guendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.50,0.00,0.50}{##1}}}
expandafterdefcsname PY@tok@gtendcsname{defPY@tc##1{textcolor[rgb]{0.00,0.25,0.82}{##1}}}
expandafterdefcsname PY@tok@gsendcsname{letPY@bf=textbf}
expandafterdefcsname PY@tok@grendcsname{defPY@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}}
expandafterdefcsname PY@tok@cmendcsname{letPY@it=textitdefPY@tc##1{textcolor[rgb]{0.25,0.50,0.50}{##1}}}
expandafterdefcsname PY@tok@vgendcsname{defPY@tc##1{textcolor[rgb]{0.10,0.09,0.49}{##1}}}
expandafterdefcsname PY@tok@mendcsname{defPY@tc##1{textcolor[rgb]{0.40,0.40,0.40}{##1}}}
expandafterdefcsname PY@tok@mhendcsname{defPY@tc##1{textcolor[rgb]{0.40,0.40,0.40}{##1}}}
expandafterdefcsname PY@tok@goendcsname{defPY@tc##1{textcolor[rgb]{0.50,0.50,0.50}{##1}}}
expandafterdefcsname PY@tok@geendcsname{letPY@it=textit}
expandafterdefcsname PY@tok@vcendcsname{defPY@tc##1{textcolor[rgb]{0.10,0.09,0.49}{##1}}}
expandafterdefcsname PY@tok@ilendcsname{defPY@tc##1{textcolor[rgb]{0.40,0.40,0.40}{##1}}}
expandafterdefcsname PY@tok@csendcsname{letPY@it=textitdefPY@tc##1{textcolor[rgb]{0.25,0.50,0.50}{##1}}}
expandafterdefcsname PY@tok@cpendcsname{defPY@tc##1{textcolor[rgb]{0.74,0.48,0.00}{##1}}}
expandafterdefcsname PY@tok@giendcsname{defPY@tc##1{textcolor[rgb]{0.00,0.63,0.00}{##1}}}
expandafterdefcsname PY@tok@ghendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.00,0.00,0.50}{##1}}}
expandafterdefcsname PY@tok@niendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.60,0.60,0.60}{##1}}}
expandafterdefcsname PY@tok@nlendcsname{defPY@tc##1{textcolor[rgb]{0.63,0.63,0.00}{##1}}}
expandafterdefcsname PY@tok@nnendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.00,0.00,1.00}{##1}}}
expandafterdefcsname PY@tok@noendcsname{defPY@tc##1{textcolor[rgb]{0.53,0.00,0.00}{##1}}}
expandafterdefcsname PY@tok@naendcsname{defPY@tc##1{textcolor[rgb]{0.49,0.56,0.16}{##1}}}
expandafterdefcsname PY@tok@nbendcsname{defPY@tc##1{textcolor[rgb]{0.00,0.50,0.00}{##1}}}
expandafterdefcsname PY@tok@ncendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.00,0.00,1.00}{##1}}}
expandafterdefcsname PY@tok@ndendcsname{defPY@tc##1{textcolor[rgb]{0.67,0.13,1.00}{##1}}}
expandafterdefcsname PY@tok@neendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.82,0.25,0.23}{##1}}}
expandafterdefcsname PY@tok@nfendcsname{defPY@tc##1{textcolor[rgb]{0.00,0.00,1.00}{##1}}}
expandafterdefcsname PY@tok@siendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.73,0.40,0.53}{##1}}}
expandafterdefcsname PY@tok@s2endcsname{defPY@tc##1{textcolor[rgb]{0.73,0.13,0.13}{##1}}}
expandafterdefcsname PY@tok@viendcsname{defPY@tc##1{textcolor[rgb]{0.10,0.09,0.49}{##1}}}
expandafterdefcsname PY@tok@ntendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.00,0.50,0.00}{##1}}}
expandafterdefcsname PY@tok@nvendcsname{defPY@tc##1{textcolor[rgb]{0.10,0.09,0.49}{##1}}}
expandafterdefcsname PY@tok@s1endcsname{defPY@tc##1{textcolor[rgb]{0.73,0.13,0.13}{##1}}}
expandafterdefcsname PY@tok@shendcsname{defPY@tc##1{textcolor[rgb]{0.73,0.13,0.13}{##1}}}
expandafterdefcsname PY@tok@scendcsname{defPY@tc##1{textcolor[rgb]{0.73,0.13,0.13}{##1}}}
expandafterdefcsname PY@tok@sxendcsname{defPY@tc##1{textcolor[rgb]{0.00,0.50,0.00}{##1}}}
expandafterdefcsname PY@tok@bpendcsname{defPY@tc##1{textcolor[rgb]{0.00,0.50,0.00}{##1}}}
expandafterdefcsname PY@tok@c1endcsname{letPY@it=textitdefPY@tc##1{textcolor[rgb]{0.25,0.50,0.50}{##1}}}
expandafterdefcsname PY@tok@kcendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.00,0.50,0.00}{##1}}}
expandafterdefcsname PY@tok@cendcsname{letPY@it=textitdefPY@tc##1{textcolor[rgb]{0.25,0.50,0.50}{##1}}}
expandafterdefcsname PY@tok@mfendcsname{defPY@tc##1{textcolor[rgb]{0.40,0.40,0.40}{##1}}}
expandafterdefcsname PY@tok@errendcsname{defPY@bc##1{setlength{fboxsep}{0pt}fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{strut ##1}}}
expandafterdefcsname PY@tok@kdendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.00,0.50,0.00}{##1}}}
expandafterdefcsname PY@tok@ssendcsname{defPY@tc##1{textcolor[rgb]{0.10,0.09,0.49}{##1}}}
expandafterdefcsname PY@tok@srendcsname{defPY@tc##1{textcolor[rgb]{0.73,0.40,0.53}{##1}}}
expandafterdefcsname PY@tok@moendcsname{defPY@tc##1{textcolor[rgb]{0.40,0.40,0.40}{##1}}}
expandafterdefcsname PY@tok@knendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.00,0.50,0.00}{##1}}}
expandafterdefcsname PY@tok@miendcsname{defPY@tc##1{textcolor[rgb]{0.40,0.40,0.40}{##1}}}
expandafterdefcsname PY@tok@gpendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.00,0.00,0.50}{##1}}}
expandafterdefcsname PY@tok@oendcsname{defPY@tc##1{textcolor[rgb]{0.40,0.40,0.40}{##1}}}
expandafterdefcsname PY@tok@krendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.00,0.50,0.00}{##1}}}
expandafterdefcsname PY@tok@sendcsname{defPY@tc##1{textcolor[rgb]{0.73,0.13,0.13}{##1}}}
expandafterdefcsname PY@tok@kpendcsname{defPY@tc##1{textcolor[rgb]{0.00,0.50,0.00}{##1}}}
expandafterdefcsname PY@tok@wendcsname{defPY@tc##1{textcolor[rgb]{0.73,0.73,0.73}{##1}}}
expandafterdefcsname PY@tok@ktendcsname{defPY@tc##1{textcolor[rgb]{0.69,0.00,0.25}{##1}}}
expandafterdefcsname PY@tok@owendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.67,0.13,1.00}{##1}}}
expandafterdefcsname PY@tok@sbendcsname{defPY@tc##1{textcolor[rgb]{0.73,0.13,0.13}{##1}}}
expandafterdefcsname PY@tok@kendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.00,0.50,0.00}{##1}}}
expandafterdefcsname PY@tok@seendcsname{letPY@bf=textbfdefPY@tc##1{textcolor[rgb]{0.73,0.40,0.13}{##1}}}
expandafterdefcsname PY@tok@sdendcsname{letPY@it=textitdefPY@tc##1{textcolor[rgb]{0.73,0.13,0.13}{##1}}}

defPYZbs{char`\}
defPYZus{char`_}
defPYZob{char`{}
defPYZcb{char`}}
defPYZca{char`^}
defPYZam{char`&}
defPYZlt{char`<}
defPYZgt{char`>}
defPYZsh{char`#}
defPYZpc{char`%}
defPYZdl{char`$}
defPYZti{char`~}
% for compatibility with earlier versions
defPYZat{@}
defPYZlb{[}
defPYZrb{]}
makeatother


% NB prompt colors
definecolor{nbframe-border}{rgb}{0.867,0.867,0.867}
definecolor{nbframe-bg}{rgb}{0.969,0.969,0.969}
definecolor{nbframe-in-prompt}{rgb}{0.0,0.0,0.502}
definecolor{nbframe-out-prompt}{rgb}{0.545,0.0,0.0}

% NB prompt lengths
newlength{inputpadding}
setlength{inputpadding}{0.5em}
newlength{cellleftmargin}
setlength{cellleftmargin}{0.15linewidth}
newlength{borderthickness}
setlength{borderthickness}{0.4pt}
newlength{smallerfontscale}
setlength{smallerfontscale}{9.5pt}

% NB prompt font size
defsmaller{fontsize{smallerfontscale}{smallerfontscale}selectfont}

% Define a background layer, in which the nb prompt shape is drawn
pgfdeclarelayer{background}
pgfsetlayers{background,main}
usetikzlibrary{calc}

% define styles for the normal border and the torn border
tikzset{
normal border/.style={draw=nbframe-border, fill=nbframe-bg,
rectangle, rounded corners=2.5pt, line width=borderthickness},
torn border/.style={draw=white, fill=white, line width=borderthickness}}

% Macro to draw the shape behind the text, when it fits completly in the
% page
defnotebookcellframe#1{%
tikz{%
node[inner sep=inputpadding] (A) {#1};% Draw the text of the node
begin{pgfonlayer}{background}% Draw the shape behind
fill[normal border]%
    (A.south east) -- ($(A.south west)+(cellleftmargin,0)$) -- 
    ($(A.north west)+(cellleftmargin,0)$) -- (A.north east) -- cycle;
end{pgfonlayer}}}%

% Macro to draw the shape, when the text will continue in next page
defnotebookcellframetop#1{%
tikz{%
node[inner sep=inputpadding] (A) {#1};    % Draw the text of the node
begin{pgfonlayer}{background}    
fill[normal border]              % Draw the ``complete shape'' behind
    (A.south east) -- ($(A.south west)+(cellleftmargin,0)$) -- 
    ($(A.north west)+(cellleftmargin,0)$) -- (A.north east) -- cycle;
fill[torn border]                % Add the torn lower border
    ($(A.south east)-(0,.1)$) -- ($(A.south west)+(cellleftmargin,-.1)$) -- 
    ($(A.south west)+(cellleftmargin,.1)$) -- ($(A.south east)+(0,.1)$) -- cycle;
end{pgfonlayer}}}

% Macro to draw the shape, when the text continues from previous page
defnotebookcellframebottom#1{%
tikz{%
node[inner sep=inputpadding] (A) {#1};   % Draw the text of the node
begin{pgfonlayer}{background}   
fill[normal border]             % Draw the ``complete shape'' behind
    (A.south east) -- ($(A.south west)+(cellleftmargin,0)$) -- 
    ($(A.north west)+(cellleftmargin,0)$) -- (A.north east) -- cycle;
fill[torn border]               % Add the torn upper border
    ($(A.north east)-(0,.1)$) -- ($(A.north west)+(cellleftmargin,-.1)$) -- 
    ($(A.north west)+(cellleftmargin,.1)$) -- ($(A.north east)+(0,.1)$) -- cycle;
end{pgfonlayer}}}

% Macro to draw the shape, when both the text continues from previous page
% and it will continue in next page
defnotebookcellframemiddle#1{%
tikz{%
node[inner sep=inputpadding] (A) {#1};   % Draw the text of the node
begin{pgfonlayer}{background}   
fill[normal border]             % Draw the ``complete shape'' behind
    (A.south east) -- ($(A.south west)+(cellleftmargin,0)$) -- 
    ($(A.north west)+(cellleftmargin,0)$) -- (A.north east) -- cycle;
fill[torn border]               % Add the torn lower border
    ($(A.south east)-(0,.1)$) -- ($(A.south west)+(cellleftmargin,-.1)$) -- 
    ($(A.south west)+(cellleftmargin,.1)$) -- ($(A.south east)+(0,.1)$) -- cycle;
fill[torn border]               % Add the torn upper border
    ($(A.north east)-(0,.1)$) -- ($(A.north west)+(cellleftmargin,-.1)$) -- 
    ($(A.north west)+(cellleftmargin,.1)$) -- ($(A.north east)+(0,.1)$) -- cycle;
end{pgfonlayer}}}

% Define the environment which puts the frame
% In this case, the environment also accepts an argument with an optional
% title (which defaults to ``Example'', which is typeset in a box overlaid
% on the top border
newenvironment{notebookcell}[1][0]{%
defFrameCommand{notebookcellframe}%
defFirstFrameCommand{notebookcellframetop}%
defLastFrameCommand{notebookcellframebottom}%
defMidFrameCommand{notebookcellframemiddle}%
parvspace{1baselineskip}%
MakeFramed {FrameRestore}%
noindenttikznode[inner sep=0em] at ($(A.north west)-(0,0)$) {%
begin{minipage}{cellleftmargin}%
hfill%
{smaller%
tt%
color{nbframe-in-prompt}%
In [#1]:}%
hspace{inputpadding}%
hspace{2pt}%
hspace{3pt}%
end{minipage}%%
}; par}%
{endMakeFramed}




sloppy % Prevent overflowing lines due to hard-to-break entities

% Setup hyperref package
hypersetup{
breaklinks=true,  % so long urls are correctly broken across lines
colorlinks=true,
urlcolor=blue,
linkcolor=darkorange,
citecolor=darkgreen,
}

% Slightly bigger margins than the latex defaults

geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}



% Override to specify your own logo
newcommand{sphinxlogo}{}

% Make the index page of the document.
makeindex



begin{document}

maketitle


This is a emph{simple} notebook

% Add contents below.

{par%
vspace{-1baselineskip}%
needspace{4baselineskip}}%
begin{notebookcell}[1]%
begin{addmargin}[cellleftmargin]{0em}% left, right
{smaller%
par%
%
vspace{-1smallerfontscale}%
begin{Verbatim}[commandchars=\{}]
PY{k}{print}PY{p}{(}PY{l+s}{"}PY{l+s}{Which has a simple task}PY{l+s+se}{PYZbs{}n}PY{l+s}{Seriously...}PY{l+s}{"}PY{p}{)}
PY{k}{print}PY{p}{(}PY{l+s}{"}PY{l+s}{Cool!}PY{l+s}{"}PY{p}{)}
end{Verbatim}
%
par%
vspace{-1smallerfontscale}}%
end{addmargin}
end{notebookcell}

parvspace{1smallerfontscale}%
% Only render the prompt if the cell is pyout.  Note, the outputs prompt 
% block isn't used since we need to check each indiviual output and only
% add prompts to the pyout ones.
%
%
begin{addmargin}[cellleftmargin]{0em}% left, right
{smaller%
vspace{-1smallerfontscale}%

begin{Verbatim}[commandchars=\{}]
Which has a simple task
Seriously...
Cool!
end{Verbatim}
}%
end{addmargin}%
% Add contents below.

{par%
vspace{-1baselineskip}%
needspace{4baselineskip}}%
begin{notebookcell}[2]%
begin{addmargin}[cellleftmargin]{0em}% left, right
{smaller%
par%
%
vspace{-1smallerfontscale}%
begin{Verbatim}[commandchars=\{}]
PY{l+s}{"}PY{l+s}{To print hello world}PY{l+s+se}{PYZbs{}n}PY{l+s}{Multiple lines}PY{l+s}{"}
end{Verbatim}
%
par%
vspace{-1smallerfontscale}}%
end{addmargin}
end{notebookcell}

parvspace{1smallerfontscale}%
% Only render the prompt if the cell is pyout.  Note, the outputs prompt 
% block isn't used since we need to check each indiviual output and only
% add prompts to the pyout ones.

{par%
vspace{-1smallerfontscale}%
noindent%
begin{minipage}{cellleftmargin}%
hfill%
{smaller%
tt%
color{nbframe-out-prompt}%
Out[2]:}%
hspace{inputpadding}%
hspace{0em}%
hspace{3pt}%
end{minipage}%%
}%
%
%
begin{addmargin}[cellleftmargin]{0em}% left, right
{smaller%
vspace{-1smallerfontscale}%



begin{verbatim}
'To print hello worldnMultiple lines'
end{verbatim}


}%
end{addmargin}%

end{document}

Arguments for TikZ style

$
0
0

Motivation

To put arrows inside of a TikZ path I have defined myself a TikZ style arrow inside. To make it even more portable I want it to take arguments like this

draw[arrow inside={pos = 0.1, end = |}] (1,-0.5) -- (1,1.5);

such that I can define the position of the arrow using pos and the type of the arrow by end. If no arguments are given it should fall back to the defaults.

enter image description here

What I have tried so far

To achive the above picture, I wrote the following snippet. The problem is that the values are properly stored in the macros I defined, but are not being updated, nor do I now, how to retain the defaults.

documentclass{article}
pagestyle{empty}
usepackage{tikz}
usetikzlibrary{decorations.markings}
makeatletter
tikzset{
    arrow inside/pos/.store in = arrow@inside@pos,
    arrow inside/end/.store in = arrow@inside@end,
    arrow inside/pos = 0.5,
    arrow inside/end = >,
    arrow inside/.style = {
        postaction = {
            decorate,
            decoration={
                markings,
                mark=at position arrow@inside@pos with {arrow{arrow@inside@end}}
            }
        }
    },
}
makeatother
begin{document}
[ int_{
    tikz[scale=0.3]{
        path[fill=lightgray] (0,0) rectangle (1,1);
        draw (1.5,1) -- (0,1) -- (0,0) -- (1.5,0);
        draw[arrow inside={pos = 0.1, end = |}] (1,-0.5) -- (1,1.5);
    }
} vec{B} cdot vec{n} , df ]
end{document}

Possibly related:

Straight math arrows

$
0
0

Is there any way to redefine all arrows in math mode (rightarrow, leftarrow, Rightarrow, Leftarrow, to, etc.) to another arrows that finish with angle 90 TikZ option?

I have done some tries and I’ve got good results with normal math size:
enter image description here

Using the following code:

documentclass{minimal}

usepackage{tikz}
usetikzlibrary{arrows}

%Redefine rightarrow
renewcommand{rightarrow}{mathbin{tikz[baseline]draw[arrows={-angle 90},yshift=0.75ex] (0,0) -- (.95em,0);}}

begin{document}

%mathchar"3221 is just the original code of rightarrow
noindent $x^2 - 2x + 1 = 0 mathchar"3221 (x-1)^2 = 0 mathchar"3221 x = 1$\
$x^2 - 2x + 1 = 0 rightarrow (x-1)^2 = 0 rightarrow x = 1$

end{document}

But I have problems when I use that arrow in special cases like limits, and I would like that all those arrows work in that situation (if possible):

enter image description here

I know that in this question is also explained how to get symbols that are like mine, but the package doesn’t include the arrows that I would like to have. Also, I would like that that new arrows behave like normal characters, so if I put $2x textcolor{red}{rightarrow} 0$, I would obtain a red arrow.

Any idea or suggestion?


Different marker at specific intervals using pgfplots

$
0
0

I have a number of large data files with x rows in the range of 0 to z. Is there an easy way to set a different marker at specific intervals using pgfplots/TikZ? How can I produce a figure such that the marker for the plot at intervals 0, 10, 20, …, z is for example a cross but a circle for the rest of the points?

Here’s a MWE that can get you started:

documentclass{article}

usepackage{tikz,pgfplots}
pgfplotsset{compat=1.8}

begin{filecontents*}{thePlot.dat}
x y
0 20.44
1 20.06
2 19.76
3 19.54
4 19.40
5 19.34
6 19.36
7 19.46
8 19.64
9 19.90
10  20.24
end{filecontents*}

begin{document}
  begin{figure}[]
    centering
    begin{tikzpicture}
      begin{axis}[
        xlabel={$x$},
        ylabel={$y$},]

        addplot+[only marks,mark=x]
          table[x=x,y=y] {thePlot.dat};
      end{axis}
    end{tikzpicture}%
    caption{The caption.}
  end{figure}
end{document}

Alter font used for every pin in a plot

$
0
0

In some scatter plots I’m producing, I want to label each point using a pin. I achieve that by adding node elements after the addplot but within the axis environment, and using the pin property:

documentclass{article}
usepackage{pgfplots}
 pgfplotsset{compat=newest}
begin{document}
begin{tikzpicture}
  begin{axis}
    addplot coordinates
      {
        (1,1)
        (2,2.5)
        (3,2.9)
        (4,4.1)
      };
    node[pin = texta] at (axis cs:1,1) {};
    node[pin = small textb] at (axis cs:2,2.5) {};
  end{axis}
end{tikzpicture}
end{document}

To adjust the font of a single pin, I can simply put in the appropriate command, as shown in the demo. However, I’d ideally like to set the style for all ‘pin text’ in one go. However, my attempts using every pin, every pin edge and so on have failed entirely. Simply doing

tikzset{font = small}

fails as all of the text is now drawn until the end of the axis, meaning this ‘escapes’ and affects the axis labels, too. So far, the best I can come up with is

documentclass{article}
usepackage{pgfplots}
pgfplotsset{compat=newest}
tikzset{Pin/.style = {font = small}}
begin{document}
begin{tikzpicture}
  begin{axis}
    addplot coordinates
      {
        (1,1)
        (2,2.5)
        (3,2.9)
        (4,4.1)
      };
    node[pin = {[Pin]texta}] at (axis cs:1,1) {};
    node[pin = {[Pin]textb}] at (axis cs:2,2.5) {};
  end{axis}
end{tikzpicture}
end{document}

which does move the detail into one place but still requires repetitive use of the style for each pin.

Is there a ‘cleaner’ way to do what I want? (If not, that would also be a valid answer.)

tikz problem (non-continuous function) [duplicate]

TikZ- best practice for line starting on a circle's edge?

$
0
0

I’d like to know how I can achieve the best seamless crossover between a node (in this case, a circle) and a line starting on that node. I would like the line to only touch the circle’s edge. So far I have found 2 methods to achieve some mere results:

  • shorten <=: It works in a somewhat satisfying fashion after some T & E runs.

  • begin{pgfonlayer}{background}: puts the enclosed contentin the background. Does not work very well as it puts the corresponding content (in this case, 2 lines) under other, already existing content (in this case, the “grid”).

enter image description here

MWE:

documentclass[
11pt
]{scrartcl}

usepackage{
tikz,
relsize,
amsmath
}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{lmodern}


%% from here on forth TikZ-stuff

usetikzlibrary{
calc,trees,shadows,positioning,arrows,chains,shapes.geometric,
decorations.pathreplacing,decorations.pathmorphing,shapes,
matrix,shapes.symbols,patterns,intersections,fit
}

pgfdeclarelayer{background layer}
pgfdeclarelayer{foreground layer}
pgfsetlayers{background layer,main,foreground layer}

tikzset{
>=latex
}

begin{document}

begin{center}
begin{tikzpicture}[font=sffamilysmall]
%
draw[style=help lines,step=0.5cm] (0,0) grid (8,6);
%
draw[->,thick] (-0.1,0) -- (8.5,0) node[anchor=west]{x}; %X-Achse
draw[->,thick] (0,-0.1) -- (0,6.5) node[anchor=south]{y}; %Y-Achse
%
draw
(0,0) coordinate (orig)
(3,3) coordinate (B)
(4.5,4.5) coordinate (C)
;
%
foreach pt/labpos in {B/below right,C/below right}{
  filldraw (pt) circle (3pt) node[labpos=3pt,fill=white]{pt};
};
%
path[name path=Segment] (B) -- (C);
%highlight segment
draw
($(B) + (-0.75,0.75)$) coordinate (BPoint)
($(B) + (-0.25,0.25)$) coordinate (BPointExtra)
($(C) + (-0.75,0.75)$) coordinate (CPoint)
;
%begin{pgfonlayer}{background layer}
draw[black!60,thick,shorten <=3pt] (B) -- (BPoint);
draw[black!60,thick,shorten <=2pt] (C) -- (CPoint);
%end{pgfonlayer}
draw[black!60,thick,<->,shorten >=2pt,shorten <=2pt] (BPointExtra) -- ($(C)!(BPointExtra)!(CPoint)$) node[black!60,above=3pt,midway,rotate=45,fill=white]{Segment};
end{tikzpicture}
end{center}

end{document}

Why does a tikz spy specified as a chamfered rectangle show up as a simple rectangle?

$
0
0

I’d like to use a tikz spy shaped like a chamfered rectangle.
The code runs without complaining, but the result is a plain rectangle.
“rounded rectangle” works as expected, as does chamfered-rectangle-shaped non-spy nodes. How could I fix this?

The code below should demonstrate my problem. Unfortunately I don’t have enough rep to add a picture..

pdflatex Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)
I had the same issue in Windows yesterday, I believe that was Tex Live 2012 as well.
tikz 2010/10/13 v2.10 (rcs-revision 1.76)

documentclass{article}
usepackage{tikz}
usetikzlibrary{spy,decorations.fractals,shapes.misc}

begin{document}

tikznode[draw, circle] {circle};
begin{tikzpicture}
  [spy using outlines={circle, magnification=3, size=1cm, connect spies}]
  draw [decoration=Koch curve type 1]
    decorate{ decorate{ decorate{ (0,0) -- (2,0) }}};
  spy [red] on (1.6,0.3) in node at (3,1);
end{tikzpicture}

tikznode[draw, rounded rectangle] {rounded rectangle};
begin{tikzpicture}
  [spy using outlines={rounded rectangle, magnification=3, width=2cm, height=1cm, connect spies}]
  draw [decoration=Koch curve type 1]
    decorate{ decorate{ decorate{ (0,0) -- (2,0) }}};
  spy [red] on (1.6,0.3) in node at (3,1);
end{tikzpicture}

tikznode[draw, chamfered rectangle] {chamfered rectangle};
begin{tikzpicture}
  [spy using outlines={chamfered rectangle, magnification=3, width=2cm, height=1cm, connect spies}]
  draw [decoration=Koch curve type 1]
    decorate{ decorate{ decorate{ (0,0) -- (2,0) }}};
  spy [red] on (1.6,0.3) in node at (3,1);
end{tikzpicture}

end{document}

Here’s what it produces for me:

enter image description here

Drawing selected borders of a node [duplicate]

Problem in Tikz

$
0
0

When I try to compile, I get the following error.

Runaway argument?
samples=60, domain=0:10, xmax=10.5, restrict y to domain=0:10, axis lETC.
! Paragraph ended before pgfplots@@environment@axis was complete.
<to be read again> 
                   par 

with the input

begin{tikzpicture}
begin{axis}[samples=60,
    domain=0:10, xmax=10.5,
    restrict y to domain=0:10,
    axis lines=left,
    y=0.5cm/3,
    x=0.5cm,
    grid=both,
    xtick={0,...,10},
    ytick={0,3,...,9},
    compat=newest,
    xlabel=$x$, xlabel style={at={(1,0)}, anchor=west},
    ylabel=$y$, ylabel style={rotate=-90,at={(0,1)}, anchor=south}

]
addplot [red] {x};
addplot [black] {x^2};
end{axis}
end{tikzpicture}

Not working. Error is

! Package pgfkeys Error: I do not know the key '/tikz/restrict y to domain' and
 I am going to ignore it. Perhaps you misspelled it.

See the pgfkeys package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.32 end{axis}

?

with the MWE

documentclass{article}
usepackage{amsmath,amssymb,amsfonts}
usepackage{epsf,graphicx,tikz,graphics}
usepackage{pgfplots}
usepackage{url}
begin{document}
title{}
author{}



maketitle



begin{tikzpicture}
begin{axis}[samples=60,
    domain=0:10, xmax=10.5,
    restrict y to domain=0:10,
    axis lines=left,
    y=0.5cm/3,
    x=0.5cm,
    grid=both,
    xtick={0,...,10},
    ytick={0,3,...,9},
    compat=newest,
    xlabel=$x$, xlabel style={at={(1,0)}, anchor=west},
    ylabel=$y$, ylabel style={rotate=-90,at={(0,1)}, anchor=south}
]
addplot [red] {x};
addplot [black] {x^2};
end{axis}
end{tikzpicture}



end{document}

Customizing legend in pgfplots

$
0
0

I am trying to customize the legend for this graph. First of all, I would like the legend width to be equal to the x-axis width. At the moment, I am setting the width of the legend via

 /tikz/every even column/.append style={column sep=1.0cm}

and I could manually adjust this value so that length equals the x-axis width, but I guess that there is a more elegant way to set the width of the legend.

Second, I don’t really like the little color rectangles in the legend. I only want one rectangle in front of every entry and not two. This rectangle does not need to have a border and should be vertically centred with the text. The alignment seems to be okay for the rectangle closer to the text, but not for one the far left.

Update: Thanks to Christian Feuersänger’s comment, there is possibility to change the rectangles via

legend image code/.code={%
    draw[#1, draw=none] (0cm,-0.1cm) rectangle (0.6cm,0.1cm);

or what Gonzalo Medina proposed

legend image code/.code={%
    draw[#1, draw=none, /tikz/.cd, bar width=3pt, yshift=-0.2em, bar shift=0pt] %
    plot coordinates {(2*pgfplotbarwidth,0.6em)};

Third, I would like to the legend entries to start next to the text “Legend:”.

I don’t really know if with these requirements it still makes sense to use legend or if it would be better to add everything manually via after end axis/.code and ref{label}.

Graph

enter image description here

MWE

documentclass{article}
usepackage{pgfplots}
pgfplotsset{compat=newest}

begin{document}
begin{tikzpicture}
    begin{axis}[
                ybar,
                height=6cm,
                title={Some plot},
                width=12cm,
                axis on top,
                y axis line style={opacity=0},
                axis x line*=bottom,
                tick align=inside,
                tick style={draw=none},
                xtick=data,
                ymajorgrids,
                major grid style={draw=white},
                xtick={1,2,3,4},
                legend style={
                    at={(0.0,-0.15)},
                    anchor=north west,
                    legend columns=-1,
                    /tikz/every even column/.append style={column sep=1.0cm}
                        },
            ]       
            addlegendimage{empty legend}
            addlegendentry{textbf{Legend:}}                   
            addplot coordinates {
                (1, 0.2064)
                (2, 0.3961)
                (3, 0.5961)
                (4, 0.7961)}; addlegendentry[text width=45pt, text depth=]{legend a}
            addplot coordinates {
                (1, 0.3064)
                (2, 0.4961)
                (3, 0.6961)
                (4, 0.8961)}; addlegendentry[text width=65pt, text depth=]{lengend b}
    end{axis} 
end{tikzpicture}
end{document}

Perpendicular lines on sloped lines

$
0
0

I’m trying to make a diagram in TikZ which is supposed to illustrate the triangle you construct when constructing a 60 degree angle. I’m having some troubles, mainly concerning the title of the question, that is: identical ticks on the triangle lines. An MWE:

documentclass{standalone}
usepackage{tikz}
begin{document}
    begin{tikzpicture}[inner sep=0]
        node (origo) at (0,0) {} ;
        draw (-0.5,0)--(3,0) ;
        filldraw[fill=green!20!white, draw=green!50!black]
        (0,0)--+(5em,0em) arc (0:60:5em) node[name=top,inner sep=0]{} -- cycle; % green arc
        draw (0,0)--+(5em,0em) node[name=base]{} arc (-5:100:5em) ; % large arc
        draw[red] (origo.center)--node[midway,name=a]{}(base.center)--node[midway,name=b]{}(top.center)node[midway,name=c]{}--cycle ;
        draw (5em,0) arc[start angle=115, end angle=125,radius=5em] ; % triangle top point arc
    end{tikzpicture}
end{document}

which produces

enter image description here

A couple of questions follows (no surprise, eh?)

  1. Usually when illustrating that a triangle has equally long sides, you “tick” each side. How can I do this? I started out by defining nodes halfway along the triangle sides, but got stuck on the cycle path, and don’t really know how to create perpendicular, small ticks in those nodes. This is my main question, thus the question title.
  2. The large arc is an attempt to illustrate how the compass often looks, and I would like it to begin a few degrees lower than zero. However, arc (-5:100:5em) doesn’t extend the arc below, it just transforms it. As the arc operation yields (start angle):(end angle):(radius) I thought this was the way to go…
  3. I expected the small arc at the lower right to show up at the top of the triangle. How can I move it up there?

I suspect that both question 2 and 3 originates from the same problem: that I don’t get a grasp about the arc operation.

How do you break long lines in pgfgantt?

$
0
0

I am drawing a gantt chart using the pgfgantt package. I have some text in nodes that I would like to break down into multilines, but it doesn’t seem to work. I made a simple example like so:

begin{ganttchart}[
            hgrid, 
            vgrid, 
            newline shortcut=true,
            bar label node/ .append style={align=left}
]{1}{2}
gantttitle{aa}{2} \
ganttbar{%
 A very long line, A very longganttalignnewline
line A very long line A very long ...%
}{1}{2}
end{ganttchart}

I get the error, *"I do not know the key //pgfgantt//bar label node// .append style'"*. The example is almost copy-and-paste from an example in the pgfgantt manual.

Customizing pgfuml (distances)

$
0
0

I’m using pgfuml to create some sequence diagrams. As you can already see in the examples on the pgf-uml Homepage, diagramms get very crammed if you insert many descriptions. Text and arrows overlap and are hard to read because they overleap each other.

I’m no experienced Latex user and I can’t figure out how to change the pgf-umlsd.sty a little bit so the diagrams get a bit straightened and better to read. Can somebody tell me how to fix this, e.g. increase the space between elements?

For example: on the examples page is shown:

<-----------------
       Update()
----------------->

How could I increase the distance between these arrows to straighten the diagram?

callout boxes not aligning with aligned environment content

$
0
0

I’ve been able to create the split rectangle successfully. I’ve been able to work with tikzmark and callout boxes. But now that I’m combining the two, something is going seriously wrong.

Here’s my MWE

documentclass{article}
usepackage{amsmath}
usepackage{tikz}
usetikzlibrary{shapes,decorations}
usetikzlibrary{shapes.callouts}
usetikzlibrary{calc}
tikzset
  {
    set frame design/.style={rounded corners=15, 
                             line width=1.4pt, 
                             inner sep=2ex,
                             color=frame_color,
                             text=title_text_color,
                            },
    rectangle split in two/.style={rectangle split, 
                                   rectangle split parts=2, 
                                  },
  }

colorlet{title_text_color}{blue}
colorlet{title_bg_color}{yellow!10}
colorlet{content_text_color}{blue}
colorlet{content_bg_color}{red!20}
colorlet{frame_color}{purple}

newenvironment{myframed}[1]
  {defmyframedtitle{#1}%%
   begin{tikzpicture}
     draw let p1=($(linewidth,0)-(1cm,0)$), 
               p2=(0,0.5baselineskip)
               in node [ 
                         draw, 
                         anchor=north,
                         set frame design,
                         rectangle split in two,
                         rectangle split part fill={title_bg_color,
                                                    content_bg_color},
                         rectangle split empty part height=y2
                       ] (this_split_frame) at (0,0) 
               bgroup 
                nodepart{second} 
                begin{minipage}{x1}
                  begin{minipage}{0.60textwidth}vspace{0pt}
                  color{title_text_color}
  }
  {               end{minipage}
                end{minipage}
             egroup;
     node [
            set frame design,
            anchor=north west,
            text=title_text_color
           ] at (this_split_frame.north west) { bflarge myframedtitle};
    end{tikzpicture}
  }

%% setting `inner sep` and `outer sep` helps a little but doesn't correct things
newcommandtikzmark[1]{%
  tikz[remember picture,overlay]node (#1) {};}
%%  tikz[remember picture,overlay,inner sep=0pt,outer sep=0pt]node (#1) {};}

newcommandmynote[3][]{%
  begin{tikzpicture}[remember picture,overlay]
  node[rectangle callout, 
        draw=blue,
        fill=blue!10,
        text width=4cm,
        align=center,
        #1] at #2 {#3};
  end{tikzpicture}%'
  }

begin{document}

begin{myframed}{Case: same denominator}
  Here is some text tikzmark{a}par
  Here's some more text tikzmark{b}
%%  begin{align*}
%%    frac{3}{5} + frac{4}{5} 
%%    & = tikzmark{a} frac{3+4}{5}  \[2ex] %% 
%%    & = tikzmark{b} frac{7}{5}   
%%  end{align*}
end{myframed}

mynote[callout relative pointer={(-1,0)}]
       {(a)}
       {Keep the denominator}

mynote[callout relative pointer={(-1,0)}]
       {(b)}
       {Combine numerators}

end{document}

enter image description here

UPDATE

It seems to me that part of the problem is that tikzmark is inheriting the settings from tikzset It would be nice to know how to turn these off contextually.

I can improve things a bit by redefining tikzmark as follows:

newcommandtikzmark[1]{%
  tikz[remember picture,
        overlay,anchor=center,
        draw=none,
        rectangle split parts=1,
        inner sep=0pt,
        outer sep=0pt,
        rounded corners=0]node (#1) {};}

But still the callout boxes are not positioned correctly and the node defined by tikzmark is still visible. As can be seen by using

mynote[callout relative pointer={(-1,0)}]
       {([xshift=0in]a.east)}
       {Keep the denominator}

mynote[callout relative pointer={(-1,0)}]
       {([yshift=-1in]b)}
       {Combine numerators}

enter image description here

FURTHER UPDATE

Things can be somewhat better improved by chaning the definition of tikzmark to

newcommandtikzmark[1]{%
  tikz[remember picture,
        overlay,
        ]coordinate (#1) at (0,0) ;
  }

By using the following command, you can see that the coordinates are placed where expected:

tikz[remember picture,overlay] draw (a) -- (b) ;

I’ve moved the callout boxes by using yshifts to help see where this line would be drawn:

enter image description here

So the question remains of why the callout box is not pointing to the correct coordinate.

SOLUTION

The problem is that I’m not referring to the reference point correctly. If instead I write

mynote[callout absolute pointer={($(a)+(1.25cm,0)$)}]
       {([xshift=2in]a)}
       {Keep the denominator}

mynote[callout absolute pointer={($(b)+(1.25cm,0)$)}]
       {([xshift=2in]b)}
       {Combine numerators}

then I get the desired result:

enter image description here

Viewing all 959 articles
Browse latest View live