This question already has an answer here:
- putting spaces within text block 2 answers
I'm an aspiring LaTeX user and have so far managed the first steps and created my first few documents. Coming from a programming background I've been wondering how you could use
\newcommand to create a command that formats numbers or strings in a hard-coded way.
For example, let's say I have the string AB1234567890. Now what I'd like to do is create a command, that used like this
should create the output
AB12 3456 7890
I realize something like that can be done with
but I would like to define a fixed "layout" in the command to make sure that every string gets formated the same way as I use that command with each string later.
In a programming language I could split strings and such but I'm unaware how to solve that with LaTeX.