LaTeX http://simonsilk.com/category/tags/latex en LaTeX: List of Notations (Nomenclature) http://simonsilk.com/content/simonsilk/2011-jun/latex-list-notations-nomenclature <span class="field field--name-title field--type-string field--label-hidden">LaTeX: List of Notations (Nomenclature)</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p><strong>Update for MikTeX 2.9 below.</strong></p> <p> </p> <p>I've been working on my thesis for a couple of months now, and frequently I have to look up ways to tweak certain Latex components, so I'm going to start posting about these tweaks, even if it's just to link to another page about how to do something. If I end up having a good collection at the end of my thesis, then I can write a final post aggregating them in a logical order so they can serve as a guide to formatting a thesis in Latex.</p> <p> </p> <p>I'm using <a href="http://www.texniccenter.org/" target="_blank">TeXnic Center</a> (TXC) 2 Alpha 3 to edit and MikTeX to build. I originally installed both using <a href="http://www.tug.org/protext/" target="_blank">ProTeXt</a> which packages TXC1, MikTeX, Ghostscript, and Ghostgum. I later installed TXC2 which provides a much-needed overhaul to the interface so that toolbars don't shift all over the place whenever you resize the window.</p> <p> </p> <p>Today, I decided to add a List of Notations (aka list of Symbols) to my thesis. This is handy in a scientific thesis to let readers quickly refer to the list in case there's a symbol they're unfamiliar with. It's also nice if you can do your Related Work review (Lit Review) using one common set of notation, which will allow readers to more easily understand the relationship between various other papers you're reviewing in case they don't share notation.</p> <p> </p> <p>The list of notations can be generated using <a href="http://www.ctan.org/tex-archive/macros/latex/contrib/glossaries" target="_blank">glossaries</a>, or even manually, but it's best done using the package <a href="http://ctan.org/tex-archive/macros/latex/contrib/nomencl/" target="_blank"><em>nomencl</em></a>, which was designed for this purpose. If you're using MikTex, then you should have this already.</p> <p> </p> <p>Anyway, as outlined <a href="http://ytyoun.wordpress.com/2010/04/18/latex-list-of-notations-using-nomencl-sty/" target="_blank">here</a>, adding a list of notations can be done in 4 simple steps:</p> <p> </p> <p><em><strong>1. Add the following code to your preamble:</strong></em></p> <p> </p> <p></p><div class="geshifilter"><pre class="latex geshifilter-latex" style="font-family:monospace;"><span style="color: #E02020; ">\</span><a href="http://www.golatex.de/wiki/%5Cusepackage"><span style="color: #800000;">usepackage</span></a><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">refpage</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">nomencl<span style="color: #E02020; ">}</span> <span style="color: #E02020; ">\</span><a href="http://www.golatex.de/wiki/%5Crenewcommand"><span style="color: #800000;">renewcommand</span></a><span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\nomname</span><span style="color: #E02020; ">}{</span>List of Notations<span style="color: #E02020; ">}</span> <span style="color: #E02020; ">\</span><a href="http://www.golatex.de/wiki/%5Crenewcommand"><span style="color: #800000;">renewcommand</span></a>*<span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\pagedeclaration</span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">1</span><span style="color: #E02020; ">]{</span><span style="color: #800000; font-weight: normal;">\unskip</span><span style="color: #800000; font-weight: normal;">\dotfill</span><span style="color: #800000; font-weight: normal;">\hyperpage</span><span style="color: #E02020; ">{</span>#1<span style="color: #E02020; ">}}</span> <span style="color: #800000; font-weight: normal;">\makenomenclature</span>     <span style="color: #E02020; ">\</span><a href="http://www.golatex.de/wiki/%5Cusepackage"><span style="color: #800000;">usepackage</span></a>{makeidx</span><span style="color: #E02020; ">}</span> <span style="color: #E02020; ">\</span><a href="http://www.golatex.de/wiki/%5Cmakeindex"><span style="color: #800000;">makeindex</span></a></pre></div> <p> </p> <!--break--><p>The first line invokes the nomenclature package, and the option refpage means that the list will include, for each symbol in the list,  the page number on which you added it with the <em>\nomenclature</em> command. Leave it out to remove page numbers. The second line is the title at the top of the list of notations. The third line changes the page numbers in the list so they are right-justified with a line of dots connecting them back to the description of the symbol. By default, they follow the description after a comma and the word "page." The last line tells Latex you're using nomenclature so it will generate and look for the associated intermediate files during successive runs.</p> <p> </p> <p>The last two lines are likely somewhere in your preamble already, but if not add them because nomencl depends on makeindex.</p> <p> </p> <p><em><strong>2. Add the following where you want the nomenclature to appear.</strong></em> For example, you might place it right after <em>\listoffigures. </em></p> <p> </p> <p></p><div class="geshifilter"><pre class="latex geshifilter-latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\printnomenclature</span></pre></div> <p> </p> <p><em><strong>3. Use the following command when you want to add a new symbol.</strong></em></p> <p> </p> <p></p><div class="geshifilter"><pre class="latex geshifilter-latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\nomenclature</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #8020E0; font-weight: normal;">$symbol$</span>}{Description</span><span style="color: #E02020; ">}</span></pre></div> <p> </p> <p>For example, you might say:</p> <p> </p> <p></p><div class="geshifilter"><pre class="latex geshifilter-latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\nomenclature</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #8020E0; font-weight: normal;">$<span style="color: #800000; font-weight: normal;">\alpha</span>$</span>}{Angular Velocities</span><span style="color: #E02020; ">}</span></pre></div> <p> </p> <p><em><strong>4. Run latex (or pdflatex, xelatex, etc.), then makeidx twice, then latex again</strong></em>, just like when you want to generate an index. Check your results. If you're using TeXnic center, this won't work automatically just using successive builds. See below.</p> <p> </p> <p>For a complete code example, please see <a href="http://ytyoun.wordpress.com/2010/04/18/latex-list-of-notations-using-nomencl-sty/" target="_blank">this post</a>.</p> <p> </p> <h3>Using nomencl in TeXnic center.</h3> <p> </p> <p>As oultined <a href="http://eldemet.wordpress.com/2009/08/06/using-nomenclatures-in-texniccenter/" target="_blank">here</a>, you need to add makeindex with nomencl arguments as a post-processor option. To do so, go <em>Build &gt; Define Output Profiles</em>, and choose your desired output profile, e.g. <em>LaTeX =&gt; PDF</em>. Go to the postprocessor tab and add a new postprocessor using the button that looks like a New Folder in TXC2. Give it a name, then add the path to the makeindex executable (<em>C:\Program Files (x86)\MiKTeX 2.8\miktex\bin\makeindex.exe</em> in my case). Then add <em>-s  nomencl.ist "%bm.nlo" -o "%bm.nls"</em>  to the arguments list. Now three builds in TXC should produce an updated nomenclature with page references.</p> <p> </p> <p><span id="cke_bm_345S" style="display: none;"> </span><span id="cke_bm_346S" style="display: none;"> </span></p> <h3>Optional Tweaks<span id="cke_bm_346E" style="display: none;"> </span><span id="cke_bm_345E" style="display: none;"> </span></h3> <p> </p> <p><em><strong>Column spacing in the list of notations</strong></em></p> <p> </p> <p>If some of your symbol entries are too long, they will push their description to the right in your table, but others will stay where they are, which is ugly. You can fix this with the label width option, inserted in the preamble just before <em>\makenomenclature</em>:</p> <p> </p> <p></p><div class="geshifilter"><pre class="latex geshifilter-latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\nomlabelwidth</span>=25mm</pre></div> <p> </p> <p>The default is 0.5cm.</p> <p> </p> <p><em><strong>Where to inset \nomenclature commands. </strong></em></p> <p> </p> <p>If you don't want page numbers, and don't really care where in your document this command is given, you can just place all the <em>\nomenclature </em>commands in one tex file, say <em>symbols.tex</em>, then insert this anywhere in your document body with <em>\input{symbols}</em>. This can be handy if you've already written your lit review using multiple authors' notations and you now want to bring them under one common notation set; just do this first to make your list of notations, then print yourself a copy and go through your lit review updating notation where necessary.</p> <p> </p> <p><em><strong>Update for MikTeX 2.9</strong></em></p> <p> </p> <p>As per <a href="http://comments.gmane.org/gmane.comp.tex.miktex/10259" target="_blank">this post</a>, with newer versions of Makeindex, <em>makeindex.exe</em> needs to be passed a relative rather than absolute pathname. This can be achieved by replacing <em>%bm</em> with<em> %tm </em>in the output profiles of TeXnice Center. Don't forget to change it in the post-processor tab as well so that Nomenclature will work.</p> <p> </p> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/users/simonsilk" typeof="schema:Person" property="schema:name" datatype="">SimonSilk</span></span> <span class="field field--name-created field--type-created field--label-hidden">Mon, 06/27/2011 - 18:02</span> <div class="field field--name-tags field--type-entity-reference field--label-hidden field--entity-reference-target-type-taxonomy-term clearfix field__items"> <div class="field__item"><a href="/category/tags/latex" hreflang="en">LaTeX</a></div> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title">Comments</h2> <article role="article" data-comment-user-id="0" id="comment-15" about="/comment/15" typeof="schema:Comment" class="comment js-comment by-anonymous clearfix"> <span class="hidden new-indicator" data-comment-timestamp="1341457772"></span> <header> <article typeof="schema:Person" about="/user/0" class="profile"> <drupal-render-placeholder callback="flag.link_builder:build" arguments="0=user&amp;1=0&amp;2=following" token="dV8BLmhD339z_wMjaUSDxONyVEf9d6Tb-DESjU5tHGA"></drupal-render-placeholder></article> </header> <div class="comment__content-container"> <nav class="comment__links"><drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=15&amp;1=default&amp;2=en&amp;3=" token="rNqCNcQQOXfzbkOZt-lpzNIGd8-5jMcJXc7motnrTtc"></drupal-render-placeholder></nav> <div class="comment__meta"> <span>Submitted by <span rel="schema:author"><span lang="" typeof="schema:Person" property="schema:name" datatype="">Anonymous (not verified)</span></span> Thu, 07/05/2012 - 00:09 <span property="schema:dateCreated" content="2012-07-05T03:09:32+00:00" class="rdf-meta hidden"></span> </span> </div> <h3 property="schema:name" datatype="" class="title"><a href="/comment/15#comment-15" class="permalink" rel="bookmark" hreflang="en">Thanks</a></h3> <div class="comment__content"> <div property="schema:text" class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item">Hi, I got exactly I was looking for. Thanks a lot.</div> </div> </div> </article> <article role="article" data-comment-user-id="0" id="comment-18" about="/comment/18" typeof="schema:Comment" class="comment js-comment by-anonymous clearfix"> <span class="hidden new-indicator" data-comment-timestamp="1355759597"></span> <header> <article typeof="schema:Person" about="/user/0" class="profile"> <drupal-render-placeholder callback="flag.link_builder:build" arguments="0=user&amp;1=0&amp;2=following" token="dV8BLmhD339z_wMjaUSDxONyVEf9d6Tb-DESjU5tHGA"></drupal-render-placeholder></article> </header> <div class="comment__content-container"> <nav class="comment__links"><drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=18&amp;1=default&amp;2=en&amp;3=" token="jVhirhDd91eC6XV9WsQl4PLehFgKsOgX9j8i4FgvScs"></drupal-render-placeholder></nav> <div class="comment__meta"> <span>Submitted by <span rel="schema:author"><span lang="" typeof="schema:Person" property="schema:name" datatype="">Anonymous (not verified)</span></span> Mon, 12/17/2012 - 11:53 <span property="schema:dateCreated" content="2012-12-17T15:53:17+00:00" class="rdf-meta hidden"></span> </span> </div> <h3 property="schema:name" datatype="" class="title"><a href="/comment/18#comment-18" class="permalink" rel="bookmark" hreflang="en">Hi, I&#039;m using nomenclature</a></h3> <div class="comment__content"> <div property="schema:text" class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item">Hi, I'm using nomenclature after \listoftables and \listoffigures, and before the beginning of the first chapter. My problem is that every of the firsts commands create a second blank page with only the header and page number, however nomenclature don't, and there is a second blank page after nomenclature with the header of listoffigures. It seems like latex don't know listoffigures end before nomenclature or something like that. By the way, listoffigures, of tables, etc. are not in the index (makeindex), and nomenclature does. Please help!!</div> </div> </div> </article> <article role="article" data-comment-user-id="0" id="comment-32" about="/comment/32" typeof="schema:Comment" class="comment js-comment by-anonymous clearfix"> <span class="hidden new-indicator" data-comment-timestamp="1358529461"></span> <header> <article typeof="schema:Person" about="/user/0" class="profile"> <drupal-render-placeholder callback="flag.link_builder:build" arguments="0=user&amp;1=0&amp;2=following" token="dV8BLmhD339z_wMjaUSDxONyVEf9d6Tb-DESjU5tHGA"></drupal-render-placeholder></article> </header> <div class="comment__content-container"> <nav class="comment__links"><drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=32&amp;1=default&amp;2=en&amp;3=" token="jq4Ec-y1qsP57EP-n5He1zEXIj34lMlEXe7GGeXB2RI"></drupal-render-placeholder></nav> <div class="comment__meta"> <span>Submitted by <span rel="schema:author"><span lang="" typeof="schema:Person" property="schema:name" datatype="">Anonymous (not verified)</span></span> Fri, 01/18/2013 - 13:17 <span property="schema:dateCreated" content="2013-01-18T17:17:41+00:00" class="rdf-meta hidden"></span> </span> </div> <h3 property="schema:name" datatype="" class="title"><a href="/comment/32#comment-32" class="permalink" rel="bookmark" hreflang="en">Thank you very very much</a></h3> <div class="comment__content"> <div property="schema:text" class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item">Thank you and thank god for this article. Much better than what the guy Bernd Schandl wrote. As opposed to that "main" article of Bernd, this actually works!!!! Using Texmaker, all I did is: 1) Open the main "name.tex" file 2) Put: " \usepackage[refpage]{nomencl} \renewcommand{\nomname}{List of Notations} \renewcommand*{\pagedeclaration}[1]{\unskip\dotfill\hyperpage{#1}} \makenomenclature \usepackage{makeidx} \makeindex " between "\documentclass[11pt]{report}" and "\begin{document}" 3) Compile with "Quick Build" 4) Type "makeindex name.nlo -s nomencl.ist -o name.nls" into the black command window. In Texmaker its under "Tools" and "Open Terminal". 5) Then I compiled by switching from mode "Quick Build" to "MakeIndex" and I compile. 6) Go back to "Quick Build" and compile. That's it then I was happy to see my list of notations.</div> </div> </div> </article> <article role="article" data-comment-user-id="0" id="comment-33" about="/comment/33" typeof="schema:Comment" class="comment js-comment by-anonymous clearfix"> <span class="hidden new-indicator" data-comment-timestamp="1359095753"></span> <header> <article typeof="schema:Person" about="/user/0" class="profile"> <drupal-render-placeholder callback="flag.link_builder:build" arguments="0=user&amp;1=0&amp;2=following" token="dV8BLmhD339z_wMjaUSDxONyVEf9d6Tb-DESjU5tHGA"></drupal-render-placeholder></article> </header> <div class="comment__content-container"> <nav class="comment__links"><drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=33&amp;1=default&amp;2=en&amp;3=" token="mK-J0A8X34ALX2iIJHbM3TrtGCfKFG4ODtJyKpXPO3Q"></drupal-render-placeholder></nav> <div class="comment__meta"> <span>Submitted by <span rel="schema:author"><span lang="" typeof="schema:Person" property="schema:name" datatype="">Anonymous (not verified)</span></span> Fri, 01/25/2013 - 02:35 <span property="schema:dateCreated" content="2013-01-25T06:35:53+00:00" class="rdf-meta hidden"></span> </span> </div> <h3 property="schema:name" datatype="" class="title"><a href="/comment/33#comment-33" class="permalink" rel="bookmark" hreflang="en">Thank you</a></h3> <div class="comment__content"> <div property="schema:text" class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item">Great little tutorial. Saved me a lot of trouble. Thank you.</div> </div> </div> </article> <article role="article" data-comment-user-id="0" id="comment-36" about="/comment/36" typeof="schema:Comment" class="comment js-comment by-anonymous clearfix"> <span class="hidden new-indicator" data-comment-timestamp="1362500595"></span> <header> <article typeof="schema:Person" about="/user/0" class="profile"> <drupal-render-placeholder callback="flag.link_builder:build" arguments="0=user&amp;1=0&amp;2=following" token="dV8BLmhD339z_wMjaUSDxONyVEf9d6Tb-DESjU5tHGA"></drupal-render-placeholder></article> </header> <div class="comment__content-container"> <nav class="comment__links"><drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=36&amp;1=default&amp;2=en&amp;3=" token="p5cbrQ-JXGqnV8y40KOWbSfElb2H2M3H6m4sKApSohQ"></drupal-render-placeholder></nav> <div class="comment__meta"> <span>Submitted by <span rel="schema:author"><span lang="" typeof="schema:Person" property="schema:name" datatype="">Anonymous (not verified)</span></span> Tue, 03/05/2013 - 12:23 <span property="schema:dateCreated" content="2013-03-05T16:23:15+00:00" class="rdf-meta hidden"></span> </span> </div> <h3 property="schema:name" datatype="" class="title"><a href="/comment/36#comment-36" class="permalink" rel="bookmark" hreflang="en">Great post, really helpful!</a></h3> <div class="comment__content"> <div property="schema:text" class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item">Great post, really helpful!</div> </div> </div> </article> <article role="article" data-comment-user-id="0" id="comment-40" about="/comment/40" typeof="schema:Comment" class="comment js-comment by-anonymous clearfix"> <span class="hidden new-indicator" data-comment-timestamp="1365665263"></span> <header> <article typeof="schema:Person" about="/user/0" class="profile"> <drupal-render-placeholder callback="flag.link_builder:build" arguments="0=user&amp;1=0&amp;2=following" token="dV8BLmhD339z_wMjaUSDxONyVEf9d6Tb-DESjU5tHGA"></drupal-render-placeholder></article> </header> <div class="comment__content-container"> <nav class="comment__links"><drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=40&amp;1=default&amp;2=en&amp;3=" token="8RxD22SSj5vnfxJTLnnbwsswMZnJXz7H4QvoCZiQGPQ"></drupal-render-placeholder></nav> <div class="comment__meta"> <span>Submitted by <span rel="schema:author"><span lang="" typeof="schema:Person" property="schema:name" datatype="">Anonymous (not verified)</span></span> Thu, 04/11/2013 - 04:27 <span property="schema:dateCreated" content="2013-04-11T07:27:43+00:00" class="rdf-meta hidden"></span> </span> </div> <h3 property="schema:name" datatype="" class="title"><a href="/comment/40#comment-40" class="permalink" rel="bookmark" hreflang="en">Thanks!</a></h3> <div class="comment__content"> <div property="schema:text" class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item">Thanks for great tips, Simon! You probably saved me from several hours' work. :)</div> </div> </div> </article> <article role="article" data-comment-user-id="0" id="comment-42" about="/comment/42" typeof="schema:Comment" class="comment js-comment by-anonymous clearfix"> <span class="hidden new-indicator" data-comment-timestamp="1377566693"></span> <header> <article typeof="schema:Person" about="/user/0" class="profile"> <drupal-render-placeholder callback="flag.link_builder:build" arguments="0=user&amp;1=0&amp;2=following" token="dV8BLmhD339z_wMjaUSDxONyVEf9d6Tb-DESjU5tHGA"></drupal-render-placeholder></article> </header> <div class="comment__content-container"> <nav class="comment__links"><drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=42&amp;1=default&amp;2=en&amp;3=" token="jTyXG9yPp5HG-5eFR3y5lHxuBvcV4a0q5S4t0pXGl_g"></drupal-render-placeholder></nav> <div class="comment__meta"> <span>Submitted by <span rel="schema:author"><span lang="" typeof="schema:Person" property="schema:name" datatype="">Anonymous (not verified)</span></span> Mon, 08/26/2013 - 22:24 <span property="schema:dateCreated" content="2013-08-27T01:24:53+00:00" class="rdf-meta hidden"></span> </span> </div> <h3 property="schema:name" datatype="" class="title"><a href="/comment/42#comment-42" class="permalink" rel="bookmark" hreflang="en">Works perfectly!</a></h3> <div class="comment__content"> <div property="schema:text" class="clearfix text-formatted field field--name-comment-body field--type-text-long field--label-hidden field__item">Did the steps using Miktex 2.9 and Texnic Center 2.0 Beta and everything worked like a charm following the provided steps!!</div> </div> </div> </article> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=27&amp;2=comment&amp;3=comment" token="TA0hR5mKqqgyHVFJ9N2hid4Y-krX49ZXWc4IWg3H7iI"></drupal-render-placeholder> </section> Mon, 27 Jun 2011 21:02:49 +0000 SimonSilk 27 at http://simonsilk.com