I have a display of two intersecting lines and a ray starting at the intersection of the two lines. I use path commands

\path[name path = left.side] (-3.75,-3.75) -- (-3.75,3.75);


\path[name path = right.side] (3.75,-3.75) -- (3.75,3.75);

and the intersections package to draw these lines between two vertical lines. How do I crop the top and bottom space? I only include the command

\draw (current bounding box.south west) grid (current bounding box.north east);

to show how much wasted space there is.







\coordinate (Q) at (0,0);
\node[fill=white,circle,inner sep=0pt] (Q-label) at ($(Q)+(-90:10pt)$) {$Q$};

\coordinate (R) at ($(Q) +(3.75,0)$);
\draw[-latex] (Q) -- (R);
\node at ($(R)+(0:10pt)$) {$m$};

\path[name path = ell.up] (0,0) -- (25:5);
\path[name path = ell.down] (0,0) -- (-155:5);
\path[name path= k.up] (0,0) -- (165:5);
\path[name path = k.down] (0,0) -- (-15:5);

%The following commands are for placing drawing the lines, placing the
%arrowheads at the ends of the line segments. The drawn lines are to be
%bound between the vertical lines $x = -3.75$ and $x = 3.75$. Since
%$\ell$ has the steeper slope, the height of the bounding box is determined
%by $\ell$.
\path[name path = left.side] (-3.75,-3.75) -- (-3.75,3.75);
\path[name path = right.side] (3.75,-3.75) -- (3.75,3.75);

\path[name intersections={of= left.side and ell.down, by=aa/ell}];%left.side.ell.down
\path[name intersections={of= right.side and ell.up, by=bb/ell}];%right.side.ell.up

\draw[draw=blue!30,latex-latex] (aa/ell) -- (bb/ell);

\path[name intersections={of= left.side and k.up, by=aa/k}];%left.side.k.down
\path[name intersections={of= right.side and k.down, by=bb/k}];%right.side.k.up

\draw[draw=green!50,latex-latex] (aa/k) -- (bb/k);

%These commands put the labels on lines $\ell$ and $k$.
\node at ($(bb/ell)+(25:10pt)$) {$\ell$};
\node at ($(bb/k)+(-15:10pt)$) {$k$};

%These commands label the angles.
\path pic[angle radius=5mm,"$\scriptstyle{40}$",angle eccentricity=1.25] {angle = aa/k--Q--aa/ell};
\path pic[angle radius=10mm,"$\scriptstyle{25}$",angle eccentricity=1.25] {angle = R--Q--bb/ell};
\path pic[angle radius=10mm,"$\scriptstyle{x}$",angle eccentricity=1.25] {angle = bb/k--Q--R};

%This command draws a dot at point Q; the dot is drawn over the two lines.
\draw[fill] (Q) circle (1.5pt);

\draw[line width=0.1pt, draw=gray!25] (current bounding box.south west) grid (current bounding box.north east);

  • You are missing a lot of overlay keys for those long 5s and 3.75s. And basically you are drawing something that can be done in 4 lines of line drawing no? – percusse May 27 '15 at 23:22

Option overlay helps:

\path[overlay, name path = left.side] (-3.75,-3.75) -- (-3.75,3.75);
\path[overlay, name path = right.side] (3.75,-3.75) -- (3.75,3.75);

Then the points in these path statements are not taken into account for the calculation of the bounding box.


And overlay applied to the other \path[name ...] commands as well:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.