Conversion of text file in PDF and vice versa in UNIXby Viral Patel · November 20, 2008 Yes, this is also a good solution. All you need is to add: \documentclass[a4paper]{article} \begin{document} …. your original text goes here … \end{document} after that call pdflatex youFIle.tex in your shell script.