<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Apolitically Incorrect &#187; Curiculum Vitae</title>
	<atom:link href="http://www.oak-tree.us/blog/index.php/tag/curiculum-vitae/feed" rel="self" type="application/rss+xml" />
	<link>http://www.oak-tree.us/blog</link>
	<description>The Rants and Raves of an Unsettled Mind</description>
	<lastBuildDate>Mon, 31 Oct 2011 21:56:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Typeset Your Curriculum Vitae &#8211; Part 3: Automatically Generate a List of Publications</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/12/02/latex-cv-part3</link>
		<comments>http://www.oak-tree.us/blog/index.php/2009/12/02/latex-cv-part3#comments</comments>
		<pubDate>Wed, 02 Dec 2009 15:19:44 +0000</pubDate>
		<dc:creator>Rob Oakes</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[rapidBOOKS]]></category>
		<category><![CDATA[Writing and Literature]]></category>
		<category><![CDATA[Curiculum Vitae]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Typesetting]]></category>

		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=1332</guid>
		<description><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Typeset+Your+Curriculum+Vitae+%26ndash%3B+Part+3%3A+Automatically+Generate+a+List+of+Publications&amp;rft.aulast=Oakes&amp;rft.aufirst=Rob&amp;rft.subject=Computer&amp;rft.subject=rapidBOOKS&amp;rft.subject=Writing+and+Literature&amp;rft.source=Apolitically+Incorrect&amp;rft.date=2009-12-02&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.oak-tree.us/blog/index.php/2009/12/02/latex-cv-part3&amp;rft.language=English"></span>
Publications are the currency of ideas.  Through them the experts, thinkers and dreamers of this world can share their thoughts and insights.  A good publication is not only influential, but it’s even capable of shifting the course of a whole society, as Martin Luther King demonstrated with his “Letter from a Birmingham Jail”. Since publications [...]<p>Copywrite 2009: Rob Oakes.  <a href="http://www.oak-tree.us/blog">Apolitically Incorrect</a><br/><br/><a href="http://www.oak-tree.us/blog/index.php/2009/12/02/latex-cv-part3">Typeset Your Curriculum Vitae &ndash; Part 3: Automatically Generate a List of Publications</a></p>
]]></description>
			<content:encoded><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Typeset+Your+Curriculum+Vitae+%26ndash%3B+Part+3%3A+Automatically+Generate+a+List+of+Publications&amp;rft.aulast=Oakes&amp;rft.aufirst=Rob&amp;rft.subject=Computer&amp;rft.subject=rapidBOOKS&amp;rft.subject=Writing+and+Literature&amp;rft.source=Apolitically+Incorrect&amp;rft.date=2009-12-02&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.oak-tree.us/blog/index.php/2009/12/02/latex-cv-part3&amp;rft.language=English"></span>
