Results 1 to 5 of 5
Like Tree1Thanks
  • 1 Post By emakarov

Math Help - fixed the Distance, please help me

  1. #1
    Member vernal's Avatar
    Joined
    Dec 2011
    Posts
    75

    fixed the Distance, please help me

    Hi, please help me.

    How can I take the space marked?


    fixed the Distance, please help me-11.jpg


    I wrote it:

    The arrows
    \begin{tikzpicture}[auto,>=stealth']
    \node (1) {$$};
    \node[right=of 1] (2) {$$};
    \draw[to reversed->] (1) -- node {} (2);
    \path[use as bounding box] (-1.5,0) rectangle (0,0);
    \end{tikzpicture}
    and
    \begin{tikzpicture}[auto,>=stealth']
    \node (1) {$$};
    \node[right=of 1] (2) {$$};

    \draw[->>] (1) -- node {} (2);
    \path[use as bounding box] (-1.5,0) rectangle (0,0);
    \end{tikzpicture} denote injective and surjective homomorphisms (monomorphism and epimorphisms), respectively, and $0={1}$ stands for the Lie lgebra of one element.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,561
    Thanks
    785

    Re: fixed the Distance, please help me

    What do you mean by taking the space: measuring the distance? How to you specify the locations of the red arrows? Since LaTeX did not typeset the red arrow, it obviously cannot calculate the distance between them.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Member vernal's Avatar
    Joined
    Dec 2011
    Posts
    75

    Re: fixed the Distance, please help me

    Quote Originally Posted by emakarov View Post
    What do you mean by taking the space: measuring the distance? How to you specify the locations of the red arrows? Since LaTeX did not typeset the red arrow, it obviously cannot calculate the distance between them.
    oh,no... i can not speak english well.. sorry...

    the latex give me

    fixed the Distance, please help me-12.jpg

    but i don't like space between "arrow" and

    (I have shown with red line)

    What should I do ?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,561
    Thanks
    785

    Re: fixed the Distance, please help me

    OK, let's make a list.

    The empty space you are talking about is created by the instruction "\path[use as bounding box] (-1.5,0) rectangle (0,0)". As p. 166 of the TikZ 2.10 manual says, the instruction adds a rectangle with length 1.5cm to the previous bounding box, which contains the arrow. To remove the extra space, get rid of this instruction.

    It is not necessary to have an empty math formula inside a node: "\node (1) {$$}" is the same thing as "\node (1) {}".

    The part "node {}" in "\draw[to reversed->] (1) -- node {} (2)" does not make any difference: it just creates an empty node in the middle of the path.

    The code of the picture can be made rather small, so instead of saying "\begin{tikzpicture} ... \end{tikzpicture}" you can say "\tikz ... ;".

    It is not necessary to declare nodes (1) and (2) and then draw an arrow between them. The default space between nodes created by "right=of 1" is 1cm (p. 187 of the manual, option "node distance"). Therefore, a similar result can be achieved by
    Code:
    \tikz[>=stealth']\draw[to reversed->] (0,0) -- (1,0);
    The main difference is that now the arrow is located at the baseline level. The reason why the arrow is raised in your version with nodes is that nodes are not empty. Due to the option "inner sep" (p. 175), a node with no text is in fact a rectangle 2/3em by 2/3em by default. You can see this by saying "\node[draw]" instead of just "\node". Thus, in your example the arrow is 1/3em above the baseline. A drawback is that the line is drawn not between the nodes' centers but between the middles of the nodes' sides facing each other. This introduces a 2/3em space before and after the arrow in addition to the regular TeX text spaces. To get rid of this horizontal space, you can say "\node[inner xsep=0pt]". However, it is better to get rid of nodes at all.

    Saying
    Code:
    \tikz[>=stealth']\draw[to reversed->] (0cm,.5ex) -- (1cm,.5ex);
    or
    Code:
    \tikz[>=stealth']\draw[yshift=.5ex,to reversed->] (0,0) -- (1,0);
    does not help to raise the arrow because TikZ computes the arrow's bounding box and places its bottom side on the baseline. But saying
    Code:
    \tikz[>=stealth',baseline]\draw[yshift=.5ex,to reversed->] (0,0) -- (1,0);
    does the job because the "baseline=y" option (p. 117) puts the coordinate (0,y) on the baseline ("baseline" is an abbreviation for "baseline=0pt").

    Finally, if you are going to use this arrow in math formulas, wrap it in \mathrel{...} to create spaces before and after suitable for a relation.
    Thanks from vernal
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Member vernal's Avatar
    Joined
    Dec 2011
    Posts
    75

    Re: fixed the Distance, please help me

    Quote Originally Posted by emakarov View Post
    OK, let's make a list.

    The empty space you are talking about is created by the instruction "\path[use as bounding box] (-1.5,0) rectangle (0,0)". As p. 166 of the TikZ 2.10 manual says, the instruction adds a rectangle with length 1.5cm to the previous bounding box, which contains the arrow. To remove the extra space, get rid of this instruction.

    It is not necessary to have an empty math formula inside a node: "\node (1) {$$}" is the same thing as "\node (1) {}".

    The part "node {}" in "\draw[to reversed->] (1) -- node {} (2)" does not make any difference: it just creates an empty node in the middle of the path.

    The code of the picture can be made rather small, so instead of saying "\begin{tikzpicture} ... \end{tikzpicture}" you can say "\tikz ... ;".

    It is not necessary to declare nodes (1) and (2) and then draw an arrow between them. The default space between nodes created by "right=of 1" is 1cm (p. 187 of the manual, option "node distance"). Therefore, a similar result can be achieved by
    Code:
    \tikz[>=stealth']\draw[to reversed->] (0,0) -- (1,0);
    The main difference is that now the arrow is located at the baseline level. The reason why the arrow is raised in your version with nodes is that nodes are not empty. Due to the option "inner sep" (p. 175), a node with no text is in fact a rectangle 2/3em by 2/3em by default. You can see this by saying "\node[draw]" instead of just "\node". Thus, in your example the arrow is 1/3em above the baseline. A drawback is that the line is drawn not between the nodes' centers but between the middles of the nodes' sides facing each other. This introduces a 2/3em space before and after the arrow in addition to the regular TeX text spaces. To get rid of this horizontal space, you can say "\node[inner xsep=0pt]". However, it is better to get rid of nodes at all.

    Saying
    Code:
    \tikz[>=stealth']\draw[to reversed->] (0cm,.5ex) -- (1cm,.5ex);
    or
    Code:
    \tikz[>=stealth']\draw[yshift=.5ex,to reversed->] (0,0) -- (1,0);
    does not help to raise the arrow because TikZ computes the arrow's bounding box and places its bottom side on the baseline. But saying
    Code:
    \tikz[>=stealth',baseline]\draw[yshift=.5ex,to reversed->] (0,0) -- (1,0);
    does the job because the "baseline=y" option (p. 117) puts the coordinate (0,y) on the baseline ("baseline" is an abbreviation for "baseline=0pt").

    Finally, if you are going to use this arrow in math formulas, wrap it in \mathrel{...} to create spaces before and after suitable for a relation.

    emakarov
    Thanks for your help
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. The fixed point
    Posted in the Geometry Forum
    Replies: 0
    Last Post: April 2nd 2011, 11:57 AM
  2. Replies: 1
    Last Post: August 9th 2010, 04:03 PM
  3. Fixed points
    Posted in the Calculus Forum
    Replies: 0
    Last Post: March 22nd 2010, 01:14 PM
  4. Maximizing fixed circles in a fixed rectangle
    Posted in the Geometry Forum
    Replies: 4
    Last Post: March 8th 2010, 09:36 AM
  5. Linear Increment Across Fixed Distance
    Posted in the Calculus Forum
    Replies: 4
    Last Post: September 8th 2007, 05:44 PM

Search Tags


/mathhelpforum @mathhelpforum