[Tex/LaTex] TeXworks pdflatex compilation does not terminate

compilingpdftextexworks

I am new to LaTeX. I took a sample tex code and tried to typeset using TeXworks after choosing pdflatex option. I get this displayed in the console output.

This is pdfTeX, Version 3.14159265-2.6-1.40.15 (MiKTeX 2.9)

But apart from this, there is nothing and the compilation does not terminate – the red logo with white x is displayed no matter how long I wait. I have to click on that to manually terminate. No file is generated by compilation process in the folder. This is the code that I tried to compile:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\geometry{a4paper}
\usepackage[francais]{babel}
\title{Premier document}
\author{Un TeXnicien}
\date{}
\begin{document}
\maketitle
\end{document}

Even if there are errors in my code, I would expect error messages. This seems like I have started running an infinite loop. What should I do to generate pdf file? I have been spending hours on this with no solution. Any help would be greatly appreciated.

I have tried this compilation with command line, LEd and LyX. And the compilation does not terminate in any of these!

Best Answer

Your output looks as if the pdflatex executable is broken. It doesn't load the format. pdflatex.exe is only a small wrapper for a call to pdftex and can be remade with initexmf (http://docs.miktex.org/2.9/manual/initexmf.html).

So try on the command line initexmf --admin --force --mklinks (if you have only a single user installation leave out the --admin).