<p><img style="margin: 0px 15px 10px 0px; display: inline;" src="http://shelfelf.files.wordpress.com/2008/01/trinity-college-library-dub.jpg" alt="" width="350" height="276" align="left" />Publications are the currency of ideas.  Through them the experts, thinkers and dreamers of this world can share their thoughts and insights.  A good publication is not only influential, but it’s even capable of shifting the course of a whole society, as Martin Luther King demonstrated with his “<a href="http://www.oak-tree.us/stuff/King-Birmingham.pdf">Letter from a Birmingham Jail</a>”.</p>
<p>Since publications are so important to the dissemination of knowledge, there is a rather high expectation that an academic author should publish prolifically.  The mantra “Publish or Perish” is not just a clever quip, but a very serious way of life.</p>
<p>It is ironic, then, that the most prolific of academic writers can suffer from a surprising problem: it can be very difficult to keep track of all of their work.  Yet, an up to date CV is very important.  After all, publishing your work in influential journals is an important first step toward establishing tenure!</p>
<p>Members of a research team or those who collaborate outside of their institution experience this same problem, only more so.  Such a person may work on many projects at once, but only have direct responsibility for one or two of them.  This places the researcher in the unenviable position of trying to track the work of others.  This situation becomes even more complicated if the collaborator refuses to play by the rules of common decency.</p>
<p><!--adsensestart--></p>
<p>It would be nice, for example, if the primary author of a publication would <em>notify</em> the co-authors of its progress, or when it has been submitted.  But … that doesn’t always happen.  Academic researchers are busy people and soliciting feedback from all of your collaborators can be difficult … and there is a tendency for difficult things to go undone.  Thus, if you don’t follow what your team mates are working on, it is quite possible that an abstract might have gotten submitted while your back was turned.</p>
<p>To stay on top of the “delightful chaos”, you need to have some kind of system.  Personally, I keep my list of projects and publications in three places. The first (and perhaps most important) is the hand-written list in my experimental notebook. Any time I hear about a new project, it gets added to this list. I keep track of what I’ve contributed, what papers or abstracts have been created from the data, and what their status is. When I know that an abstract or paper has been accepted, I then create an entry for the item in my bibliography manager. Once in the bibliography manager, I can cite the reference in other documents such as proposals or related papers.</p>
<p>About once a year, I go through the tedious process of updating my CV. This typically involves manually sorting through both my project list and my reference database and account for new items or reconcile differences. Every time I do this, it's painful; and because I’ve historically formatted the reference list by hand, it's not uncommon for a typo to sneak its way in or for an author to accidentally get left off of a citation. These mistakes are never intentional, but they do happen.</p>
<p>When I find such an error in the reference database, I fix it. But since I often import these references from websites, the errors tend to be few and far between. Moreover, my reference database is something that I use every day; as a result, it gets a lot of scrutiny. My CV, on the other hand, gets updated much less frequently and errors tend to persist longer.</p>
<p>For a very long time, I've wanted to automate the process. Instead of keeping three separate lists – active projects, reference database, and CV – I’d prefer to keep only one (or two). But I've never found a really satisfactory way of doing so.  Or at least I hadn’t found a system until quite recently.</p>
<p>In my last review of different ways to typeset a CV, I came across an interesting article by <a href="http://nitens.org/taraborelli/home">Dario Taraborelli</a>.  In it, he described how to create a CV based on the standard “article” document class.  It was well designed, elegant, simple and attractive.  From his work, I created the <a href="http://www.oak-tree.us/blog/index.php/2009/11/25/latex-cv-part1">xetexCV document class</a>.  Additional research turned up an add-on module that makes it convenient to automatically generate a list of publications.  So, for the first time  in a great while, I have finally found a way to automatically generate a publications list in a simple and automated manner.  In this article, I will demonstrate how that is done.</p>
<p><span id="more-1332"></span></p>
<h2>The Basic Requirements</h2>
<p>For any automated solution to be successful, it needs to meet three primary criteria:</p>
<ul>
<li>When generating a list of references, bibliographic details should be pulled from the database.  This ensures that the information is always up to date.</li>
<li>The citation style must be customizable. I want the ability to specify whether my CV includes page numbers and hyperlinks.  Not all citation styles do.</li>
<li>The publication list should be broken into different categories.  Book chapters should not be listed with peer-reviewed journal articles, nor should abstracts be listed amongst the books.</li>
</ul>
<h2>cvsplitbib and xetexCV</h2>
<p>All three of these requirements can be met by using the xetexCV document class and the cvsplitbib style (both are provided in this <a href="http://www.oak-tree.us/stuff/LyX/xetexCV.zip">zipped directory</a>).  cvsplitbib is a version of regular <a href="http://www.ctan.org/tex-archive/macros/latex/contrib/splitbib/">splitbib</a>, a package that makes it possible to create categories in your bibliography. While all of the main features work as described in the <a href="ftp://indian.cse.msu.edu/pub/mirrors/CTAN/macros/latex/contrib/splitbib/splitbib.pdf">splitbib manual</a>, the macros have been changed to use the \cvsection and \cvsubsection macros of the xetexCV document class.  This ensures that formatting and indentation of the publications list is consistent with the rest of the document.</p>
<p>This combination also has an additional benefit.  Because cvsplitbib works entirely through LaTeX, any bibtex citaiton style can be used.  In the example below, I've used the the "plain" style, though it would have been just as easy to use ama, MLA, chicago or any other style in my distribution.</p>
<p><em>Note: There is an important difference between cvsplitbib and splitbib.  In the standard version of splitbib, it is possible to create subsubcategories (a second level of nested references).  Cvsplitbib does not support this as xetexCV does not define a \cvsubsubsection macro.</em></p>
<h2>Creating a Categorized List</h2>
<p>Creating different bibliography sections is achieved through the use of the “category” environment.  The arguments of the environment define the title of the section while the \SBentries macro is used to specify the citation key of any reference that should be included in that particular list.</p>
<p><em>Note: Citation keys should be added as a list separated by commas, any spaces will result in an error.</em></p>
<p>The following example creates a categorized bibliography with three different sections (<em>Novels</em>, <em>Children’s Literature</em> and <em>Comics, Graphic Novels</em>).  The bibliography data is pulled from the file “NeilGaiman-Publications.bib”, part of the xetexCV examples (see below):</p>
<blockquote><p>\begin{category}[A]{Novels}<br />
\SBentries{Gaiman2001-American-Gods,Gaiman2005-Anansi,<br />
Gaiman1990-Good-Omens,Gaiman1996-Neverwhere,<br />
Gaiman1999a-Stardust,Gaiman1985-Ghastly}<br />
\end{category}</p>
<p>\begin{category}[B]{Children's Literature}<br />
\SBentries{Gaiman1998a-Goldfish,Gaiman2008-Graveyard}<br />
\end{category}</p>
<p>\begin{category}[C]{Comics and Graphic Novels}<br />
\SBentries{Gaiman1994b-Angela,Gaiman1993-Angels,<br />
Gaiman1989-Black-Orchid,Gaiman1993a-<br />
Books-Magic,Gaiman1994a-Death-Living,Gaiman1997-Death-Time-Life,<br />
Gaiman2000a-Green-Lantern,Gaiman2003-Marvel-1602,<br />
Gaiman1999-Midnight-Days,Gaiman1994-Anthology-Virus,<br />
Gaiman2000-End-World,Gaiman1992-Signal-to-Noise,<br />
Gaiman1998b-Smoke-Mirrors,Gaiman1998-Inkeeper,<br />
Gaiman1991-Sandman,Gaiman1987-Violent-Cases}<br />
\end{category}</p></blockquote>
<p>Any reference that is not included in a specified category will be added to a fourth category, titled: “Miscellaneous”.</p>
<h2>Generating the Bibliography</h2>
<p>Once the various references have been categorized, you can generate the bibliography as you would in any other document:</p>
<blockquote><p>\nocite{*}\bibliographystyle{plain}<br />
\bibliography{NeilGaiman-Publications}</p></blockquote>
<p>Here the \nocite{*} command is used to list all of the publications in the .bib database.  \bibliographystyle{plain} specifies the BibTeX style to use, and \bibliography{Database-Name} tells BibTeX which database file to pull the information from.  Part of the formatted output from the example is shown below.</p>
<p><img style="display: inline; border-width: 0px;" title="image" src="http://www.oak-tree.us/blog/wp-content/uploads/2009/12/image.png" border="0" alt="image" width="525" height="210" /></p>
<h2>Examples and Class Files</h2>
<ul>
<li><a href="http://www.oak-tree.us/stuff/LyX/xetexCV.zip">Document Class and Examples (.zip)</a>.  This file contains the document class, cvsplitbib package, examples and other supporting files.</li>
<li>Neil Gaiman (Automatic Bibliography).  <a href="http://www.oak-tree.us/stuff/LyX/xetexCV/example3-xetexCV-AutomaticBib.tex">LaTeX Source</a>, <a href="http://www.oak-tree.us/stuff/LyX/xetexCV/example3-xetexCV-AutomaticBib.pdf">PDF Output</a>, <a href="http://www.oak-tree.us/stuff/LyX/xetexCV/NeilGaiman-Publications.bib">Reference Database</a></li>
<li>Albert Einstein.  <a href="http://www.oak-tree.us/stuff/LyX/xetexCV/example-xetexCV.tex">LaTeX Source</a>, <a href="http://www.oak-tree.us/stuff/LyX/xetexCV/example-xetexCV.pdf">PDF Output</a></li>
<li>Isaac Newton.  <a href="http://www.oak-tree.us/stuff/LyX/xetexCV/example2-xetexCV.tex">LaTeX Source</a>, <a href="http://www.oak-tree.us/stuff/LyX/xetexCV/example2-xetexCV.pdf">PDF Output</a></li>
</ul>
<p>______________________________________________________</p>
<h2>Acknowledgements and Further Reading</h2>
<p>The xetexCV document style is based on work from <a href="http://nitens.org/taraborelli/home">Dario Taraborelli’s website</a>.  The cvsplitbib package is a modified version of <a href="http://www.ctan.org/tex-archive/macros/latex/contrib/splitbib/">splitbib</a>, by <a href="http://www.lsv.ens-cachan.fr/~markey/">Nicolas Markey</a>.</p>
<p>This article is part 3 of a four part series.  <a href="http://www.oak-tree.us/blog/index.php/2009/11/30/latex-cv-part2">Part 1</a> introduces the xetexCV document class and describes its use.  <a href="http://www.oak-tree.us/blog/index.php/2009/11/30/latex-cv-part2">Part 2</a> dissects the code and explains how it works.  Part 4 describes how to use the document class and a corresponding layout file with LyX<br />
<h3>Similar Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.oak-tree.us/blog/index.php/2009/11/25/latex-cv-part1" rel="bookmark" title="November 25, 2009">Typeset Your Curriculum Vitae &ndash; Part 1: The xetexCV Document Class</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2009/08/23/time-drive-bugs" rel="bookmark" title="August 23, 2009">Filing Bugs for Time Drive or LyX-Outline</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2009/11/30/latex-cv-part2" rel="bookmark" title="November 30, 2009">Typeset Your Curriculum Vitae &ndash; Part 2: Extending and Customizing an Existing Document Class</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2008/12/08/ironpython-part7" rel="bookmark" title="December 8, 2008">Learning IronPython - Part 7 - A Summary of Lessons Learned</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2009/10/05/install-timedrive-ubuntu" rel="bookmark" title="October 5, 2009">Install Time Drive On Ubuntu and Other Debian Linux Distributions</a></li>
</ul>
<p><!-- Similar Posts took 17.947 ms --></p>
<p>Copywrite 2009: Rob Oakes.  <a href="http://www.oak-tree.us/blog">Apolitically Incorrect</a><br/><br/><a href="http://www.oak-tree.us/blog/index.php/2009/12/02/latex-cv-part3">Typeset Your Curriculum Vitae &ndash; Part 3: Automatically Generate a List of Publications</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oak-tree.us/blog/index.php/2009/12/02/latex-cv-part3/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Typeset Your Curriculum Vitae &#8211; Part 2: Extending and Customizing an Existing Document Class</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/11/30/latex-cv-part2</link>
		<comments>http://www.oak-tree.us/blog/index.php/2009/11/30/latex-cv-part2#comments</comments>
		<pubDate>Mon, 30 Nov 2009 18:54:16 +0000</pubDate>
		<dc:creator>Rob Oakes</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[rapidBOOKS]]></category>
		<category><![CDATA[Writing and Literature]]></category>
		<category><![CDATA[Curiculum Vitae]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Typesetting]]></category>

		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=1327</guid>
		<description><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Typeset+Your+Curriculum+Vitae+%26ndash%3B+Part+2%3A+Extending+and+Customizing+an+Existing+Document+Class&amp;rft.aulast=Oakes&amp;rft.aufirst=Rob&amp;rft.subject=Computer&amp;rft.subject=rapidBOOKS&amp;rft.subject=Writing+and+Literature&amp;rft.source=Apolitically+Incorrect&amp;rft.date=2009-11-30&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.oak-tree.us/blog/index.php/2009/11/30/latex-cv-part2&amp;rft.language=English"></span>
