Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have found a strange behavior when combining the tabbing environement with a font change. When I write the following code

blah blah blah blah
blah blah blah blah
blah blah blah blah
\begin{tabbing}
SELECT \= * \\
FROM \> Student S \\
WHERE \> Dept = 1
\end{tabbing}
more more more more
more more more more
more more more more

the tabbing environment DOES NOT start a new paragraph and therefore the subsequent text (more ...) is not indented.

On the other hand when I want to change to \sf within the tabbing environment as follows

blah blah blah blah
blah blah blah blah
blah blah blah blah
\textsf{
\begin{tabbing}
SELECT \= * \\
FROM \> Student S \\
WHERE \> Dept = 1
\end{tabbing}
}
more more more more
more more more more
more more more more

THERE IS a paragraph break and the subsequent text is therefore written indented.

Any idea why this happen and how to circumvent it?

share|improve this question
    
Welcome to TeX.sx! Please put personal information into your user profile rather than attaching it to your post. –  lockstep Feb 26 '13 at 9:42
add comment

2 Answers

Please always post complete documents, it makes testing a lot easier. It isn't so much the font change as the group which defeats LaTeX's trivlist code detecting whether to start a paragraph.

Also it is better to use \sffamily rather than \textsf in vertical mode contexts. The easiest fix is to start the partial paragraph after the tabbing before ending the group as shown in the last example:

enter image description here

\documentclass{article}

\begin{document}

blah blah blah blah
blah blah blah blah
blah blah blah blah
\begin{tabbing}
SELECT \= * \\
FROM \> Student S \\
WHERE \> Dept = 1
\end{tabbing}
more more more more
more more more more
more more more more


blah blah blah blah
blah blah blah blah
blah blah blah blah
\textsf{
\begin{tabbing}
SELECT \= * \\
FROM \> Student S \\
WHERE \> Dept = 1
\end{tabbing}
}
more more more more
more more more more
more more more more



blah blah blah blah
blah blah blah blah
blah blah blah blah
{\sffamily
\begin{tabbing}
SELECT \= * \\
FROM \> Student S \\
WHERE \> Dept = 1
\end{tabbing}
\mbox{}}more more more more
more more more more
more more more more

\end{document}
share|improve this answer
add comment

The check for a blank line after \end{tabbing} fails when you enclose tabbing as the argument to \textsf, so you get an end of paragraph.

You're best served if you define your own environment:

\documentclass{article}

\newenvironment{sftabbing}
  {\sffamily\tabbing}
  {\endtabbing}

\begin{document}
blah blah blah blah
blah blah blah blah
blah blah blah blah
\begin{tabbing}
SELECT \= * \\
FROM \> Student S \\
WHERE \> Dept = 1
\end{tabbing}
more more more more
more more more more
more more more more

blah blah blah blah
blah blah blah blah
blah blah blah blah
\begin{sftabbing}
SELECT \= * \\
FROM \> Student S \\
WHERE \> Dept = 1
\end{sftabbing}
more more more more
more more more more
more more more more

\end{document}

In this way, if you change your mind about how the sftabbing environment should be rendered, you can simply act on its definition, rather than hunting for tabbing through the whole document.

enter image description here

share|improve this answer
    
Dear David and Enrico Many thanks for your anwers ! That helped me a lot. Regards Esteban –  Esteban Zimanyi Feb 27 '13 at 8:15
    
As a follow-up of the question –  Esteban Zimanyi Mar 8 '13 at 12:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.