<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE artikkel PUBLIC "-//infoweb.ntnu.no//DTD Infoweb 1.0//NO"  "http://infoweb.ntnu.no/infoweb.dtd">
<artikkel spraak="en">
	<tittel>LaTeX and TextPad</tittel>
	<forfatter>daljord</forfatter>
	<sammendrag>
		How to configure TextPad so it recognizes LaTeX-syntax and is able to compile it and display the dvi-file. 
      This guide can also be used to configure TextPad to other tools you might use like java.
	</sammendrag>
   <lenker></lenker>
	
   <hoveddel>
      <avsnitt>
         TextPad is a widely used text editor at campus, and we want to be able to edit LaTeX source in TextPad. For TextPad 
         to recognize the LaTeX-syntax it needs to know where it can find the syntax-file. It also needs a 
         TeX-compiler to be able to display the dvi-file. In this guide we will use MiKTeX as a basis because 
         it is easy to use. You can download it <ekstern tittel="MiKTeX" uri="http://www.miktex.org/">here</ekstern>. 
      </avsnitt>

      <os1>Colored syntax</os1>
         <avsnitt>
            By activating colored syntax, TextPad will display the code in different colors which makes it easier 
            for the user to separate text from coding.
         </avsnitt>

      	<ul>
      		<li>Open TextPad</li>
		      <li>Close all open documents</li>
   	   	<li>Choose <trykk>Configure -> Preferences...</trykk></li>
	   	   <li>Choose <trykk>Document Classes</trykk> on the left-hand side</li>
	      </ul>

         <bilde navn="textpad" alt="Document Classes" plassering="midt"/>

      	<ul>
		      <li>Write <kommando>LaTeX</kommando> in the bottom-right corner</li>
      		<li>Choose <trykk>Apply</trykk></li>
		      <li>Expand <trykk>Document Classes</trykk> by clicking on the +-sign on the left-hand side</li>
      		<li>Highlight <trykk>LaTeX</trykk> </li>
		      <li>Write <kommando>*.tex</kommando> in the middle column</li>
      	</ul>

         <bilde navn="textpad2" alt="*.tex" plassering="midt"/>

	      <ul>
		      <li>Expand <trykk>LaTeX</trykk> by clicking on the +-sign on the left-hand side</li>
		      <li>
               Choose <trykk>Syntax</trykk>, check <trykk>Enable syntax
		         highlighting</trykk> and open <kommando>LaTeX.syn</kommando> from the list and press <trykk>Apply</trykk>
            </li>
	      </ul>

         <bilde navn="textpad3" alt="Syntax" plassering="midt"/>

	   <os1>Adding tools</os1>
	      <ul>
		      <li>Open the window <trykk>Preferences...</trykk> like you did earlier</li>
		      <li>Highlight <trykk>Tools</trykk> in the bottom-left corner</li>
		      <li>Choose <trykk>Add</trykk> and <trykk>DOS Command</trykk> to the far right</li>
		      <li>Write <kommando>LaTeX</kommando> and press <trykk>Apply</trykk> (like the picture below)</li>
		      <li>
               Repeat with the command <kommando>DVIView</kommando>,
		         <kommando>pdflatex</kommando>, <kommando>dvips</kommando> and
		         <kommando>BiBTeX</kommando>
            </li>
	      </ul>

         <bilde navn="textpad4" alt="DOS Command" plassering="midt"/>

         <avsnitt>
         	The commands will not work as they are now, so we need to tweak them.
         </avsnitt>

         <ul>
		      <li>Expand <trykk>Tools</trykk> by clicking on the +-sign on the left-hand side and press <trykk>LaTeX</trykk></li>
      		<li>
               Enter the command <kommando>latex $File</kommando> in the
         		<trykk>Parameters</trykk>-field and press <trykk>Apply</trykk>
            </li>
      	</ul>

         <bilde navn="textpad5" alt="LaTeX-command" plassering="midt"/>

      	<ul>
	      	<li>Repeat the procedure for dvips with the parameter <kommando>dvips
		      $BaseName.dvi</kommando></li>
		      <li>Repeat the procedure for DVIView with the parameter <kommando>yap
		      $BaseName.dvi</kommando></li>
		      <li>Repeat the procedure for pdflatex with the parameter <kommando>pdflatex
		      $File</kommando></li>
		      <li>Repeat the procedure for BiBTeX with the parameter <kommando>bibtex
		      $BaseName</kommando></li>
		      <li>Choose <trykk>OK</trykk> and you are done!</li>
	      </ul>

         <bilde navn="textpad6" alt="Tools" plassering="midt"/>

      <os1>Java-tools</os1>
         <avsnitt>
            If JDK/SDK was installed prior to the installation of TextPad, the tools should 
            already be there. If not, you have to add them yourself. This is how: 
         </avsnitt>

         <ul>
		      <li>Highlight <trykk>Tools</trykk> in the bottom-left side</li>
		      <li>Choose <trykk>Add</trykk> og <trykk>Java SDK Commands</trykk> on the far right</li>
		      <li>Press <trykk>Apply</trykk></li>
         </ul>
	</hoveddel>
</artikkel>
