LaTeX forum ⇒ Text Formattingincrease space between lines in tabbing Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
white_owl
Posts: 12
Joined: Wed Apr 21, 2010 6:56 pm

increase space between lines in tabbing

Postby white_owl » Fri Jan 25, 2013 10:59 pm

I have a long equation inside a tabbing environment like this:
  1. \begin{tabbing}
  2. $f(x)$ \= $ = \left( \dfrac{a}{b} \right)$ \\
  3. \> $ = \left( \dfrac{c}{d} \right)$ \\
  4. \end{tabbing}

This works nice, but parenthesis from these two lines touch each other (as well as b and c).
How to separate them?
Attachments
badimage.gif
badimage.gif (1.92 KiB) Viewed 3956 times
Last edited by Stefan Kottwitz on Sat Jan 26, 2013 12:52 am, edited 1 time in total.
Reason: inline code changed to code block

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7801
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sat Jan 26, 2013 12:55 am

The quickest way is using the optional argument to \\ for adding vertical space:
  1. \begin{tabbing}
  2. $f(x)$ \= $ = \left( \dfrac{a}{b} \right)$ \\[1ex]
  3. \> $ = \left( \dfrac{c}{d} \right)$ \\
  4. \end{tabbing}


Stefan
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Sat Jan 26, 2013 12:00 pm

white_owl wrote:I have a long equation inside a {tabbing} environment […]

Is there a special reason why don't use the align* environment from amsmath?
  1. \documentclass[11pt]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{mathtools} % loads »amsmath«
  4.  
  5. \begin{document}
  6. \begin{align*}
  7. f(x) &= \left(\frac{a}{b}\right) \\
  8. &= \left(\frac{c}{d}\right)
  9. \end{align*}
  10. \end{document}


Further reading:



Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

white_owl
Posts: 12
Joined: Wed Apr 21, 2010 6:56 pm

Postby white_owl » Sun Jan 27, 2013 12:29 am

Thank you, Stefan_K. Your solution works wonderfully.


localghost, The reason why I do not use align* is because I did not know about it. Looks promising, probably I will use in the future. The main problem of TeX - too many packages and not enough documentation for them.
But what I see from your example - the align* also centers the equations. What if I do not want that? How to move the equations to the left side of the page?

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7801
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sun Jan 27, 2013 12:38 am

Some comments,

white_owl wrote:too many packages and not enough documentation for them.


Most packages are well documented. Do you read documentation? In this case, besides the excellent mathmode document, the amsmath manual is relevant. Every good introduction, tutorial and book should mention amsmath. Perhaps you did not read one. No problem, but in this case better not judge on TeX. ;)

white_owl wrote:How to move the equations to the left side of the page?


Both linked documentation would tell you that: you could simply use the class option fleqn (flush left equations), such as

  1. \documentclass[fleqn]{article}


Stefan
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

white_owl
Posts: 12
Joined: Wed Apr 21, 2010 6:56 pm

Postby white_owl » Sun Jan 27, 2013 8:42 am

Stefan_K wrote:Some comments,

white_owl wrote:too many packages and not enough documentation for them.


Most packages are well documented. Do you read documentation? In this case, besides the excellent mathmode document, the amsmath manual is relevant. Every good introduction, tutorial and book should mention amsmath. Perhaps you did not read one. No problem, but in this case better not judge on TeX. ;)
Ok, can I judge texdoc in this case?
I learned about amsmath package from looking at some examples. It was mentioned as a good source for math symbols so I use it... Then I tried to read documentation for that package I typed `texdoc amsmath` and got the PDF with "The amsmath package, Version 2.13, 2000/07/18" on the first page. It is a very technical text which can be useful if you would like to reverse engineer the package but it is definitely not a user-friendly documentation.
The documentation you are referring to is called "amsldoc" and sure, if I run `texdoc amsldoc` I am finally able to read documentation for amsmath. But how am I supposed to know that user guide for amsmath package is called amsldoc and not amsmath - is beyond me. How did you learned that?

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7801
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sun Jan 27, 2013 10:06 am

white_owl wrote:Ok, can I judge texdoc in this case?


If you don't use an outdated version, but a new one. ;) Wich version of TeX do you have installed?

In current versions texdoc amsmath works fine and opens amsldoc. I tested with TeX Live 2012 and 2011, possibly it worked also earlier. You can test it online on texdoc.net. My link above is based on it. There's a quick search feature for the browser if you don't want to update your local TeX.

texdoc is a great tool for working with the documentation. It's based on filenames, but sometimes developers choose difficult names, as it's the case with amsmath. So somebody added an exception for amsmath, and there were also synonyms introduced.

Stefan
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Sun Jan 27, 2013 1:37 pm

white_owl wrote:[…] The main problem of TeX - too many packages and not enough documentation for them. […]

Here I have to disagree vigorously. The vast majority of the packages (>90%) are documented very good. So I can't comprehend these concerns.
white_owl wrote:[…] But what I see from your example - the align* also centers the equations. What if I do not want that? How to move the equations to the left side of the page?

The amsmath package also provides the flalign* environment which allows to align equations individually to the left margin.
  1. \documentclass[11pt]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{mathtools} % loads »amsmath«
  4.  
  5. \begin{document}
  6. Preceding Text
  7. \begin{flalign*}
  8. f(x) &= \left(\frac{a}{b}\right) &\\
  9. &= \left(\frac{c}{d}\right) &
  10. \end{flalign*}
  11. Following Text
  12. \end{document}

The environment is also described in the document I mentioned earlier.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode: Topic is solved[/url]" title="Click to select post's link in BBcode format" onclick="this.focus();this.select();" />
HTML: Topic is solved</a>" title="Click to select post's link in HTML format" onclick="this.focus();this.select();" />
Hide post links
Show post links

white_owl
Posts: 12
Joined: Wed Apr 21, 2010 6:56 pm

Postby white_owl » Mon Feb 04, 2013 12:30 am

Stefan_K wrote:
white_owl wrote:Ok, can I judge texdoc in this case?


If you don't use an outdated version, but a new one. ;) Wich version of TeX do you have installed?

In current versions texdoc amsmath works fine and opens amsldoc. I tested with TeX Live 2012 and 2011, possibly it worked also earlier.
I have texlive "2009-11 squeeze1". The one which is distributed by Debian's repository.


Stefan_K wrote:You can test it online on texdoc.net.
Thank you very much. It looks like it would be my primary search engine from now on.

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Text Formatting”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests