Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cannot compile tables due to babel problem

43 views
Skip to first unread message

Uwe Stöhr

unread,
Sep 25, 2008, 7:42:14 PM9/25/08
to
I need to compile this small document:

\documentclass[slovak]{article}
\usepackage[T1]{fontenc}
\usepackage[latin2]{inputenc}
\usepackage{babel}

\begin{document}

\begin{center}

\begin{tabular}{|l||r|r|}
\hline
\multicolumn{1}{|l||}{point a \& b} & 103 & 9\\
\cline{2-3}
point b \& a & 599 & 340\\
\hline
point abc & 1009 & 52\\
\hline
\end{tabular}

\end{center}

\end{document}


But I get the error:

Runaway argument?
2-3\@nil point b \& a & 599 & 340\\ \hline point abc & 1009 & 52\\ \hline \ETC
.
! Paragraph ended before \@cline was complete.
<to be read again>
\par
l.21

But when I use instead of
\documentclass[slovak]{article}
e.g.
\documentclass[serbian]{article}
or another language, then it compiles.

I get btw. also this babel warning:

Package babel Warning: No hyphenation patterns were loaded for
(babel) the language `Slovak'
(babel) I will use the patterns loaded for \language=0 instead.

Does babel not provide hyphenation patterns for Slovak?

thanks and regards
Uwe

Heiko Oberdiek

unread,
Sep 26, 2008, 12:10:46 AM9/26/08
to
Uwe Stöhr <uwes...@web.de> wrote:

> \documentclass[slovak]{article}
> \usepackage[T1]{fontenc}
> \usepackage[latin2]{inputenc}
> \usepackage{babel}
>
> \begin{document}
>
> \begin{center}
>
> \begin{tabular}{|l||r|r|}
> \hline
> \multicolumn{1}{|l||}{point a \& b} & 103 & 9\\
> \cline{2-3}
> point b \& a & 599 & 340\\
> \hline
> point abc & 1009 & 52\\
> \hline
> \end{tabular}
>
> \end{center}
>
> \end{document}
>
>
> But I get the error:
>
> Runaway argument?
> 2-3\@nil point b \& a & 599 & 340\\ \hline point abc & 1009 & 52\\ \hline \ETC

\cline is breaks because `-' is an active shorthand character in
slovak, but \cline expects catcode 12 for `-'.

Babel provides \shorthandoff{-}:

\shorthandoff{-}
\begin{tabular}...
\cline{2-3}
...
\end{tabular}
\shorthandon{-}

or you can convert an active `-' to a normal hyphen (catcode 12):
\expandafter\cline\expandafter{\expandafter2\string-3}
or
\expandafter\cline\expandafter{\detokenize{2-3}}

> Does babel not provide hyphenation patterns for Slovak?

No, hyphenation patterns are usually found below CTAN:language/...
And the hyphenation patterns must be configured (added) in
language.dat. In TL2008 the patterns for Slovak are already
there and are used in language.dat.

Yours sincerely
Heiko <ober...@uni-freiburg.de>

Dan

unread,
Sep 26, 2008, 12:25:30 AM9/26/08
to
On Sep 25, 6:42 pm, Uwe Stöhr <uwesto...@web.de> wrote:
> I need to compile this small document:
>
> \documentclass[slovak]{article}
> \usepackage[T1]{fontenc}
> \usepackage[latin2]{inputenc}
> \usepackage{babel}
>
> \begin{document}
>
> \begin{center}
>

\shorthandoff{-}

> \begin{tabular}{|l||r|r|}
> \hline
> \multicolumn{1}{|l||}{point a \& b} & 103 & 9\\
> \cline{2-3}
> point b \& a & 599 & 340\\
> \hline
> point abc & 1009 & 52\\
> \hline
> \end{tabular}

The problem is that "-" is a shorthand character in slovak.
But \cline needs to see a normal hyphen.

>
> I get btw. also this babel warning:
>
> Package babel Warning: No hyphenation patterns were loaded for
> (babel)                the language `Slovak'
> (babel)                I will use the patterns loaded for \language=0 instead.
>
> Does babel not provide hyphenation patterns for Slovak?

The babel package provides no hyphenations at all, but it does
provide a scheme for loading them, which must be done when
the latex format is created. Try searching the documentation of
your TeX distribution, since the means to do that can vary.


Dan

Uwe Stöhr

unread,
Sep 26, 2008, 3:28:08 PM9/26/08
to Heiko Oberdiek
Heiko Oberdiek schrieb:

> \cline is breaks because `-' is an active shorthand character in
> slovak, but \cline expects catcode 12 for `-'.

Thanks for your quick reply.

> or you can convert an active `-' to a normal hyphen (catcode 12):
> \expandafter\cline\expandafter{\expandafter2\string-3}

I use now this code. Many thanks for this hint!
Is there a way to find out quickly what other languages make "-" an active shorthand?

thanks and regards
Uwe

Heiko Oberdiek

unread,
Sep 26, 2008, 3:31:19 PM9/26/08
to
Uwe Stöhr <uwes...@web.de> wrote:

> Is there a way to find out quickly what other languages make "-" an active shorthand?

Perhaps `find' + `grep' can give hints.

Yours sincerely
Heiko <ober...@uni-freiburg.de>

Uwe Stöhr

unread,
Sep 26, 2008, 3:44:01 PM9/26/08
to Heiko Oberdiek
Heiko Oberdiek schrieb:

> Perhaps `find' + `grep' can give hints.

Thanks, I found Czech of course.

Another related question:
When I load in the example document hyperref with the option

colorlinks=true

I need to load the package color, but not when I use another language than Slovak or Czech. What
could be the reason?

thanks again and regards
Uwe

Heiko Oberdiek

unread,
Sep 26, 2008, 6:05:56 PM9/26/08
to
Uwe Stöhr <uwes...@web.de> wrote:

> When I load in the example document hyperref with the option
>
> colorlinks=true
>
> I need to load the package color, but not when I use another language than Slovak or Czech. What
> could be the reason?

The babel packages makes the shorthands active using \AtBeginDocument.
hyperref also loads package color using \AtBeginDocument, but after
babel's \AtBeginDocument, if hyperref is loaded after babel (the
recommended order). Then the active shorthands interfere.
Therefore the easiest solution you have already found, loading color
before babel.

Yours sincerely
Heiko <ober...@uni-freiburg.de>

Uwe Stöhr

unread,
Sep 27, 2008, 3:15:13 PM9/27/08
to Heiko Oberdiek
Heiko Oberdiek schrieb:

> The babel packages makes the shorthands active using \AtBeginDocument.
> hyperref also loads package color using \AtBeginDocument, but after
> babel's \AtBeginDocument, if hyperref is loaded after babel (the
> recommended order). Then the active shorthands interfere.

Thanks for the explanation.

regards Uwe

Heiko Oberdiek

unread,
Sep 27, 2008, 4:10:40 PM9/27/08
to
Heiko Oberdiek <ober...@uni-freiburg.de> wrote:

Or use the latest hyperref 6.78k, I have just added a fix for this.

Yours sincerely
Heiko <ober...@uni-freiburg.de>

0 new messages