TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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 need to define a token list of the form

\tl_new:N  \g_silly_tl
\tl_set:Nn \g_silly_tl { Text ~ and ~ a ~ tie:?? }

How do I do this?

More generally, is there a reference where one can see how to input characters 'normally' under expl3 syntax?

share|improve this question
up vote 17 down vote accepted

This question has two distinct parts, one of which is easier than the other!

The specific issue here is (presumably) not inserting a tilde but rather inserting a non-breaking space in some 'fixed' text stores as within a LaTeX3 tl variable. While a tilde is a convenient shortcut for this at the document level, here I think I would simply use the macro \nobreakspace.

\tl_set:Nn \l_silly_tl { Text ~ and ~ a \nobreakspace tie:?? }

(Note that at present there is no expl3 code-level 'non-breaking space' function.)

On the wider issue of 'inserting non-standard catcode characters', the current approach is to use the 'traditional' \lowercase trick, using expl3 naming of course

\char_set_catcode_active:n { `\@ }
\char_set_lccode:nn { `\@ } { `\~ }
     \tl_set:Nn \l_silly_tl { Text ~ and ~ a @ tie:?? }

However, we know that this is not really 'right': the concept 'make text lower case' is separate from 'create non-standard category codes', and indeed the current \tl_to_lowercase:n is 'wrong' as it's not expandable. At the time of writing we've not worked out the full detail of a 'better' approach, but this is something we do know we need to do. (I will raise it again with the rest of the team: I'd like to solve this.)

share|improve this answer

Your Answer


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.