Thursday, December 13, 2012

Miktex and latex Editors links and example



Miktex is alternative of LATEX

http://miktex.org/download

Latex Editor

http://www.xm1math.net/texmaker/download.html#windows
http://sourceforge.net/projects/texniccenter/files/TeXnicCenter/2%20Beta%201/TXCSetup_2Beta1_x64.exe/download
http://www.lyx.org/Download
http://www.tug.org/texworks/






http://maths-people.anu.edu.au/~huerta/latexforbeginners.html
https://notendur.hi.is/tpr/latex/index.html

http://sourceforge.net/projects/latex-beamer/files/latex-beamer/Version%203.07/latex-beamer-3.07.tar.gz/download?use_mirror=superb-dca3&r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Flatex-beamer%2F&use_mirror=superb-dca3

http://www.tex.ac.uk/cgi-bin/texfaq2html?label=slidecls

http://www.iit.edu/csl/am/resources/computing/pdfs/igor_tutorial_slides.pdf

Introduction

LaTeX works like this: First, you use a text editor (we'll be using the freeware Texmaker) to create a LaTeX document.
  • Then, you run a LaTeX compiler (we'll be using MiKTeX).
  • Finally, you need to use some kind of viewer/previewer (we'll be using Yap, which stands for "Yet Another Previewer") to view or print the formatted file. You will do everything from the program Texmaker, which  will utilize MiKTeX and Yap. This document will take you through the steps of downloading, installing, configuring, and working with MiKTeX and Texmaker. Be sure to follow ALL of the directions below, IN ORDER.

    Downloading and installing MiKTeX for Windows

    1. Go to miktex.org/2.8/setup.
    2. Click the Download button next to "Basic MiKTeX 2.7" Installer
    3. Now click "Save File".
    4. Find where the file was saved and double click on it.
    5. Windows will ask "Unknown publisher, install anyway?".  Click "run".
    6. The Setup wizard will now open.  Click the box "I accept" and keep clicking "next" until the setup is complete.  Don't change any of the defaults.
    7. At the end, click close.

Now you are ready to download the text editor, Texmaker for Windows.
  1. Go to http://www.xm1math.net/texmaker/download.html
  2. Now click under the appropriate platform.  If you are using windows, click on Executable file for win32 systems : texmakerwin32_install.exe.
  3. Now click "Run" (or click save, save the installer to the desktop, and then double click the icon).
  4. Windows will ask "Unknown publisher, install anyway?".  Click "run".
  5. The Setup wizard will now open.  Click the box "I agree" then click "install" and keep clicking "next" until the setup is complete.  Don't change any of the defaults.
  6. At the end, click close.

   Downloading and installing TeXShop for Macintosh OS X

  1. Go to http://www.tug.org/mactex/
  2. Click on MacTeX.mpkg.zip to download.  If you have trouble, then click on "mirror page" above and select an appropriate mirror site.  The download will start automatically.
  3. The file to be downloaded is 1.2GB zipped and took me over 1/2 an hour on JMU wireless.  If you have dialup or another slow connection, try downloading "smaller packages"  The unzipped file requires over 2G of space.
  4. Click "install" and follow the prompts.Hello

Creating a simple document using LaTeX with TeXMaker for Windows

Now we're finally ready to write a document in LaTeX. The instructions below will take you through the process of creating a very simple document.
  1. Open: Texmaker from the Start menu.  You may want to put a shortcut on your desktop.
  2. Write: In the upper right box, type this:
\documentclass{article}
\begin{document}
Hello universe!
\end{document}

    3.  Save: Save this file as "universe.tex" to whatever directory you choose. Be sure the extension is "tex" and NOT "txt". Also be sure to select "All Files" under the "Save as Type" menu before you save.     4.  Compile:  Now click on the little "PDFLAT" icon on the toolbar.  You should get a message below the window which reads  "Process Started" "Process exited normally".
    5. View: Now click the PDF icon on the tool bar to view the PDF file.

Texmaker has a special command called "Quick Build".  If you click on the "Q" button to the left of the "Latex" button, Texmaker will show you the log file in the lower window with any errors highlighted in red. First you need to configure Quick Build.  On the menu bar at the top of the screen, click on "Options", then "Configure Texmaker".  Now click the button to the left calls "Quick Build".  Click the button that says "PDF LaTeX + View PDF".  Then "ok".

Creating a simple document using LaTeX with TeXShop for Macs

Now we're finally ready to write a document in LaTeX. The instructions below will take you through the process of creating a very simple document.
  1. Find: TexShop under Applications/TeX.  Drag the icon someplace convenient.
  2. Open: Double click the TeXShop icon.  This will open a blank document.  
  3. Write: In thewindow, type this:
\documentclass{article}
\begin{document}
Hello universe!
\end{document}

    4.  Compile:  Now click on the  "typeset" icon on the upper left.  You will be prompted to save the file.  Be sure to save it with a .tex (not .txt) extention.
    5. View: A PDF file will automatically pop up with the finished product..

Handling compiling errors

LaTeX is a very picky typesetting program, and a lot of tiny things can cause compiling errors. By following the instructions below you will introduce an error into your universe.tex file and then see how to deal with it.
  1. Change your .tex file so that it looks like this:
     
    \documentclass{article}
    \begin{document}
    Howdy universe!
    The & is a special character.
    \end{document}
  2. Now click Typeset and you will get the following error:  "Misplaced alignment tab character &".
  3. In LaTeX, the "&" character is used for tabbing (alignment) in certain environments, but it is not a legal character on its own; that is what the first line of the error message above is saying - that the character "&" is being used somewhere it shouldn't. Click "Go To Error" to go to the place where the compiler thinks there is an error in the editing window.
    4.   To fix the problem, you could "comment out" the entire line by placing a % at the beginning of the line.  Try this and click typeset again.
    5.  Or you can do as LaTeX suggests, and put a "\" in front of the &.  Remove the % and try this.

Printing a finished LaTeX document

If you want to print right from the computer you are working on, it's easy; just choose "Print" from the "File" menu of the PDF viewer.  Don't print from the Texmaker window, because you will only be printing the LaTeX code, not the finished product.
Thanks to Laura Taalman for assistance with this document.



******************************************

etting up LaTeX for Microsoft Windows

All software listed here is "free".

Table of contents

Files you need to download ...

  1. Download LaTeX compiler MikTeX (23 to 64MB). (setup-version.exe setup wizard ~425KB)
  2. Download ghostscript and ghostview for printing, converting and viewing postscript files (gs???w32.exe ~5.2 MB and gsv??w32.exe ~1.2 MB).

Files you may also want to check out ...

  • A bibliography reference manager known as JabRef (~5 MB) and runs on the Java VM (version 1.4.2 or greater).
  • Ipe extensible drawing editor (~4.5 MB) - A drawing editor for creating figures in PDF or (encapsulated) Postscript format. It supports making small figures for inclusion into LaTeX-documents, i.e. native LaTeX text and equations in figure. It is also possible to import postscript figures (for example MATLAB plots) to Ipe using first ps2pdf (part of MikTeX) and then pdftoipe (part of IPE).
    To get the icelandic fonts to work in IPE do the following: (1) Install "cm-super" (2) Select "Edit->Document properties" and add to the "Latex Preamble", the following lines:
    \usepackage[utf8]{inputenc}
    \usepackage{ucs}
    \usepackage[T1]{fontenc}
    
    If you do not install "cm-super" you must select a font like
    \usepackage{palatino}
    
    see also creating PDF files below.
  • LaTable is a WYSIWYG style editing program for LaTeX tables, useful when designing complicated tables.

The LaTeX text editor/environment

  1. The LaTeX editor GNU/Emacs + AucTeX, Ispell ...

    A good working environment for MikTeX is GNU/Emacs. Here is an excellent description: http://www.math.aau.dk/~dethlef/Tips/introduction.html on how-to set it up! Includes syntax highlighting, macros, on-the-fly spelling, ... (everything!).
    (A quick reference card for Emacs: EmacsRefcard.pdf.)
  2. Texmaker

    Texmaker: Free cross-platform LaTeX editor that integrates many tools needed to develop documents with LaTeX, in just one application.
  3. A good WYSIWYG style editor is LyX (www.lyx.org)

    This open source document processor is good for those who don't want to learn LaTeX: see http://wiki.lyx.org/Windows/Windows (simple to install, around 8MB)

Installing the software

  1. Gs???w32.exe and Gsv??w32.exe are self-extracting zip files, they automatically run setup, just follow the instructions on the screen.
  2. You have downloaded one file called setup.exe run it and follow the instructions on the screen (I strongly recommend you setup MikTeX on the root of the hard disk).
  3. Reboot the computer (if needed), and that's it!
    To compile your LaTeX documents in a "DOS" window (cmd or command), use the line: latex myfile.tex (and dvips myfile.dvi, bibtex mybib.bib, etc.). Or compile directly from your IDE, for example in GNU/Emacs use <ctrl>-C-C to compile.

Online help on LaTeX

Macros and style files

  • Adding Style files to the MikTeX distribution. Any extra style files (not in MikTeX) should be put in the directory: \texmf\tex\latex\ (any sub-folder there, but only one folder depth). Then refresh the file name database in "MikTeX options".

Creating a PDF document

Creating PDF files using dvipdfm (command: dvipdfm myfile.dvi)
Take a look at the "config" file for dvipdfm located under \texmf\dvipdfm\config. Make sure that for the "D" options the complete path is set for gswin32c, i.e.

% The following line works with GhostScript

D "c:/progra~1/gs/gs8.00/bin/gswin32c -q -sPAPERSIZE=a0 -sDEVICE=pdfwrite -dCompatibilityLevel=1.2 -dUseFlateCompression=true -dNOPAUSE -sOutputFile=\"%o\" \"%i\" -c quit"

This is one line!
For those using different font encodings like: \usepackage[T1]{fontenc}. The PDF document may not display crisp fonts. To solve this try using different fonts, i.e. \usepackage{palatino} (take a look in the directory \texmf\tex\latex\psnfss\*.sty for additional fonts), OR simply install the font package cm-super.
You may have some troubles generating PDF files with dvipdfm when using PSFRAG. The workaround is to create the PDF directly from the PS file, i.e. Open file in "gsview", then choose file-convert (gsview-convert-snapshot.jpg) followed by device-pdfwrite (600 pt) (gsview-pdfwrite-snapshot.jpg). The command line version ps2pdf can also be used.

Adding images to a LaTeX document

The most common way of adding figures to LaTeX is by including postscript files (see the demo file above for an example). You can create figures using the Ipe program mentioned above. Here is also a MATLAB m-file that converts most image formats to encapsulated postscript (better to use EPS because the bounding box is then as small as possible). The file may be downloaded here: im2eps (the file includes instructions of usage). Note you must have the image processing toolbox to use this file.

Changing MATLAB figures to native LaTeX using PSFRAG

You need to download the PSFRAG macro package (it also includes a demo). Install this package in the folder: \texmf\tex\latex\psfrag. Installation is completed by running latex psfrag.ins in this folder and by copying the created file psfrag.pro to the folder \texmf\dvips\base\. Now take a look at this demo file (you will also need this encapsulated postscript file, the MATLAB figure, to compile the document). You should also definitely take a look at laprint.m by Linnemann for printing MATLAB figures (also based on PSFRAG but does all the work for you!).

Icelandic dictionary

There is a dictionary for ispell (or here) available and one compiled for aspell-is by ElĂ­as.

Icelandic language (using Babel with MikTeX or teTeX)

These files and procedures are now part of the MikTeX package, as of version 2.0. MikTeX now includes an "options dialog box" enabling you to select the language of your choice, just don't forget to hit the "update format files" button!
Add to your LaTeX document header:
\usepackage[icelandic]{babel}
\usepackage[T1]{fontenc}

(install the font package cm-super)
If you want to change between hyphens, say for example icelandic and english, then use
\usepackage[english,icelandic]{babel}
and then when switching between hyphens use
\selectlanguage{icelandic} or \selectlanguage{english}.
If you have an older version on MikTeX or teTeX (for Linux or MacOS), then you must do the following:
  1. Copy files icelandic.ldf and icelandic.sty to the directory \texmf\tex\generic\babel\.
  2. Add the line \DeclareOption{icelandic}{\input{icelandic.ldf}} to the file \texmf\tex\generic\babel\babel.sty.
  3. Copy the file ishyph.tex to the directory \texmf\tex\generic\hyphen\
  4. Add the line: icelandic ishyph.tex to the file \texmf\tex\generic\config\language.dat (you will see where when you open the file, you may want to comment out other languages such as french, etc.).
  5. Run MikTeX -> Maintainer -> Reconfigure (close all tex related software first!).
If you are using teTeX for Linux or MacOS then the above instructions are the same (perhaps steps 1 and 2 have been done). You will find the texmf directory under /usr/share/texmf. Run fmtutil --all (but before doing so, run texhash first so it knows about the new files you added to the directories) to remake the formats (as root). If you have any trouble with teTeX try this hyphen file.

No comments:

Post a Comment