# macros (text)

Source: https://ref.dm-lang.org/DM/text/macros/

Text macros start with '\\' (a backslash) and end with a space or other punctuation.

```dm
\the, \The // insert 'the' (if needed)
\a, \an,   // insert 'a(n)' or 'some' (if needed)
\A, \An

\he, \He   // insert 'he/she/they/it'
\she, \She // same
\his, \His // insert 'his/her/their/its'
\him       // insert 'him/her/them/it'
\himself   // insert 'himself/herself/themself/itself'
\herself   // same
\hers      // insert 'his/hers/theirs/its'

\proper    // used in an object name to force proper-noun behavior
\improper  // used in an object name to force improper-noun behavior

\th        // insert 1st, 2nd, 5th etc.
\s         // insert 's' if [] was plural
\icon      // insert icon of following []
\ref       // insert a unique id for following []
\roman     // insert following [] as a lower-case roman numeral
\Roman     // insert following [] as an upper-case roman numeral
\...       // suppress final new line
\t         // insert tab
\n         // insert new line
\"         // insert double quote
\\         // insert backslash
\<         // insert &amp;lt; (less than)
\>         // insert &amp;gt; (greater than)
\(space)   // skip a space
\(newline) // skip a newline (and following space)

\xNN       // insert a character by its ASCII/Unicode value
\uNNNN     // "
\UNNNNNN   // "
```

```dm
mob/verb/steal(M as mob,obj/O as obj in M)
  O.loc = usr
  view() << "[usr] finds \himself \an [O]."
```

```dm
var/DayCount
proc/NewDay()
  DayCount++
  world << "The [DayCount]\th day dawns."
```

```dm
obj/CPU
  name = "\improper CPU"  //prevent capitalization from causing proper-noun behavior
```

### See also
- [icon text macro](https://ref.dm-lang.org/DM/text/macros/icon.md)
- [text](https://ref.dm-lang.org/DM/text/index.md)
- [text proc](https://ref.dm-lang.org/proc/text.md)

## Pages

- [icon text macro](https://ref.dm-lang.org/DM/text/macros/icon.md)
- [ref text macro](https://ref.dm-lang.org/DM/text/macros/ref.md)
