How to Install a Full MiKTeX LaTeX Installation and configure TeXnicCenter on Windows XP, Windows Vista and Windows 7

TeXnicCenter LogoThe purpose of this article is to outline in concise form the steps required to install and configure a full LaTeX distribution from scratch up to the point of editing documents in LaTeX on a Windows PC.  Furthermore, I will show you how to integrate the LaTeX editor with the PDF viewer to enable you to switch seamlessly between them while creating your documents.

The LaTeX editor employed here is the free open source TeXnicCenter editor which provides all the functionality you need to create, write, build, view and print your LaTeX documents.

Adobe Reader iconPlease ensure you have a PDF viewer already installed before commencing the steps below.  This article will provide instructions on how to configure and integrate two PDF viewers with our LaTeX editor: the free open source PDF viewer Sumatra PDF and the freeware Adobe Acrobat Reader.  You may install either one (or both if you wish).

This article provides instructions for the following platforms: Windows XP, Windows Vista and Windows 7.

  1. Download and run the free open source MiKTeX Net Installer setup-2.X.xxxx.exe from the MiKteX download page. The MiKTeX installation consists of two phases:  the first phase will download the MiKTeX distribution to your PC, the second phase will perform the actual installation.  Once the download operation has finished, the first phase is complete and you are ready to install MiKTeX.  It is recommended to download the latest stable version.  At the time of writing, the latest stable version is 2.9.
  2. To perform the second phase of the installation, start Windows Explorer and browse to the directory which contains the complete MiKTeX distribution (where you downloaded it). Look for a file named setup.exe.   This is the MiKTeX Setup application.  Run setup.exe by double-clicking its icon.  When asked to select a repository folder, select the location of the downloaded MiKTeX distribution. Please be patient as the installation may take quite some time to complete.
  3. Update the MiKTeX Installation:
    From the Start menu, 

    1. On Windows XP:
      select  Start | Programs | MiKTeX 2.X | Update
    2. On Windows Vista or Windows 7:
      select  Start | Programs | MiKTeX 2.X | Maintenance (Admin) | Update (Admin)
    3. Select the option:
      I want to get updated packages from a remote package repository
      and the option:
      Let me choose a remote package repository
      and select the repository nearest you.
    4. Follow the onscreen instructions.
  4. Update the MiKTeX Package Manager:
    From the Start menu, 

    1. On Windows XP:
      select Start | Programs | MiKTeX 2.X | Settings
    2. On Windows Vista or Windows 7:
      select  Start | Programs | MiKTeX 2.X | Maintenance (Admin) | Settings (Admin)
    3. Select the option Refresh FNDB
    4. Select the option Update Formats
    5. Exit the application by clicking Ok.
  5. Install TeXnicCenter:
    1. Download the latest version of TeXnicCenter from http://www.texniccenter.org
    2. Run the TeXnicCenter installer and follow the onscreen instructions.
  6. Configure TeXnicCenter’s initial settings:
    1. When running TeXnicCenter for the first time, follow the onscreen instructions.
    2. Close and rerun TeXnicCenter.
    3. Select Tools | Options | Editor Tab
      Enable display line numbers
  7. If you are running Windows Vista or Windows 7:
    1. Configure the TeXnicCenter application to run as an administrator.
    2. Configure the TeXnicCenter application to run in compatibility mode: Windows XP SP3.
    3. If you will use Sumatra PDF as your PDF viewer, configure the Sumatra PDF application to run in compatibility mode: Windows XP SP3.
  8. A brief explanation of terminology concerning Integration features between TeXnicCenter and the PDF viewers is now required.
    Several PDF viewers support the concept of Forward-Search and Inverse-Search. 

    • What is Forward-Search?: When compiling (generating PDF output) your LaTeX source document in TeXnicCenter, Forward-Search enables the current editing location in the source latex file to be displayed and highlighted in the generated PDF.  For example, if you are editing text that appears on page 8 of the PDF; after compiling the LaTeX source, the PDF viewer will open the document and jump directly to page 8 to display the text you have just edited.  This is a great timesaver.  The communication between the editor and PDF viewer often relies on the DDE protocol.
    • What is Inverse-Search?: Inverse-Search is a synchronisation feature whereby doubling-clicking on a line in the PDF document will switch to the LaTeX editor and display the corresponding line in the document source.  Again, another great timesaver.
    • Adobe Reader and Adobe Acrobat:
      Forward-Search and Inverse-Search may not work with adobe Reader version 8 or higher (i.e.: all recent versions).
    • Sumatra PDF Viewer:
      Forward-Search and Inverse-Search function correctly using Sumatra PDF on Windows XP SP3, Windows Vista and Windows 7. This author’s preference is to use the Sumatra PDF viewer to view the document during the creation and editing phases, and only use Adobe Reader to view the final completed document to verify the final document version appears correctly when viewed with Adobe Reader.
      Note 1: At present (TeXnicCenter v1.0 and Sumatra V1.3), forward search only works if the file name and entire file path do not contain spaces!

      Note 2: Be aware that cutting and pasting the configuration information that appears in the subsequent steps from this webpage directly into the TeXnicCenter configuration panel may not work.  The double-quotes (and single-quotes) are often misrepresented.
  9. To configure TeXnicCenter to view document output using Adobe Reader:
    1. Run TeXnicCenter.
    2. Select Build | Define Output Profiles | Viewer Tab
    3. Ensure the profile selected is LaTeX => PDF
      For both View Project’s Output and Forward Search options, enter the following: 

      1. Enable DDE
      2. Command: [DocOpen(“%bm.pdf”)][FileOpen(“%bm.pdf”)]
      3. Server: acroview
      4. Topic: control
    4. For Close Document before running LaTeX:
      1. Enable DDE
      2. Command: [DocClose(“%bm.pdf”)]
      3. Server: acroview
      4. Topic: control
  10. To configure TeXnicCenter to view document output using Sumatra PDF:
    The Sumatra PDF viewer integrates nicely with TeXnicCenter supporting both forward-search and inverse-search. 

    1. Run TeXnicCenter.
    2. Select Build | Define Output Profiles | (La)Tex Tab
      1. Select Add to add a new profile.
        Enter the profile name:  Latex => PDF (Sumatra)
    3. Under the (La)TeX Tab
      1. Select the checkbox:  Run (La)TeX compiler
        1. Path to the latex compiler:
          C:\software\MiKTeX 2.8\miktex\bin\pdflatex.exe
          Note: The path references may be different on your computer.
        2. Command line arguments to pass to the compiler:
          -interaction=nonstopmode “%pm” -synctex=-1
      2. Unselect the checkbox:  Do not use BibTeX in this profile
         

        1. Path to BibTeX executable:
          C:\software\MiKTeX 2.8\miktex\bin\bibtex.exe
        2. Command lne arguments to pass to BibTeX:
          “%bm”
      3. Unselect the checkbox:  MakeIndex
        1. Path to MakeIndex executable:
          C:\software\MiKTeX 2.8\miktex
          \bin\makeindex.exe
          Note: The path should be on one line, I split the path here to ensure it displays clearly. There should be no space  at the line break between miktex and \bin.
        2. Command line arguments to pass to MakeIndex:
          “%bm”
    4. The Postprocessor tab may be left blank.
    5. Under the Viewer Tab:
      1. Path to executable:
        C:\software\SumatraPDF\SumatraPDF.exe
        -inverse-search “\”C:\software\TeXnicCenter\TEXCNTR.EXE\”
        /ddecmd \”[goto(‘%f’,’%l’)]\””
        Note: The path should be on one line, I split the path here to ensure it displays clearly.  There should be a space inserted at the position of the line breaks:
         

        • one space after SumatraPDF.EXE
        • another space after TEXCNTR.EXE\
      2. For View project’s output:
        1. Enable Command line argument
        2. Command: “%bm.pdf”
      3. For Forward Search:
         

        1. Enable DDE command:
        2. Command: [ForwardSearch(“%bm.pdf”,”%Wc”,%l,0)]
        3. Server: sumatra
        4. Topic: control
      4. For Close document before running (La)Tex
        1. Enable Do not close.
  11. Well Done!  You are now ready to create beautifully typesetted PDF documents.  Enjoy!

References

10 comments on “How to Install a Full MiKTeX LaTeX Installation and configure TeXnicCenter on Windows XP, Windows Vista and Windows 7

  1. Evert says:

    First of all: thanks for the very clear explanation.
    I followed all your steps, but it still won’t work on my pc. When I hit F5 in TXC it returns: ‘[ForwardSearch(“%bm.pdf”,”%Wc”,%l,0,0,1)] Cannet execute the command’. Maybe you can help me out?
    I’ve got:
    OS: Windows 7 64-bit
    TXC: TeXnicCenter 1.0 stable
    Sumatra: Sumatra PDF v1.2
    TeX main file: C:\Users\Gebruiker\Documents\TU\Afstuderen\Thesis\TeX\thesis.tex
    Clearly there are no spaces in the dir, so that shouldn’t give any problems…

  2. Munawar Zaman says:

    Thanks for such a good step by step expaination. I have the problem in in graphics.
    the text file beatifully give output results but graphical output give errors by explaining other brother above
    can u help me?

  3. manio says:

    It is really helpful. I’ve been looking for it for a long time. But I still think the side2side tex, pdf comparison works better…

  4. skassl says:

    I enter the path to the dirs, but when i F5 says “cannot execute the command”
    HELP!!
    O.S. Win7 x64

  5. John Adams says:

    I have similar issues with the forward search no functioning.
    Also, using pdflatex means you can’t use pstricks. Can we fix the forward search and use the same dvi=>ps=>pdf that miktex already generates, just change the viewer??

  6. sharkllama says:

    Ditto on the ‘Cannot Execute Command’ problem. Also, I’d like to suggest that you tell the reader early on to install TeXniCenter to a non-standard path if they plan on using Sumatra, and provide your brief argument for why sumatra would be desirable (forward search). Thanks for the tutorial, and I’ll keep an eye out to see if the command problem is fixed soon. Otherwise, I suppose I’ll stick to using TeXWorks (comes as a part of the miktex distribution).

  7. BK says:

    Very neatly described installation..thank you!

  8. Thanh Long says:

    Thank you for your instruction. It is so helpful! But there are a problem, when I try to use acrobat reader as viewer, the acrobat reader 11 require to update and it can not complete update, so I change to use foxit reader. Finally it works properly. Thanks!

  9. Joana Carvalho says:

    There is no setup.exe file where I downloaded MikTeX, did anyone had the same problem?

  10. […] How to Install a Full MiKTeX LaTeX Installation and … – Mar 07, 2010 · Bookmark the permalink. How to Install a Full MiKTeX LaTeX Installation and configure TeXnicCenter on Windows XP, Windows Vista and Windows 7… […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s