Text Formattingincrease space between lines in tabbing

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

increase space between lines in tabbing

Post by white_owl »

I have a long equation inside a tabbing environment like this:

Code: Select all

\begin{tabbing}
$f(x)$ \= $ = \left( \dfrac{a}{b} \right)$ \\
\> $ = \left( \dfrac{c}{d} \right)$ \\
\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 11620 times
Last edited by Stefan Kottwitz on Sat Jan 26, 2013 12:52 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

increase space between lines in tabbing

Post by Stefan Kottwitz »

The quickest way is using the optional argument to \\ for adding vertical space:

Code: Select all

\begin{tabbing}
$f(x)$ \= $ = \left( \dfrac{a}{b} \right)$ \\[1ex]
\> $ = \left( \dfrac{c}{d} \right)$ \\
\end{tabbing}
Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

increase space between lines in tabbing

Post by localghost »

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?

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools}  % loads »amsmath«

\begin{document}
  \begin{align*}
    f(x) &= \left(\frac{a}{b}\right) \\
         &= \left(\frac{c}{d}\right)
  \end{align*}
\end{document}
Further reading:

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

Re: increase space between lines in tabbing

Post by white_owl »

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?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

increase space between lines in tabbing

Post by Stefan Kottwitz »

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

Code: Select all

\documentclass[fleqn]{article}
Stefan
LaTeX.org admin
white_owl
Posts: 12
Joined: Wed Apr 21, 2010 6:56 pm

increase space between lines in tabbing

Post by white_owl »

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?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

increase space between lines in tabbing

Post by Stefan Kottwitz »

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
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

increase space between lines in tabbing

Post by localghost »

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.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools}  % loads »amsmath«

\begin{document}
  Preceding Text
  \begin{flalign*}
    f(x) &= \left(\frac{a}{b}\right) &\\
         &= \left(\frac{c}{d}\right) &
  \end{flalign*}
  Following Text
\end{document}
The environment is also described in the document I mentioned earlier.
white_owl
Posts: 12
Joined: Wed Apr 21, 2010 6:56 pm

increase space between lines in tabbing

Post by white_owl »

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.
Post Reply