LaTeX forum ⇒ Text FormattingTabbing, alignment

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
danmaker
Posts: 6
Joined: Sun Mar 07, 2010 7:24 pm

Tabbing, alignment

Postby danmaker » Sun Mar 07, 2010 7:44 pm

Hello,

is there any way to set a right aligment of text in the tabbing environment?
The first tab has left alignment, but I need the next tab to have the text aligned to the right.

Thanks in advance

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

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm
Location: Colombia

Postby gmedina » Sun Mar 07, 2010 7:54 pm

Hi,

can't you use a tabular environment?

  1. \documentclass{article}
  2.  
  3. \begin{document}
  4.  
  5. \begin{tabular}{lr}
  6. column1 & column2\\
  7. text & text
  8. \end{tabular}
  9.  
  10. \end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...

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

danmaker
Posts: 6
Joined: Sun Mar 07, 2010 7:24 pm

Postby danmaker » Sun Mar 07, 2010 8:46 pm

hi,

tried that out, but can´t make the left column to align with the left side of the page, it sets the table in the vertical center

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 Mar 07, 2010 8:57 pm

danmaker wrote:[...] tried that out, but can´t make the left column to align with the left side of the page, it sets the table in the vertical center

Please explain what the (horizontal) alignment to the left has to do with the alleged vertical centering.


Best regards
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

danmaker
Posts: 6
Joined: Sun Mar 07, 2010 7:24 pm

Postby danmaker » Sun Mar 07, 2010 9:13 pm

right, sorry about the confusion.. when I set the tabular environment, the left column doesn´t align to the left as the rest of the text in the document does

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 Mar 07, 2010 9:19 pm

  1. \documentclass{article}
  2.  
  3. \begin{document}
  4. \begin{tabular}{@{}lr@{}}
  5. column1 & column2\\
  6. text & text
  7. \end{tabular}
  8. \end{document}
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

danmaker
Posts: 6
Joined: Sun Mar 07, 2010 7:24 pm

Postby danmaker » Sun Mar 07, 2010 9:26 pm

great, thanks a lot!

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

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am
Location: Amherst, MA

Postby frabjous » Mon Mar 08, 2010 4:51 am

For the record, you can right align in a tabbing environment using the \` command, which will push the text right aligned up to the next tab stop, or the end of the line if there are no more assigned.

  1. \documentclass{article}
  2. \begin{document}
  3. \begin{tabbing}
  4. left \` right\\
  5. gauche \` droit\\
  6. links \` rechts\\
  7. \end{tabbing}
  8. \end{document}

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


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 2 guests