# Single space after inline code?

by Pejman Poh   Last Updated January 06, 2018 16:23 PM

I'm writing a bunch of inline code like so:

\documentclass[a4paper,12pt]{report}

% New Commands
\newcommand{\code}[1]{\texttt{#1}} % Create new \code blocks
\newcommand{\malloc}{\code{malloc()}}
\newcommand{\flp}{\code{\_\_flp}}

\begin{document}

Another important variable used in \malloc is \flp.

\end{document}


However what gets produced:

There is no space after malloc(). I could fix this by appending a \space to the end of the newcommand but then __flp would mess up. How do I get \texttt to stop ignoring spaces after it's command.

I tried switching to \listings but whatever configs I had set up didn't fix the issue. I am not averse to switching back however.

Tags :