[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to create a PDF-Printer from the command line



On  9-01-2018, at 07h 35'28", David Wright wrote about "Re: How to create a PDF-Printer from the command line"
> On Tue 09 Jan 2018 at 13:06:44 (+0000), Curt wrote:
> > On 2018-01-09, Curt <curty@free.fr> wrote:
> > > On 2018-01-09, Ionel Mugurel Ciobîcă <I.M.Ciobica@upcmail.nl> wrote:
> > >> On  9-01-2018, at 06h 52'16", davidson wrote about "Re: How to create a PDF-Printer from the command line"
> > >>> >
> > >>> >How does one convert a text file to a PDF using the command line?
> > >>> 
> > >>> Step 1. Make sure the text file is also a latex document.
> > >>> Step 2. Use latex.
> > >>
> > >> Assuming step 1 is reached, step 2 will make a dvi file. That was not
> > >> what the OP asked for...
> > >
> > > pdftex (your one step road to a pdf)?
> > >
> > >  DESCRIPTION
> > >        Run  the  pdfTeX  typesetter  on  file,  usually creating
> > >        file.pdf.  
> > >
> > > Of course, B. will inform us that this amounts to eradicating a microbe with a
> > > gorilla (or vice-versa?).
> > >
> > >>
> > >> Ionel
> > >>
> > 
> > If you're dealing with latex files, as I have taken some minutes to
> > discover (cough), you need 'pdflatex', not pdftex, which will barf
> > immediately upon encountering latex commands.
> 
> So could you now elaborate on step 1 of this "one-step" process?
> 
> Cheers,
> David.


For the non-LaTeX people, the easiest is to create a tex file (or ltx,
if you wish) that contains this lines before the text:

  \documentclass[a4paper,12pt]{article}
  \pagenumbering{arabic}
  \begin{document}

and this line after the text:

  \end{document}

LaTeX will ignore spaces and newlines. So if you wish a newline
somewhere you need to add it with \newline. If the text is UTF-8, add
also \usepackage[utf8x]{inputenc} before \begin{document}. 
You can make a title with:
  \title{Title}
  \author{Me}
  \date{\today}
  \maketitle
after \begin{document}

``%'' is a comment in LaTeX, so you need to escaped it with \. The
same goes for few other characters (&, etc.) $ and [ are for
equations. < and > will not work, use $<$ and $>$ instead.

Good luck.

Ionel

P.S. I am not the one that suggested to go via LaTeX!




Reply to: