# TeXworks pdflatex compilation does not terminate

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!

• I failed to reproduce your error. It works perfectly in my computer. And welcome to TeX.SE. – Masroor Feb 18 '15 at 5:53
• Thanks for your reply. So there's nothing wrong with the code. Have I missed something during configuration of MikTex? – Usha Feb 18 '15 at 5:56
• Delete any related .aux file and try again. Also try from the commandline or another editor. Also consider looking at the .log file (one should be generated) to see if any errors are mentioned. – jon Feb 18 '15 at 5:56
• I tried from command line and from Led editor. Same problem. But sorry where do I look for the .aux file? It is not in the folder where I have my .tex file. – Usha Feb 18 '15 at 5:59
• @jon Thanks but no .log file either. – Usha Feb 18 '15 at 6:00

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).