6
votes
1answer
87 views

Why \shorthandon and \shorthandoff cannot be embedded in other macros?

Surrounding \title macro with \shorthandon{;:!?} and \shorthandoff{;:!?} gives the expected result with babel's french language (space added before the '?', '!', ':' and ';'): ...
11
votes
3answers
152 views

How to pass a macro as the argument to \selectlanguage

The following mwe throws the error You haven't defined the language lang yet. \documentclass{article} \usepackage[american]{babel} \newcommand{\lang}{american} \selectlanguage{\lang} \begin{document} ...
6
votes
2answers
113 views

Branching construct based on the (babel) language selected

I'd like to keep one of my presentations in German and English and have defined a corresponding boolean variable withifthen and a command to typeset either the German or the English text. Is there ...
6
votes
2answers
159 views

babel + xdef compile error

The following code throws the error Incomplete \iffalse; all text was ignored after line 7 when I enable the babel package. \documentclass[a4paper,12pt]{book} \usepackage[latin1]{inputenc} ...
6
votes
3answers
176 views

How to define a new command for guillemets marks [duplicate]

Possible Duplicate: babel shorthand "| doesn’t work in macros I would like to define a new command for guillemets marks. I know how to obtain them in LaTeX and those I would like to ...
3
votes
1answer
433 views

Using “German” quotation marks inside \newcommand [duplicate]

Possible Duplicate: babel shorthand "| doesn’t work in macros I know there is a deeper non-understanding of LaTeX mechanics at work here, but I have no idea how to phrase my question ...
4
votes
3answers
209 views

Command to uppercase the first letter of a maths command

This question is a bit similar to Command to uppercase the first letter of each word in a sentence. What I want is to build a new command for being used just at math mode, using the ...
11
votes
2answers
326 views

Using breakable hyphen "= in \newcommand

I want to use a breakable hyphen "= in a command: \documentclass[a4paper]{article} \usepackage[ngerman]{babel} \newcommand{\TT}{Test"=Text } \begin{document} This is a test whether the hyphen in \TT ...
4
votes
3answers
211 views

Babel[french] adds \ier commands, why doesn't Babel[english] add \th?

I recently realized that when called with the option [french], the babel package adds a number of useful commands such as ier{} for "1er" read "premier", \no or \degres. Yet it seems to get similar ...
16
votes
1answer
566 views

babel shorthand "| doesn't work in macros

The package babel with the ngerman option (and most other languages as well, but not english) provides the shorthand "|, which prevents a ligature at the given position (see p. 81 of the babel ...
11
votes
1answer
522 views

“ with tipa and babel's ngerman / \shorthandoff{”} in a macro

TL;DR see below at "core problem" Problem I'm trying to solve a conflict between the packages tipa (Fonts and macros for IPA phonetics characters) and babel with the ngerman option. The problem ...
6
votes
1answer
203 views

Expansion of command for language in otherlanguage environment

I wish to keep the language in a command \newcommand{\testlang}{english} \begin{otherlanguage}{\testlang} ... \end{otherlangauge} However, \testlang is not expanded, and i get the error ! ...
10
votes
2answers
792 views

What is the right way to redefine macros defined by babel?

If I want to use the babel package and redefine a macro such as \contentsname, what is the right way to go about this? Just putting \renewcommand in the preamble doesn't work. This sort of works ...