Question: I have the following LaTeX:

```
\documentclass{article}
\begin{document}
\newcommand{\lit}[1]{{\texttt #1}}
 \lit{()} \lit{(hello)} \lit{(}\lit{)} 
\lit{hello}
\end{document}

```

which produces the following output: 

![enter image description here](https://i.stack.imgur.com/Tdphz.png)

I'm curious to know why the first two closing parenthesis are of a different style to their opening ones. Any ideas?

Answer: 
```
\newcommand{\lit}[1]{{\texttt #1}}
\lit{()}

```

After one expansion step `\lit{()}` becomes:

```
\texttt ()

```

`\texttt` takes *one* argument, written with braces:

```
\texttt{(})

```

Thus the first open parentheses is written in the typewriter font, the second isn't.

Therefore you need curly braces around `#1`:

```
\newcommand{\lit}[1]{\texttt{#1}}

```
heiko's answer is good, but there's another way:

```
\newcommand{\lit}[1]{{\ttfamily #1}}

```

`\ttfamily` is "persistent"; it affects everything in the following text until the
end of the group. it's parallel to `\bfseries` or `\itshape`.