{"id":890,"date":"2011-06-22T11:09:12","date_gmt":"2011-06-22T10:09:12","guid":{"rendered":"http:\/\/www.monkeyshines.co.uk\/blog\/?p=890"},"modified":"2011-10-18T21:29:55","modified_gmt":"2011-10-18T20:29:55","slug":"lyx-latex-the-easyish-way","status":"publish","type":"post","link":"https:\/\/monkeyshines.co.uk\/blog\/lyx-latex-the-easyish-way\/","title":{"rendered":"LyX: LaTeX, the Easy(ish) Way"},"content":{"rendered":"<h2 style='padding-left: 0px;'>Introduction<\/h2>\n<p>\nI&#8217;ve resisted learning TeX\/LaTeX for years; I appreciate the principle, but I baulk at the idea of learning another language, particularly one which requires a bunch of opaque commands at the top of each file. I like a nice GUI, and Word, for all its faults, does give you lots of control if you use the styles correctly. And the <a href=\"http:\/\/www.endnote.com\/enwebinfo.asp\">EndNote Web<\/a> plugin allows you to sort out referencing without too much pain.\n<\/p>\n<p>\nAnd yet, and yet&#8230; LaTeX <em>is<\/em> <a href='http:\/\/nitens.org\/taraborelli\/latex'>the right way<\/a> to do things, from a typesetting viewpoint, and also because it correctly places the emphasis on content. What&#8217;s a graphically minded chap to do? I recently discovered <a href='http:\/\/www.lyx.org'>LyX<\/a>, which claims to fill this gap in the market. I thought I&#8217;d see how easy it was to turn out a nice looking document with LyX by replicating a Word doc that I was intending to post on this blog (on <a href='\/blog\/archives\/891'>tree comparison<\/a>).\n<\/p>\n<h2 style='padding-left: 0px;'>Citing References<\/h2>\n<p>\nTo make life a bit easier for myself, I shelved sorting out a BibTeX library, and just copied the references from the Word doc. Getting the citations to appear correctly was trickier than I thought it should be; it was easy enough to change the document settings so that the bibliography was &#8216;natbib&#8217; format. But then I had no control over the precise display of the citation, e.g. (Mackenzie, 2011) versus Mackenzie (2011). I resorted to writing the TeX tags directly, aided by an excellent <a href=\"http:\/\/merkel.zoneo.net\/Latex\/natbib.php\">Natbib reference sheet<\/a>. But then I got some errors when compiling the LyX document in PDF format. After a bit of digging, I determined that the <code>\\usepackage{natbib}<\/code> had disappeared from the LaTeX preamble &#8211; other than entering it manually, I couldn&#8217;t figure out how to get it back.\n<\/p>\n<h2 style='padding-left: 0px;'>Inserting a Header<\/h2>\n<p>\nGetting a header was also somewhat convoluted, and again involved dipping a reluctant toe into grimy TeX-infested waters. I had an intermediate problem in that the help within LyX is not searchable, which seems odd; but the interwebs told me that I needed to switch on <a href=\"http:\/\/www.ctan.org\/tex-archive\/macros\/latex\/contrib\/fancyhdr\"><em>fancy<\/em> headers<\/a> in the page layout settings, and then amend the preamble again (grrr) with <code>\\lhead{}<\/code>, <code>\\chead{}<\/code>, and <code>\\rhead{Tree Comparison - James E. Allen}<\/code>. You need the empty definitions to suppress default headings, which seems more annoying than useful.\n<\/p>\n<h2 style='padding-left: 0px;'>Results<\/h2>\n<p>\nI used Word&#8217;s built-in PDF-saving (it&#8217;s version 2007, btw), and created two versions, with and without automatic hyphenation. (I also switched on kerning in the hyphenated doc, but I couldn&#8217;t see that it had any effect&#8230;) For the LyX document, I used the XeTeX PDF exporter, since I wanted to use my favourite Windows font, <em>Georgia<\/em>.\n<\/p>\n<p style='padding-left: 25px;'>\n<a href='\/blog\/wp-content\/uploads\/2011\/06\/Tree_Comparison_Word.pdf'>Tree Comparison: Word<\/a>\n<\/p>\n<p style='padding-left: 25px;'>\n<a href='\/blog\/wp-content\/uploads\/2011\/06\/Tree_Comparison_Word_Hyphen.pdf'>Tree Comparison: Word (Hyphenated)<\/a>\n<\/p>\n<p style='padding-left: 25px;'>\n<a href='\/blog\/wp-content\/uploads\/2011\/06\/Tree_Comparison_LyX.pdf'>Tree Comparison: LyX<\/a>\n<\/p>\n<h2 style='padding-left: 0px;'>Verdict<\/h2>\n<p>\nLyX wasn&#8217;t as straightforward as I&#8217;d hoped, but now that I&#8217;ve sorted a few teething issues, I think I could use it in future with a minimum of fuss. As to the results, I think the LyX-based document looks the best; the Word version without hyphenation looks quite gappy, and the automatic hyphenation isn&#8217;t great. The LyX file has too much whitespace above the title for my liking, and I&#8217;d prefer gaps between the paragraphs rather than indentation, but I daresay I can find a different layout that I like better. The wider margins make the text more readable, but it is odd that \u201cweighted\u201d juts out into the right margin; I couldn&#8217;t figure out why, but I could fix it by adding <code>{sloppypar}<\/code> tags around that paragraph. (The <a href=\"http:\/\/en.wikibooks.org\/wiki\/LaTeX\">LaTeX wikibook<\/a> is excellent for figuring out stuff like that.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction I&#8217;ve resisted learning TeX\/LaTeX for years; I appreciate the principle, but I baulk at the idea of learning another language, particularly one which requires a bunch of opaque commands at the top of each file. I like a nice GUI, and Word, for all its faults, does give you lots of control if you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,7],"tags":[],"class_list":["post-890","post","type-post","status-publish","format-standard","hentry","category-biology","category-coding"],"_links":{"self":[{"href":"https:\/\/monkeyshines.co.uk\/blog\/wp-json\/wp\/v2\/posts\/890","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monkeyshines.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monkeyshines.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monkeyshines.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monkeyshines.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=890"}],"version-history":[{"count":22,"href":"https:\/\/monkeyshines.co.uk\/blog\/wp-json\/wp\/v2\/posts\/890\/revisions"}],"predecessor-version":[{"id":918,"href":"https:\/\/monkeyshines.co.uk\/blog\/wp-json\/wp\/v2\/posts\/890\/revisions\/918"}],"wp:attachment":[{"href":"https:\/\/monkeyshines.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monkeyshines.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monkeyshines.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}