Many first-time users of LaTeX often mistakenly look at the language as a a type of glorified word processing software – albeit a particularly complicated one.  While such an analogy may be apt in helping new users become acclimatized to the language, it suffers from a rather nasty problem: LaTeX isn’t a word processor. If [...]<p>Copywrite 2009: Rob Oakes.  <a href="http://www.oak-tree.us/blog">Apolitically Incorrect</a><br/><br/><a href="http://www.oak-tree.us/blog/index.php/2009/11/30/latex-cv-part2">Typeset Your Curriculum Vitae &ndash; Part 2: Extending and Customizing an Existing Document Class</a></p>
]]></description>
			<content:encoded><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Typeset+Your+Curriculum+Vitae+%26ndash%3B+Part+2%3A+Extending+and+Customizing+an+Existing+Document+Class&amp;rft.aulast=Oakes&amp;rft.aufirst=Rob&amp;rft.subject=Computer&amp;rft.subject=rapidBOOKS&amp;rft.subject=Writing+and+Literature&amp;rft.source=Apolitically+Incorrect&amp;rft.date=2009-11-30&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.oak-tree.us/blog/index.php/2009/11/30/latex-cv-part2&amp;rft.language=English"></span>
<p><img src="http://www.wordinfo.info/words/images/evolution-man-computer.gif" alt="" /></p>
<p><!--adsensestart--></p>
<p>Many first-time users of LaTeX often mistakenly look at the language as a a type of glorified word processing software – albeit a particularly complicated one.  While such an analogy may be apt in helping new users become acclimatized to the language, it suffers from a rather nasty problem: LaTeX isn’t a word processor.</p>
<p>If anything, LaTeX shares more in common with a programming languages than any type of application.  In fact, the document processing system is really nothing more than a bunch of re-usable pieces of programming called macros.  <em>Everything </em>is a macro.  That includes the commands that every user is familiar with: \title{}, \section{}, \subsection{}; in addition to the internal formatting commands that allows LaTeX to function.  (Most of the macros were originally created or packaged by <a href="http://en.wikipedia.org/wiki/Leslie_Lamport">Leslie Lamport</a> as a way of making TeX – the typesetting system created by <a href="http://www-cs-faculty.stanford.edu/~knuth/">Donald Knuth</a> – easier to work with.)</p>
<p>This has some rather practical consequence; because everything in LaTeX is a macro, it is far more extensible than a word processor could ever hope to be.  If you require a feature that doesn’t yet exist, it typically isn’t all that difficult to add it.  And when your extension is packaged inside a style or class, you can use those customizations in anything that you want to write.</p>
<p>But though creating macros isn’t particularly complicated, it is a different beast than just using the stock macros for writing.  This is not surprising, the craft of design is inherently different than the craft of writing.  There are different conventions to follow and different topics to obsess about.  In the <a href="http://www.oak-tree.us/blog/index.php/2009/11/25/latex-cv-part1">first article</a> of this series, I introduced the <a href="http://www.oak-tree.us/stuff/LyX/xetexCV.zip">xetexCV document class</a>, which is one example of where I decided to don the designer hat.</p>
<p>But before you get too far down the road of customizing and extending, there are a some important things that you need to know.  These include the general conventions used when working with document classes, their internal anatomy, an understanding of how macros are created, and how to handle formatting and layout challenges.  In this article, I will look at these issues more in detail, particularly as they pertain to xetexCV.  In the process of reviewing these topics, I will also explain some of my design choices.</p>
<p><span id="more-1327"></span></p>
<h2>Understanding Conventions</h2>
<p>When trying to customize or extend a document class, perhaps the very first thing to understand is that there are certain conventions.  The document “LateX 2E for class and package designers” describes them this way:</p>
<blockquote><p>LaTeX has three types of commands.</p>
<p>There are the author commands, such as \section, \emph and \times: most of these have short names, all in lower case.</p>
<p>There are also the class and package writer commands.  Most of these have long mixed-case names such as the following:</p>
<p>\InputIfFileExists    \RequirePackage    \PassOptionsToClass</p>
<p>Finally, there are the internal commands used in the LaTeX implementation, such as \@tempcnta, \@ifnextchar and \@eha: most of these commands contain @ in their names, which means they should not be used in documents, only in class and package files.</p></blockquote>
<p>These conventions help to better separate  procedural formatting from the descriptive tags used in writing a document.  But it also makes it easier to identify what different sections of the code do.  Sections that are responsible for importing and configuring packages will typically use mixed case names, while variables will contain the @ symbol, and user facing macros will be in lower case.</p>
<h2>The Internal Anatomy of a Document Class</h2>
<p>The next important thing to understand is that all document classes have a few well defined components.  That is to say, they have an internal anatomy which contributes to their function and physiology.  The internal bits include the class description and required statements, a block that imports and configures packages which new features will depend on, and a section where new macro commands are created or existing commands are redefined.</p>
<h3>Class Description and Required Statements</h3>
<h4>\ProvidesClass</h4>
<p>The very first such section gives the package name and description.  Also included is a definition of the most recent version of LaTeX that the document class will work with.  The relevant code from xetexCV is shown below:</p>
<blockquote><p>\NeedsTeXFormat{LaTeX2e}<br />
\ProvidesClass{xetexCV}[2009/11/30 – Modern looking résumé which uses<br />
the xetex typesetting system]<br />
…</p></blockquote>
<p>Here, the \NeedsTeXFormat{LaTeX2e} command is the earliest version of LaTeX that the document class will work with.  \ProvidesClass{xetexCV} identifies the class name (xeteCV) and everything in square brackets is the document description.</p>
<h4>\LoadClassWithOptions</h4>
<p>Generally speaking, there are two major types of LaTeX document classes: those that are free standing, and those that are variations of other document classes.  The standard classes (article.cls, report.cls, and book.cls) are examples of the former.  They contain all of the code needed to compile and work without additional extensions.  xetexCV, is an example of the second type.</p>
<p>To load an existing class as the foundation, you can use the \LoadClassWithOptions macro:</p>
<blockquote><p>…<br />
\LoadClassWithOptions{article}<br />
…</p></blockquote>
<p>xetexCV uses “article” for its foundation.  For that reason it is likely that other packages and styles will work without conflict.</p>
<h3>Building on the Foundation</h3>
<h4>\RequirePackage</h4>
<p>After the base class has been loaded, the new package is fully functional, if identical to the foundation class.  The next step in the customization process, then, is to begin adding new features and modifying old ones.  In the case of xetexCV, there were several changes which I wanted to make.  First,  I wanted to use an 8 1/2 inch by 11 inch paper (US letter) by default.  I also wanted to set a 1 inch margin.  Next, I wanted to use the XeTeX typesetting system and a pair of advanced OpenType fonts.</p>
<p>These changes are made through the use of other LaTeX packages.  In a document class, add-on modules are loaded through the \RequirePackage command.  Below is the related code from xetexCV:</p>
<blockquote><p>…<br />
\RequirePackage{fontspec}<br />
\RequirePackage{xunicode}<br />
\RequirePackage{xlxtra}</p>
<p>\RequirePackage{graphicx}<br />
\RequirePackage[colorlinks]{hyperref}</p>
<p>\RequirePackage{ifthen}<br />
…</p></blockquote>
<p>The first three packages (fontspec, xunicode, and xlxtra) are used by XeTeX to set fonts and provide unicode support.  <a href="http://www.ctan.org/tex-archive/help/Catalogue/entries/fontspec.html">fontspec</a>, in particular, is very important.  It provides convenience macros that make it easy to change the the various font families: \setmainfont{fontname}, \setromanfont, \setsansfont, and \setmonofont.  It also provides a way to manipulate font mappings, color, scaling, and inter-word spacing.  graphicx is used to add images to the document and manipulate their size.</p>
<p>hyperref makes it possible to add clickable hyperlinks and bookmarks.  The [colorlinks] option specifies that these special links should be rendered in a different color than other text.  The hyperref package is then configured using the \hypersetup{} macro.  By default, I’ve configured xetexCV to use blue for urls and webpages and black for filenames:</p>
<blockquote><p>\hypersetup{linkcolor=blue,citecolor=blue,filecolor=black,urlcolor=blue}</p></blockquote>
<p>The ifthen package provides several macros that make it easier to apply conditional formatting.  These will be discussed in more detail below.</p>
<h3>Creating New Features and Modifying Old Ones</h3>
<p>The last major section of a document class is where new macros are defined and old ones are modified.  As might be expected, this section typically accounts for the majority of the code.</p>
<h4>\def and \newcommand</h4>
<p>There are two major commands used to define macros and variables: \def and \newcommand.  \def is a TeX primitive while \newcommand is a LaTeX macro that checks for name clashes or other problems.  In many cases, they may be used interchangeably or in concert.  Consider the code block below which defines the \cvname macro:</p>
<blockquote><p>…<br />
\def\@cvname{\relax}<br />
\newcommand{\cvname}[1]{\gdef\@cvname{#1}}<br />
…</p></blockquote>
<p>\@cvname (according to the LaTeX conventions) is a variable/macro which should only be used from inside the LaTeX document class.  Consequently, it needs a user-facing macro that can be used to assign it a value.  This is what \cvname does.  In this example, the first line of code creates the variable and assigns it the LaTeX equivalent of a null value (\relax).  The second line is a little more interesting.  It defines a macro called \cvname with one argument [1].  Then, it takes the \cname argument and assigns it to \@cvname.</p>
<p>A second, related example can be seen in the definitions of \@cvimage and \cvimage:</p>
<blockquote><p>…<br />
\def\@cvimage{\relax}<br />
\newcommand{\cvimage}[1]{\gdef\@cvimage{#1}}<br />
…</p></blockquote>
<p>Again, the first line of code creates a variable (\@cvimage) with a null value, and the second line creates the user facing macro (\cvimage).  In later commands, the internal variables are used for layout and formatting (see below).</p>
<h4>\renewcommand</h4>
<p>If I need to modify a particular piece of code, those changes can be made using the \renewcommand macro.  This is similar to over-riding a method in an object-oriented programming language like C++ or Python.  Everything that hasn’t been changed continues to work as before.  In xetexCV, I wanted to modify the \section and \subsection macros.  To do so requires \@startsection and six arguments:</p>
<blockquote><p>\@startsection {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE}</p>
<p>Generic command to start a section.</p>
<p>NAME : e.g., “subsection”<br />
LEVEL : a number, denoting the depth of the section in the table of contents<br />
INDENT : Indentation of the heading from the left margin<br />
BEFORESKIP : Space to leave above the heading<br />
AFTERSKIP : Space to leave after the heading<br />
STYLE : Commands to set the font and style of the heading</p></blockquote>
<p>I, therefore, copied over the definitions from article.cls and modified the spacing and fonts:</p>
<blockquote><p>\renewcommand\section{\@startsection<br />
{section}{1}{\z@}%<br />
{-3.5ex \@plus –1ex<br />
\@minus -.2ex \vspace{1mm}}%<br />
{0.5mm}%<br />
{\sffamily\large\bfseries}}</p>
<p>\renewcommand\subsection{\@startsection<br />
{subsection}{1}{\z@}%<br />
{-3.5ex \@plus -1ex \@minus -.2ex}%<br />
{3.0mm}%<br />
{\sffamily\mdseries}}</p></blockquote>
<p>But while I chose to completely rewrite my section definitions, much the same thing could have been accomplished through the <a href="http://www.ctan.org/tex-archive/help/Catalogue/entries/sectsty.html">sectsty package</a>.  Despite the ease of sectsty, I felt that it would be better to define my styles from scratch.  sectsty often throws errors when used with other document classes, like scrbook.</p>
<h2>Rules for Creating New Macros</h2>
<p>The third important thing to understand when writing a document class is when you should add new macros rather than modifying the behavior of old ones.  In trying to make this decision, it is good to think about how changing a macro’s behavior will influence other document features.  In cases where a change might cause other features to break, it is better to add a new macro.</p>
<h3>Managing Complex Formatting - \cvsection and \cvsubsection</h3>
<p>While I was redefining the \section and \subsection macros, I ran into one such difficulty.  I wanted to set one indentation level for the header and another for the body text.  Further, I wanted to include a decorative line following the header.  Yet, no matter how I chose to define the STYLE or AFTERSKIP arguments, I couldn’t quite achieve the formatting I wished (shown below).</p>
<p><img style="display: inline; border-width: 0px;" title="image" src="http://www.oak-tree.us/blog/wp-content/uploads/2009/11/image6.png" border="0" alt="image" width="600" height="149" /></p>
<p>I finally decided that the formatting was too complex and required a new macro that could be used instead of \section and \subsection.  These new additions became \cvsection and \cvsubsection:</p>
<blockquote><p>\newcommand{\cvsection}[1]{\leftskip 0cm<br />
\section*{#1}\decorativeline\marginpar{\vspace{0.3ex}}<br />
\leftskip 116pt}</p></blockquote>
<p>As in the previous examples, \newcommand was used to define a code block with a single argument – the text to be formatted).  Then, I specified the procedure that I wanted to apply to the text</p>
<ul>
<li>The left text margin is moved so that it is flush with the page margin (\leftskip 0cm)</li>
<li>A non-numbered section header is added (\section*{#1})</li>
<li>The  decorative line is included (\decorativeline)</li>
<li>The text indentation is returned to the previous value (\leftskip 116pt).</li>
</ul>
<p><!--adsensestop--></p>
<p>The definition of \cvsubsection is similar, with two exceptions.  First, the \cvsubsection style does not include a decorative life.  The second major difference is more substantial.  I found the vertical spacing <em>preceding</em> the \subsection definition to be too large, I therefore moved the entire text block up by 0.2 cm (\vspace{-0.2cm}).  This was ultimately easier than trying to find a better value for the BEFORESKIP argument:</p>
<blockquote><p>\newcommand{\cvsubsection}[1]{\leftskip 0cm \vspace{-0.2cm}<br />
\subsection*{#1}\vspace{1.0mm} \leftskip 116pt}</p></blockquote>
<p><em>Note: When given a negative value, \vspace moves up the block of text by the specified amount</em>.</p>
<h2>Layout and Formatting<img style="margin: 0px 0px 10px 15px; display: inline; border-width: 0px;" title="image" src="http://www.oak-tree.us/blog/wp-content/uploads/2009/11/image7.png" border="0" alt="image" width="387" height="245" align="right" /></h2>
<p>One of the very best features of TeX is the automatic layout algorithm that it uses to position content.  In nearly all cases, allowing for LaTeX to manage spacing and layout will result in a better looking document than if you try and do so yourself.  There will be circumstances, however, where it is necessary to manually specify the position of photos or text in a more precise manner.</p>
<p>In xetexCV, there are two such cases.  In the first, special handling is required so that the CV contact information is correctly labeled and typeset.  Additional formatting commands are required so that the images and text of the title section have a “balanced” feel to them.  All of this processing occurs in the \makecvtitle macro.</p>
<h3>Conditional Formatting - \ifthenelse</h3>
<p>While it may appear simple, the formatting of the xetexCV contact section (which includes the institution, address, phone, fax, email and website information) is rather involved.  First, in order to simplify the use of the document class, I chose to add this information through the use of special macros (\email, \website\, \cvname, etc.).  Because the information is added through tags, this means that logical rules must be set up to handle to handle the layout.  What should happen, for example, if a fax number or website isn’t supplied?</p>
<p>The obvious answer is that the information should be left out of the contact details.  That also means that the label (“Fax:”, “Phone:”, “Email:”) should be omitted.  To accomplish this goal requires conditional formatting, better known to programmers as the “if, then, else” loop.  “If” a condition exists, “then” do one thing, “else” do another.</p>
<p>In LaTeX, conditional formatting is performed by the “ifthen” package and uses the \ifthenelse macro.</p>
<p>\ifthenelse takes three arguments:</p>
<blockquote><p>\ifthenelse{CONDITION}{IF TRUE}{ELSE}</p>
<p>CONDITION : The test condition, often expressed as \equals{VARIABLE}{VALUE}<br />
IF TRUE : The code that should be executed if the condition is satisfied<br />
ELSE : What to do if the condition is false</p></blockquote>
<p>At several instances in xetexCV, \ifthenelse is used to test if there is a null (or empty) value for a particular tag.  In the cases where it finds a null value, then no formatting commands are executed.  If, however, there is a value, then text is added.  A few of the simpler examples are shown below:</p>
<blockquote><p>\ifthenelse{\equal{\@phonenumber}{\relax}}<br />
{}{Phone: \texttt{\@phonenumber}\\}<br />
\ifthenelse{\equal{\@faxnumber}{\relax}}<br />
{}{Fax: \texttt{\@faxnumber}\<p style='text-align:center;'><span class='MathJax_Preview'><img src='http://www.oak-tree.us/blog/wp-content/plugins/latex/cache/tex_a284b26481d8734fcbdc5a5d9037aa4f.gif' style='' class='tex' alt="0.2cm]}<br />
\ifthenelse{\equal{\@email}{\relax}}<br />
{}{Email: \href{mailto:\@email}{\@email}\\}<br />
\ifthenelse{\equal{\@website}{\relax}}<br />
{}{Website: \href{\@website}{\@website}\\}</p></blockquote>
<p>In each of these cases, the \equal macro is used to check if the pertinent variable (specified by the \@ symbol) still has a value of \relax (\equal{\@variablename}{relax}).</p>
<p><em>Note: \relax can be thought of as an equivalent to null in other language.</em></p>
<p>If the value is still set to \relax, then nothing is done (denoted by the empty diamond brackets). If there is a non-null value, however, then the appropriate label and formatted text is added to the document.</p>
<p>While these examples are relatively simple, the same principle can be used to for very complicated formatting. \makecvtitle, for example, uses a similar conditional statement to see if the user has specified an image. If not, then it will use one formatting style for the entire title section. If so, then it uses the layout shown in the examples.</p>
<h3>Balancing Images and Text - \makecvtitle</h3>
<p>In addition to the conditional formatting issues, \makecvtitle must also wrestle with the best way of creating a single, unified title block. The CV name, contact information and photo should all be included. Moreover, subsequent sections should be added after the end of the photo, rather than wrapping around it. One of the easiest ways to create such a unified block of content is to use the minipage environment.</p>
<p>The minipage is extremely flexible. It can have text, formatting and image within a self-enclosed space. Furthermore, they can be embedded within one another. By creating a series of embedded minipages (as shown below), you can group related content. You can additionally specify how wide you want each minipage environment to be, or you can let the LaTeX engine make those determinations.</p>
<p><em>Note: An additional advantage of minipage is that any footnotes added to text within the minipage are part of that environment instead of the main document. This is useful for adding footnotes to figures or text. Accomplishing the same thing in Microsoft Word without tedious manual formatting is impossible.</em></p>
<p><img style="display: inline; border-width: 0px;" title="Embedded Minipages" src="http://www.oak-tree.us/blog/wp-content/uploads/2009/11/EmbeddedMinipages.png" border="0" alt="Embedded Minipages" width="400" height="365" /></p>
<p>I?ve used this strategy to ensure that text containing the contact details is properly aligned against the cv photo. The minipage environment from xetexCV is shown below:</p>
<blockquote><p>\begin{minipage}{6in}<br />
\begin{minipage}{114pt}<br />
\resizebox*{100pt}{!}<br />
{\includegraphics{\@cvimage}}<br />
\end{minipage}<br />
\begin{minipage}{4in}<br />
\ifthenelse{\equal{\@institution}{\relax}}<br />
{}{\bfseries\@institution\\}<br />
\mdseries\@contactaddress\" /></span></p>!0.2cm]<br />
\ifthenelse{\equal{\@phonenumber}{\relax}}<br />
{}{Phone: \texttt{\@phonenumber}\\}<br />
\ifthenelse{\equal{\@faxnumber}{\relax}}<br />
{}{Fax: \texttt{\@faxnumber}\$$!0.2cm]}<br />
\ifthenelse{\equal{\@email}{\relax}}<br />
{}{Email: \href{mailto:\@email}{\@email}\\}<br />
\ifthenelse{\equal{\@website}{\relax}}<br />
{}{Website: \href{\@website}{\@website}\\}<br />
\end{minipage}<br />
\end{minipage}</p></blockquote>
<p>As you may notice, there are three embedded minipages here (the main minipage and two sub pages).  The main minipage is set to span the entire width of the text.  However, the first embedded minipage is only 114 pt in width (about 1.6 inches).  Within this first box, I place the cvphoto, resized to a width of 100 pt:</p>
<blockquote><p>\resizebox*{100pt}{!}<br />
{\includegraphics{\@cvimage}}</p></blockquote>
<p><em>Note: The {!} argument in \resizebox allows the image to stretch proportionally in the vertical direction.</em></p>
<p>The second minipage is allowed to take up the rest of the paper width and includes the conditional formatting for the contact details.</p>
<h2>Conclusion</h2>
<p>Through the use of custom formatting, packages and macros, I’ve created a document that is substantially different from the foundation class (article.cls).  Despite those differences, nearly every major customization was made using simple LaTeX macros which many users will be familiar with.  Further, because it is built on a solid foundation, the ability to use other add-on packages is retained.</p>
<p>Extending an existing document class does not need to be difficult.  It is possible to use many of the commands used for writing a document.  Additionally, the modifications could be packaged as a style (.sty) and used to enhance any content that I might write in the future.</p>
<p>This flexibility is one of the reasons why LaTeX is such a good candidate for the typesetting of scientific and technical material.  It’s also why LaTeX is a good candidate for creating design heavy documents, such as a curiculum vitae.</p>
<p>______________________________________________________</p>
<h2>Acknowledgements and Further Reading</h2>
<p>Additional information on the structure of document classes can be found in the article “<a href="http://www.tug.org/TUGboat/Articles/tb28-1/tb88flynn.pdf">Rolling your own Document Class: Using LaTeX to keep away from the Dark Side</a>” by Peter Flynn of Silmaril Consultants.</p>
<p>A second article called “<a href="http://www.tug.org/TUGboat/Articles/tb29-3/tb93mansfield.pdf">How to develop your own document class – our experience</a>” describes additional techniques for documents that might have non-standard formatting.  It outlines several common mistakes and ways to get avoid them.</p>
<p>This article is part 2 of a four part series.  <a href="http://www.oak-tree.us/blog/index.php/2009/11/25/latex-cv-part1">Part 1</a> introduces the xetexCV document class and describes its use.  <a href="http://www.oak-tree.us/blog/index.php/2009/12/02/latex-cv-part3">Part 3</a> shows how to generate a publications list through the use of a .bib database and custom BibTeX style.  Part 4 describes how to use the document class and a corresponding layout file with LyX.<br />
<h3>Similar Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.oak-tree.us/blog/index.php/2009/11/25/latex-cv-part1" rel="bookmark" title="November 25, 2009">Typeset Your Curriculum Vitae &ndash; Part 1: The xetexCV Document Class</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2009/11/14/customize-lyx-character-styles" rel="bookmark" title="November 14, 2009">Customizing LyX: Character Styles and the LyX Local Layout</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2009/12/02/latex-cv-part3" rel="bookmark" title="December 2, 2009">Typeset Your Curriculum Vitae &ndash; Part 3: Automatically Generate a List of Publications</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2008/11/19/ironpython-part3" rel="bookmark" title="November 19, 2008">Learning IronPython – Part 3 – A Beautiful Start</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2009/03/04/perfect-tool" rel="bookmark" title="March 4, 2009">Creating the Perfect Writing Tool: A Proposal</a></li>
</ul>
<p><!-- Similar Posts took 34.391 ms --></p>
<p>Copywrite 2009: Rob Oakes.  <a href="http://www.oak-tree.us/blog">Apolitically Incorrect</a><br/><br/><a href="http://www.oak-tree.us/blog/index.php/2009/11/30/latex-cv-part2">Typeset Your Curriculum Vitae &ndash; Part 2: Extending and Customizing an Existing Document Class</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oak-tree.us/blog/index.php/2009/11/30/latex-cv-part2/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Typeset Your Curriculum Vitae &#8211; Part 1: The xetexCV Document Class</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/11/25/latex-cv-part1</link>
		<comments>http://www.oak-tree.us/blog/index.php/2009/11/25/latex-cv-part1#comments</comments>
		<pubDate>Wed, 25 Nov 2009 04:02:27 +0000</pubDate>
		<dc:creator>Rob Oakes</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[rapidBOOKS]]></category>
		<category><![CDATA[Writing and Literature]]></category>
		<category><![CDATA[Curiculum Vitae]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Typesetting]]></category>

		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=1321</guid>
		<description><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Typeset+Your+Curriculum+Vitae+%26ndash%3B+Part+1%3A+The+xetexCV+Document+Class&amp;rft.aulast=Oakes&amp;rft.aufirst=Rob&amp;rft.subject=Computer&amp;rft.subject=rapidBOOKS&amp;rft.subject=Writing+and+Literature&amp;rft.source=Apolitically+Incorrect&amp;rft.date=2009-11-25&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.oak-tree.us/blog/index.php/2009/11/25/latex-cv-part1&amp;rft.language=English"></span>
Very few documents are more personal than a curriculum vitae (CV).  A CV lists a person’s educational history, who they’ve worked for and what they’ve accomplished.  Moreover, a CV is frequently used to judge a person’s inherent worth and value (or at least exploitability).  A quality curiculum vitae matters, a lot. For that reason, a [...]<p>Copywrite 2009: Rob Oakes.  <a href="http://www.oak-tree.us/blog">Apolitically Incorrect</a><br/><br/><a href="http://www.oak-tree.us/blog/index.php/2009/11/25/latex-cv-part1">Typeset Your Curriculum Vitae &ndash; Part 1: The xetexCV Document Class</a></p>
]]></description>
			<content:encoded><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Typeset+Your+Curriculum+Vitae+%26ndash%3B+Part+1%3A+The+xetexCV+Document+Class&amp;rft.aulast=Oakes&amp;rft.aufirst=Rob&amp;rft.subject=Computer&amp;rft.subject=rapidBOOKS&amp;rft.subject=Writing+and+Literature&amp;rft.source=Apolitically+Incorrect&amp;rft.date=2009-11-25&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.oak-tree.us/blog/index.php/2009/11/25/latex-cv-part1&amp;rft.language=English"></span>
<p><!--adsensestart-->Very few documents are more personal than a curriculum vitae (CV).  A CV lists a person’s educational history, who they’ve worked for and what they’ve accomplished.  Moreover, a CV is frequently used to judge a person’s inherent worth and value (or at least exploitability).  A quality curiculum vitae <em>matters</em>, a lot.</p>
<p>For that reason, a CV not only needs to include all the pertinent information of a person’s life, but it also needs to look <em>good. </em>An attractive CV with good spacing and contrast leaves a positive impression and makes it easier to find information.  When laid out correctly, a reviewer might just find themselves scouring past accomplishments for interesting tidbits: “I didn’t realize that this applicant organized a lecture series with Patch Adams and other notables, that’s <em>interesting</em>!”</p>
<p><span id="more-1321"></span>There are many dedicated CV classes which can be used to typeset a CV with LaTeX.  Unfortunately, they all share one thing in common: they’re complicated.  To ensure that the spacing and fonts are correct, far too often a document based on these classes will devolve into a jumbled mess of tags and obscure page layout commands.</p>
<p>I’ve tried to typeset my CV with LaTeX a number of times, and in nearly every case, I’ve been unhappy with the output.  Sure, the end product is attractive <em>enough; </em>but it doesn’t quite match the CV that I have in my head.  To really arrive at my coveted ideal of perfection, I would need to manually specify the font and position of nearly every element on the page; which is why I’ve normally used a dedicated layout program (such as Adobe InDesign) for the job.</p>
<p>This is unfortunate, however, since a CV based on LaTeX would be much easier to keep current.  Additionally, a well designed document class and corresponding BibTeX style would allow me to use my existing bibliographic database to automate the process.</p>
<p>Thus, any time that I need to make major updates, I always check the internet for information and new LaTeX classes.  While conducting one such review a few days ago, I came across <a href="http://nitens.org/taraborelli/cvtex">a very interesting article</a> and set of examples by <a href="http://nitens.org/taraborelli/home">Dario Taraborelli</a> of the <a href="http://cress.soc.surrey.ac.uk/">University of Surrey</a>.  In his write-up, Dr. Taraborelli expresses frustrations which are similar to my own;  but instead of complaining and throwing his hands up in exasperation, he went on to solve the problems in an elegant way.</p>
<p>Rather than use or modify one of the existing CV classes (as I would have done), Taraborelli opted to extend the article class by adding additional features.  Perhaps the most important addition was the use of <a href="http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&amp;id=XeTeX">XeTeX</a> and the \fontspec package, which allows for OpenType or <a href="http://nitens.org/taraborelli/latex">expert fonts</a> to be used and other advanced features.  The end result of this work is an attractive and <em>flexible </em>document template.</p>
<p>Dr. Taraborelli’s example also shows how easy it can be to extend an existing document class to meet a more specific need.  As I read through the example code, I realized that it would be straightforward to build upon his work and create something that would suit my particular aesthetic.<!--adsensestop--></p>
<p>So … I did, and this series is the result of my efforts.</p>
<p>In the remainder of this article, I will introduce the new CV document class I created (called xetexCV) and provide a few examples of how to work with it.  In <a href="http://www.oak-tree.us/blog/index.php/2009/11/30/latex-cv-part2">part 2</a>, I will dissect the class code and explain how it works.  I will also provide hints on how it might be modified.  In <a href="http://www.oak-tree.us/blog/index.php/2009/12/02/latex-cv-part3">part 3</a>, I will show how to generate a publications list through the use of a .bib database and custom BibTeX style.  In Part 4, I will describe how the document class and corresponding layout file can be used with LyX.</p>
<p><img style="display: inline; border-width: 0px;" title="image" src="http://www.oak-tree.us/blog/wp-content/uploads/2009/11/image3.png" border="0" alt="image" width="550" height="286" /></p>
<h2>xetexCV – An Attractive and Easy to Use CV Document Class</h2>
<h3>Downloads and Installation</h3>
<p>All of the files needed to use the class (including xetexCV.cls, examples and supporting files) can be found <a href="http://www.oak-tree.us/stuff/LyX/xetexCV.zip">here</a>.  To install, copy to an appropriate folder in your tex path and refresh the tex database:</p>
<blockquote><p>sudo texhash</p></blockquote>
<h4>Package Requirements</h4>
<ul>
<li>XeTeX Typesetting Engine.  For users of Mac OS X and Windows, XeTeX is included in the MacTeX and MikTeX distributions (respectively).  Users of Linux, however, will need to install the texlive-xetex package</li>
<li>Fontspec package (included with MacTeX, MikTeX or texlive-xetex)</li>
<li>OpenType Expert Fonts.  By default, the document class uses <a href="http://www.josbuivenga.demon.nl/fontin.html">Fontin</a> and <a href="http://www.josbuivenga.demon.nl/fontinsans.html">Fontin sans</a>.</li>
</ul>
<h3>Curiculum Vitae Examples</h3>
<ul>
<li>Albert Einstein.  <a href="http://www.oak-tree.us/stuff/LyX/xetexCV/example-xetexCV.tex">LaTeX Source</a>, <a href="http://www.oak-tree.us/stuff/LyX/xetexCV/example-xetexCV.pdf">PDF Output</a></li>
<li>Isaac Newton.  <a href="http://www.oak-tree.us/stuff/LyX/xetexCV/example2-xetexCV.tex">LaTeX Source</a>, <a href="http://www.oak-tree.us/stuff/LyX/xetexCV/example2-xetexCV.pdf">PDF Output</a></li>
</ul>
<h3>xetexCV Class Usage</h3>
<p>To use the xetexCV class, there are a few important macros.  These include:</p>
<ul>
<li>The \makecvtitle macro and title block tags</li>
<li>The \cvsection and \cvsubsection macros</li>
<li>The \years tag for hanging notes</li>
</ul>
<h4>\makecvtitle</h4>
<p>The title block is created through the use of the \makecvtitle macro.  The name, institution and contact information are all specified by descriptive tags.  The example below shows what these are and how they are used:</p>
<blockquote><p>\documentclass{xetexCV}</p>
<p>\cvname{Albert Einstein}<br />
\cvimage{Albert-Einstein.jpg}<br />
\institution{Institute for Advanced Study}</p>
<p>\contactaddress{Einstein Drive\\<br />
Princeton, New Jersey 08450<br />
United States of America}</p>
<p>\phone number{609-734-8000}<br />
\faxnumber{609-924-8399}<br />
\email{a.einstein@ias.edu}<br />
\website{http://www.ias.edu/spfeatures/einstein}</p>
<p><img style="margin: 0px 0px 0px 15px; display: inline; border-width: 0px;" title="image" src="http://www.oak-tree.us/blog/wp-content/uploads/2009/11/image4.png" border="0" alt="image" width="335" height="322" align="right" />\makecvtitle</p></blockquote>
<h4>\cvsection and \cvsubsection</h4>
<p>Sections and subsections can be added through the \cvsection{section name} and \cvsubsection{subsection name} macros.  The following codeblock creates the “Publications” section header and “Peer Reviewed Journals” subhead seen at right:</p>
<blockquote><p>\cvsection{Publications}<br />
\cvsubsection{Journal Articles}</p>
<p>…</p></blockquote>
<h4>Hanging Notes</h4>
<p>Hanging notes can be specified through the use of the \years macro.  This is helpful for typesetting education, employment history, and awards.  The following example produces the output seen below:</p>
<blockquote><p>\cvsection{Appointments Held}</p>
<p>University of Bern \years{1908-1911}\\<br />
University of Zurich \years{1911-1912}\\<br />
Charles University of Prague \years{1912-1914}\\<br />
Prussian Academy of Sciences, Berlin \years{1914-1932}\\<br />
University of Leiden \years{1920-1930}\\<br />
Institute for Advanced Study, Princeton \years{1932-1955}</p></blockquote>
<p><img style="display: inline; border-width: 0px;" title="image" src="http://www.oak-tree.us/blog/wp-content/uploads/2009/11/image5.png" border="0" alt="image" width="431" height="160" /></p>
<h4>Choosing a Font</h4>
<p>To change the font, use the \fontspec package and appropriate \settext macro.  The example below shows how to change the main font and sans font to Warnock Pro and Frutiger LT Std (commercial fonts available as part of the Adobe Font Folio 11):</p>
<blockquote><p>\setmainfont[Ligatures={Common}, Numbers={OldStyle}]{Warnock Pro}<br />
\setsansfont{Frutiger LT Std}</p></blockquote>
<p>All of the examples shown here were typeset with Warner Pro and Frutiger.  By default, however, the document class uses <a href="http://www.josbuivenga.demon.nl/fontin.html">Fontin</a> and <a href="http://www.josbuivenga.demon.nl/fontinsans.html">Fontin sans</a>, which are available as free downloads.  Another excellent font alternative is <a href="http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&amp;item_id=Gentium_basic">Gentium Basic</a>.  Because XeTeX can use OpenType fonts, however, you can use any font installed on your computer.</p>
<h3>Other Features</h3>
<ul>
<li>Font features such as ligatures and glyph variants can be accessed through the <a href="http://www.ctan.org/tex-archive/help/Catalogue/entries/fontspec.html">fontspec</a> package</li>
<li>The examples and class are unicode compatible.  This means means that you can write in Chinese, Cyrillic or Greek without additional packages</li>
</ul>
<p>______________________________________________________</p>
<h2>Acknowledgements and Further Reading</h2>
<p>As noted above, this document class is based on a <a href="http://nitens.org/taraborelli/cvtex">similar example</a> available from <a href="http://nitens.org/taraborelli/home">Dario Taraborelli’s website</a>.  Other examples of how to create a resume or CV are available from <a href="http://matthewm.boedicker.org/code/latex_resume_tips.php">Matthew Boedicker</a> and <a href="http://linux.dsplabs.com.au/resume-writing-example-latex-template-linux-curriculum-vitae-professional-cv-layout-format-text-p54/">Kamil Wójcicki</a>.<br />
<h3>Similar Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.oak-tree.us/blog/index.php/2009/11/30/latex-cv-part2" rel="bookmark" title="November 30, 2009">Typeset Your Curriculum Vitae &ndash; Part 2: Extending and Customizing an Existing Document Class</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2009/11/14/customize-lyx-character-styles" rel="bookmark" title="November 14, 2009">Customizing LyX: Character Styles and the LyX Local Layout</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2009/12/02/latex-cv-part3" rel="bookmark" title="December 2, 2009">Typeset Your Curriculum Vitae &ndash; Part 3: Automatically Generate a List of Publications</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2008/12/05/the-win32-api-and-simplicity" rel="bookmark" title="December 5, 2008">The Win32 API and Simplicity</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2008/12/14/wpf-svg-xaml-part2" rel="bookmark" title="December 14, 2008">WPF – SVG Graphics and XAML – Part 2</a></li>
</ul>
<p><!-- Similar Posts took 48.188 ms --></p>
<p>Copywrite 2009: Rob Oakes.  <a href="http://www.oak-tree.us/blog">Apolitically Incorrect</a><br/><br/><a href="http://www.oak-tree.us/blog/index.php/2009/11/25/latex-cv-part1">Typeset Your Curriculum Vitae &ndash; Part 1: The xetexCV Document Class</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oak-tree.us/blog/index.php/2009/11/25/latex-cv-part1/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

