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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to use {\AA} to input a capital A with a ring above. However, the document I am writing has to import some definitions which I have no control over.

One of the definitions changes \r:

\renewcommand{\r}[1]{\right#1}

Is there a way to import the above definition without changing it, and somehow still use {\AA}? I can put definitions before the file that changes \r is imported, if that helps.

share|improve this question
3  
One of the silliest redefinitions I've seen, you have all my sympathy 😄 – egreg 1 hour ago
    
Isn't as simple to use utf8 inputenc and simply type Å? – Bernard 7 mins ago
up vote 3 down vote accepted

whatever is defining \r is incorrect and breaking latex so you should report a bug even if you can not change it.

Use \let\temp\r before importing the bad definitions and put \let\r\temp after them to restore \r.

You could of course redefine \AA but \r is an encoding specific command so it is (re)defined if you switch encodings such as

\usepackage[T1]{fontenc}

it is used internally if you use Å directly using inputenc, so you would have to make multiple changes in many files to make latex not call \r anywhere.

share|improve this answer
1  
I hope that LaTeX3 is more flexible in this regard, and that no document command is “fixed”. – Manuel 1 hour ago
2  
@Manuel The current approach has separate code and document levels, so we would expect something like \AA here to be implemented as a code-level command not in terms of another document-level one. (There are complex open questions about engine support and thus the nature of \AA specifically, but the general point stands.) – Joseph Wright 1 hour ago

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.