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

how to disable babel shorthands?

70 views
Skip to first unread message

Oleg Paraschenko

unread,
Oct 4, 2005, 10:46:38 AM10/4/05
to
Hello,

is it possible to disable babel's shorthands? I found the
"\shorthandoff{chars}" command, but:

* I should know all the shorthands characters in advance, and
* If I provide a non-shorthand character, then I get an error in
terminal.

I generate LaTeX-files automatically, and I'd like to avoid hard-coding
all the language-shorthands mapping into the script. Any better ideas?

Thank you.

--
Oleg Paraschenko olpa@ http://uucode.com/
http://uucode.com/blog/ Generative Programming, XML, TeX, Scheme

Morten Høgholm

unread,
Oct 4, 2005, 11:01:39 AM10/4/05
to
On Tue, 04 Oct 2005 16:46:38 +0200, Oleg Paraschenko <ole...@gmail.com>
wrote:

> Hello,
>
> is it possible to disable babel's shorthands? I found the
> "\shorthandoff{chars}" command, but:
>
> * I should know all the shorthands characters in advance, and
> * If I provide a non-shorthand character, then I get an error in
> terminal.
>
> I generate LaTeX-files automatically, and I'd like to avoid hard-coding
> all the language-shorthands mapping into the script. Any better ideas?

The following doesn't really disable them but it does make them expand to
the harmless representation of the character in question. Is that what you
want?

\makeatletter
\def\active@prefix#1#2{%
\ifx\protect\@typeset@protect
\string#1%
\else
\ifx\protect\@unexpandable@protect
\noexpand#1%
\else
\protect#1%
\fi
\fi}
\makeatother


--
Morten

Oleg Paraschenko

unread,
Oct 4, 2005, 11:46:22 AM10/4/05
to
Hello Morten,

thanks for the suggestion. I've finally implemented a solution, which
is also based on hooking babel internals:

[lessbabel.sty]
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{lessbabel}[2005/10/04 Babel without shorthands]

\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{babel}}
\ProcessOptions\relax
\RequirePackage{babel}

\def\bbl@activate#1{}
[/lessbabel.sty]

My documents now use

\usepackage[english,german]{lessbabel}

instead of

\usepackage[english,german]{babel}

0 new messages