Take the 2-minute tour ×
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.

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

1 Answer 1

up vote 14 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 \nonbreakspace.

\tl_set:Nn \l_silly_tl { Text ~ and ~ a \nonbreakspace 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

\group_begin:
\char_set_catcode_active:n { `\@ }
\char_set_lccode:nn { `\@ } { `\~ }
\tl_to_lowercase:n
   {
     \group_end:
     \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

 
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.