3

I have a question regarding supertabular and babel. Whenever I'm using different language specifications inside a cell, there is a slight vertical space, which is not there when there is no language specification. I imagine something must be missing somewhere, but I can't figure out where.

Supertabular is needed because the document I'm working on is about 30 pages long. Default language is French, but I have to include other languages in the cells.

When there is no language specification, the problem doesn't appear. I've put some exclamation points to show that the French spacing is effective, both as default and when specified (which is all but normal), to show that babel is working correctly at least for that.

This is the output of the code shown below

%!TeX - program = pdflatex
%!TEX encoding = UTF-8 Unicode

\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,frenchb]{babel} 
\usepackage{array}
\usepackage{supertabular}
\usepackage{hhline}
\usepackage{hyperref}
\usepackage{geometry}
\geometry{a4paper,margin=2cm}

\begin{document}
\begin{supertabular}{|>{\raggedright}p{7.5cm}<{\raggedright}|p{7.5cm}|}

\hline
\begin{otherlanguage}{english}
This is marked as English!
\end{otherlanguage}
&
Ceci n'est pas marqué!
\\
\hline

\begin{otherlanguage}{english}
And again!
\end{otherlanguage}
&
Et encore!
\\
\hline
This time it isn't marked!
&
\begin{otherlanguage}{frenchb}
Cette fois-ci c'est marqué!
\end{otherlanguage}
\\
\hline

\end{supertabular}
\end{document}

Thanks for all comments!

3

This has nothing to do with supertabular; here's a minimal example with a workaround:

\documentclass[a4paper,11pt]{article}
\usepackage[english]{babel}

\begin{document}
\begin{tabular}{|p{5cm}|}
\hline
\begin{otherlanguage}{english}
This is marked as English!
\end{otherlanguage}\\
\hline
\leavevmode\begin{otherlanguage}{english}
This is marked as English!
\end{otherlanguage}\\
\hline
Not marked\\
\hline
\end{tabular}
\end{document}

enter image description here

The problem is that \begin{otherlanguage} places a whatsit for marking a point where to write an annotation in the .aux file. This happens at an unfortunate time when it's the first object in a p cell.

However, it makes probably more sense to use the otherlanguage* environment, in such a case. With

\begin{tabular}{|p{5cm}|}
\hline
\begin{otherlanguage*}{english}
This is marked as English!
\end{otherlanguage*}\\
\hline
Not marked\\
\hline
\end{tabular}

the output is correct:

enter image description here

  • Oh, I figured it was something of the kind. Thanks for the workaround. – gingko Jan 24 '15 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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