6
votes
1answer
53 views

Conditional based on character following the macro

Basically, I would like to something like \xspace does, i.e. the meaning of the macro should depend on what is following it. So for example if I say \mymacro a it might expand to foo, and if any ...
2
votes
1answer
51 views

Dynamic macros with csname and utf-8

I wrote the following commands for dynamic variable names and assignment % in class file \RequirePackage[ngerman]{babel} \RequirePackage[T1]{fontenc} \RequirePackage[utf8]{inputenc} % in latex file ...
6
votes
1answer
86 views

Parsing utf8 problems

There are a number of questions relating to problems when using utf8 input encoding, and the closest I found to my problem is, I think, What characters in a normal text document will screw up LaTeX?. ...
4
votes
1answer
150 views

representing literal characters in a \newcommand or \def

Consider this short LaTeX document: \documentclass[11pt]{article} \usepackage[T2A]{fontenc} \usepackage[utf8]{inputenc} \usepackage[russian]{babel} \def\name{...} \begin{document} Hello: \name ...
6
votes
4answers
352 views

UTF-8 (but not in current font) character in newcommand

I'm trying to define a new single-character LaTeX command (to insert a 1 pt space with \kern1pt) and want to use one of the characters obtained through the AltGr key on a US International keyboard ...
15
votes
2answers
256 views

“Namethatchar” macro

I am searching for a macro/package that would give the name of characters. Here are a few examples of a possible behaviour: \namethatchar{A} → A \namethatchar{À} → Agrave \namethatchar{a} → a ...
2
votes
1answer
365 views

utf8, newcommand and umlaut

In my document, which is encoded as utf8 throughout (hopefully), umlaute etc. in the document body are put out correctly, but those defined in a \newcommand are not. I have tried some alternatives to ...
5
votes
1answer
338 views

How to write infix macro/newcommand?

Is it possible to write a new command/macro in infix syntax instead of prefix syntax; especially I'd like to have this for $\frac{a}{b}$. I use LuaLaTeX and with \newunicodechar{‾}{\overline} I can ...
14
votes
1answer
501 views

Command names with utf-8/special characters

Is it possible to define \newcommand{\√}[1]{\sqrt{#1}} as commands like this one would sometimes be easier to use.
5
votes
1answer
578 views

How do I convert a character to a numeric value?

Now that I've gotten Will Robertson's excellent unicode-math package working to change the colour and style of letters in my mathematics (trust me, there is a reason) thanks to his answer to my ...