Suppose, we need to create a block for signatures for a contract consisting of 2 horizontal lines and names below them. main.tex
:
\documentclass[12pt]{article}
\usepackage[a5paper]{geometry}
\geometry{verbose,tmargin=2cm,bmargin=3cm,lmargin=2cm,rmargin=2cm}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\begin{document}
\noindent\makebox[.45\textwidth]{\hrulefill} \hfill\makebox[.45\textwidth]{\hrulefill}
\noindent\makebox[.45\textwidth][l]{Director 1} \hfill\makebox[.45\textwidth][l]{Director 2}
\end{document}
Output:
Everything is fine. But when I move the code into a separate file
signature.tex
and put a reference to it into the main file:
\documentclass[12pt]{article}
\usepackage[a5paper]{geometry}
\geometry{verbose,tmargin=2cm,bmargin=3cm,lmargin=2cm,rmargin=2cm}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\begin{document}
\input{signature.tex}
\end{document}
The name of the second person becomes shifted to the left:
What's wrong? How to fix? Using TeX Live 2017 on Windows XP.
%
in the last line of the input file: like...{Director 2}%
. Or alternatively add\unskip
after the input line, like\input{signature.tex}\unskip
.