# Remove trailing space from \input [duplicate]

It seems that \input appends a trailing space. MWE:

foo.tex

\documentclass{article}
\begin{document}
foo\input{bar.txt}baz
\end{document}


bar.txt

bar


Which, using pdflatex foo gives the output foobar baz, with a space in between. How do I remove it?

• \input{bar.txt}\unskip baz – egreg Jul 23 '14 at 13:53