Showing posts with label Unicode. Show all posts
Showing posts with label Unicode. Show all posts

Tuesday, August 28, 2012

Appetitive/Spirited: Formatting in LaTex

I've been fighting with LaTeX for the last few days. I wrote my thesis in LaTeX because the formatting was so pretty, but I was really foolish. I am not a computer person in general and it didn't occur to me that I might want to deal with portions of my thesis in other contexts and trying to make a decent version of a portion of my thesis is problematic with LaTeX partially because I'm just completely hopeless with it and partially because it just takes a lot longer to make some of the stuff work.

In case anyone else uses LaTeX for writing, I thought I'd put up some pointers for writing in Ancient Greek. I had some problems with Teubner, which is what (I think) most of my friends used and I just wanted to use unicode polytonic Greek and enter it like I enter Greek for everything else. Unicode should work in every program, right? Well, everyone on the internet seemed to agree with me, but basically none of the ways that any one posted worked. It was really really really disheartening/frustrating. So I thought I'd post what I'd managed to do, just in case anyone else runs into the same problems.

Here are my system specifications:
  • Windows 7
  • MiKTeX 2.9 (which runs as TeXworks and a DVI previewer)
  • Aspell
  • Emacs
  • + any packages MiKTeX prompted me to download throughout this process. If you have this, it will prompt you too so never fear.
If you don't have this system or any of this other stuff, I have no idea whether this will work for you. If you're using XeTeX I do know that this won't work. There are other ways, but you will have to do your own research on that (sorry guys).

Directions:
  • Click on edit > preferences > editor > encoding > UTF-8 > ok
  •  Make sure that your system is building to pdfLaTeX+MakeIndex+BibTeX
  • Now insert this piece of coding. The bolded part is necessary, the unbolded parts around it show you where to insert it in your document
    • \documentclass[12pt,twoside] {article}
      \usepackage[utf8x]{inputenx}
      \usepackage[LGR, T1]{fontenc}
      \usepackage[polutonikogreek,english]{babel}
      \newcommand{\greek}[1]{{\selectlanguage{greek}#1}}
      \usepackage{palatino}
      \begin{document}
  • When you want to type in Greek in the document, \greek{σκιαία}
    • The bolded portion is the way to indicate Greek. The Greek goes inside the curly-brackets. For this to work, you must have unicode polytonic Greek enabled on your computer and type in it in the curly brackets. If you don't have it set up, I wrote up some instructions for Windows XP and Windows 7. 
  • That's all!
I don't know why this works or why other methods didn't work for me. So far as I can understand, the  \usepackage[utf8x]{inputenx} tells LaTeX to use the unicode, the \usepackage[polutonikogreek,english]{babel} tells the document what languages you are writing in, and the \newcommand{\greek}[1]{{\selectlanguage{greek}#1}} tells it what the command is going to look like in order that LaTeX can recognize it. it seems to be working, anyway, which is all that matters.