Hacker News new | ask | show | jobs
by keepamovin 1021 days ago
Wow, I always thought this stuff was done by hand. I had no idea! Yeah, I recently discovered how to turn these old ascii docs into PDFs and page images in a way that preserves their beautiful formatting, using LaTeX:

    input_file="my_file_downloaded_from_textfiles.txt"
      cat <<TAO > "file.tex"
    \documentclass{article}
    \usepackage[left=2cm,right=1cm,top=2cm,bottom=2cm]{geometry} % Adjust the global margin
    \usepackage{listings}
    \usepackage{beramono}
    \usepackage[T1]{fontenc}

    \lstset{%
      language={},%
      basicstyle=\ttfamily,%
      linewidth=19cm,%
      breaklines=true,%
      breakatwhitespace=false,%
      texcl=false,%
      literate={\\\}{{\textbackslash}}1
    }

    \begin{document}
    \pagestyle{empty}  % Remove page numbers

    \lstinputlisting{"$input_file"}

    \end{document}
    TAO

I put it into a project here: https://github.com/dosyago/chai