LaTeX forum ⇒ Text Formatting\hfill doesn't work in tabbing environment

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Posts: 2
Joined: Sat Oct 03, 2009 9:26 pm

\hfill doesn't work in tabbing environment

Postby clementian » Sat Oct 03, 2009 9:46 pm

Hi, all,

Here is my question.
When I use \hfill in the tabbing environment, it doesn't seem to play
the role expected. In what way we can achieve the effect of \hfill in
a tabbing env? thank you.

My original problem is I want a layout as below:

--Assume A \subseteq B
----For all x \in A
------x \in C ..............................(1) %right aligned
------x \in CEDF ............................(2) %right aligned
------Therefore, by (1) and (2),
----x \in C \cap CEDF .......................(3) %right aligned
--A \subseteq C \cap CEDF

(Ignore --- in the begining of each line. they should be taken
as spaces. I didn't use spaces because the system automatically dels them)
I use tabbing env to implement the "tabbing" inside the proof. However,
inside tabbing env, \dotfill (or \hfill) doesn't work as expected.

Again, appreciate you answer to this question.



User avatar
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Postby frabjous » Sat Oct 03, 2009 11:42 pm

In the tabbing environment, you can use \` to right align stuff up to the next tab stop (or end of line, if there are no more):


  1. \documentclass{article}
  2. \begin{document}
  3. Proof:
  4. \begin{tabbing}
  5. XXX\=XXX\=XXX\=\kill\\
  6. \>Assume $A \subseteq B$\\
  7. \>\>For all $x \in A$\\
  8. \>\>\>$x \in C$ \`(1) \\
  9. \>\>\>\ldots\\
  10. \>\>\>$x \in CEDF$ \`(2)\\
  11. \>\>\>Therefore, by (1) and (2),\\
  12. \>\>$x \in C \cap CEDF$ \`(3)\\ %right aligned
  13. \>\>Therefore,\\
  14. \>\>$A \subseteq C \cap CEDF$\\
  15. \end{tabbing}
  16. \end{document}

But, in all honestly, you'd probably be better off finding some kind of proof environment, e.g., one that automatically tags your lines, from the AMS math packages or similar.

Posts: 2
Joined: Sat Oct 03, 2009 9:26 pm

Postby clementian » Thu Oct 08, 2009 5:04 pm


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 4 guests