<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>A blog about LaTeX, Linux and FreeBSD</title>
	<atom:link href="http://alexkrispin.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexkrispin.wordpress.com</link>
	<description></description>
	<lastBuildDate>Fri, 27 Apr 2012 23:33:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='alexkrispin.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>A blog about LaTeX, Linux and FreeBSD</title>
		<link>http://alexkrispin.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://alexkrispin.wordpress.com/osd.xml" title="A blog about LaTeX, Linux and FreeBSD" />
	<atom:link rel='hub' href='http://alexkrispin.wordpress.com/?pushpress=hub'/>
		<item>
		<title>[Update] A script to automate the installation of TeXLive 2011 on Ubuntu</title>
		<link>http://alexkrispin.wordpress.com/2011/08/16/update-a-script-to-automate-the-installation-of-texlive-2011-on-ubuntu/</link>
		<comments>http://alexkrispin.wordpress.com/2011/08/16/update-a-script-to-automate-the-installation-of-texlive-2011-on-ubuntu/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 15:20:22 +0000</pubDate>
		<dc:creator>alexandre krispin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://alexkrispin.wordpress.com/?p=632</guid>
		<description><![CDATA[About the installation of TeXlive 2011 (general matters) The previous script to install TeXLive 2010 worked fine to install TeXLive 2011 on Ubuntu The previous script to install TeXLive 2010 worked quite fine to install TeXLive 2011, I just had to modify a few things to get settings working correctly. Since I have Kubuntu Natty <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=632&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>About the installation of TeXlive 2011 (general matters)</h3>
<p><del datetime="2011-08-16T22:38:23+00:00">The previous script to install TeXLive 2010 worked fine to install TeXLive 2011 on Ubuntu</del> The previous script to install TeXLive 2010 worked quite fine to install TeXLive 2011, I just had to modify a few things to get settings working correctly. Since I have Kubuntu Natty (11.04), I had to install zenity, but it is just a minor issue. Maybe one day I will write a program more sophisticated with Python, but nothing sure by now.</p>
<p>If you are interested, you are welcome to download this script by clicking <a href="http://www.2shared.com/file/eZSpENE3/install_update_texlive.html">here</a>.</p>
<p>For further informations, I encourage you to refer to the previous post :<br />
<a href="http://alexkrispin.wordpress.com/2010/10/12/a-script-to-automate-the-installation-of-texlive-2010/" title="A script to automate the installation of TeXLive 2010 on Ubuntu">A script to automate the installation of TeXLive 2010 on Ubuntu</a></p>
<p>Though the script contain other instructions to install TeXlive on Archlinux, I have not tested it on this platform, only on Kubuntu 11.04.</p>
<h3>More updates for LuaLaTeX users</h3>
<p>Finally, if you use LuaLaTeX to compile your documents, you might be interested in further updates from TLContrib. In particular, at the time I am writing this blog post, a newer version of the microtype package is available.</p>
<p>To install packages from TLContrib you can refer to <a href="http://tlcontrib.metatex.org/usage.html"> the official site</a> or to <a href="http://alexkrispin.wordpress.com/2010/10/12/a-script-to-automate-the-installation-of-texlive-2010/" title="A script to automate the installation of TeXLive 2010 on Ubuntu">my previous blog post</a>.</p>
<p>Basically you have to call tmlgr by the following command (depending on your computer&#8217;s architecture, mine is 64bit)<br />
<code>sudo /usr/local/texlive/2011/bin/x86_64-linux/tlmgr --gui</code><br />
And then, you have to write the repository of TLContrib by loading an other repository (in the menu : tlmgr &#8211;&gt; Load other repository, and then push the button &#8220;Update all installed&#8221;)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexkrispin.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexkrispin.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexkrispin.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexkrispin.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/alexkrispin.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/alexkrispin.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/alexkrispin.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/alexkrispin.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexkrispin.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexkrispin.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexkrispin.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexkrispin.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexkrispin.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexkrispin.wordpress.com/632/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=632&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://alexkrispin.wordpress.com/2011/08/16/update-a-script-to-automate-the-installation-of-texlive-2011-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c525bdd7a10e1af7026c8b55a2d9a50d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexkrispin</media:title>
		</media:content>
	</item>
		<item>
		<title>Writing with Emacs and AucTeX part 2</title>
		<link>http://alexkrispin.wordpress.com/2010/10/25/writing-with-emacs-and-auctex-part-2/</link>
		<comments>http://alexkrispin.wordpress.com/2010/10/25/writing-with-emacs-and-auctex-part-2/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 18:33:12 +0000</pubDate>
		<dc:creator>alexandre krispin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://alexkrispin.wordpress.com/?p=479</guid>
		<description><![CDATA[Here I will describe some tips that I have learned during the period I have been trying Emacs. But again, I recommend Vim if you want to be efficient, although the choice of your text editor might depend on your habits, your relationships or people who influence you. I won&#8217;t repeat some features already pointed <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=479&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here I will describe some tips that I have learned during the period I have been trying Emacs. But again, I recommend Vim if you want to be efficient, although the choice of your text editor might depend on your habits, your relationships or people who influence you. I won&#8217;t repeat some features already pointed earlier in the first part of my post, so if you want to get information about snippets, abbrev mode and completion-ui, look at the first part.</p>
<p>For the following basic tips I assume that you use the configuration I have set and briefly described previously. If you don&#8217;t want to use my configuration and are a beginner, then use easymacs. To use it, look <a href="http://www.dur.ac.uk/p.j.heslin/Software/Emacs/Easymacs/index.php">here</a>.</p>
<blockquote><p>C-_             :   undo<br />
C-x C-_       :   redo</p></blockquote>
<p>Notice that C-* means to press the control key and the * key. Also for example if you want to redo something, you will have to press the control key and &#8220;x&#8221; in the same time, and then control key again with the _ key in the same time.</p>
<blockquote><p>C-h m   : list of command you can use in your buffer.<br />
C-h k    : to get help for a shortcut<br />
C-h f     : help to describe a function<br />
C-space or C-@		: sets a mark to mark a block of text</p></blockquote>
<p>Notice that if you use ibus to write in japanese, chinese, arabic or any other language, you will have to use C-@, since C-space is a shortcut calling ibus.</p>
<blockquote><p>Ctrl-v       : page forward<br />
Esc v        : page back<br />
Esc q        : fill (reformat) paragraph<br />
ESC x	: allows you to enter a command by spelling it out (typing a space will complete a non-ambigous partial command)<br />
C-c C-c      : compile<br />
C-c C-v      : viewer<br />
Time-stamp: : writing it at the beginning of a file allow you to get the last time when saved your file</p></blockquote>
<p>Notice 2 things. The first is that C-c C-c will compile your files with xelatex since it is the way I compile all my files. Secondly, writing Time-stamp:  is useful if you want to know easily the date when you last modified a file. And if you want to use it, you should write a snippet to write it automatically with a template or a simple command.</p>
<blockquote><p>C-w    : cut<br />
ESC w : copy<br />
C-y     : paste<br />
M-^    : merge two lines (or in other words delete indentation)<br />
alt+shift+\% : replace<br />
alt+shift+\%, replace, then if ! is pressed, all strings are replaced<br />
C-i or C-q C-i : indent<br />
C-z     : minimize the window</p></blockquote>
<p>Notice that I have used C-z with Gnome (Ubuntu 10.04), and I don&#8217;t know the effect in other operating systems like Microsoft Windows.</p>
<blockquote><p>C-c C-c : compile<br />
C-c C-v : view with evince the pdf produced after you compiled the file<br />
C-x C-c : quit emacs<br />
C-x C-s : save your file<br />
C-x C-f : open a new file<br />
M-x dired : open the file browser in emacs</p></blockquote>
<p>Notice that these commands are the basics, and if you don&#8217;t know the basics you should look at the following websites :<br />
<a href="http://www-uxsup.csx.cam.ac.uk/courses/Emacs/index.html">An Emacs introduction course</a><br />
<a href="http://www.columbia.edu/acis/publications/emacs.html">A quick guide</a><br />
<a href="http://mally.stanford.edu/~sr/computing/emacs.html">Emacs basics</a><br />
<a href="http://www.emacswiki.org/">The Emacs wiki</a><br />
<a href="http://xahlee.org/emacs/emacs.html">A really good tutorial</a><br />
<a href="http://refcards.com/refcard/gnu-emacs-gildeas">A reference card</a><br />
<a href="http://clx.anet.fr/spip/article.php3?id_article=181">For french users look here</a> and <a href="http://www.tuteurs.ens.fr/unix/editeurs/emacs_memo.html">also here</a><br />
<a href="http://www.freebsd.org/doc/en/books/developers-handbook/emacs.html">A page from the FreeBSD developer&#8217;s handbook</a><br />
Finally, if you are interested in ESS, look <a href="http://sites.google.com/site/andreaskiermeier/essmaterials">here</a>.</p>
<p>The following is a brief description of what you can do with my configuration (since I don&#8217;t use anymore Emacs, I may have forgotten some things I have done) :</p>
<ul>
<li>Compiling with Emacs will be done automatically with XeLaTeX (the default compiler)</li>
<li>ispell is configured for english and french</li>
<li>you can configure your own pdf viewer, but default is evince</li>
<li>there is a template system, with yasnipets.</li>
<li>you can use gnuplot in emacs (see the first part of this post for more details)</li>
<li>there is a tabbar to easily switch from a buffer to another one and see them</li>
<li>you can see all recently opened files in the menu</li>
<li>you can get fullscreen</li>
<li>you can get abbreviation working with Emacs, and auto-completion</li>
<li>there is a time stamp system to insert time at the beginning of the files</li>
<li>and maybe some others things that I don&#8217;t remember</li>
</ul>
<p>In any case, I prefer Vim, and I think that auto-completion with Vim is better, and abbreviations easier to configure.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexkrispin.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexkrispin.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexkrispin.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexkrispin.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/alexkrispin.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/alexkrispin.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/alexkrispin.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/alexkrispin.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexkrispin.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexkrispin.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexkrispin.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexkrispin.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexkrispin.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexkrispin.wordpress.com/479/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=479&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://alexkrispin.wordpress.com/2010/10/25/writing-with-emacs-and-auctex-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c525bdd7a10e1af7026c8b55a2d9a50d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexkrispin</media:title>
		</media:content>
	</item>
		<item>
		<title>Writing with Emacs and AucTeX part 1</title>
		<link>http://alexkrispin.wordpress.com/2010/10/25/writing-with-emacs-and-auctex-part-1/</link>
		<comments>http://alexkrispin.wordpress.com/2010/10/25/writing-with-emacs-and-auctex-part-1/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 18:29:27 +0000</pubDate>
		<dc:creator>alexandre krispin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://alexkrispin.wordpress.com/?p=456</guid>
		<description><![CDATA[The purpose of this post is to explain my setup for GNU/Emacs I made during the period I got a try to it to write files compiled with XeLaTeX. First, here is not a place where I want to restart the childish &#8220;war editor&#8221;. Like the &#8220;FreeBSD vs Linux&#8221;, it would make no sense. Be <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=456&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The purpose of this post is to explain my setup for GNU/Emacs I made during the period I got a try to it to write files compiled with XeLaTeX. First, here is not a place where I want to restart the childish &#8220;war editor&#8221;. Like the &#8220;FreeBSD vs Linux&#8221;, it would make no sense. Be sure that if you find a post about Emacs criticizing Vim, even if they are hosted by websites which seems serious, you should not pay attention to them. Of course, in these posts like, say, <a href="http://www.charlietanksley.net/philtex/emacs-an-advertisment/">&#8220;Emacs: an advertisement&#8221; at charlietanksley.net</a>, some criticize the &#8220;unin­tu­itive way that Vim forces you to move around&#8221;. The only advice someone should tell is : make your own choice after trying both text editors. Also, I personally recommend Vim.</p>
<ol>
<li>If you plan to use Emacs, since I had problem with Ubuntu 10.04, I recommend not to install it from you package manager, but from the official website. The download link is the following :
<p><a href="http://ftp.gnu.org/gnu/emacs/">choose emacs-23.2.tar.bz2</a></p>
<p>f you are not familiar with Unix command, then save your emacs version in you home (/home/username, where username is the name of your computer). To install it, you will have to use the terminal (press alt+F2 and enter gnome-terminal in the prompt). Then, enter the following commands :</p>
<p><code>cd ~<br />
tar xjvf emacs-23.2.tar.bz2<br />
cd emacs-23.2<br />
./configure<br />
make<br />
sudo make install</code></p>
<p>The installation will take some time to process.</li>
<li>After the installation has completed, you will have to download all the files I have put at <a href="http://github.com/alexandre-k/repository_alexandre_krispin/tree/master/configuration_files_for_text_editors/emacs_configuration_files/">Github</a>. To do so, you will have to use the terminal (with Ubuntu, press ctrl+t and gnome-terminal will appear), to install git if you don&#8217;t have it yet, and to download all the files at github. To do so, copy-paste the following, and type enter after all new lines :<br />
<code>cd ~<br />
sudo apt-get instal git<br />
git </code><br />
Then copy the file dot_emacs in your home (/home/username, where username is the name of your computer) and rename it as .emacs.</p>
<p>Notice that my .emacs.d contains several plugins, such as yasnippet, completion-ui, autopairs, etc.</p>
<p>Finally, I will make a short description of my file init.el, important to be aware of all configurations I have made to make emacs work like I wanted :</p>
<blockquote><p>;;##################################################################################################<br />
;;##################################################################################################</p>
<p>; LaTeX</p>
<p>;;##################################################################################################</p>
<p>; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
;; load AucTeX etc<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
(require &#8216;tex-site)<br />
(require &#8216;tex-style)<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
; To turn on RefTeX Minor Mode for all LaTeX files, and other<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
(add-hook &#8216;LaTeX-mode-hook &#8216;turn-on-reftex)   ; with AUCTeX LaTeX mode<br />
(add-hook &#8216;reftex-load-hook &#8216;imenu-add-menubar-index)<br />
(add-hook &#8216;reftex-mode-hook &#8216;imenu-add-menubar-index)</p>
<p>(add-hook &#8216;LaTeX-mode-hook<br />
&#8216;(lambda ()<br />
(setq TeX-open-quote &#8220;«~&#8221;)<br />
(setq TeX-close-quote &#8220;~»&#8221;)<br />
(auto-fill-mode t)<br />
))</p>
<p>; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
; Smart quotes<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
(setq TeX-open-quote &#8220;&lt;&lt;&#8221;) (setq TeX-close-quote &#8220;&gt;&gt;&#8221;)</p>
<p>; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
;LaTeX-math and other usefull stuff<br />
; see http://www.emacswiki.org/emacs/AUCTeX<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
(add-hook &#8216;LaTeX-mode-hook &#8216;LaTeX-math-mode)<br />
(add-hook &#8216;LaTeX-mode-hook &#8216;auto-fill-mode)<br />
(add-hook &#8216;LaTeX-mode-hook &#8216;flyspell-mode)</p>
<p>;;; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; dictionnaire &#8211; correction orthographique &#8212;&#8212;&#8212;&#8211;<br />
;(setq-default ispell-program-name &#8220;hunspell&#8221;)</p>
<p>;(add-hook &#8216;text-mode-hook<br />
;     (lambda ()<br />
;        (flyspell-mode 1)<br />
;        (ispell-change-dictionary &#8220;francais&#8221;)<br />
;        (turn-on-auto-fill)<br />
 <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
; completion, style file, or multi-file stuff work<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(setq TeX-auto-save t)<br />
(setq TeX-parse-self t)<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;;Mode PDFLatex par défaut ou non<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(setq TeX-PDF-mode t); pour mettre par défaut décommenter cette ligne et commenter celle du dessous</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;;Visualiseurs<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(setq TeX-output-view-style (quote (<br />
(&#8220;^pdf$&#8221; &#8220;.&#8221; &#8220;evince %o&#8221;)<br />
(&#8220;^ps$&#8221; &#8220;.&#8221; &#8220;gv %o&#8221;)<br />
(&#8220;^dvi$&#8221; &#8220;.&#8221; &#8220;xdvi %o&#8221;)<br />
)))<br />
(setq tex-dvi-view-command &#8220;xdvi&#8221;)<br />
(setq tex-dvi-print-command &#8220;dvips&#8221;)<br />
(setq tex-alt-dvi-print-command &#8220;dvips&#8221;)</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;; Pour aller a la ligne automatiquement<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(turn-on-auto-fill)</p>
<p>; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
; Autopairs<br />
;see http://autopair.googlecode.com/svn/trunk/autopair.el<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
(add-to-list &#8216;load-path &#8220;~/.emacs.d/lisp&#8221;)<br />
(require &#8216;autopair)<br />
(autopair-global-mode) ;; to enable in all buffers</p>
<p>;see http://www.emacswiki.org/emacs/AutoPairs#Discussion<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
(setq skeleton-pair t) ; enable pairing</p>
<p>; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
; master file<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
(setq-default TeX-master nil)<br />
TeX-master nil</p>
<p>;; ;;; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; Template &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
;; (setq load-path (cons (expand-file-name &#8220;~/.emacs.d/lisp&#8221;)<br />
;;                             load-path))<br />
;; (require &#8216;template)<br />
;; (template-initialize)<br />
;; ;;;; If you don&#8217;t want to use yasnippet, look download the tarball here :<br />
;; ;;;; voir http://emacs-template.sourceforge.net/</p>
<p>; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
; Wrapping the region in double quotes<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
(defadvice TeX-insert-quote (around wrap-region activate)<br />
(cond<br />
(mark-active<br />
(let ((skeleton-end-newline nil))<br />
(skeleton-insert `(nil ,TeX-open-quote _ ,TeX-close-quote) -1)))<br />
((looking-at (regexp-opt (list TeX-open-quote TeX-close-quote)))<br />
(forward-char (length TeX-open-quote)))<br />
(t<br />
ad-do-it)))<br />
(put &#8216;TeX-insert-quote &#8216;delete-selection nil)</p>
<p>; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
; Inserting and wrapping single quotes<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
(defun TeX-insert-single-quote (arg)<br />
(interactive &#8220;p&#8221;)<br />
(cond<br />
(mark-active<br />
(let ((skeleton-end-newline nil))<br />
(skeleton-insert<br />
`(nil ?` _ ?&#8217;) -1)))<br />
((or (looking-at &#8220;\\&lt;&#8221;)<br />
(looking-back &#8220;^\\|\\s-\\|`&#8221;))<br />
(insert &#8220;`&#8221;))<br />
(t<br />
(self-insert-command arg))))</p>
<p>(add-hook &#8216;LaTeX-mode-hook<br />
&#8216;(lambda ()<br />
(local-set-key &#8220;&#8216;&#8221; &#8216;TeX-insert-single-quote)))</p>
<p>; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
;;set xetex mode in tex/latex<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
(add-hook &#8216;LaTeX-mode-hook (lambda()<br />
(add-to-list &#8216;TeX-command-list &#8216;(&#8220;XeLaTeX&#8221; &#8220;%`xelatex%(mode)%&#8217; %t&#8221; TeX-run-TeX nil t))<br />
(setq TeX-command-default &#8220;XeLaTeX&#8221;)<br />
(setq TeX-save-query nil)<br />
(setq TeX-show-compilation t)<br />
))</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
;Whizzy TeX<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>;; (setq my-toggle-whizzy-count 0)<br />
;; (defun my-toggle-whizzy-mode ()<br />
;;   (interactive)<br />
;;   (if (= (mod my-toggle-whizzy-count 2) 0)<br />
;;       (progn<br />
;;         (whizzytex-mode)<br />
;;         (message &#8220;WhizzyTeX on&#8221;))<br />
;;     (progn<br />
;;       (whizzy-mode-off)<br />
;;       (kill-buffer (concat &#8220;*&#8221; (buffer-name) &#8220;*&#8221;))<br />
;;       (message &#8220;WhizzyTeX off&#8221;)))<br />
;;   (setq my-toggle-whizzy-count (+ my-toggle-whizzy-count 1)))</p>
<p>;; (add-hook &#8216;LaTeX-mode-hook<br />
;;           (lambda ()<br />
;;             (define-key LaTeX-mode-map (kbd &#8220;&#8221;) &#8216;my-toggle-whizzy-mode)))</p></blockquote>
<p>This first part load AucTeX when a .tex file is opened, turn on reftex, enable hook for math, turn on pdf by default instead of dvi, command AucTeX to use evince as pdf viewer, gv for postscript and xdvi for dvi, automatically close bracket or complete the other bracket once you have opened one, etc.</p>
<p>Notice that some things which you might think useful are commented, such as whizzy tex and flyspell. Therefore you will have to uncomment it if you want to use it.</p>
<p>One other important thing for me is to unable compilation for XeLaTeX. For this reason, XeLaTeX is the default setting.</p>
<blockquote><p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
;Yasnippet<br />
;; Auto completion / snippets<br />
(add-to-list &#8216;load-path &#8220;~/.emacs.d/lisp/yasnippet.el&#8221;)<br />
(require &#8216;yasnippet)<br />
(setq yas/root-directory &#8220;~/.emacs.d/snippets&#8221;)<br />
(yas/load-directory yas/root-directory)<br />
(yas/global-mode)<br />
(define-key global-map [f6] &#8216;yas/expand)<br />
(require &#8216;dropdown-list)</p>
<p>;;       (setq yas/prompt-functions &#8216;(yas/dropdown-prompt<br />
;;                                    yas/ido-prompt<br />
;;                                    yas/completing-prompt))</p></blockquote>
<p>Yasnippet is used by default. For this reason, if you want to use it and want to know what are the files available, just look at the menu :</p>
<p><a href="http://alexkrispin.files.wordpress.com/2010/09/yasnippet-menu.png"><img class="alignnone size-large wp-image-471" title="yasnippet menu" src="http://alexkrispin.files.wordpress.com/2010/09/yasnippet-menu.png?w=792&#038;h=444" alt="" width="792" height="444" /></a></p>
<blockquote><p>;;##################################################################################################<br />
;;                ;; GNUPlot<br />
;;##################################################################################################<br />
(add-to-list &#8216;load-path &#8220;~/emacs.d/lisp/&#8221;)<br />
(autoload &#8216;gnuplot-mode &#8220;gnuplot&#8221; &#8220;gnuplot major mode&#8221; t)<br />
(autoload &#8216;gnuplot-make-buffer &#8220;gnuplot&#8221; &#8220;open a buffer in gnuplot mode&#8221; t)</p>
<p>;; this line automatically causes all files with the .gp extension to<br />
;; be loaded into gnuplot mode<br />
(setq auto-mode-alist (append &#8216;((&#8220;\\.gp$&#8221; . gnuplot-mode)) auto-mode-alist))</p>
<p>;; This line binds the function-9 key so that it opens a buffer into<br />
;; gnuplot mode<br />
(global-set-key [(f9)] &#8216;gnuplot-make-buffer)</p>
<p>;;##################################################################################################<br />
;;                 key board / input method settings<br />
;;##################################################################################################</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;; key board / input method settings<br />
(setq locale-coding-system &#8216;utf-8)<br />
(set-terminal-coding-system &#8216;utf-8)<br />
(set-keyboard-coding-system &#8216;utf-8)<br />
(set-language-environment &#8216;UTF-8)       ; prefer utf-8 for language settings<br />
(setq read-quoted-char-radix 10)         ; use decimal, not octal<br />
(load-library &#8220;iso-transl&#8221;) ; for accent ^<br />
;see http://tldp.org/HOWTO/Keyboard-and-Console-HOWTO-12.html<br />
;http://www.docmirror.net/fr/linux/howto/hardware/Keyboard-and-Console-HOWTO/Keyboard-and-Console-HOWTO-8.html<br />
;http://www.faqs.org/docs/Linux-HOWTO/Keyboard-and-Console-HOWTO.html<br />
;(iso-accents-customize french)<br />
;;; Pour le clavier<br />
;(load-library &#8220;iso-ascii&#8221;)<br />
;(load-library &#8220;iso-insert&#8221;)<br />
;(iso-accents-mode)</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;Keyboard shortcuts<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(add-to-list &#8216;load-path &#8220;~/.emacs.d/lisp/&#8221;)<br />
(require &#8216;redo)<br />
(define-key global-map (kbd &#8220;C-_&#8221;) &#8216;undo)<br />
(define-key global-map (kbd &#8220;C-x C-_&#8221;) &#8216;redo)<br />
;if you want to keep the C-w, M-w, and C-y original settings, there is a way is to bind cut,<br />
;copy and past keys by using the default X11 :<br />
;http://www.emacswiki.org/emacs/CopyAndPaste<br />
;; (global-set-key [(shift delete)] &#8216;clipboard-kill-region)<br />
;; (global-set-key [(control insert)] &#8216;clipboard-kill-ring-save)<br />
;; (global-set-key [(shift insert)] &#8216;clipboard-yank)</p>
<p>;;######################################################################################################<br />
;; MENUS, BUFFERS&#8230;<br />
;;######################################################################################################<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;;disable menu, toolbar, scrollbar<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(tool-bar-mode -1)<br />
(toggle-scroll-bar -1)<br />
;(set-scroll-bar-mode &#8216;right)                                    ;;スクロールバーを右に表示<br />
(menu-bar-mode 1)<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;menu avec les buffer dans une tabbar<br />
; thanks to http://www.emacswiki.org/emacs/TabBarMode<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(add-to-list &#8216;load-path &#8220;/usr/share/emacs/site-lisp/emhacks&#8221;)<br />
(require &#8216;tabbar)<br />
(tabbar-mode 1)</p>
<p>;; the following is taken from http://d.hatena.ne.jp/alfad/20100425/1272208744<br />
;; 左に表示されるボタンを無効化<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;(setq tabbar-home-button-enabled &#8220;&#8221;)<br />
;(setq tabbar-scroll-left-button-enabled &#8220;&#8221;)<br />
;(setq tabbar-scroll-right-button-enabled &#8220;&#8221;)<br />
(setq tabbar-scroll-left-button-disabled &#8220;&#8221;)<br />
(setq tabbar-scroll-right-button-disabled &#8220;&#8221;)</p>
<p>;; Firefoxライクなキーバインドに<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(global-set-key [(f8)] &#8216;tabbar-forward)<br />
(global-set-key [(f7)] &#8216;tabbar-backward)</p>
<p>;all tabs is just one group<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(setq tabbar-buffer-groups-function<br />
(lambda ()<br />
(list &#8220;All&#8221;))) ;; code by Peter Barabas</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
; one more item n the menu for new files<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>(define-key menu-bar-file-menu [new-file]<br />
&#8216;(menu-item &#8220;New&#8230;&#8221; find-file<br />
:enable (menu-bar-non-minibuffer-window-p)<br />
:help &#8220;Specify a new file&#8217;s name, to edit the file&#8221;))</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;; A list of recent files<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>(require &#8216;recentf)<br />
(setq recentf-exclude &#8216;(&#8220;^/ftp.*&#8221; &#8220;^/ssh.*&#8221; &#8220;^/private.*&#8221; ))<br />
(setq recentf-save-file &#8220;~/.emacs.d/recentf&#8221;)<br />
(recentf-mode 1)</p>
<p>;; GS-05/07/2006-12:15<br />
;; http://www.emacswiki.org/cgi-bin/wiki/RecentFiles#toc6<br />
(defun recentf-interactive-complete ()<br />
&#8220;find a file in the recently open file using iswitchb for completion&#8221;<br />
(interactive)<br />
(let* ((all-files recentf-list)<br />
(file-assoc-list (mapcar (lambda (x) (cons (file-name-nondirectory x) x)) all-files))<br />
(filename-list (remove-duplicates (mapcar &#8216;car file-assoc-list) :test &#8216;string=))<br />
(iswitchb-make-buflist-hook<br />
(lambda ()<br />
(setq iswitchb-temp-buflist filename-list)))<br />
(filename (iswitchb-read-buffer &#8220;Find Recent File: &#8220;))<br />
(result-list (delq nil (mapcar (lambda (x) (if (string= (car x) filename) (cdr x))) file-assoc-list)))<br />
(result-length (length result-list)))<br />
(find-file<br />
(cond<br />
((= result-length 0) filename)<br />
((= result-length 1) (car result-list))<br />
( t<br />
(let ( (ido-make-buffer-list-hook<br />
(lambda ()<br />
(setq iswitchb-temp-buflist result-list))))<br />
(iswitchb-read-buffer (format &#8220;%d matches:&#8221; result-length))))<br />
))))</p>
<p>;; to open recent files with keyboard<br />
;;(global-set-key &#8220;\C-x\C-r&#8221; &#8216;recentf-open-files-compl)<br />
(global-set-key &#8220;\C-x\C-r&#8221; &#8216;recentf-interactive-complete)</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;; the minibuffer<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(setq<br />
enable-recursive-minibuffers nil         ;;  allow mb cmds in the mb<br />
max-mini-window-height .25             ;;  max 2 lines<br />
minibuffer-scroll-window nil<br />
resize-mini-windows nil)</p>
<p>;(icomplete-mode t)                       ;; completion in minibuffer<br />
;; (setq<br />
;;   icomplete-prospects-height 1           ;; don&#8217;t spam my minibuffer<br />
;;   icomplete-compute-delay 0)             ;; don&#8217;t wait<br />
;; (require &#8216;icomplete+ nil &#8216;noerror)       ;; drew adams&#8217; extras</p></blockquote>
<p>The first part is for Gnuplot, then for the encoding (utf-8). Notice that at the line 211, I load something to get the dead key working for accent circumflex with an azerty keyboard. Also, I have a shortcut to undo and redo an action, a setup for the menu, the toolbar and the scrollbar, a setup for the tabbar, etc.</p>
<blockquote><p>;;################################################################################################<br />
;; FULLSCREEN : appuyer sur F11<br />
;;thanks to http://www.emacswiki.org/emacs/FullScreen<br />
;;################################################################################################</p>
<p>; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;F11 is for fullscreen<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(defun fullscreen (&amp;optional f)<br />
(interactive)<br />
(set-frame-parameter f &#8216;fullscreen<br />
(if (frame-parameter f &#8216;fullscreen) nil &#8216;fullboth)))</p>
<p>(global-set-key [f11] &#8216;fullscreen)</p>
<p>(add-hook &#8216;after-make-frame-functions &#8216;fullscreen)<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;Send X Messages to the Window Manager<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(defun fullscreen ()<br />
(interactive)<br />
(x-send-client-message nil 0 nil &#8220;_NET_WM_STATE&#8221; 32<br />
&#8216;(2 &#8220;_NET_WM_STATE_FULLSCREEN&#8221; 0)))</p>
<p>; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
; fullscreen mode<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(run-with-idle-timer 0.1 nil &#8216;fullscreen)</p>
<p>; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;To maximize the window only, uncomment<br />
; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(defun fullscreen (&amp;optional f)<br />
(interactive)<br />
(x-send-client-message nil 0 nil &#8220;_NET_WM_STATE&#8221; 32<br />
&#8216;(2 &#8220;_NET_WM_STATE_MAXIMIZED_VERT&#8221; 0))<br />
(x-send-client-message nil 0 nil &#8220;_NET_WM_STATE&#8221; 32<br />
&#8216;(2 &#8220;_NET_WM_STATE_MAXIMIZED_HORZ&#8221; 0)))</p>
<p>;;#################################################################################################<br />
;;                          		   MOUSE, CURSOR<br />
;;#################################################################################################</p>
<p>(mouse-wheel-mode t)<br />
(setq scroll-conservatively 10000)</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;; If you like to get a scroll one line at a time (less &#8220;jumpy&#8221; than defaults), uncomment<br />
;;thanks to http://www.emacswiki.org/emacs/SmoothScrolling<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;  (setq mouse-wheel-scroll-amount &#8216;(1 ((shift) . 1))) ;; one line at a time</p>
<p>(setq mouse-wheel-progressive-speed nil) ;; don&#8217;t accelerate scrolling<br />
;     (setq mouse-wheel-progressive-speed true) ;;accelerate scrolling</p>
<p>;(setq mouse-wheel-follow-mouse &#8216;t) ;; scroll window under mouse</p>
<p>;(setq scroll-step 1) ;; keyboard scroll one line at a time<br />
;(setq scroll-step 0) ;; keyboard don&#8217;t scroll one line at a time</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
; Molette de la souris<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(defun up-slightly () (interactive) (scroll-up 5))<br />
(defun down-slightly () (interactive) (scroll-down 5))<br />
(global-set-key [mouse-4] &#8216;down-slightly)<br />
(global-set-key [mouse-5] &#8216;up-slightly)<br />
(defun up-one () (interactive) (scroll-up 1))<br />
(defun down-one () (interactive) (scroll-down 1))<br />
(global-set-key [S-mouse-4] &#8216;down-one)<br />
(global-set-key [S-mouse-5] &#8216;up-one)<br />
(defun up-a-lot () (interactive) (scroll-up))<br />
(defun down-a-lot () (interactive) (scroll-down))<br />
(global-set-key [C-mouse-4] &#8216;down-a-lot)<br />
(global-set-key [C-mouse-5] &#8216;up-a-lot)</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;; curseur en barre et non clignotant<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;;(setq cursor-type &#8216;bar) -&gt; default-frame-alist<br />
(blink-cursor-mode 0)<br />
;;(set-cursor-color &#8220;black&#8221;)</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
; Laisser le curseur en place lors d&#8217;un défilement par pages.<br />
; Par défaut, Emacs place le curseur en début ou fin d&#8217;écran<br />
; selon le sens du défilement.<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>;(setq scroll-preserve-screen-position t)</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;; Use box cursor for overwrite-mode, and red cursor for quail active input.<br />
;;thanks to http://www.jurta.org/en/emacs/dotemacs<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(defun my-change-cursor ()<br />
&#8220;Change cursor color and type depending on insertion mode and input method.&#8221;<br />
(set-cursor-color<br />
(cond (current-input-method &#8220;red3&#8243;) ; &#8220;AntiqueWhite4&#8243;<br />
((eq (frame-parameter (selected-frame) &#8216;background-mode) &#8216;dark)<br />
&#8220;DarkGrey&#8221;)<br />
(t                    &#8220;black&#8221;)))<br />
(setq default-cursor-type ;; set-cursor-type<br />
(cond (overwrite-mode       &#8216;box)<br />
(t                    &#8216;bar))))<br />
(add-hook &#8216;post-command-hook &#8216;my-change-cursor)</p>
<p>;;###########################################################################################################<br />
;;                 		Title bar<br />
;;###########################################################################################################</p>
<p>(setq frame-title-format &#8216;(buffer-file-name &#8220;Emacs: %b (%f)&#8221; &#8220;Emacs: %b&#8221;)) ;CHEMIN COMPLET DANS LA BARRE DE TITRE</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;; de jolis noms pour les buffers sur un meme *nom* de fichier<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(require &#8216;uniquify)<br />
(setq uniquify-buffer-name-style &#8216;post-forward-angle-brackets)</p></blockquote>
<p>Here is the setup for fullscreen mode, the mouse, the cursor, the title.</p>
<blockquote><p>;;##################################################################################################<br />
;;Writing<br />
;;##################################################################################################</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
;; Complétion automatique<br />
;;Work in progress<br />
;;see http://www.dr-qubit.org/emacs.php<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(abbrev-mode t) ; completion automatique<br />
(global-set-key (quote [tab]) (quote dabbrev-expand))</p>
<p>(setq default-abbrev-mode t)<br />
(define-abbrev-table &#8216;global-abbrev-table &#8216;(<br />
(&#8220;\.\.\.&#8221; &#8220;\ldots&#8221; nil)<br />
(&#8220;letat&#8221; &#8220;l&#8217;État&#8221; nil)<br />
(&#8220;comeur&#8221; &#8220;Commission Européenne&#8221; t 4)<br />
(&#8220;coneur&#8221;"Conseil Européen&#8221; nil)<br />
))</p>
<p>;; ;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
;; ;to enable or disable completion-ui, comment or uncomment the following lines<br />
(add-to-list &#8216;load-path &#8220;~/.emacs.d/completion-ui/&#8221;)<br />
(require &#8216;completion-ui)<br />
(auto-completion-mode)<br />
;(global-set-key [?\M-/] &#8216;complete-dabbrev)</p>
<p>;; ;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
;; ;auto-complete-mode</p>
<p>;; (setq dabbrev-case-replace nil)<br />
;; (add-to-list &#8216;load-path &#8220;~/.emacs.d/lisp/auto-complete-1.3&#8243;)<br />
;; (add-to-list  &#8216;load-path &#8220;~/.emacs.d/lisp/auto-complete-1.3/dict&#8221;)<br />
;; (require &#8216;auto-complete-config)<br />
;; (auto-complete-mode)<br />
;; (ac-config-default)</p>
<p>;; ;(require &#8216;auto-complete)<br />
;; ;(setq ac-auto-start 1)<br />
;; ;(require &#8216;auto-complete-config)<br />
;; (require &#8216;popup)<br />
;; ;(require &#8216;fuzzy)<br />
;; (global-auto-complete-mode t)<br />
;; (setq ac-auto-start t)<br />
;; ;(autoload &#8216;auto-complete-mode t)</p>
<p>;; ;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
;predictive<br />
;; predictive install location<br />
;;   (add-to-list &#8216;load-path &#8220;~/.emacs.d/predictive/&#8221;)<br />
;;   ;; dictionary locations<br />
;;   (add-to-list &#8216;load-path &#8220;~/.emacs.d/predictive/latex/&#8221;)<br />
;;   (add-to-list &#8216;load-path &#8220;~/.emacs.d/predictive/texinfo/&#8221;)<br />
;;   (add-to-list &#8216;load-path &#8220;~/.emacs.d/predictive/html/&#8221;)<br />
;;   ;; load predictive package<br />
;;   (require &#8216;predictive)<br />
;; (autoload &#8216;predictive-mode &#8220;~/.emacs.d/predictive/predictive&#8221;<br />
;;             &#8220;Turn on Predictive Completion Mode.&#8221; t)</p></blockquote>
<p>Here is the setup for autocompletion. You will notice that there are several ways to get autocompletion with Emacs. The first, really great (though all features that I discussed here might be great), is the abbrev mode. So if you often type a word, define an abbreviation. Say, a french word, &#8220;l&#8217;État&#8221;. Writing l&#8217;État is painful with an azerty keyboard : you have to press l&#8221;&#8216;&#8221;, then the caps lock key, then press &#8220;é&#8221;, then again caps lock key, and then &#8220;tat&#8221;. Defining letat allow you to get l&#8217;État when typing space after to have writen letat. Really great.</p>
<p>Completion-ui is another really great completion utility for emacs. For more details, look at the <a href="http://www.emacswiki.org/emacs/CompletionUI">Emacs wiki</a>. The other ways of completion, such as &#8220;predictive mode&#8221;, are also well explained in the Emacs wiki, therefore I won&#8217;t describe them.</p>
<blockquote>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
;;                  SUPPRIME TOUS LES ESPACES EN FIN DE LIGNE<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>(autoload &#8216;nuke-trailing-whitespace &#8220;whitespace&#8221; nil t)</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
  			;Wrap Long Lines By Word Boundary<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
  (global-visual-line-mode 1) ; 1 for on, 0 for off.</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
;     			  TEXT AND AUTO FILL MODE<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>(setq default-major-mode &#8216;text-mode)<br />
(add-hook &#8216;text-mode-hook &#8216;text-mode-hook-identify)<br />
(add-hook &#8216;text-mode-hook &#8216;turn-on-auto-fill)</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
;; PARENTHESE MATCHING, PERMET DE VERIFIER AU FUR ET À MESURE DE LA FRAPPE QUE<br />
;; L&#8217;ON FERME BIEN CE QUE L&#8217;ON OUVRE, AUSSI BIEN POUR LES PARENTHÈSES QUE LES<br />
;; CROCHETS OU LES ACCOLADES.<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>(require &#8216;paren)<br />
(show-paren-mode 1)<br />
(setq-default hilight-paren-expression t)
</p></blockquote>
<p>Here are some useful settings for editing, like the feature to automatically format your text, insert the closing parenthesis when you have inserted the opening one, etc.</p>
<blockquote><p>
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
				;;TIME STAMPS<br />
				;;thanks to http://www.djcbsoftware.nl/dot-emacs.html<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
;;Emacs permet d&#8217;insérer automatiquement des time stamps, typiquement<br />
;;pour indiquer la date de dernière modification d&#8217;un fichier.<br />
;;Pour utiliser les time stamps, indiquer dans les 8 premières lignes d&#8217;un fichier ceci :<br />
;;Time-stamp:<br />
(setq ;; when there&#8217;s &#8220;Time-stamp: &#8221; in the first 10 lines of the file<br />
  time-stamp-active t        ; do enable time-stamps<br />
  time-stamp-line-limit 10   ; check first 10 buffer lines for Time-stamp:<br />
  time-stamp-format &#8220;%04y-%02m-%02d %02H:%02M:%02S (%u)&#8221;) ; date format<br />
(add-hook &#8216;write-file-hooks &#8216;time-stamp) ; update when saving
</p></blockquote>
<p>If you want to have the time displayed at the beginning of your file, insert &#8220;Time-stamp: &#8220;, and save your file. It will add automatically the date.</p>
<blockquote><p>;;################################################################################<br />
            ;; File browser<br />
;;################################################################################</p>
<p>(setq dired-ls-F-marks-symlinks t)<br />
(defun my-dired-mode-init ()<br />
  (hl-line-mode 1)<br />
  (setq truncate-lines t))<br />
(add-hook &#8216;dired-mode-hook &#8216;my-dired-mode-init)<br />
;; Image viewer.<br />
(when (require &#8216;image-mode nil)<br />
  (defun my-image-next-by-number ()<br />
    (interactive)<br />
    (let ((file-name (buffer-file-name))<br />
      base num suffix<br />
      num-width fmt)<br />
      (unless (string-match<br />
           &#8220;^\\(.*[^0-9-]\\)?\\(?:[0-9]+-\\)?\\([0-9]+\\)\\(\\.[^.]+\\)?$&#8221;<br />
           file-name)<br />
    (error &#8220;Improper file name&#8221;))<br />
      (setq base (match-string 1 file-name))<br />
      (setq num (match-string 2 file-name))<br />
      (setq suffix (match-string 3 file-name))<br />
      (setq num-width (length num))<br />
      (setq fmt (format &#8220;%%s%%0%dd%%s&#8221; num-width))<br />
      (setq num (1+ (string-to-number num)))<br />
      (setq file-name (format fmt base num suffix))<br />
      (unless (file-exists-p file-name)<br />
    (setq fmt (format &#8220;%%s%%0%dd-*%%s&#8221; num-width))<br />
    (setq file-name (format fmt base num suffix))<br />
    (setq file-name (file-expand-wildcards file-name))<br />
    (if file-name<br />
        (setq file-name (car file-name))<br />
      (error &#8220;No more files&#8221;)))<br />
      (find-alternate-file file-name)))<br />
  (defun my-image-scroll-up-or-next-by-number ()<br />
    (interactive)<br />
    (let* ((image (image-get-display-property))<br />
       (edges (window-inside-edges))<br />
       (win-height (- (nth 3 edges) (nth 1 edges)))<br />
       (img-height (ceiling (cdr (image-size image)))))<br />
      (if (= (window-end) (point-max))<br />
             (goto-char (point-max))<br />
           (View-scroll-page-forward-set-page-size))))<br />
     (define-key view-mode-map [(meta up)]<br />
       (lambda ()<br />
         (interactive)<br />
         (if (&lt;= (window-start) (point-min))<br />
             (goto-char (point-min))<br />
           (View-scroll-page-backward-set-page-size))))<br />
     ;; qv http://thread.gmane.org/gmane.emacs.devel/111117/focus=112357<br />
     (defadvice View-scroll-line-forward (after my-View-scroll-line-forward activate)<br />
       &quot;Fix point position to be at the bottom line.&quot;<br />
       (move-to-window-line -1)<br />
       (beginning-of-line))<br />
     ))</p>
<p>;;; doc-view<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
(eval-after-load &quot;doc-view&quot;<br />
  &#039;(progn<br />
     ;; Shift-Space to scroll back.<br />
     (define-key doc-view-mode-map [?\S- ] &#039;doc-view-scroll-down-or-previous-page)<br />
     ))</p>
<p>;;; image<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
;; This is now in `image-dired-cmd-create-standard-thumbnail-command&#039;<br />
;; (used by `C-t C-t&#039; in Dired).<br />
(defun my-make-thumbnail (file)<br />
  (let* ((image-file (concat &quot;file://&quot; (expand-file-name file)))<br />
         (thumb-file (expand-file-name<br />
                      (concat &quot;~/.thumbnails/normal/&quot; (md5 image-file) &quot;.png&quot;)))<br />
         (file-attrs (file-attributes file))<br />
         (modif-time (float-time (nth 5 file-attrs))))<br />
    (unless (file-exists-p thumb-file)<br />
      (shell-command<br />
       (mapconcat<br />
        &#039;identity<br />
        (list<br />
         &quot;convert&quot;<br />
         (format &quot;\&quot;%s\&quot;&quot; file)<br />
         ;; &quot;-size 128&#215;128&quot;<br />
         (format &quot;-set \&quot;Description\&quot; \&quot;Thumbnail of %s\&quot;&quot; image-file)<br />
         (format &quot;-set \&quot;Software\&quot; \&quot;ImageMagick, GNU Emacs %s\&quot;&quot; emacs-version)<br />
         (format &quot;-set \&quot;Thumb::URI\&quot; \&quot;%s\&quot;&quot; image-file)<br />
         (format &quot;-set \&quot;Thumb::MTime\&quot; \&quot;%.0f\&quot;&quot; modif-time)<br />
         &quot;-set \&quot;Thumb::Size\&quot; \&quot;%b\&quot;&quot;<br />
         &quot;-set \&quot;Thumb::Image::Width\&quot; \&quot;%w\&quot;&quot;<br />
         &quot;-set \&quot;Thumb::Image::Height\&quot; \&quot;%h\&quot;&quot;<br />
         &quot;-set \&quot;Thumb::Image::Mimetype\&quot; \&quot;image/jpeg\&quot;&quot;<br />
         &quot;-resize 128&#215;128&quot; ;; &quot;-resize 64&#215;64&quot;<br />
         &quot;+profile \&quot;*\&quot;&quot;<br />
         &quot;-type TrueColorMatte&quot;<br />
         ;; &quot;-sharpen 11&quot; ; TRY THIS<br />
         (format &quot;png:\&quot;%s\&quot;&quot; thumb-file))<br />
        &quot; &quot;)))<br />
    thumb-file))</p>
<p>;;; thumbs<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
(defadvice thumbs-mode (after my-thumbs-mode activate)<br />
  (toggle-truncate-lines -1))</p>
<p>;;; dired<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
(require &#039;dired-x)</p>
<p>;; HINT: the following expression is useful for `M-(&#039; `dired-mark-sexp&#039;<br />
;; to mark files by their type:<br />
;; (string-match &quot;perl&quot; (shell-command-to-string (concat &quot;file &quot; name)))</p>
<p>;; Uses editor/viewer info from /usr/bin/run-mailcap<br />
(defun my-dired-run-find-file ()<br />
  &quot;My view file for dired.&quot;<br />
  (interactive)<br />
  (let* ((file (dired-get-filename)))<br />
    (cond<br />
     ((let* ((command<br />
              (and (functionp &#039;mm-mime-info)<br />
                   (mm-mime-info<br />
                    (mm-extension-to-mime (file-name-extension file))))))<br />
        (if (and command (stringp command))<br />
            ;; always return `t&#039; for `cond&#039;<br />
            (or (ignore (shell-command (concat (format command file) &quot;&amp;&quot;)))<br />
                t))))<br />
     ;; ((string-match &quot;\\.html?$&quot; file) (w3-open-local file))<br />
     ((string-match &quot;\\.html?$&quot; file)<br />
      (cond<br />
       ((fboundp &#039;w3m-goto-url-new-session)<br />
        (w3m-find-file-new-session file))<br />
       ((fboundp &#039;browse-url)<br />
        (browse-url file))))<br />
     ((string-match &quot;\\.elc?$&quot; file)<br />
      (load-file file))<br />
     ((string-match &quot;\\.info?$&quot; file)<br />
      (info file))<br />
     (;; (or (string-match &quot;\\.jpe?g$&quot; file)<br />
      ;;           (string-match &quot;\\.gif$&quot; file)<br />
      ;;           (string-match &quot;\\.pdf$&quot; file))<br />
      (let* ((file-list (list (dired-get-filename)))<br />
             (command (dired-guess-default file-list)))<br />
        (if (listp command)<br />
            (setq command (car command)))<br />
        (if command<br />
            (shell-command<br />
             (dired-shell-stuff-it command file-list nil 0)))))<br />
     (t<br />
      (message file)))))</p>
<p>(define-key dired-mode-map [(control return)] &#039;my-dired-run-find-file)</p>
<p>;; Add different directory sorting keys<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
(mapc (lambda (elt)<br />
        (define-key dired-mode-map (car elt)<br />
          `(lambda ()<br />
            (interactive)<br />
            (dired-sort-other (concat dired-listing-switches ,(cadr elt))))))<br />
      &#039;(([(control f3)]       &quot;&quot;     &quot;by name&quot;)<br />
        ([(control f4)]       &quot; -X&quot;  &quot;by extension&quot;)<br />
        ([(control f5)]       &quot; -t&quot;  &quot;by date&quot;)<br />
        ([(control f6)]       &quot; -S&quot;  &quot;by size&quot;)<br />
        ([(control shift f3)] &quot; -r&quot;  &quot;by reverse name&quot;)<br />
        ([(control shift f4)] &quot; -rX&quot; &quot;by reverse extension&quot;)<br />
        ([(control shift f5)] &quot; -rt&quot; &quot;by reverse date&quot;)<br />
        ([(control shift f6)] &quot; -rS&quot; &quot;by reverse size&quot;)))</p>
<p>;; The following two bindings allow to open file for editing by [f4],<br />
;; and return back to dired without killing the buffer.<br />
;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(define-key dired-mode-map [f3] &#039;dired-find-file) ;; &#039;dired-view-file<br />
(define-key global-map [f3] &#039;dired-jump)</p>
<p>(define-key dired-mode-map [(shift f4)] &#039;dired-count-sizes)
</p></blockquote>
<p>Some settings for the dired mode (to display the mode, press alt+x in emacs and write dired in the bottom).</p>
<blockquote><p>
;;##################################################################################################<br />
						;highlighting<br />
;;##################################################################################################<br />
;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
				;; Syntaxe highlighting pour tout<br />
;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>(require &#8216;font-lock)<br />
(setq initial-major-mode<br />
      (lambda ()<br />
    (text-mode)<br />
    (font-lock-mode)))<br />
(setq font-lock-mode-maximum-decoration t<br />
      font-lock-use-default-fonts t<br />
      font-lock-use-default-colors t)</p>
<p>;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
   			   ;; hl-line: highlight the current line<br />
   			   ;;(thanks to http://www.djcbsoftware.nl/dot-emacs.html)<br />
;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(when (fboundp &#8216;global-hl-line-mode)<br />
  (global-hl-line-mode t)) ;; turn it on for all modes by default</p>
<p>;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;;                                  ACTIVER LA COLORATION SYNTAXIQUE<br />
;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(global-font-lock-mode t)<br />
(setq font-lock-maximum-decoration t)<br />
(setq font-lock-maximum-size nil)<br />
;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;;                              SURLIGNAGE D&#8217;UNE RÉGION SÉLECTIONNÉE ET EFFACER<br />
;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>(transient-mark-mode 1) ; highlight text selection<br />
(delete-selection-mode 1) ; delete seleted text when typing
</p></blockquote>
<p>Here are settings for highlighting. You will notice that the line where your cursor is is highlighted. I prefer to highlight a line than to get an annoying blincking cursor.</p>
<blockquote><p>
;;##################################################################################################<br />
			;;Sauvegardes, bookmarks, etc<br />
;;##################################################################################################<br />
;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
				;; bookmarks<br />
;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(setq bookmark-default-file &#8220;~/.emacs.d/data/bookmarks&#8221; ;; bookmarks<br />
  bookmark-save-flag 1)                            ;; autosave each change</p>
<p>;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;; 		saveplace: save location in file when saving files<br />
;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(setq save-place-file &#8220;~/.emacs.d/cache/saveplace&#8221;)<br />
(setq-default save-place t)            ;; activate it for all buffers<br />
(require &#8216;saveplace)                   ;; get the package</p>
<p>;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;;		 savehist: save some history<br />
;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(setq savehist-additional-variables    ;; also save&#8230;<br />
  &#8216;(search ring regexp-search-ring)    ;; &#8230; my search entries<br />
  savehist-autosave-interval 60        ;; save every minute (default: 5 min)<br />
  savehist-file &#8220;~/.emacs.d/cache/savehist&#8221;)   ;; keep my home clean<br />
(savehist-mode t)                      ;; do customization before activation</p>
<p>;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
			;; Save/restore sessions on exit/startup.<br />
;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>; (desktop-save-mode 1)</p>
<p>;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
 ;; POUR ENREGISTRER AUTOMATIQUEMENT LA POSITION DU CURSEUR QUAND ON QUITTE UN<br />
;; FICHIER, ET Y RETOURNER AUTOMATIQUEMENT À LA RÉOUVERTURE<br />
;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>(require &#8216;saveplace)<br />
(setq-default save-place t)</p>
<p>;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
				;; backups<br />
;;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(setq make-backup-files t ;; do make backups<br />
  backup-by-copying t     ;; and copy them here<br />
  backup-directory-alist &#8216;((&#8220;.&#8221; . &#8220;~/.emacs.d/backups&#8221;))<br />
  version-control t<br />
  kept-new-versions 2<br />
  kept-old-versions 5<br />
  delete-old-versions t)
</p></blockquote>
<p>Settings for backups. Nothing special.</p>
<blockquote><p>
;;##################################################################################################<br />
                    ;;APPEARENCE, etc<br />
;;##################################################################################################<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;;                 Status bar<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>(column-number-mode t) ;Affiche le numéro de ligne, de colonne<br />
(line-number-mode t)    ;Affiche le numéro de colonne</p>
<p>(size-indication-mode t)                 ;; show file size (emacs 22+)</p>
<p>(display-time) ;POUR AVOIR L&#8217;HEURE DANS LA BARRE D&#8217;ETAT<br />
(setq display-time-24hr-format t)  ;; Format 24 heures
</p></blockquote>
<p>Some settings to get the line and column number, the time, the size of your file in the status bar. Useful.</p>
<blockquote><p>
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
  			 ; folding mode<br />
  			 ;work in progress \o/<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p> (if (load &#8220;folding&#8221; &#8216;nomessage &#8216;noerror)<br />
 (folding-mode-add-find-file-hook))</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
  			 ; show hide<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p> (defun toggle-selective-display (column)<br />
      (interactive &#8220;P&#8221;)<br />
      (set-selective-display<br />
       (or column<br />
          (unless selective-display<br />
             (1+ (current-column))))))</p>
<p>   (defun toggle-hiding (column)<br />
      (interactive &#8220;P&#8221;)<br />
      (if hs-minor-mode<br />
          (if (condition-case nil<br />
                  (hs-toggle-hiding)<br />
                (error t))<br />
              (hs-show-all))<br />
        (toggle-selective-display column)))</p>
<p>            (global-set-key (kbd &#8220;C-+&#8221;) &#8216;toggle-hiding)<br />
    (global-set-key (kbd &#8220;C-\\&#8221;) &#8216;toggle-selective-display)</p>
</blockquote>
<p>I tried to get the same settings I had with Vim, but without success. And since I won&#8217;t use Emacs anymore, I stopped my researches.</p>
<blockquote><p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
                ;; tabulations<br />
                ;; Comment changer la longueur des tabulations<br />
                ;; pour un code écrit par<br />
                ;; des sagouins.<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>(defun tab4()<br />
  &#8220;Les tabulations vaudront 4 espaces&#8221;<br />
  (interactive &#8220;*&#8221;)<br />
  (setq tab-width 4)<br />
)</p>
<p>(defun tab8()<br />
  &#8220;Les tabulations vaudront 8 espaces&#8221;<br />
  (interactive &#8220;*&#8221;)<br />
  (setq tab-width 8)<br />
)</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
                ;pour ne pas avoir de bandes verticales<br />
                ;thanks to http://www.emacswiki.org/emacs/beginner.el<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;(set-fringe-mode 0)<br />
;; don&#8217;t show tiny scroll bar in echo area<br />
;(set-window-scroll-bars (minibuffer-window) nil)<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
                    ;Misc<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>(setq visible-bell t)                                          ;;警告音を消す</p>
</blockquote>
<p>Some settings I have copy-pasted from somewhere a long time ago, for tabulations, scroll-bars and bell.</p>
<blockquote><p>
;;################################################################################<br />
                        ;;;  ESS<br />
;;################################################################################</p>
<p>;; (require &#8216;ess-site)<br />
;; ;(require &#8216;ess-eldoc)</p>
<p>;; (ess-add-MM-keys)   ;; notamment pour des &#8220;squelettes&#8221; de fonctions</p>
<p>;; (autoload &#8216;ess-rdired &#8220;ess-rdired&#8221;<br />
;;   &#8220;View *R* objects in a dire-like buffer.&#8221; t)</p>
<p>;; (setq-default ess-ask-for-ess-directory t)   ;; demande le dossier de travail à chaque démarrage de R<br />
;; (setq-default ess-directory &#8220;/media/ifremer/Analyses/R/&#8221;)  ;; répertoire de travail proposé par défaut</p>
<p>;; (add-hook &#8216;ess-mode-hook<br />
;;      &#8216;(lambda ()<br />
;;        (auto-fill-mode t)<br />
;;        ;;(flyspell-mode t)<br />
;;        (setq-default fill-column 100)<br />
;;        )<br />
;;      )</p>
<p>;; ;; Pour ajouter à la liste d&#8217;association les .Rhistory pour les traîter comme<br />
;; ;; des fichiers sources R<br />
;; (setq auto-mode-alist<br />
;;       (append<br />
;;        &#8216;((&#8220;\\.[rR]history\\&#8217;&#8221; . R-mode))<br />
;;        auto-mode-alist))</p>
<p>;; (define-key ess-mode-map [f6] &#8216;comint-dynamic-complete-filename)</p>
<p>;; ;; Montrer &#8220;au vol&#8221; les arguments de fonctions:</p>
<p>;; ;; ess-r-args-noargsmsg is printed, if no argument information could<br />
;; ;; be found. You could set it to an empty string (&#8220;&#8221;) for no message.<br />
;; (setq ess-r-args-noargsmsg &#8220;No args found.&#8221;)</p>
<p>;; ;; ess-r-args-show-as determines how (where) the information is<br />
;; ;; displayed. Set it to &#8220;tooltip&#8221; for little tooltip windows or to<br />
;; ;; nil (the default) which will use the echo area at the bottom of<br />
;; ;; your Emacs frame.<br />
;; ;; (setq ess-r-args-show-as &#8220;tooltip&#8221;)</p>
<p>;; ;; ess-r-args-show-prefix is a string that is printed in front of the<br />
;; ;; arguments list. The default ist &#8220;ARGS: &#8220;.<br />
;; (setq ess-r-args-show-prefix &#8220;ARGS: &#8220;)</p>
<p>;; (defun Rnw-mode ()<br />
;;   (require &#8216;ess-noweb)<br />
;;   (noweb-mode)<br />
;;   (if (fboundp &#8216;R-mode)<br />
;;       (setq noweb-default-code-mode &#8216;R-mode)))</p>
<p>;; (add-hook &#8216;ess-mode-hook &#8216;my-ess-options)<br />
;; (setq-default inferior-R-args &#8220;&#8211;no-restore-history &#8211;no-save &#8220;)<br />
;; (add-hook &#8216;inferior-ess-mode-hook &#8216;my-iess-keybindings)</p>
<p>;; (defun my-ess-options ()<br />
;;   (ess-set-style &#8216;C++)<br />
;;   (column-number-mode t)<br />
;;   (add-hook &#8216;write-file-functions<br />
;;         (lambda ()<br />
;;           (nuke-trailing-whitespace)))<br />
;;   (define-key ess-mode-map [(meta backspace)] &#8216;backward-kill-word))</p>
<p>;; (defun my-iess-keybindings ()<br />
;;   (define-key inferior-ess-mode-map [(control ?a)] &#8216;comint-bol)<br />
;;   (define-key inferior-ess-mode-map [home] &#8216;comint-bol))
</p></blockquote>
<p>Here are settings for ESS if yo plan to use it.</p>
<blockquote><p>
;;##################################################################################################</p>
<p>				;;CUSTOMIZATION-FACE : FONT, COLOR<br />
;; Modifications de l&#8217;apparence<br />
;; font : aller dans Option &#8211;&gt; Set default font ; pour sauvegarder : Option &#8211;&gt; Save Options<br />
;; color : pour tester les couleurs, aller dans le Menu &#8211;&gt; Tools &#8211;&gt; Color Themes<br />
(add-to-list &#8216;load-path &#8220;~/.emacs.d/color-theme-6.6.0/&#8221;)<br />
(require &#8216;color-theme)<br />
(eval-after-load &#8220;color-theme&#8221;<br />
  &#8216;(progn<br />
     (color-theme-initialize)<br />
     (color-theme-andreas)))</p>
<p>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;    (require &#8216;color-theme)<br />
  ;  (color-theme-initialize)<br />
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;    (color-theme-andreas)<br />
;; pour color theme voir aussi dans dans Option &#8211;&gt; Customize emacs &#8211;&gt; Browse customization groups &#8211;&gt; Group &#8220;Faces&#8221; &#8211;&gt; Group &#8220;Color Theme&#8221;<br />
;; pour LaTeX :<br />
;; &#8211; \emph &#8211;&gt; font-latex-italic-face<br />
;; &#8211; \footnote &#8211;&gt; font-lock-constant-face<br />
;; &#8211; commandes (\emph, \textsc) &#8211;&gt; font-lock-keyword-face</p>
<p>;;##################################################################################################</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
				;Default font<br />
				;thanks to http://www.emacswiki.org/emacs/XftGnuEmacs<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;; To me, the best fonts are as follow ; modify if you prefer Bitstream or another font :</p>
<p>;(set-default-font &#8220;Deja Vu Sans Mono 10&#8243;)</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(custom-set-variables<br />
  ;; custom-set-variables was added by Custom.<br />
  ;; If you edit it by hand, you could mess it up, so be careful.<br />
  ;; Your init file should contain only one such instance.<br />
  ;; If there is more than one, they won&#8217;t work right.<br />
 &#8216;(blink-cursor-mode nil)<br />
 &#8216;(column-number-mode t)<br />
 &#8216;(display-time-mode t)<br />
 &#8216;(show-paren-mode t)<br />
 &#8216;(size-indication-mode t))
</p></blockquote>
<p>Here are settings related to appearance. You will notice that you can easily change that with emacs, and that there are plainty of choices. But Vim&#8217;s color schemes are better (in my humble opinion).</p>
<blockquote><p>
;;##################################################################################################<br />
;;				MISCELLANEOUS<br />
;;##################################################################################################<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
				;; do not show the startup message and other stuff<br />
				;; at http://www.djcbsoftware.nl/dot-emacs.html<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>(put &#8216;narrow-to-region &#8216;disabled nil)    ;; enable&#8230;<br />
(put &#8216;erase-buffer &#8216;disabled nil)        ;; &#8230; useful things<br />
(file-name-shadow-mode t)                ;; be smart about filenames in mbuf</p>
<p>(setq inhibit-startup-message t          ;; don&#8217;t show &#8230;<br />
  inhibit-startup-echo-area-message t)   ;; &#8230; startup messages</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;;                   POUR NE PAS AVOIR À TAPER EN ENTIER LA RÉPONSE YES/NO<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>(fset &#8216;yes-or-no-p &#8216;y-or-n-p)</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
					;; Fichiers annexes dans ~/.emacs.d/lisp<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;;stuff in separate files;; maybe use autoload?</p>
<p>;;inclusion de la gestion des couleurs<br />
;(require &#8216;couleurs nil &#8216;noerror)<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
;;inclusion du calendrier<br />
(add-to-list &#8216;load-path &#8220;~/.emacs.d/lisp/&#8221;)<br />
;(require &#8216;calendrier nil &#8216;noerror)<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
;;afficher les numéros de ligne<br />
(load-file &#8220;~/.emacs.d/lisp/line-num.el&#8221;)<br />
;(and (&lt; emacs-major-version 20) (eval-when-compile (require &#039;cl)))<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
;(add-to-list &#039;load-path &quot;~/.emacs.d/lisp/linum.el&quot;)<br />
;(require &#039;linum)<br />
;(autoload &#039;linum-mode &quot;linum&quot;)</p>
<p>;display line numbers in margin (fringe). Emacs 23 only.<br />
;(global-linum-mode 1) ; always show line numbers
</p></blockquote>
<p>Some settings such as &#8220;no startup message&#8221; (really useful if you are tired of this), and some others that you can enable or disable. But notice I have disable the option allowing you to get line numbers at the left. By the way, the display of line numbers with Vim is better, so if you want to get it, try to use Vim.</p>
<blockquote><p>
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
;;                                            THUMBS-MODE<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
 (autoload &#8216;thumbs &#8220;thumbs&#8221; &#8220;Preview images in a directory.&#8221; t)</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
					;Search and case sensitivity<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>; (setq case-fold-search nil) ; make searches case sensitive<br />
 (setq case-fold-search t) ; make searches case insensitive</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
			;; Switch ispell dictionary locally.<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
		;;; Mode Ispell<br />
;; (require &#8216;ispell)<br />
;;   (setq ispell-dictionary &#8220;francais&#8221;)</p>
<p>;; (global-set-key (kbd &#8220;C-c d e&#8221;)<br />
;;                 (lambda () (interactive)<br />
;;                   (ispell-change-dictionary &#8220;english&#8221;)))<br />
;; (global-set-key (kbd &#8220;C-c d f&#8221;)<br />
;;                 (lambda () (interactive)<br />
;;                   (ispell-change-dictionary &#8220;francais&#8221;)))</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
 				; Comment rafraîchir un fichier dans .emacs lorsqu&#8217;il<br />
 				; a été modifié par un autre programme ?<br />
 				; thanks to http://www.emacswiki.org/emacs/RevertBuffer<br />
;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>  (global-auto-revert-mode 1)</p>
<p> ;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
 ; a function to revert all buffers :<br />
 ;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
   (defun revert-all-buffers ()<br />
   &#8220;Refreshes all open buffers from their respective files&#8221;<br />
   (interactive)<br />
   (let* ((list (buffer-list))<br />
          (buffer (car list)))<br />
     (while buffer<br />
       (when (buffer-file-name buffer)<br />
         (progn<br />
           (set-buffer buffer)<br />
           (revert-buffer t t t)))<br />
       (setq list (cdr list))<br />
       (setq buffer (car list))))<br />
  (message &#8220;Refreshing open files&#8221;))</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
(defun my-info-refresh (&amp;optional arg)<br />
  &#8220;Display some useful information in the echo area instead of the mode line.<br />
With prefix arg, insert the current timestamp to the current buffer.&#8221;</p>
<p>;; §§ WORK IN PROGRESS §§ doesn&#8217;t work !</p>
<p>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
  (interactive &#8220;P&#8221;)<br />
  (cond<br />
   ((equal arg &#8216;(4))  ; C-u f5<br />
    (insert (format-time-string &#8220;%Y%m%d&#8221; (current-time))))<br />
   ((equal arg &#8216;(16)) ; C-u C-u f5<br />
    (insert (format-time-string &#8220;%Y-%m-%d&#8221; (current-time))))<br />
   (t (message &#8220;%s&#8221;<br />
               (concat<br />
                (format-time-string &#8220;%Y-%m-%d %H:%M:%S %z&#8221; (current-time)) ;; ISO<br />
                &#8221; &#8220;<br />
                (aref calendar-day-abbrev-array (nth 6 (decode-time (current-time))))<br />
                &#8221; : &#8220;<br />
                (or (buffer-file-name) default-directory))))))</p>
<p>;(define-key my-map     [f5]  &#8216;my-info-refresh)<br />
;(define-key global-map [f5]  &#8216;my-info-refresh)</p>
<p>;; open Word files with antiword<br />
(autoload &#8216;no-word &#8220;no-word&#8221; &#8220;word to txt&#8221;)<br />
(add-to-list &#8216;auto-mode-alist &#8216;(&#8220;\\.doc\\&#8217;&#8221; . no-word))<br />
(custom-set-faces<br />
  ;; custom-set-faces was added by Custom.<br />
  ;; If you edit it by hand, you could mess it up, so be careful.<br />
  ;; Your init file should contain only one such instance.<br />
  ;; If there is more than one, they won&#8217;t work right.<br />
 &#8216;(default ((t (:inherit nil :stipple nil :background &#8220;white&#8221; :foreground &#8220;black&#8221; :inverse-video nil :box nil :strike-through nil <img src='http://s1.wp.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> verline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry &#8220;unknown&#8221; :family &#8220;DejaVu Sans Mono&#8221;)))))
</p></blockquote>
<p>Finally, here are some settings which might be useful but nothing special, and others who are related to appearance.</p>
<p>In the future I will continue to use Vim. For this reason I will just make a short description of some useful commands with Emacs in the second part.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexkrispin.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexkrispin.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexkrispin.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexkrispin.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/alexkrispin.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/alexkrispin.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/alexkrispin.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/alexkrispin.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexkrispin.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexkrispin.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexkrispin.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexkrispin.wordpress.com/456/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexkrispin.wordpress.com/456/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexkrispin.wordpress.com/456/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=456&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://alexkrispin.wordpress.com/2010/10/25/writing-with-emacs-and-auctex-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c525bdd7a10e1af7026c8b55a2d9a50d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexkrispin</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/09/yasnippet-menu.png?w=1024" medium="image">
			<media:title type="html">yasnippet menu</media:title>
		</media:content>
	</item>
		<item>
		<title>A script to automate the installation of TeXLive 2010 on Ubuntu</title>
		<link>http://alexkrispin.wordpress.com/2010/10/12/a-script-to-automate-the-installation-of-texlive-2010/</link>
		<comments>http://alexkrispin.wordpress.com/2010/10/12/a-script-to-automate-the-installation-of-texlive-2010/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 15:43:47 +0000</pubDate>
		<dc:creator>alexandre krispin</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://alexkrispin.wordpress.com/?p=578</guid>
		<description><![CDATA[#****************************************************** 2010年 11月 20日 土曜日 19:08:00 CET - Several improvements thanks to Cédrik Copol among them, translation in french, function for test password, etc - Fixed some problems - I suggest to use Vim to benefit from folding and thus to get a clarified file #******************************************************* 2010年 11月 11日 木曜日 12:52:53 CET Improvements for several <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=578&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>#******************************************************<br />
2010年 11月 20日 土曜日 19:08:00 CET<br />
- Several improvements thanks to Cédrik Copol<br />
among them, translation in french, function for<br />
test password, etc<br />
- Fixed some problems<br />
- I suggest to use Vim to benefit from folding and<br />
thus to get a clarified file<br />
#*******************************************************<br />
2010年 11月 11日 木曜日 12:52:53 CET<br />
Improvements for several things, passwords are<br />
now hidden.<br />
#*****************************************************<br />
2010年 11月 06日 土曜日 00:00:00 CEST<br />
Script improved thanks to Matthew Mower.<br />
#*****************************************************<br />
several updates, among them :<br />
- choice between opensuse and ubuntu available<br />
- choice between i386 and x64 installation process<br />
- improved some parts<br />
#*****************************************************<br />
#3rd update, 2010/10/16 1:27 pm<br />
#improved choice dialog box, now it is easier<br />
#to select install or update, no need to write<br />
#it. Replaced also if else statement by case.<br />
#improved update process<br />
#*****************************************************<br />
#2nd update, 2010/10/15 08:33pm<br />
#improved the script with just a small &#8220;trick&#8221;<br />
#(nothing smart at all, just a simple modification)<br />
#to enable the user not to enter the date<br />
#*****************************************************</p>
<p>#*****************************************************<br />
#Updated the post on 2010/10/14, 07:22<br />
#corrected html code to unable correct copy-<br />
#paste in a text editor: code instead of<br />
#blockquote, and added some other<br />
#features to the script to make it easier<br />
#to use<br />
#*****************************************************</p>
<p>Recently I had to install several times TeXLive 2010 on different computers. Also, I have friends who do not feel comfortable with command line and don&#8217;t want to install the last version of TeXLive for this reason. Consequently, I have written a small script to automate the task and to allow others to easily install TeXlive 2010 (or at least, I hope it will be more easy with this script).</p>
<p>Also, this script has been written for Ubuntu users, but if you use another operating system, you might be used to command line. So if you use for example Archlinux, replace &#8220;apt-get install&#8221; by &#8220;pacman -S&#8221;.</p>
<p><strong>TO USE THIS SCRIPT</strong> you have 2 choices :</p>
<ol>
<li>download it from <a href="http://www.2shared.com/file/NA9xoLut/install_update_texlive.html">here</a>.</li>
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/download_2upshare.png"><img class="alignnone size-medium wp-image-619" title="download_2upshare" src="http://alexkrispin.files.wordpress.com/2010/10/download_2upshare.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>Save it in your home directory, and open a terminal (press Ctrl+Alt+t). Then, copy-paste the following in the terminal :<br />
<code>chmod +x install_update_tex<br />
./install_update_tex</code></p>
<p>And follow the instructions. If you have any problem, let a comment (it has only been tested on my computer at the moment).</p>
<li> The second way is to copy the script in your text editor, let say gedit. Press Alt+F2, and in the prompt, enter gedit. Then, copy the following :<code><br />
#=======================================================================<br />
# FILE: install_update_texlive.sh<br />
# USAGE: Run from the terminal<br />
# DESCRIPTION: Automatic install/update of TeXLive 2010<br />
# OPTIONS: —<br />
# REQUIREMENTS: Ubuntu or OpenSuse<br />
# BUGS: —<br />
# NOTES: Website: http://alexkrispin.wordpress.com/<br />
# AUTHORS: Alexandre Krispin, k.m.alexandre@gmail.com, Matthew D. Mower, Cédrick Copol<br />
# COMPANY: —<br />
# CREATED: 2010 Oct 11, 20:25:43 UTC<br />
# REVISION: 2010年 11月 20日 土曜日 19:06:34 CET<br />
#=======================================================================<br />
#! /bin/bash</code></p>
<p><code>sudo -k</p>
<p>#-------------------------------------------------------------------------------<br />
#  Translations<br />
#-------------------------------------------------------------------------------<br />
#{{{<br />
echo $LANG | grep -i fr;<br />
if [ "$?" == "0" ]; then</p>
<p>#La langue est le français {{{<br />
SELECT="Sélectionnez"<br />
CHOISE="Choix"</p>
<p>IN_UP_TITLE="Installation ou mise à jour"<br />
IN_UP_TEXT="Souhaitez-vous faire une (ré)installation ou une mise à jour ?"<br />
IN_UP_TRUE="Installation"<br />
IN_UP_FALS="Mise à jour"<br />
DISC_TITLE="Espace disque"<br />
DISC_TEXT="Une installation complète nécessite ~2,3GB d'espace libre. Appuyer sur Oui pour continuer ou Non pour quitter."<br />
PASSWD_TITLE="Mot de passe"<br />
PASSWD_TEXT="Votre mot de passe est nécessaire pour continuer."<br />
BAD_PASSWD_TITLE="Mot de passe invalide"<br />
BAD_PASSWD_TEXT="Mot de passe invalide. Veuillez recomposer celui-ci :"<br />
EXIT_BAD_PASSWD="Désolé 3 mauvais mot de passe donné.\n$0 va se fermer."<br />
INFO_TEXT="L'installation va commencer et une fenêtre s'ouvrira. Pour exemple voir\nhttp://www.tug.org/texlive/doc/texlive-common/install-lnx-main.png\n\nVérifiez la taille du papier (A4 en général) puis cliquer sur 'Install TeX Live' pour continuer. (Notez que ce script ne fonctionne correctement qu'avec le dossier d'installation par défaut de TeX Live)"<br />
INFO_TITLE="Dernière notification avant installation"<br />
FILE_TITLE="Fichiers d'installation"<br />
FILE_TEXT="Voulez-vous conserver les fichiers d'installation téléchargés ? (Ils ne sont pas nécessaire au fonctionnement de TeX Live)"<br />
FONT_TITLE="Remarque informative"<br />
FONT_TEXT="Les fontes vont maintenant être installées."<br />
IN_END_TITLE="Installation terminée"<br />
IN_END_TEXT="L'installation est terminée. Vous pouvez périodiquement relancer ce script plus tard afin de mettre à jour votre distribution. Pour appliquer les modifications veuillez fermer votre session puis la réouvrir."<br />
UP_END_TITLE="Mise à jour terminé"<br />
UP_END_TEXT="TeXlive a été mis à jour."<br />
#}}}<br />
else<br />
# Default language is English {{{<br />
SELECT="Select"<br />
CHOISE="Choice"</p>
<p>IN_UP_TITLE="Install or update"<br />
IN_UP_TEXT="New install or update?"<br />
IN_UP_TRUE="Install"<br />
IN_UP_FALS="Update"<br />
DISC_TITLE="Disc  space"<br />
DISC_TEXT="A full  installation requires  ~2.3GB of<br />
disc space. Press Yes to preceed or No to halt"<br />
PASSWD_TITLE="Password"<br />
PASSWD_TEXT="Your password is needed to continue:"<br />
BAD_PASSWD_TITLE="Invalid password"<br />
BAD_PASSWD_TEXT="Invalid password. Please re-enter a sudo capable password:"<br />
EXIT_BAD_PASSWD="Sorry 3 incorrect password attempts.\n $0 will be closed"<br />
INFO_TEXT="The installation process will begin and a window will appear. See here for an example:\nhttp://www.tug.org/texlive/doc/texlive-common/install-lnx-main.png\n\nCheck that paper size is correct. Then click 'Install TeX Live' to continue. (Note that this script is hard coded to work only with the default installation directory)"<br />
INFO_TITLE="Last notification before installation"<br />
FILE_TITLE="Install files"<br />
FILE_TEXT="Would you like to keep the downloaded installation files? (They are not necessary to use TeXLive)"<br />
FONT_TITLE="Information notice"<br />
FONT_TEXT="Now fonts will be configured."<br />
IN_END_TITLE="Installation finished"<br />
IN_END_TEXT="Installation finished. You can periodically run this script at later dates to update your distribution. In order for environment variables to be set, you still need to log out and log back in"<br />
UP_END_TITLE="Update finished"<br />
UP_END_TEXT="TeXlive has been updated."<br />
fi<br />
#}}}<br />
#}}}</p>
<p>#===  FUNCTION  ================================================================<br />
#          NAME:  ask_passwd<br />
#   DESCRIPTION:  ask the password, and stop if there is more than 3 errors<br />
#    PARAMETERS:<br />
#       RETURNS:<br />
#===============================================================================<br />
# {{{<br />
ask_passwd()<br />
{<br />
PASSWORD=`zenity --title='$PASSWD_TITLE' --text="$PASSWD_TEXT" --hide-text --entry`<br />
if [ "$?" -eq "1" ] ; then<br />
exit<br />
fi<br />
# Count of the times you try to enter the password<br />
nb_inputpwd=1<br />
echo $PASSWORD | sudo -S echo -e '\nPassword test.'<br />
while [ "$?" -eq "1" ]; do<br />
# Only 3 errors are authorized<br />
if [ "$nb_inputpwd" -eq "3" ]; then<br />
zenity --title='$BAD_PASSWD_TITLE' --text="$EXIT_BAD_PASSWD" --error<br />
exit<br />
else<br />
PASSWORD=`zenity --title='$BAD_PASSWD_TITLE' --text="$BAD_PASSWD_TEXT" --hide-text --entry`<br />
if [ "$?" -eq "1" ]; then<br />
exit<br />
fi<br />
# Incrementation<br />
nb_inputpwd=$(( nb_inputpwd+1 ))<br />
echo $PASSWORD | sudo -S echo -e '\nPassword test.'<br />
fi<br />
done<br />
}<br />
#}}}</p>
<p>#-------------------------------------------------------------------------------<br />
#  Select platform automatically, i386 or x64 {{{<br />
#-------------------------------------------------------------------------------<br />
PLATFORM=`uname -m`<br />
case "$PLATFORM" in<br />
i386 | i486 | i586 | i686 | k7) BITTAG="i386-linux";;<br />
x86_64 | EM64T) BITTAG="x86_64-linux";;<br />
*)echo -e "$BAD_PLAT_TEXT" | zenity --title="$BAD_PLAT_TITLE" --text-info --width 500 --height 200;exit;;<br />
esac<br />
#}}}</p>
<p>#-------------------------------------------------------------------------------<br />
#  Install or Update choice {{{<br />
#-------------------------------------------------------------------------------<br />
INSTALL_OR_UPDATE=$(zenity --title="$IN_UP_TITLE" --text="$IN_UP_TEXT" --list --radiolist --column "$SELECT" --column "$CHOISE" true "$IN_UP_TRUE" false "$IN_UP_FALS")<br />
if [ "$?" -eq "1" ]<br />
then<br />
exit;<br />
fi<br />
#}}}<br />
#-------------------------------------------------------------------------------<br />
#  Case Install {{{<br />
#-------------------------------------------------------------------------------<br />
case "$INSTALL_OR_UPDATE" in<br />
"$IN_UP_TRUE")</p>
<p>#-------------------------------------------------------------------------------<br />
#  Select OS {{{<br />
#-------------------------------------------------------------------------------</p>
<p>OS=$(zenity --title="Your OS"\<br />
--text="Choose your OS:"\<br />
--list\<br />
--radiolist\<br />
--column "Select"\<br />
--column "Choice"\<br />
true "Ubuntu"\<br />
false "ArchLinux"\<br />
false "OpenSuse")<br />
if [ "$?" -eq "1" ]<br />
then<br />
exit;<br />
fi<br />
#}}}</p>
<p>#-------------------------------------------------------------------------------<br />
#  Installing a package for the official install script of TeXLive 2010 {{{<br />
#-------------------------------------------------------------------------------<br />
case "$OS" in<br />
"Ubuntu") PKGMGR_PERL="apt-get install perl-tk";;<br />
"SUSE LINUX") PKGMGR_PERL="zypper perl-Tk";;<br />
"ArchLinux") PKGMGR_PERL="pacman -S perl-tk";;<br />
*) echo -e "$BAD_OS_TEXT" | zenity --title="$BAD_OS_TITLE" --text-info --width 500 --height 200;exit;;<br />
esac<br />
#}}}</p>
<p>zenity --question --title="$DISC_TITLE" --text="$DISC_TEXT"<br />
if [ "$?" -eq "1" ]<br />
then<br />
exit;<br />
fi</p>
<p>STARTDIR=$(pwd)</p>
<p>ask_passwd</p>
<p>echo $PASSWORD | sudo -S $PKGMGR_PERL</p>
<p>wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz<br />
tar -xf install-tl-unx.tar.gz</p>
<p>echo -e "$INFO_TEXT" | zenity --title="$INFO_TITLE" --text-info --width 550 --height 200</p>
<p>cd $STARTDIR/install-tl-2*<br />
echo $PASSWORD | sudo -S ./install-tl -gui</p>
<p>cd $STARTDIR</p>
<p>zenity --question --title="$FILE_TITLE" --text="$FILE_TEXT"<br />
if [ "$?" -eq "1" ]<br />
then<br />
rm -rf install-tl*<br />
fi</p>
<p>echo -e "\nPATH=/usr/local/texlive/2010/bin/$BITTAG:\$PATH; export PATH\nMANPATH=/usr/local/texlive/2010/texmf/doc/man:\$MANPATH; export MANPATH\nINFOPATH=/usr/local/texlive/2010/texmf/doc/info:\$INFOPATH; export INFOPATH\n" &gt;&gt; ~/.profile</p>
<p>zenity --info --title="$FONT_TITLE" --text="$FONT_TEXT"</p>
<p>echo $PASSWORD | sudo -S cp /usr/local/texlive/2010/texmf-var/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf<br />
echo $PASSWORD | sudo -S fc-cache -fsv</p>
<p>zenity --info title="$IN_END_TITLE" --text="$IN_END_TEXT"</p>
<p>;;<br />
esac<br />
#}}}</p>
<p>#-------------------------------------------------------------------------------<br />
#  Case Update {{{<br />
#-------------------------------------------------------------------------------<br />
case "$INSTALL_OR_UPDATE" in<br />
"$IN_UP_FALS")</p>
<p>ask_passwd</p>
<p>echo $PASSWORD | sudo -S /usr/local/texlive/2010/bin/$BITTAG/tlmgr update --self<br />
echo $PASSWORD | sudo -S /usr/local/texlive/2010/bin/$BITTAG/tlmgr update --all<br />
zenity --info --title="$UP_END_TITLE" --text="$UP_END_TEXT"</p>
<p>;;<br />
esac<br />
#}}}</p>
<p>exit</p>
<p></code><code>#}}}<br />
</code></p>
<p>Save the file in your home directory under the name install_update_tex, and open a terminal (press Ctrl+Alt+t). Then, copy-paste the following in the terminal :<br />
<code>chmod +x install_update_tex<br />
./install_update_tex</code></li>
</ol>
<p>If you have any problem, comments are welcome.</p>
<p><strong>UPDATE OF THE POST, 03/05/2011 :</strong></p>
<p>With the update of this post we will see, first, how to overide the installation of TeXlive 2009 for the packages which have TeXlive 2009 as a dependency, and secondly, we will see how to use an external repository to make an update (let say, for example, to have the latest luatex engine) :</p>
<ol>
<li>With Ubuntu, to disable unwanted texlive-* packages to be installed, you have to open a Terminal (press Alt+F2, and in the newly opened window, enter gnome-terminal) and then copy-past the following :<br />
<blockquote><p>sudo apt-get install equivs<br />
mkdir ~/tmp<br />
cd !$<br />
equivs-control texlive-local</p></blockquote>
<p>Then, open the file created in the tmp directory with, let say Gedit (press Alt+F2 and enter gedit in the prompt), and copy in this file the following :</p>
<blockquote><p>Section: misc<br />
Priority: optional<br />
Standards-Version: 3.6.2</p>
<p>Package: texlive-local<br />
Version: 2008-1<br />
Maintainer: MPG<br />
Provides: cm-super, cm-super-minimal, context, latex-beamer,<br />
latex-cjk-all, latex-cjk-chinese, latex-cjk-chinese-arphic-bkai00mp,<br />
latex-cjk-chinese-arphic-bsmi00lp, latex-cjk-chinese-arphic-gbsn00lp,<br />
latex-cjk-chinese-arphic-gkai00mp, latex-cjk-common, latex-cjk-japanese,<br />
latex-cjk-japanese-wadalab, latex-cjk-korean, latex-cjk-thai,<br />
latex-sanskrit, latex-xcolor, lmodern, luatex, musixtex, pgf, prosper,<br />
tex4ht, tex4ht-common, texinfo, texlive-base, texlive-base-bin,<br />
texlive-base-bin-doc, texlive-bibtex-extra, texlive-common,<br />
texlive-doc-base, texlive-doc-bg, texlive-doc-cs+sk, texlive-doc-de,<br />
texlive-doc-el, texlive-doc-en, texlive-doc-es, texlive-doc-fi,<br />
texlive-doc-fr, texlive-doc-it, texlive-doc-ja, texlive-doc-ko,<br />
texlive-doc-mn, texlive-doc-nl, texlive-doc-pl, texlive-doc-pt,<br />
texlive-doc-ru, texlive-doc-th, texlive-doc-tr, texlive-doc-uk,<br />
texlive-doc-vi, texlive-doc-zh, texlive-extra-utils, texlive-font-utils,<br />
texlive-fonts-extra, texlive-fonts-extra-doc, texlive-fonts-recommended,<br />
texlive-fonts-recommended-doc, texlive-formats-extra, texlive-full,<br />
texlive-games, texlive-generic-extra, texlive-generic-recommended,<br />
texlive-humanities, texlive-humanities-doc, texlive-lang-african,<br />
texlive-lang-arab, texlive-lang-armenian, texlive-lang-croatian,<br />
texlive-lang-cyrillic, texlive-lang-czechslovak, texlive-lang-danish,<br />
texlive-lang-dutch, texlive-lang-finnish, texlive-lang-french,<br />
texlive-lang-german, texlive-lang-greek, texlive-lang-hebrew,<br />
texlive-lang-hungarian, texlive-lang-indic, texlive-lang-italian,<br />
texlive-lang-latin, texlive-lang-manju, texlive-lang-mongolian,<br />
texlive-lang-norwegian, texlive-lang-other, texlive-lang-polish,<br />
texlive-lang-portuguese, texlive-lang-spanish, texlive-lang-swedish,<br />
texlive-lang-tibetan, texlive-lang-ukenglish, texlive-lang-vietnamese,<br />
texlive-latex-base, texlive-latex-base-doc, texlive-latex-extra,<br />
texlive-latex-extra-doc, texlive-latex-recommended,<br />
texlive-latex-recommended-doc, texlive-latex3, texlive-math-extra,<br />
texlive-metapost, texlive-metapost-doc, texlive-music, texlive-omega,<br />
texlive-pictures, texlive-pictures-doc, texlive-plain-extra,<br />
texlive-pstricks, texlive-pstricks-doc, texlive-publishers,<br />
texlive-publishers-doc, texlive-science, texlive-science-doc,<br />
texlive-xetex, tipa,<br />
Architecture: all<br />
Description: Installation locale de TeX Live.<br />
Installation locale d&#8217;une TeX Live nature complete.</p></blockquote>
<p>After saving the file, copy-paste the following in the terminal :</p>
<blockquote><p>equivs-build texlive-local<br />
sudo dpkg -i texlive-local_2008-1_all.deb</p></blockquote>
<p>From now on, you will be able to install any package usually requiring TeXlive 2009 as a dependency without installing TeXlive 2009. This tip is from Manuel Pegourier-gonard,  <a href="http://weblog.elzevir.fr/2008/11/tex-live-2008-a-la-vanille-sur-debian-like/">see his post for more details (in french)</a>, modified a little to make it work with Ubuntu 10.10 and earlier.</p>
</li>
<li>
To install packages from TLContrib (for more details about it <a href="http://tlcontrib.metatex.org/usage.html">see the corresponding website</a>), you will have to use the terminal (press alt+f2 and in the prompt write gnome-terminal and press enter) :</p>
<blockquote><p>sudo /usr/local/texlive/2010/bin/i386-linux/tlmgr &#8211;gui</p></blockquote>
<p>If your computer doesn&#8217;t use the i386 version of TeXLive, then do as follows :</p>
<blockquote><p>sudo /usr/local/texlive/2010/bin/x86_64-linux/tlmgr &#8211;gui</p></blockquote>
<p>In the window newly opened, select an other repository :<br />
<a href="http://alexkrispin.files.wordpress.com/2010/10/choosing-another-repository.png"><img src="http://alexkrispin.files.wordpress.com/2010/10/choosing-another-repository.png?w=300&#038;h=168" alt="" title="choosing another repository" width="300" height="168" class="alignnone size-medium wp-image-624" /></a></p>
<p>Then, enter the url :</p>
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/selecting-the-repository.png"><img src="http://alexkrispin.files.wordpress.com/2010/10/selecting-the-repository.png?w=300&#038;h=168" alt="" title="selecting the repository" width="300" height="168" class="alignnone size-medium wp-image-625" /></a></p>
<p>And then, push the button to start the update :</p>
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/starting-the-update.png"><img src="http://alexkrispin.files.wordpress.com/2010/10/starting-the-update.png?w=300&#038;h=168" alt="" title="starting the update" width="300" height="168" class="alignnone size-medium wp-image-626" /></a></p>
<p>Finally you will just have to wait until it finishes.
</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexkrispin.wordpress.com/578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexkrispin.wordpress.com/578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexkrispin.wordpress.com/578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexkrispin.wordpress.com/578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/alexkrispin.wordpress.com/578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/alexkrispin.wordpress.com/578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/alexkrispin.wordpress.com/578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/alexkrispin.wordpress.com/578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexkrispin.wordpress.com/578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexkrispin.wordpress.com/578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexkrispin.wordpress.com/578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexkrispin.wordpress.com/578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexkrispin.wordpress.com/578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexkrispin.wordpress.com/578/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=578&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://alexkrispin.wordpress.com/2010/10/12/a-script-to-automate-the-installation-of-texlive-2010/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c525bdd7a10e1af7026c8b55a2d9a50d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexkrispin</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/download_2upshare.png?w=300" medium="image">
			<media:title type="html">download_2upshare</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/choosing-another-repository.png?w=300" medium="image">
			<media:title type="html">choosing another repository</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/selecting-the-repository.png?w=300" medium="image">
			<media:title type="html">selecting the repository</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/starting-the-update.png?w=300" medium="image">
			<media:title type="html">starting the update</media:title>
		</media:content>
	</item>
		<item>
		<title>Writing LaTeX files with GVim</title>
		<link>http://alexkrispin.wordpress.com/2010/10/07/writing-latex-files-with-gvim/</link>
		<comments>http://alexkrispin.wordpress.com/2010/10/07/writing-latex-files-with-gvim/#comments</comments>
		<pubDate>Thu, 07 Oct 2010 19:25:11 +0000</pubDate>
		<dc:creator>alexandre krispin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://alexkrispin.wordpress.com/?p=484</guid>
		<description><![CDATA[In this post I will show some useful links, some tips and shortcuts I have set in my settings for Vim. First, here are screenshots and videos you might find useful if you are a beginner : If you don&#8217;t know how GVim looks like, here is the screenshot taken from a video at youtube.com <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=484&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this post I will show some useful links, some tips and shortcuts I have set in my settings for Vim.</p>
<ol>
<li>First, here are screenshots and videos you might find useful if you are a beginner :
<ul>
<li>If you don&#8217;t know how GVim looks like, here is the screenshot taken from <a href="http://www.youtube.com/watch?v=6NtyXh1Jl0M&amp;feature=related">a video at youtube.com</a> :
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/gvim.png"><img class="alignnone size-medium wp-image-522" title="GVim" src="http://alexkrispin.files.wordpress.com/2010/10/gvim.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>And here is how GVim looks like with my own settings :</p>
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/gvim_2.png"><img class="alignnone size-medium wp-image-523" title="GVim_2" src="http://alexkrispin.files.wordpress.com/2010/10/gvim_2.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></li>
<li> Here is a screencast which explains the basics of vim that you can find with <a href="http://www.youtube.com/results?search_query=vim+tutorial&amp;aq=f">youtube</a> or <a href="http://www.google.fr/search?hl=fr&amp;tbs=vid%3A1&amp;q=vim+tutorial&amp;aq=f&amp;aqi=&amp;aql=&amp;oq=&amp;gs_rfai=">google videos</a> :
<span style="text-align:center; display: block;"><a href="http://alexkrispin.wordpress.com/2010/10/07/writing-latex-files-with-gvim/"><img src="http://img.youtube.com/vi/71YTkxUNwmg/2.jpg" alt="" /></a></span>
<p>An other screencast with some explanations about basic but useful plugins available for Vim, which will save your time when you edit files (such as LaTeX files) :</p>
<span style="text-align:center; display: block;"><a href="http://alexkrispin.wordpress.com/2010/10/07/writing-latex-files-with-gvim/"><img src="http://img.youtube.com/vi/_galFWwSDt0/2.jpg" alt="" /></a></span>
<p>Once you get the basic idea of what GVim is, here are some lessons :</p>
<span style="text-align:center; display: block;"><a href="http://alexkrispin.wordpress.com/2010/10/07/writing-latex-files-with-gvim/"><img src="http://img.youtube.com/vi/SI8TeVMX8pk/2.jpg" alt="" /></a></span>
<span style="text-align:center; display: block;"><a href="http://alexkrispin.wordpress.com/2010/10/07/writing-latex-files-with-gvim/"><img src="http://img.youtube.com/vi/F3OO7ZIOaJE/2.jpg" alt="" /></a></span>
<span style="text-align:center; display: block;"><a href="http://alexkrispin.wordpress.com/2010/10/07/writing-latex-files-with-gvim/"><img src="http://img.youtube.com/vi/ZYEccA_nMaI/2.jpg" alt="" /></a></span>
<p><span style="text-align:center; display: block;"><a href="http://alexkrispin.wordpress.com/2010/10/07/writing-latex-files-with-gvim/"><img src="http://img.youtube.com/vi/1lYD5gwgZIA/2.jpg" alt="" /></a></span></li>
</ul>
</li>
<li>Secondly, here are some explanations about plugins I use in GVim :
<ul>
<li><a href="http://www.vim.org/scripts/script.php?script_id=521">MRU</a> is a vim script which enable you to use the Most Recently Used files. If you use the settings I have put <a href="http://github.com/alexandre-k/repository_alexandre_krispin/tree/master/configuration_files_for_text_editors/vim_configuration_files/">in my repository at Github</a>, then press F8, and you will get files you closed recently :
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/plugin_mru_files.png"><img class="alignnone size-medium wp-image-529" title="Plugin_MRU_files" src="http://alexkrispin.files.wordpress.com/2010/10/plugin_mru_files.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></li>
<li> When I don&#8217;t have used a file recently and want to open one, I press F4 and I get the <a href="http://www.vim.org/scripts/script.php?script_id=1950">Vim Explorer</a> :&nbsp;
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/plugin_vimexplorer.png"><img class="alignnone size-medium wp-image-530" title="Plugin_VimExplorer" src="http://alexkrispin.files.wordpress.com/2010/10/plugin_vimexplorer.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>If you want to enter in a directory, move the cursor to this directory and press enter. If you want to move back, press Backspace. To open a file, place the cursor on this file and press enter.<br />
You will also notice that all files are sorted according to the extension, a nice feature of the plugin.</li>
<li> <a href="http://www.vim.org/scripts/script.php?script_id=1658">NerdTree</a> is an other way to search files. When another file is already opened, NerdTree will be opened automatically in a small part of the window, on the left :
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/plugin_nerdtree.png"><img class="alignnone size-medium wp-image-531" title="Plugin_NerdTree" src="http://alexkrispin.files.wordpress.com/2010/10/plugin_nerdtree.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>To open it, press Shift+F4. To switch from the buffer opened on the left to the main buffer, you will have to use the mouse, or to type twice ctrl+w, a keystroke which will move automatically the cursor to the main part of the window.</p>
<p>You can also look at this screencast showing you more about the NerdTree plugin :</p>
<p><span style="text-align:center; display: block;"><a href="http://alexkrispin.wordpress.com/2010/10/07/writing-latex-files-with-gvim/"><img src="http://img.youtube.com/vi/8jWL3wZSOkY/2.jpg" alt="" /></a></span></li>
<li> If you are editing a LaTeX file (it works with other sort of files), select the block you wish to comment, and then type &#8220;,ci&#8221;. It will comment it, thanks to the plugin <a href="http://www.vim.org/scripts/download_script.php?src_id=10318">NerdCommenter</a>. To uncomment it, do the same thing. Here are screenshots showing you a selected block and then the same block commented after typing ,ci :&nbsp;
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/plugin_nerdcommenter_block_selected.png"><img class="alignnone size-medium wp-image-532" title="Plugin_NerdCommenter_block_selected" src="http://alexkrispin.files.wordpress.com/2010/10/plugin_nerdcommenter_block_selected.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/plugin_nerdcommenter_block_commented.png"><img class="alignnone size-medium wp-image-533" title="Plugin_NerdCommenter_block_commented" src="http://alexkrispin.files.wordpress.com/2010/10/plugin_nerdcommenter_block_commented.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></li>
<li> Thanks to the <a href="http://www.vim.org/scripts/script.php?script_id=1879">AutoComplPop plugin</a>, when you type a word, a popup will automatically be displayed, and will show you all words available in your dictionaries&#8217; directory specified in the settings I have made (~/.vim/ftplugin/tex.vim) :&nbsp;
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/plugin_autocompletion_popup.png"><img class="alignnone size-medium wp-image-534" title="Plugin_Autocompletion_popup" src="http://alexkrispin.files.wordpress.com/2010/10/plugin_autocompletion_popup.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></li>
<li>Let us assume you wish to enter a section in your LaTeX file. With the <a href="http://www.vim.org/scripts/script.php?script_id=2540">plugin SnipMate</a>, you will only have to type sec and press tab, and you will have everything expanded. Then when you will enter the title, it will automatically write the same for the label, and once you will have pressed tab again, the cursor will automatically jump to the place where you will have to begin your section. In this screenshot I enter sec :
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/plugin_snipmat_sec.png"><img class="alignnone size-medium wp-image-535" title="Plugin_snipmate_sec" src="http://alexkrispin.files.wordpress.com/2010/10/plugin_snipmat_sec.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>Here is what I get when I press tab :</p>
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/plugin_snipmate_section_expanded.png"><img class="alignnone size-medium wp-image-536" title="Plugin_snipmate_section_expanded" src="http://alexkrispin.files.wordpress.com/2010/10/plugin_snipmate_section_expanded.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>And while I am typing the title, it automatically type the label :</p>
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/plugin_snipmate_auto_complete.png"><img class="alignnone size-medium wp-image-538" title="Plugin_snipmate_auto_complete" src="http://alexkrispin.files.wordpress.com/2010/10/plugin_snipmate_auto_complete.png?w=300&#038;h=168" alt="" width="300" height="168" /></a><br />
And then, pressing tab will make the cursor jump to the right place between the delimited space defined with the snippet (for Ubuntu users not aware of what a snippet is, basically let us say it is similar to a template).</p>
<p>Also, many other snippets are already defined, and I have defined others snippets by myself. If you want to get a try or to look at it, see <a href="http://github.com/alexandre-k/repository_alexandre_krispin/blob/master/configuration_files_for_text_editors/vim_configuration_files/.vim/snippets/tex.snippets">the corresponding file in my repository at Github</a>.</p>
<p>If you don&#8217;t get the idea of Snipmate, then look at this video :</p>
<span style="text-align:center; display: block;"><a href="http://alexkrispin.wordpress.com/2010/10/07/writing-latex-files-with-gvim/"><img src="http://img.youtube.com/vi/MQy2rVOf-z0/2.jpg" alt="" /></a></span>
</li>
<li> Let us assume you have multiple files (which we call in this case &#8220;<a href="http://vim.wikia.com/wiki/Vim_buffer_FAQ">buffer</a>&#8220;) opened in the same window, and you wish to select one. With the <a href="http://www.vim.org/scripts/script.php?script_id=107">plugin SelectBuffer</a>, you will just have to press F10 and it will open a small area where you will can select the one you want. Once you get it, press F10 again and it will automatically close itself :&nbsp;
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/plugin_selectbuf.png"><img class="alignnone size-medium wp-image-539" title="Plugin_SelectBuf" src="http://alexkrispin.files.wordpress.com/2010/10/plugin_selectbuf.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>If you don&#8217;t understand what a buffer is, since it is important to understand the use of this plugin, look at this screencast :</p>
<p><span style="text-align:center; display: block;"><a href="http://alexkrispin.wordpress.com/2010/10/07/writing-latex-files-with-gvim/"><img src="http://img.youtube.com/vi/KVAeelM-0QI/2.jpg" alt="" /></a></span></li>
<li> Let us assume the cursor is positioned on a bracket. Press % in normal mode, and your cursor will automatically jump to the other one, thanks to the <a href="http://www.vim.org/scripts/script.php?script_id=39">matchit plugin</a>. It might be useful for footnotes or other things in *.tex files.&nbsp;
<p>The following screencast show an example at 8 min 01 s :</p>
<span style="text-align:center; display: block;"><a href="http://alexkrispin.wordpress.com/2010/10/07/writing-latex-files-with-gvim/"><img src="http://img.youtube.com/vi/_galFWwSDt0/2.jpg" alt="" /></a></span>
<p>Let us assume you wish to get 2 files in the same screen. In normal mode, type ;bv and press enter, and the screen will split vertically thanks to the <a href="http://www.vim.org/scripts/script.php?script_id=42">buffer explorer</a> plugin :</p>
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/plugin_buffer_explorer_split_vertically.png"><img class="alignnone size-medium wp-image-541" title="Plugin_buffer_explorer_split_vertically" src="http://alexkrispin.files.wordpress.com/2010/10/plugin_buffer_explorer_split_vertically.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>You can try yourself other commands like ;be and ;bs if you are interested.</li>
<li> Other plugins are also in my .vim directory. <a href="http://www.vim.org/scripts/script.php?script_id=1984">FuzzyFinder</a> for example. If you type :FuzzyFile, you will get the following :&nbsp;
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/plugin_fuzzyfinder_example.png"><img class="alignnone size-medium wp-image-542" title="Plugin_Fuzzyfinder_example" src="http://alexkrispin.files.wordpress.com/2010/10/plugin_fuzzyfinder_example.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>For more details, look at the documentation of the plugin or see <a href="http://vimeo.com/2938498">this screencast</a>.</li>
<li> If you type :Calendar and press enter in normal mode, a calendar will be displayed thanks to the <a href="http://www.vim.org/scripts/script.php?script_id=52">calendar plugin</a> :&nbsp;
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/plugin_calendar.png"><img class="alignnone size-medium wp-image-543" title="Plugin_Calendar" src="http://alexkrispin.files.wordpress.com/2010/10/plugin_calendar.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></li>
<li> Other plugins may be interesting for you, such as the <a href="http://www.vim.org/scripts/script.php?script_id=479">multiple search plugin</a>, the <a href="http://vim.sourceforge.net/scripts/script.php?script_id=294">align plugin</a> and the <a href="http://www.vim.org/scripts/script.php?script_id=923">time stamp plugin</a>. But for these plugins, I will let you look by yourself the documentation.<br />
If you don&#8217;t know how to look to the relevant documentation corresponding to the plugin, then do as follow. In normal mode, type :h Align and press enter, and you will get a new buffer displayed for the Align documentation :&nbsp;</p>
<p><a href="http://alexkrispin.files.wordpress.com/2010/10/typing_h_align.png"><img class="alignnone size-medium wp-image-544" title="typing_:h_align" src="http://alexkrispin.files.wordpress.com/2010/10/typing_h_align.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></li>
</ul>
</li>
<li> Though it is not plugins, here are some other tips you need to know if you wish to use my settings :&nbsp;
<ul>
<li>If you want to save a file, press F2.</li>
<li>If you want to open a terminal, press shift+F2</li>
<li>If you want to open nautilus, press Alt+F2. Notice that if you want to open another file manager, you will have to change it in THE settings. For this, look in the .vimrc file.</li>
<li>If you want to close a buffer, that is to say a file, then press F3. If you want to close all buffers currently opened in a window, press shift+F3. And if you don&#8217;t want to save and want to exit, press Alt+F3.</li>
<li> If you want to compile a *.tex file, press F11. It will also automatically start the viewer after finishing to compile. If you just want to compile, and don&#8217;t want to see the result, press Alt+F11. Notice that the default compiler is XeLaTeX, and not pdfLaTeX. If you want to change the compiler, you will have to change my settings, and to do so you will have to modify the tex.vim located in <a href="http://github.com/alexandre-k/repository_alexandre_krispin/blob/master/configuration_files_for_text_editors/vim_configuration_files/.vim/ftplugin/tex.vim">~/.vim/ftplugin</a>. And if you don&#8217;t understand how to modify it after looking at the tex.vim file, let a comment (though you should get a try to XeLaTeX).
<li>If you want to enable spell checking for french, press F12. If you want to disable it, press F12 again. If you want to enable spell checking for english, press Alt+F12. If you use most of the time english files, you might change the default mapping in .vimrc to replace the mapping for french by the mapping for english.</li>
<li> When you want to copy a selected line, word, etc, press Ctrl+Insert. To cut a selected line, word or other, press Insert+Suppr. And to paste it, press Shift+Insert. If you are not familiar to these shortcuts, then learn to like it instead of changing it, because these shortcuts are also used in other programs.</li>
<li> To search a word, type &#8220;/&#8221; in normal mode, and then enter your word. If several words exist, press enter and then type &#8220;n&#8221;, which means &#8220;next&#8221;. The cursor will jump to the next word each time you will press &#8220;n&#8221;. Once your searches are finished, enter Ctrl+n to cancel highlighting.</li>
<li> To open a new tab, press Ctrl+t in normal mode. To move to the next tab, press Ctrl+&#8221;left arrow&#8221; or Ctrl+&#8221;right arrow&#8221; depending on what tab you want to select.</li>
<li> To format a paragraph, press Shift+q in normal mode. But be aware that you should avoid it with my settings, which won&#8217;t let you get a correct formatting with LaTeX files.</li>
<p>To emphasize a word, select it and press &#8220;,em&#8221; in normal mode. See other shortcuts in the latex-suite documentation. But notice that I have changed the default mapping. Instead of pressing ` and the abbreviation, you will have to press &#8220;,&#8221; and the abbreviation (the reason of this mapping is that a comma is easier to type than a &#8220;`&#8221; with a french keyboard). Here are some examples of shortcut :<br />
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" ALIGN="Center" WIDTH="80%"></p>
<th>Shortcuts</th>
<th>LaTeX commands</th>
</tr>
<tr>
<td>,md</td>
<td>\textmd{}</td>
</tr>
<tr>
<td>,tt</td>
<td>\texttt{}</td>
</tr>
<tr>
<td>,sf</td>
<td>\textsf{}</td>
</tr>
<tr>
<td>,up</td>
<td>\textup{}</td>
</tr>
<tr>
<td>,bf</td>
<td>\textbf{}</td>
</tr>
<tr>
<td>,sl</td>
<td>\textsl{}</td>
</tr>
<tr>
<td>,sc</td>
<td>\textsc{}</td>
</tr>
<tr>
<td>,it</td>
<td>\textit{}</td>
</tr>
<tr>
<td>,em</td>
<td>\emph{}</td>
</tr>
<tr>
<td>,a</td>
<td>\alpha</td>
</tr>
<tr>
<td>,b</td>
<td>\beta</td>
</tr>
<tr>
<td>,A</td>
<td>\Alpha</td>
</tr>
<tr>
<td>,B</td>
<td>\Beta</td>
</tr>
<tr>
<td>And so on<br />
etc, etc</td>
<td>I won&#8217;t show you<br />
all shortcut<br />
for more details,<br />
see the latex-suite<br />
documentation</td>
</tr>
<p></TD><br />
</TR><br />
</TABLE><br />
In any case this setting is for french keyboards, if you use another keyboard, change this in tex.vim if you want.
	</li>
<li>
If you want to search a word in google with firefox, then select the word, and press &#8220;f&#8221; in visual mode. If you want to search in Wikipedia instead of google, press &#8220;w&#8221; instead of &#8220;f&#8221; in visual mode.
</li>
</ul>
</li>
<li>
Here is another tip with Vim, really useful. Let us assume you wish to enter a word or several words which are painful to typeset with your keyboard, and let us also assume that you often use this or these words. Then using abbreviations is a nice idea. My abbreviations are set <a href="http://github.com/alexandre-k/repository_alexandre_krispin/blob/master/configuration_files_for_text_editors/vim_configuration_files/.vim/ftplugin/tex.vim">in the tex.vim, see the line 33</a>. Basically, an abbreviation is something you type and which will expand automatically to the word or the words you have set previously after you press the space key. So for example, since I have :</p>
<blockquote><p>
iab bcp beaucoup<br />
iab qqn quelqu&#8217;un<br />
iab qqc quelque chose
</p></blockquote>
<p>When I will write bcp, it will transform automatically in beaucoup when I will press the space bar.</p>
<p>Look <a href="http://vim.wikia.com/wiki/Use_abbreviations_for_frequently-used_words">here</a> or <a href="http://vimdoc.sourceforge.net/htmldoc/map.html#abbreviations">here</a> for further explanations.
</li>
<li>
With Vim, another thing really useful is imap (or nmap for normal mode, and vmap for visual map). Imaps are mappings set to work in insert mode. So for example, let us assume you wish to insert a bracket, say &#8220;(&#8220;. Since I have defined &#8220;imap  ( ()&#8221; in my tex.vim, pressing ( will automatically load the other bracket. So writing ( will write automatically (). When you write &#8220;,ja&#8221;, it will automatically write {\ja }. Same thing for &#8220;&#8230;&#8221;, it will be replaced automatically by &#8220;\ldots&#8221;. For further details, see the vim documentation (in normal mode, type &#8220;:h imap&#8221;).
</li>
<li>
Don&#8217;t forget that Vim is not as bad as Microsoft Word, OpenOffice.org Writer and other similar text processors are. Let us take an example. If you have the following :<br />
a  b  c<br />
d  e  f<br />
i  j  k<br />
Could you insert a &amp; between each letter in each lines easily ? No. But with Vim it is easy. With Word or other similar softwares, could you easily replace each letter or each word of the beginning of a line ? No. But with vim it is easy to do so. Therefore, if you are a beginner, don&#8217;t forget to search with google if something you need to do is painful, maybe there is an easy way with Vim to automatize your task and to achieve your goal.
</li>
</ol>
<p>Finally, here are some links which you could find useful :</p>
<p><a href="http://my.opera.com/subjam/blog/vim-tips">Vim tips if you don&#8217;t want to use my settings, or are just curious</a><br />
<a href="http://www-uxsup.csx.cam.ac.uk/courses/Vi/index.html">A course, &#8220;Vi : introduction&#8221;</a><br />
<a href="http://ftp.vim.org/pub/vim/doc/book/">A book about Vim available for free</a><br />
<a href="http://vim-latex.sourceforge.net/documentation/latex-suite.html">The LaTeX suite documentation in html</a> or in <a href="http://vim-latex.sourceforge.net/documentation/latex-suite.txt">txt format</a> (available in Vim)<br />
<a href="http://tnerual.eriogerg.free.fr/vim.html">A nice ref card of Vim in several formats (download the pdf file)</a> and <a href="http://tnerual.eriogerg.free.fr/vimqrc.html">another one in html</a>, maybe more clear<br />
<a href="http://www.clement-mondon.fr/?path=%2FMes+Memos%2FOutils+divers/Vim&amp;PHPSESSID=5d8b4372d5bca708af129ffbe03f1bee">French speakers should also take a look here </a><br />
In case you wish to ask a question, <a href="http://groups.google.fr/group/vim_use?pli=1">Google group</a> is a good place.<br />
<a href="http://tips.webdesign10.com/another-vim-tutorial">Another Vim tutorial</a><br />
If you are japanese, you could find <a href="http://d.hatena.ne.jp/mFumi/20090901/1251779763">this blog</a> useful.<br />
<a href="http://bepo.fr/wiki/Vim">If you are french and want to use the bépo keyboard</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexkrispin.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexkrispin.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexkrispin.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexkrispin.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/alexkrispin.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/alexkrispin.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/alexkrispin.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/alexkrispin.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexkrispin.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexkrispin.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexkrispin.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexkrispin.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexkrispin.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexkrispin.wordpress.com/484/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=484&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://alexkrispin.wordpress.com/2010/10/07/writing-latex-files-with-gvim/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c525bdd7a10e1af7026c8b55a2d9a50d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexkrispin</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/gvim.png?w=300" medium="image">
			<media:title type="html">GVim</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/gvim_2.png?w=300" medium="image">
			<media:title type="html">GVim_2</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/plugin_mru_files.png?w=300" medium="image">
			<media:title type="html">Plugin_MRU_files</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/plugin_vimexplorer.png?w=300" medium="image">
			<media:title type="html">Plugin_VimExplorer</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/plugin_nerdtree.png?w=300" medium="image">
			<media:title type="html">Plugin_NerdTree</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/plugin_nerdcommenter_block_selected.png?w=300" medium="image">
			<media:title type="html">Plugin_NerdCommenter_block_selected</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/plugin_nerdcommenter_block_commented.png?w=300" medium="image">
			<media:title type="html">Plugin_NerdCommenter_block_commented</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/plugin_autocompletion_popup.png?w=300" medium="image">
			<media:title type="html">Plugin_Autocompletion_popup</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/plugin_snipmat_sec.png?w=300" medium="image">
			<media:title type="html">Plugin_snipmate_sec</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/plugin_snipmate_section_expanded.png?w=300" medium="image">
			<media:title type="html">Plugin_snipmate_section_expanded</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/plugin_snipmate_auto_complete.png?w=300" medium="image">
			<media:title type="html">Plugin_snipmate_auto_complete</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/plugin_selectbuf.png?w=300" medium="image">
			<media:title type="html">Plugin_SelectBuf</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/plugin_buffer_explorer_split_vertically.png?w=300" medium="image">
			<media:title type="html">Plugin_buffer_explorer_split_vertically</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/plugin_fuzzyfinder_example.png?w=300" medium="image">
			<media:title type="html">Plugin_Fuzzyfinder_example</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/plugin_calendar.png?w=300" medium="image">
			<media:title type="html">Plugin_Calendar</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/typing_h_align.png?w=300" medium="image">
			<media:title type="html">typing_:h_align</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing and setting up the Vim text editor</title>
		<link>http://alexkrispin.wordpress.com/2010/10/06/installing-and-setting-vim/</link>
		<comments>http://alexkrispin.wordpress.com/2010/10/06/installing-and-setting-vim/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 21:24:03 +0000</pubDate>
		<dc:creator>alexandre krispin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://alexkrispin.wordpress.com/?p=485</guid>
		<description><![CDATA[To write LaTeX files, I use GVim which is basically Vim with a modern outlook. If you are interested to get a good text editor, use Vim or GVim with free Unix operating systems (that is to say operating systems which are under GPL or BSD license), MacVim with Mac OSX, and maybe GVim or <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=485&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To write LaTeX files, I use GVim which is basically Vim with a modern outlook. If you are interested to get a good text editor, use <a href="http://www.vim.org/">Vim</a> or <a href="http://packages.ubuntu.com/lucid/vim-gtk">GVim</a> with free Unix operating systems (that is to say operating systems which are under <a href="http://en.wikipedia.org/wiki/GNU_General_Public_License">GPL</a> or <a href="http://en.wikipedia.org/wiki/BSD_licenses">BSD</a> license), <a href="http://code.google.com/p/macvim/">MacVim</a> with Mac OSX, and maybe <a href="http://www.vim.org/download.php#pc">GVim</a> or <a href="http://linuxcommand.org/man_pages/evim1.html">Evim</a> with Microsoft Windows operating systems (XP, Vista, Seven).</p>
<p>If you make some researches about text editors, you may notice that there is a stupid &#8220;<a href="http://en.wikipedia.org/wiki/Editor_war">war</a>&#8221; between Emacs and Vim. Actually, both are excellent text editors, only the approach changes. Also, though comparing a text editor might be highly controversial and subjective, it might be right to say that Vim is one of the best text editors, available for all platforms.</p>
<p>If you wish to write LaTeX files, a well configured text editor like GVim will make your life easier, and will increase your efficiency in typesetting. Once you will have learned how to use Vim, you will also understand how ridiculous are Word processors like Microsoft Word or OpenOffice.org Writer compared to Vim or Emacs.</p>
<p>In this post I will explain, first, how to install Vim in GNU/Linux, FreeBSD, Microsoft Windows and Mac OSX, and secondly, I will write a short explanation of my setup.</p>
<ol>
<li><strong>For GNU/Linux    </strong> To install GVim with GNU/Linux, the version of Vim with a modern interface, you have 2 choices. (1) To install it with your package manager. If you have Ubuntu, install Vim-gtk with Ubuntu Software Center :<br />
<a href="http://alexkrispin.files.wordpress.com/2010/10/ubuntu_software_center__vim-gtk.png"><img class="alignnone size-medium wp-image-486" title="Ubuntu_Software_center_:_Vim-gtk" src="http://alexkrispin.files.wordpress.com/2010/10/ubuntu_software_center__vim-gtk.png?w=300&#038;h=168" alt="" width="300" height="168" /></a><br />
(2) Th second choice is to install GVim from the official website, useful if you want the latest version of Vim (currently, 7.3) :<br />
<a href="http://ftp.vim.org/pub/vim/unix/">http://ftp.vim.org/pub/vim/unix/</a><br />
Download the latest version, at the bottom of the page. Notice that to install it with Ubuntu, you will need some development libraries, such as libx11-dev, libgtk2.0-dev and another one but I don&#8217;t remember (look at the compilation errors, or the INSTALL* file). So if you are not familiar with command line and compilation errors, I recommend to use your package manager instead of the tarball file of the official website.</li>
<li><strong>For FreeBSD</strong> To install GVim with FreeBSD, you could choose the second way I have described above for GNU/Linux, or to install it from ports (notice that the install process with ports is quite long thanks to patches) :<br />
<code><br />
su<br />
cd /usr/ports/editors/vim<br />
make WITH_GTK2=yes<br />
make install clean<br />
</code></li>
<li><strong>For Microsoft Windows    </strong> Though I am not really aware of the install process with any version of Windows (I have never used Windows on my laptop), I suppose you will have to install and download it from the following url :<br />
<a href="link to download the windows version of Vim">http://www.vim.org/download.php#pc</a></li>
<li><strong>For Mac OSX    </strong> I don&#8217;t have tried to install Vim on Mac OSX, but try the following link :<br />
<a href="MacVim">http://macvim.org/OSX/index.php</a></li>
</ol>
<p>Secondly, you have to make Vim work like you want. Indeed, you won&#8217;t be efficient with Vim if you don&#8217;t have a good setup. Since I have already done the job (thanks to all informations I have gathered from the internet), you will just have to make a copy of my git repository. To do so, you will need to install git if you don&#8217;t have it. If you are not familiar with the command line and use Ubuntu, copy-paste the following in a terminal (to open a terminal, press &#8220;ctrl+alt+t&#8221;) :<br />
<code><br />
cd ~<br />
sudo apt-get install git<br />
git https://alexandre-k@github.com/alexandre-k/repository_alexandre_krispin.git<br />
cp ~/repository_alexandre_krispin/configuration_files_for_text_editors/vim_configuration_files/.vim ~/.vim<br />
cp ~/repository_alexandre_krispin/configuration_files_for_text_editors/vim_configuration_files/.vimrc ~/.vimrc<br />
cp ~/repository_alexandre_krispin/configuration_files_for_text_editors/vim_configuration_files/.gvimrc ~/.gvimrc<br />
</code><br />
That&#8217;s all. Notice that I don&#8217;t have used my setup with Mac OSX and Windows, and I don&#8217;t know if I will be able to help you if you have any troubles with Windows.</p>
<p>Now I will explain my .vimrc, my .gvimrc and then my tex.vim (located in .vim/ftplugin/) :</p>
<ol>
<li>First, my .vimrc (located in /home/your_username/.vimrc in free Unix operating systems like GNU/Linux and *BSD). You can take a look at it in <a href="http://github.com/alexandre-k/repository_alexandre_krispin/blob/master/configuration_files_for_text_editors/vim_configuration_files/.vimrc">my Github repository</a> :<br />
<blockquote><p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8221;		Basic settings for LaTeXsuite<br />
&#8220;http://vim-latex.sourceforge.net/documentation/latex-suite/recommended-settings.html<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8221; REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.<br />
filetype plugin on</p></blockquote>
<p>This setting will allow you to get the right settings according to the file extension. In other words, it will load all settings used with LaTeX-suite.</p>
<blockquote><p>&#8221; IMPORTANT: win32 users will need to have &#8216;shellslash&#8217; set so that latex<br />
&#8221; can be called correctly.<br />
&#8220;set shellslash</p>
<p>&#8221; IMPORTANT: grep will sometimes skip displaying the file name if you<br />
&#8221; search in a singe file. This will confuse Latex-Suite. Set your grep<br />
&#8221; program to always generate a file-name.<br />
set grepprg=grep\ -nH\ $*</p>
<p>&#8221; OPTIONAL: This enables automatic indentation as you type.<br />
filetype indent on</p>
<p>&#8221; OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to<br />
&#8221; &#8216;plaintex&#8217; instead of &#8216;tex&#8217;, which results in vim-latex not being loaded.<br />
&#8221; The following changes the default filetype back to &#8216;tex&#8217;:<br />
let g:tex_flavor=&#8217;latex&#8217;</p>
<p>&#8220;To jump from a section to another one<br />
map  ]s :/\\\(sub\)\{,2}section\s*{ :noh<br />
map  [s <img src='http://s1.wp.com/wp-includes/images/smilies/icon_confused.gif' alt=':?' class='wp-smiley' /> \\\(sub\)\{,2}section\s*{ :noh</p></blockquote>
<p>This part is just a copy of the recommended settings from the official website of Latex-suite.</p>
<blockquote><p>"------------------------------------------------------------------------<br />
"				General settings<br />
"------------------------------------------------------------------------<br />
let b:loaded_tex_autoclose = 1<br />
let g:autoclose = 1<br />
set backspace=indent,eol,start "allow backspacing over everything in insert mode<br />
set textwidth=80<br />
set title                " change the terminal's title<br />
syntax on		"switch on syntax highlight<br />
set undolevels=1000	"number of undos<br />
set history=1000"	"sets how many lines of history VIM has to remember<br />
set complete+=k         " enable dictionary completion<br />
set clipboard+=unnamed  " yank and copy to X clipboard<br />
set showmatch		"show pairs of brackets<br />
set hlsearch        " When there is a previous search pattern, highlight all<br />
" its matches.<br />
set incsearch       " While typing a search command, show immediately where the<br />
" so far typed pattern matches.<br />
set ignorecase      " Ignore case in search patterns.<br />
set smartcase       " Override the 'ignorecase' option if<br />
set wrapscan                          " end of search has been achieved!<br />
set magic		"regexp version magic<br />
set cursorline   	"highlight current line<br />
set cursorcolumn 	"highlight current column<br />
set wildmenu<br />
set wildignore=*.o,*~,*.cmo,*.cmi,*.a,*.cmx,*.cmxa,*.lo,*.log,*.aux,*.dvi,*.aut,*.aux,*.bbl,*.blg,*.dvi,*.fff,*.out,*.pdf,*.ps,*.toc,*.ttt<br />
set number		"to show line number<br />
"set nocompatible	"seems that setting Vim not to be compatible with Vi disables the setting bellow, whichwrap.<br />
"Therefore I disable it<br />
set whichwrap=b,s,,[,]	&#8221; Allow specified keys that move the cursor left/right<br />
&#8221; to move to the previous/next line when the cursor is on the first/last character<br />
&#8221; in the line. b (backspace), s (space) and the arrows.  set nostartofline<br />
&#8221; Do not place the cursor at the start of the line when using Page up/down.<br />
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.out,.toc &#8220;for file names completion<br />
set hi=2000		&#8221; remember last 2000 typed commands<br />
set autoread	&#8221; Set to auto read when a file is changed from the outside<br />
set enc=utf-8<br />
set hidden	&#8221; It hides buffers instead of closing them. This means that you<br />
&#8221; can have unwritten changes to a file and open a new file using :e, without being<br />
&#8221; forced to write or undo your changes first. Also, undo buffers and marks are<br />
&#8221; preserved while the buffer is open.<br />
set visualbell           &#8221; don&#8217;t beep<br />
set noerrorbells         &#8221; don&#8217;t beep<br />
set list		&#8221; Vim can highlight whitespaces for you in a convenient way:<br />
set listchars=tab:&gt;.,trail:.,extends:#,nbsp:.<br />
set laststatus=2	&#8220;status bar<br />
set statusline=%n:\ %f%m%r%h%w\ [%Y,%{&amp;fileencoding},%{&amp;fileformat}]\ [%l-%L,%v][%p%%]\ [%{strftime(\"%l:%M:%S\ \%p,\ %a\ %b\ %d,\ %Y\")}]<br />
set ruler<br />
set rulerformat=%25(%n%m%r:\ %Y\ [%l,%v]\ %p%%%)<br />
&#8221; toujours afficher le mode courant<br />
set showcmd		 &#8220;show the command being typed</p></blockquote>
<p>Then come the general settings. Since they are well commented, I let you read by yourself. To sum up, I have put here some settings about the text width, the search, the cursor, the status line, and other stuff for convenience that you can find everywhere on the internet.</p>
<blockquote><p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8221; change cursor colour depending upon mode<br />
if exists(&#8216;&amp;t_SI&#8217;)<br />
let &amp;t_SI = &#8220;\]12;lightgoldenrod\x7&#8243;<br />
let &amp;t_EI = &#8220;\]12;grey80\x7&#8243;<br />
endif</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8221; Backups<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
set nobackup<br />
set backupcopy=auto<br />
set backupskip=/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*test*,*temp*,*tmp*,*tst*,*~,*bak</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;nice colors and fonts<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
colorscheme herald<br />
colors herald<br />
&#8220;set guifont=DejaVu\ Sans\ Mono\ 10<br />
set guifont=Inconsolata\ 12 &#8221; very nice, but leaves terrible artefacts with national (mostly russian) characters<br />
&#8220;set guifont=Terminus\ 10 &#8221; wonderful, yet smallish, and sucks at larger sizes<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8221; GUI Options<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8220;if has(&#8220;gui_running&#8221;)<br />
&#8221;	&#8221; GUI cursor: no blinking<br />
set guicursor+=a:blinkon0<br />
&#8220;<br />
&#8221;	&#8221; no toolbar<br />
&#8221;	set guioptions-=T<br />
&#8221;	&#8221; no autoselect<br />
&#8221;	set guioptions-=a<br />
&#8220;<br />
&#8221;	&#8221; Use console messages instead of GUI dialogs<br />
&#8221;	set guioptions+=c<br />
&#8220;endif</p></blockquote>
<p>The most important thing here is the settings for backups. Since backup files annoyed me, I have set it to &#8220;nobackup&#8221;. If you prefer to get backup, replace &#8220;set nobackup&#8221; by &#8220;set backup&#8221;. Also, the color scheme is &#8220;herald&#8221;, a nice one, and the font is inconsolata. If you prefer to get a more shiny or simply another color scheme you would like, check the demos at the following url :<br />
<a href="http://www.vi-improved.org/color_sampler_pack/">Color sampler pack</a><br />
Or this one :<br />
<a href="http://vimcolorschemetest.googlecode.com/svn/html/index-tex.html">Color samples with LaTeX files</a><br />
Once you have chosen, replace the &#8220;herald&#8221; colorscheme by the one you want.</p>
<blockquote><p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8220;formatting<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
set formatoptions=tcroqn &#8221; see help<br />
&#8220;set formatoptions=c,q,r,t &#8221; This is a sequence of letters which describes how<br />
&#8221; automatic formatting is to be done.<br />
&#8220;<br />
&#8221; letter    meaning when present in &#8216;formatoptions&#8217;<br />
&#8221; &#8212;&#8212;    &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8221; c         Auto-wrap comments using textwidth, inserting<br />
&#8221;           the current comment leader automatically.<br />
&#8221; q         Allow formatting of comments with &#8220;gq&#8221;.<br />
&#8221; r         Automatically insert the current comment leader<br />
&#8221;           after hitting  in Insert mode.<br />
&#8221; t         Auto-wrap text using textwidth (does not apply<br />
&#8221;           to comments)<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
set smartindent      &#8221; turn on smart indenting<br />
set autoindent    &#8221; always set autoindenting on<br />
set copyindent    &#8221; copy the previous indentation on autoindenting<br />
set shiftwidth=4  &#8221; number of spaces to use for autoindenting<br />
set shiftround    &#8221; use multiple of shiftwidth when indenting with &#8216;&lt;&#8217; and &#8216;&gt;&#8217;<br />
set smarttab      &#8221; insert tabs on the start of a line according to<br />
&#8221;    shiftwidth, not tabstop<br />
set comments+=:%,:\\begin{,:\\end{,:\\title{,:\\author{,:\\subtitle{,:\\part{,:\\chapter{,:\\section{,:\\subsection{,:\\subsubsection{,:\\paragraph,:\\subparagraph{,:\\usepackage{,:\\documenclass{,:\\usepackage[,:\\item[,:\\item<br />
"setlocal indentkeys+=},=\\item,=\\bibitem,=\\else,=\\fi,=\\or,=\\]</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8221; indentation automatique (à la Emacs)<br />
&#8220;vnoremap    =$<br />
&#8220;vnoremap    =<br />
&#8220;nnoremap    =$<br />
&#8220;nnoremap  mzvip=`z</p>
<p>&#8220;let g:tex_indent_items = 1</p></blockquote>
<p>Here are settings to make formatting work&#8230; But it doesn&#8217;t work well for LaTeX files, I am sorry for the inconvenience. Since I don&#8217;t really need to format LaTeX files (I write it correctly), I don&#8217;t really care of this. If one day I receive files badly formatted, then I will try to make it work. However, if you just plan to write LaTeX files, then the current settings might be sufficient.</p>
<blockquote><p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8220;TAB BAR<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8221; set up tab labels with tab number, buffer name, number of windows<br />
function! GuiTabLabel()<br />
let label = &#8221;<br />
let bufnrlist = tabpagebuflist(v:lnum)</p>
<p>&#8221; Add &#8216;+&#8217; if one of the buffers in the tab page is modified<br />
for bufnr in bufnrlist<br />
if getbufvar(bufnr, &#8220;&amp;modified&#8221;)<br />
let label = &#8216;+&#8217;<br />
break<br />
endif<br />
endfor</p>
<p>&#8221; Append the tab number<br />
let label .= tabpagenr().&#8217;: &#8216;</p>
<p>&#8221; Append the buffer name<br />
let name = bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])<br />
if name == &#8221;<br />
&#8221; give a name to no-name documents<br />
if &amp;buftype==&#8217;quickfix&#8217;<br />
let name = &#8216;[Quickfix List]&#8216;<br />
else<br />
let name = &#8216;[Not yet saved]&#8216;<br />
endif<br />
else<br />
&#8221; get only the file name<br />
let name = fnamemodify(name,&#8221;:t&#8221;)<br />
endif<br />
let label .= name</p>
<p>&#8221; Append the number of windows in the tab page<br />
let wincount = tabpagewinnr(v:lnum, &#8216;$&#8217;)<br />
return label . &#8216;  [' . wincount . ']&#8216;<br />
endfunction</p>
<p>&#8221; set up tab tooltips with every buffer name<br />
function! GuiTabToolTip()<br />
let tip = &#8221;<br />
let bufnrlist = tabpagebuflist(v:lnum)</p>
<p>for bufnr in bufnrlist<br />
&#8221; separate buffer entries<br />
if tip!=&#8221;<br />
let tip .= &#8216; | &#8216;<br />
endif</p>
<p>&#8221; Add name of buffer<br />
let name=bufname(bufnr)<br />
if name == &#8221;<br />
&#8221; give a name to no name documents<br />
if getbufvar(bufnr,&#8217;&amp;buftype&#8217;)==&#8217;quickfix&#8217;<br />
let name = &#8216;[Quickfix List]&#8216;<br />
else<br />
let name = &#8216;[Not yet saved]&#8216;<br />
endif<br />
endif<br />
let tip.=name</p>
<p>&#8221; add modified/modifiable flags<br />
if getbufvar(bufnr, &#8220;&amp;modified&#8221;)<br />
let tip .= &#8216; [+]&#8216;<br />
endif<br />
if getbufvar(bufnr, &#8220;&amp;modifiable&#8221;)==0<br />
let tip .= &#8216; [-]&#8216;<br />
endif<br />
endfor</p>
<p>return tip<br />
endfunction</p>
<p>set guitablabel=%!GuiTabLabel()<br />
set guitabtooltip=%!GuiTabToolTip()</p></blockquote>
<p>Here are settings for the tab bar. Notice that for some Vim users, it seems to be a kind of pride an joy, but you can get tab bars with Emacs, Kile, and other softwares.</p>
<blockquote><p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;spelling&#8230;<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;to enable spell checking by default, uncomment the following line,<br />
&#8220;set spell<br />
&#8221; automatic spell checking in your language for .txt et .tex. Replace &#8220;fr&#8221; by your default<br />
&#8221; language, &#8220;en&#8221; if english :</p>
<p>&#8220;augroup filetypedetect<br />
&#8220;au BufNewFile,BufRead *.txt setlocal spell spelllang=fr<br />
&#8220;au BufNewFile,BufRead *.tex setlocal spell spelllang=fr<br />
&#8220;augroup END</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8221; painless spell checking<br />
&#8221; for French, you&#8217;ll need<br />
&#8221; wget http://ftp.vim.org/pub/vim/runtime/spell/fr.utf-8.sug<br />
&#8221; wget http://ftp.vim.org/pub/vim/runtime/spell/fr.utf-8.spl<br />
&#8221; which you may move into ~/.vim/spell<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
function s:spell_fr()<br />
if !exists(&#8220;s:spell_check&#8221;) || s:spell_check == 0<br />
echo &#8220;Spell checking activated (french)&#8221;<br />
let s:spell_check = 1<br />
setlocal spell spelllang=fr<br />
else<br />
echo &#8220;Spell checking canceled&#8221;<br />
let s:spell_check = 0<br />
setlocal spell spelllang=<br />
endif<br />
endfunction<br />
&#8221; for English<br />
function s:spell_en()<br />
if !exists(&#8220;s:spell_check&#8221;) || s:spell_check == 0<br />
echo &#8220;Spell checking activated (english)&#8221;<br />
let s:spell_check = 1<br />
setlocal spell spelllang=en<br />
else<br />
echo &#8220;Spell checking canceled&#8221;<br />
let s:spell_check = 0<br />
setlocal spell spelllang=<br />
endif<br />
endfunction</p>
<p>&#8220;See mapping for spell checking in the relevant section, l. 361</p>
<p>&#8220;&#8212;&#8212;&#8211;Another trick for spell checking is the following line :<br />
&#8220;uncomment if you want to use it, type &#8220;,C&#8221; if you want to enable it,<br />
&#8220;and replace aspell by any other dictionary you use (ispell, hunspell)<br />
&#8220;map ,C :w:!aspell -c %:e %&#8221;</p></blockquote>
<p>Here are settings for spell checking. If you want to enable spell checking by default, there are several ways. One is to uncomment the lines :<br />
<code>""augroup filetypedetect<br />
"au BufNewFile,BufRead *.txt setlocal spell spelllang=fr<br />
"au BufNewFile,BufRead *.tex setlocal spell spelllang=fr<br />
"augroup END"</code><br />
and to replace &#8220;fr&#8221; by &#8220;en&#8221; or any other abbreviation depending on the language you use.</p>
<blockquote><p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8220;For tags, but doesn&#8217;t work<br />
let tlist_tex_settings   = &#8216;latex;s:sections;g:graphics;l:labels&#8217;<br />
let tlist_make_settings  = &#8216;make;m:makros;t:targets&#8217;</p></blockquote>
<p>Here was a rest of the period when I tried to set up tags for LaTeX files, but didn&#8217;t get it successfully working. And since I don&#8217;t care and don&#8217;t have time for it, I let it for better days.</p>
<blockquote><p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8221;				MAPPING<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8220;Saving<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
map  :w<br />
imap  :w</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8221; Terminal<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
map  :!gnome-terminal &amp;<br />
imap  :!gnome-terminal &amp;</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8221; Graphical file manager<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
map  :!nautilus &amp;<br />
map  :!nautilus &amp;</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8220;Exit<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8220;exit<br />
map  :q<br />
imap  :q<br />
&#8220;exit all<br />
map  :qall<br />
imap  :qall<br />
&#8220;force Exit<br />
map  :qall!<br />
imap  :qall!</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8220;Mapping to activate file explorer<br />
&#8220;of the specified directory<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8220;To display NERDTree<br />
nnoremap   :NERDTree /home/freeman/<br />
&#8221; To display VimExplorer<br />
nmap   :VE %:p:h</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8220;Mapping to explorer of recent file,<br />
&#8220;Most recently used files<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
map  :Mru<br />
imap  :Mru</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;-<br />
&#8220;SelectBuf<br />
&#8220;&#8212;&#8212;&#8212;&#8212;-<br />
nmap<br />
SelectBuf<br />
noremap<br />
SelBufHelpKey</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;Compiling and viewing its .tex file<br />
&#8220;with XeLaTeX and evince (set in tex.vim)<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;Compile and start viewer<br />
map  ;ll ;lv<br />
imap  ;ll ;lv<br />
&#8220;Compile only<br />
map  ;ll<br />
imap  ;ll</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;To enable spell checking for french :<br />
noremap    :call spell_fr()<br />
inoremap   :call spell_fr()<br />
vnoremap   :call spell_fr()<br />
&#8221; and for english :<br />
noremap   :call spell_en()<br />
inoremap  :call spell_en()<br />
vnoremap  :call spell_en()</p></blockquote>
<p>Here are settings related to F* keys. I will explain their use latter, though you might be able to undestand it easily by yourself thanks to comments. Notice that if you don&#8217;t use gnome-terminal as terminal and nautilus as file manager, you will have to change the settings (if you don&#8217;t understand what I am talking about and use Ubuntu, then don&#8217;t worry and don&#8217;t change anything).</p>
<blockquote><p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8220;Ctrl+Insert to copy into clipboard<br />
&#8220;Shift+Insert to paste from clipboard<br />
&#8220;Shift+Delete to cut into clipboard<br />
&#8220;Ctrl+a to select all<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
nmap  &#8220;+gP<br />
imap  i<br />
vmap  &#8220;+y<br />
map  ggVG<br />
map  &#8220;+x</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8220;Mapping to desactivate highligting<br />
&#8220;of search results<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
nnoremap   :noh</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8221; firefox like shorcuts<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
map      :tabnew<br />
map   :tabnext<br />
map  :tabprevious<br />
map  :e</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8221; Quickly edit/reload the vimrc file<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
nmap  ev :e $MYVIMRC<br />
nmap  sv :so $MYVIMRC</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8221; Use Q for formatting the current paragraph (or selection)<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
vmap Q gq<br />
nmap Q gqap</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;If you like long lines with line wrapping enabled<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
nnoremap j gj<br />
nnoremap k gk</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8221; unmap arrows/pgdn/pgup so you learn to use hjkl<br />
map  \<br />
map  \<br />
map  \<br />
map  \<br />
map<br />
\<br />
map<br />
\</p>
<p>imap<br />
imap<br />
imap<br />
imap<br />
imap</p>
<p>imap</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;Tired of clearing highlighted searches ?<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
nmap  ,/ :nohlsearch</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;Will search the word in firefox where<br />
&#8220;the cursor is when typing g in visual mode<br />
&#8220;big thanks to http://la.firme.perso.esil.univmed.fr/website/article.php3?id_article=70<br />
vmap f :!firefox &#8220;http://www.google.fr/search?hl=fr&amp;q=&amp;btnG=Recherche+Google&amp;meta=&#8221; &gt;&amp; /dev/null<br />
&#8220;A similar behaviour but for Wikipedia<br />
vmap w :!firefox &#8220;http://en.wikipedia.org/wiki/&#8221; &gt;&amp; /dev/null</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;For qwerty keyboards : instead of<br />
&#8220;pressing &#8220;shift&#8221;+&#8221;;&#8221;, you will just<br />
&#8220;have to press ;, and say w to save.<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8220;nnoremap ; :</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;when you forgot to sudo before editing a file that requires root privileges<br />
&#8220;(typically /etc/hosts). This lets you use w!! to do that after you opened the<br />
&#8220;file already<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
cmap w!! w !sudo tee % &gt;/dev/null</p></blockquote>
<p>Here are other settings to easily copy, paste, etc. Notice that I have disable arrow keys to force beginners to use hjkl keys.</p>
<blockquote><p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8221;			MiSCELLANOUS<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8221; Go back where I left off<br />
autocmd BufReadPost * call RestoreCursorPos()<br />
autocmd BufWinEnter * call OpenFoldOnRestore()</p>
<p>&#8221; Restore my cursor position<br />
function! RestoreCursorPos()<br />
if expand(&#8220;:p:h&#8221;) !=? $TEMP<br />
if line(&#8220;&#8216;\&#8221;") &gt; 1 &amp;&amp; line(&#8220;&#8216;\&#8221;") &lt;= line(&#8220;$&#8221;)             let line_num = line(&#8220;&#8216;\&#8221;")             let b:doopenfold = 1             if (foldlevel(line_num) &gt; foldlevel(line_num &#8211; 1))<br />
let line_num = line_num &#8211; 1<br />
let b:doopenfold = 2<br />
endif<br />
execute line_num<br />
endif<br />
endif<br />
endfunction</p>
<p>&#8221; Open the fold if restoring cursor position<br />
function! OpenFoldOnRestore()<br />
if exists(&#8220;b:doopenfold&#8221;)<br />
execute &#8220;normal zv&#8221;<br />
if(b:doopenfold &gt; 1)<br />
execute &#8220;+&#8221;.1<br />
endif<br />
unlet b:doopenfold<br />
endif<br />
endfunction</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8221; 日本語入力に関する設定:<br />
&#8220;<br />
if has(&#8216;multi_byte_ime&#8217;) || has(&#8216;xim&#8217;)<br />
&#8221; IME ON時のカーソルの色を設定(設定例:紫)<br />
highlight CursorIM guibg=Purple guifg=NONE<br />
&#8221; 挿入モード・検索モードでのデフォルトのIME状態設定<br />
set iminsert=0 imsearch=0<br />
if has(&#8216;xim&#8217;) &amp;&amp; has(&#8216;GUI_GTK&#8217;)<br />
&#8221; XIMの入力開始キーを設定:<br />
&#8221; 下記の s-space はShift+Spaceの意味でkinput2+canna用設定<br />
&#8220;set imactivatekey=s-space<br />
endif<br />
&#8221; 挿入モードでのIME状態を記憶させない場合、次行のコメントを解除<br />
&#8220;inoremap   :set iminsert=0<br />
endif</p>
<p>&#8221; 日本語入力用のkeymapの設定例 (コメントアウト)<br />
&#8220;if has(&#8216;keymap&#8217;)<br />
&#8221;  &#8221; ローマ字仮名のkeymap<br />
&#8221;  &#8220;silent! set keymap=japanese<br />
set iminsert=0 imsearch=0 &#8221; 入力時の初期状態 = IME OFF<br />
&#8220;endif</p></blockquote>
<p>Finally, here are settings to restore the position when you open again your file, and some settings to use ibus with japanese. Unfortunatly, it seems ibus conflicts with Latex-suite, and I don&#8217;t have time to search where does the problem come from. Since I don&#8217;t expect to write japanese files at the moment, I won&#8217;t search a solution until I have time. But if you can use ibus with GVim, then comments are welcome.</p>
<li>Secondly, here are my settings for .gvimrc. You can find it in <a href="http://github.com/alexandre-k/repository_alexandre_krispin/blob/master/configuration_files_for_text_editors/vim_configuration_files/.gvimrc">my repository at Github</a> :<br />
<blockquote><p>
&#8221; ウインドウの幅<br />
set columns=200<br />
&#8221; ウインドウの高さ<br />
set lines=150<br />
&#8220;set guioptions+=c 	&#8221; use console dialogs, not the gui ones<br />
set guioptions-=T 	&#8221; don&#8217;t show the toolbar<br />
set guioptions-=m 	&#8221; don&#8217;t show the menu<br />
set guioptions-=r 	&#8221; don&#8217;t need right scrollbar<br />
set guioptions-=L 	&#8221; don&#8217;t show left scrollbars
</p></blockquote>
<p>Basically, it will allow you to get a bigger window at startup than the default one, and it will disable useless things like scrollbars.
</li>
<li>Thirdly, I will present my tex.vim file, that you can also find in <a href="http://github.com/alexandre-k/repository_alexandre_krispin/blob/master/configuration_files_for_text_editors/vim_configuration_files/.vim/ftplugin/tex.vim">my repository at Github</a> :<br />
<blockquote><p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8221;			General settings<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;let g:autoclose = 1<br />
&#8220;let g:Tex_SmartKeyQuote = 1</p>
<p>setlocal efm+=%E%f:%l:\ %m</p>
<p>let g:Tex_DefaultTargetFormat=&#8217;pdf&#8217;<br />
let g:Tex_CompileRule_pdf=&#8217;/usr/local/texlive/2010/bin/i386-linux/xelatex $*&#8217;</p>
<p>let g:Tex_ViewRule_dvi = &#8216;xdvi&#8217;<br />
let g:Tex_ViewRule_ps  = &#8216;gv&#8217;<br />
let g:Tex_ViewRule_pdf = &#8216;evince&#8217;</p></blockquote>
<p>Here are some settings to make Vim call the correct software related to the corresponding output. So for *.dvi files, I use xdvi, for *.ps files, gv, and for *.pdf files, evince. If you use other softwares, then replace the settings accordingly. If you use Ubuntu, then don&#8217;t do anything.</p>
<blockquote><p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8220;Enhanced Vim formatting of LaTeX files<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8220;map \gq ?^$\\|^\s*\(\\begin\\|\\end\\|\\label\\|\\documentclass\\|\\usepackage\\|\\paragraph\\item\)?1gq//+1<br />
&#8220;omap lp ?^$\\|^\s*\(\\begin\\|\\end\\|\\label\)?1//-1.</p>
<p>&#8220;&#8221;To format LaTeX files,</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8220;Dictionaries<br />
autocmd Filetype tex,latex :set dictionary=~/.vim/ftplugin/latex-suite/dictionaries/dictionary,/home/linux/.vim/spell</p></blockquote>
<p>Here are other rests from the period when I tried to setup a correct formatting with Vim for LaTeX files. Also, there is the settings for dictionaries, which are located in my home directory, ~/ (the abbreviation of /home/your_username).</p>
<blockquote><p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8221;			Abbreviations<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
iab ds dans<br />
iab bcp beaucoup<br />
iab qqn quelqu&#8217;un<br />
iab qqc quelque chose<br />
iab pol politique<br />
iab leurope l&#8217;Europe<br />
iab tv télévision<br />
iab ceca CECA<br />
iab ue Union Européenne<br />
iab CE Commission Européenne<br />
iab AL Amérique Latine<br />
iab letat l&#8217;État<br />
iab socio sociologie<br />
iab éco économie<br />
iab math mathématique<br />
iab xelatex \XeLaTeX<br />
iab latex \LaTeX<br />
iab ak Alexandre Krispin</p></blockquote>
<p>Here are settings for abbreviations. Remove them if you don&#8217;t use it. Also, notice that since the abbreviations are in the file &#8220;tex.vim&#8221; (~/.vim/ftplugin/tex.vim), they won&#8217;t be available for other files. If you want to make your abbreviations available for all files (.txt, .tex, .sty, etc), then copy your&#8217;s in the file .vimrc.</p>
<blockquote><p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8221;				MAPPING<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;Change the mapleader from \ to ,<br />
let mapleader=&#8221;;&#8221;</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;fixing of é letter :<br />
imap  it<br />
Tex_InsertItemOnThisLine<br />
imap<br />
Tex_MathBF<br />
imap<br />
Tex_MathCal<br />
imap<br />
Tex_LeftRight</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8220;Another shortcut for placeholders.<br />
&#8220;The default one is ctrl+j, really<br />
&#8220;annoying. Pressing shift+tab is easier<br />
imap<br />
IMAP_JumpForward</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8220;useful imaps<br />
imap  ,ja {\ja<br />
&#8220;the above imap is intended to work with<br />
&#8220;my setup for japanese in my templates compiled<br />
&#8220;with XeLaTeX. For more details, look at my<br />
&#8220;blog : http://alexkrispin.wordpress.com/<br />
imap  &#8230; \ldots</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8220;autoclose brackets<br />
&#8220;Actually you can get a similar<br />
&#8220;behavior with snippets : just type (,<br />
&#8220;and then press the tab key. In case<br />
&#8220;you prefer snippets, comment the<br />
&#8220;following 3 lines<br />
imap  { {}<br />
imap  ( ()<br />
imap  [ []</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8220;With XeLaTeX, these imaps are no longer<br />
&#8220;required since you compile with<br />
&#8220;unicode. In case you use pdfLaTeX to<br />
&#8220;compile, enable the following :<br />
&#8220;imap  « \og<br />
&#8220;imap  » \fg<br />
&#8220;imap  € \EUR<br />
&#8220;imap ~ $\sim\<br />
&#8220;imap  &#8221; \textquotedblleft<br />
&#8220;imap  ¢ \textquotedblright\</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;If you have a french keyboard, this setting<br />
&#8220;will let you easily put, let say `bf.<br />
&#8220;Instead of inserting `bf in normal mode<br />
&#8220;you will just have to insert ,bf (therefore,<br />
&#8220;no need of the Alt Gr key)<br />
vmap   , `</p></blockquote>
<p>Finally, I have set up my mappings :</p>
<ul>
<li> since I use an azerty keyboard, I have changed the map leader (&#8220;\&#8221;) to &#8220;;&#8221;. If you have another type of keyboard, then set the map leader to any other key you want.</li>
<li>Also, if you don&#8217;t need to write the &#8220;é&#8221;, remove this setting.</li>
<li> Notice that I have made another setting to move the cursor to the placeholder (&#8220;&lt;++&gt;&#8221;), I prefer to type shift+tab rather than &#8220;ctrl+j&#8221;, but remove it if you want.</li>
<li>Since one day I will use Vim to write in japanese and maybe in arabic or persian (who knows) I have set the command &#8220;,ja&#8221; to write automatically &#8220;{\ja }&#8221; in LaTeX files. Further informations in the second part of my post about Vim.</li>
<li>An other thing which might be worth to say is that if you write &#8220;&#8230;&#8221; in a LaTeX file, it will be automatically replaced by &#8220;\ldots&#8221;. If you don&#8217;t use XeLaTeX but LaTeX, you might find useful to uncomment lines like &#8220;imap  € \EUR.</li>
<li>lastly, notice that I have change the &#8220;`&#8221; to &#8220;,&#8221; (more easy to type with french keyboard). So if you want to enter, let say, \textbf{}, then press &#8220;,bf&#8221; instead of the usual &#8220;`bf&#8221;.</li>
</ul>
</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexkrispin.wordpress.com/485/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexkrispin.wordpress.com/485/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexkrispin.wordpress.com/485/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexkrispin.wordpress.com/485/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/alexkrispin.wordpress.com/485/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/alexkrispin.wordpress.com/485/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/alexkrispin.wordpress.com/485/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/alexkrispin.wordpress.com/485/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexkrispin.wordpress.com/485/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexkrispin.wordpress.com/485/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexkrispin.wordpress.com/485/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexkrispin.wordpress.com/485/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexkrispin.wordpress.com/485/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexkrispin.wordpress.com/485/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=485&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://alexkrispin.wordpress.com/2010/10/06/installing-and-setting-vim/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c525bdd7a10e1af7026c8b55a2d9a50d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexkrispin</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/10/ubuntu_software_center__vim-gtk.png?w=300" medium="image">
			<media:title type="html">Ubuntu_Software_center_:_Vim-gtk</media:title>
		</media:content>
	</item>
		<item>
		<title>Writing math with XeLaTeX</title>
		<link>http://alexkrispin.wordpress.com/2010/09/27/writing-math-with-xelatex/</link>
		<comments>http://alexkrispin.wordpress.com/2010/09/27/writing-math-with-xelatex/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 17:12:12 +0000</pubDate>
		<dc:creator>alexandre krispin</dc:creator>
				<category><![CDATA[XeLaTeX]]></category>

		<guid isPermaLink="false">http://alexkrispin.wordpress.com/?p=445</guid>
		<description><![CDATA[The following is a short explanation for those who wish to get the basics to write math with XeLaTeX : First, you will notice, if you look at the xelatex directory, that there is a mathspec folder. If you don&#8217;t know where is your xelatex folder, then look here if you have installed TeXlive with <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=445&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following is a short explanation for those who wish to get the basics to write math with XeLaTeX :</p>
<ul>
<li>First, you will notice, if you look at the xelatex directory, that there is a mathspec folder. If you don&#8217;t know where is your xelatex folder, then look here if you have installed TeXlive with the installation script :<br />
<blockquote><p>/usr/local/texlive/2010/texmf-dist/doc/xelatex/mathespec/</p></blockquote>
<p>Or look here if you have installed TeXlive with your package manager :</p>
<blockquote><p>/usr/share/doc/texlive-doc/xelatex/mathspec/</p></blockquote>
</li>
<li> But a better choice might be to use unicode-math, though it is still in its beta stage. Documentation about this package is located in the following directory in case you have installed TeXlive with the installation script install-tl :<br />
<blockquote><p>/usr/local/texlive/2010/texmf-dist/doc/latex/unicode-math</p></blockquote>
<p>Or here if you have installed TeXlive with your package manager :</p>
<blockquote><p>/usr/share/doc/texlive-doc/latex/unicode-math</p></blockquote>
</li>
<p>Let us assume you wish to use the unicode-math package. Then, you will have to load it :</p>
<blockquote><p>\usepackage{unicode-math}</p></blockquote>
<p>And to define the font for math :</p>
<blockquote><p>\setmathfont{Asana Math}</p></blockquote>
<p>Consequently, here is an example of minimal preamble to write math and compile with XeLaTeX :</p>
<blockquote><p>\documentclass{article}<br />
\usepackage{unicode-math}<br />
\usepackage{amsmath}<br />
\usepackage{xltxtra}<br />
\setmainfont{TeX Gyre Pagella}<br />
\setmathfont{Asana Math}</p></blockquote>
<p>Where article is a class to make a test, unicode-math the package to input math with XeLaTeX, amsmath the usual package for math and xltxtra the usual package for XeLaTeX which load some useful modules (see the xltxtra for a list of these modules).<br />
Also, \setmainfont{TeX Gyre Pagella} is the definition of the font for your text, and \setmathfont{Asana Math} the definition of the fonts for math as I said previously.</ul>
<p>Here is a screenshot of an example of output (a pdf file) we can get with XeLaTeX :</p>
<p><a href="http://alexkrispin.files.wordpress.com/2010/09/writing_math.png"><img class="alignnone size-large wp-image-446" title="writing_math" src="http://alexkrispin.files.wordpress.com/2010/09/writing_math.png?w=1024&#038;h=575" alt="" width="1024" height="575" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexkrispin.wordpress.com/445/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexkrispin.wordpress.com/445/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexkrispin.wordpress.com/445/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexkrispin.wordpress.com/445/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/alexkrispin.wordpress.com/445/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/alexkrispin.wordpress.com/445/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/alexkrispin.wordpress.com/445/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/alexkrispin.wordpress.com/445/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexkrispin.wordpress.com/445/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexkrispin.wordpress.com/445/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexkrispin.wordpress.com/445/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexkrispin.wordpress.com/445/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexkrispin.wordpress.com/445/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexkrispin.wordpress.com/445/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=445&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://alexkrispin.wordpress.com/2010/09/27/writing-math-with-xelatex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c525bdd7a10e1af7026c8b55a2d9a50d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexkrispin</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/09/writing_math.png?w=1024" medium="image">
			<media:title type="html">writing_math</media:title>
		</media:content>
	</item>
		<item>
		<title>Writing an application letter with XeLaTeX</title>
		<link>http://alexkrispin.wordpress.com/2010/09/27/writing-an-application-letter-with-xelatex/</link>
		<comments>http://alexkrispin.wordpress.com/2010/09/27/writing-an-application-letter-with-xelatex/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 00:16:38 +0000</pubDate>
		<dc:creator>alexandre krispin</dc:creator>
				<category><![CDATA[XeLaTeX]]></category>

		<guid isPermaLink="false">http://alexkrispin.wordpress.com/?p=433</guid>
		<description><![CDATA[With LaTeX, several packages are dedicated for letters. For french TeX users, there is for example the class lettre, which might be widely used. For english TeX users, the letter written with the letter class or with koma-script might be also used. Also, notice that the structure of a letter should be as follows : <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=433&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With LaTeX, several packages are dedicated for letters. For french TeX users, there is for example the class <a href="http://www.ctan.org/tex-archive/macros/latex/contrib/lettre/doc/">lettre</a>, which might be widely used. For english TeX users, the letter written with the letter class or with koma-script might be also used.</p>
<p>Also, notice that the structure of a letter should be as follows :</p>
<p><a href="http://alexkrispin.files.wordpress.com/2010/09/letter_form.png"><img class="alignnone size-medium wp-image-434" title="letter_form" src="http://alexkrispin.files.wordpress.com/2010/09/letter_form.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>Here I will focus on the isodoc class for application letters. I have pushed a template in <a href="http://github.com/alexandre-k/repository_alexandre_krispin/blob/master/templates_for_XeLaTeX/letter/template_letter_isodoc/template_letter_isodoc.tex">my repository at Github</a>. If you want documentation for this letter, then type Alt+F2 and in the prompt enter (without quotes) &#8220;texdoc isodoc&#8221;, or look <a href="http://mirror.ctan.org/macros/latex/contrib/isodoc/isodoc.pdf">here</a>. The documentation for this package is really good, and contains some examples, so don&#8217;t hesitate to refer to it if you have any problem.</p>
<p>Basically, the .tex file is divided into three parts, that is to say the preamble, the setup of the letter and then the text. The following is a description of the parts from my template that I use for an example :</p>
<ol>
<li>A brief description of the preamble :</li>
<blockquote><p>% Created 2010-09-21 Tue 22:02<br />
\documentclass{isodoc}<br />
\usepackage{xltxtra}</p></blockquote>
<p>First, here is the class of the document, and then the package for XeLaTeX.</p>
<blockquote><p>\linespread{1.05}<br />
\setmainfont[Numbers=OldStyle,Ligatures=Historic]{TeX Gyre Pagella}</p></blockquote>
<p>Here is the usual setup for fonts I use. If you want some documentation about TeX Gyre Pagella, type Alt+F2 and enter in the prompt &#8220;texdoc qpl-info&#8221;, or look <a href="www.ctan.org/tex-archive/fonts/tex-gyre/doc/fonts/tex-gyre/qpl-info.pdf">here</a>.</p>
<blockquote><p>\usepackage{fixltx2e}<br />
\usepackage{graphicx}<br />
\usepackage{url}<br />
\usepackage{float}<br />
\usepackage{wrapfig}<br />
\usepackage{soul}<br />
\usepackage{textcomp}</p></blockquote>
<p>Some useful packages, nothing special.</p>
<blockquote><p>\usepackage[frenchb]{babel}</p></blockquote>
<p>If you are not french, replace it by polyglossia, according to the language you wish to use. For more information, type Alt+F2 and &#8220;texdoc polyglossia&#8221; in the prompt or look <a href="http://mirror.ctan.org/macros/xetex/latex/polyglossia/polyglossia.pdf">here</a>.</p>
<blockquote><p>\usepackage{hyperref}<br />
\hypersetup{<br />
colorlinks=true, linktocpage=true,breaklinks=true,<br />
urlcolor=spot, linkcolor=blue, citecolor=green,<br />
pdftitle={Letter},%the title<br />
pdfauthor={}<br />
}</p></blockquote>
<p>Nothing special, just the usual hyperref setup I use.</p>
<blockquote><p>\tolerance=1000 % http://dcwww.camd.dtu.dk/~schiotz/comp/LatexTips/LatexTips.html<br />
\usepackage{pdfpages}<br />
\definecolor{headcolor}{gray}{0.5}<br />
\definecolor{spot}{rgb}{0.6,0,0}<br />
\definecolor{headingcolor}{rgb}{0.6,0,0}</p></blockquote>
<p>Some nice settings, for hyphenation, and others, such as headcolor, which unable the nice gray color of headers and footers you will see in the screenshot at the bottom of my post.</p>
<li> The following is a brief description of the setup of the letter (notice that the following is just MY setup, an example, there are more options, look at the isodoc documentation I have indicated above if you need more) :</li>
<blockquote><p>\setupdocument{%about this section, see isodoc, p. 3 to 7<br />
language = french<br />
,<br />
company = Alexandre Krispin<br />
,<br />
who = Alexandre Krispin<br />
,<br />
street = {41 rue Guynemer}<br />
,<br />
city = St-Denis<br />
,<br />
zip = 93200<br />
,</p></blockquote>
<p>Here is the first part of my setup. If you are not french, replace french by your language. Since it is not a letter from an employee of a company, I have put my name after &#8220;company =&#8221;, as it is indicated in the documentation. Then, you have to put your name and adress. Notice that you must put a comma after the information you enter, in order to indicate the end of the information. Also, if you want to put commas in your adress, you will have to use brackets {}. If you don&#8217;t use the brackets {}, then you will have erors when compiling your file.</p>
<blockquote><p>to = {Université Paris Ouest \\<br />
Nanterre La Défense\\<br />
200, avenue de la République\\<br />
92201 \caps{NANTERRE CEDEX}}<br />
,<br />
return<br />
,<br />
header<br />
,<br />
date = today<br />
,<br />
opening = {Madame, Monsieur,}<br />
,<br />
subject = {Here goes the subject of your letter}<br />
,</p></blockquote>
<p>&#8220;To&#8221; indicates the addressee. &#8220;Return&#8221; the address where you wish to receive an answer, etc. For more information, look at the isodoc documentation, easy to understand and very good.</p>
<blockquote><p>closing = {Je me tiens à votre entière disposition pour plus<br />
d&#8217;information, je vous prie d&#8217;agréer, Madame, Monsieur, l&#8217;expression<br />
de mes salutations les plus distinguées}<br />
,<br />
signature = Alexandre Krispin<br />
,<br />
footer<br />
,<br />
phone = 0628766934<br />
,<br />
email = k.m.alexandre@gmail.com<br />
,<br />
website = \url{http://alexkrispin.wordpress.com/}<br />
,<br />
fill<br />
,<br />
}</p></blockquote>
<p>Then comes the closing, the signature and the footer if you want it. In the footer will appear your phone, email and your website.<br />
The fill option is to get the text fully justified, on the left and on the right. In other words, &#8220;fill&#8221; is the option to get the usual hyphenation with LaTeX.</p>
<li> Finally, you have the environment in which your text is written :</li>
<blockquote><p>\begin{document}<br />
\letter{<br />
Je me présente, je m&#8217;appelle henri. Je voudrais bien réussir ma vie, être aimé. Quand je serai grand, j&#8217;aimerai bien être médecin, ou plombier, ou rappeur, ou dealer, ou braqueur, ou\ldots tout niquer tout dans paname !<br />
[...]<br />
etc, etc.<br />
}<br />
\end{document}</p></blockquote>
</ol>
<p>Here is a screenshot of the output, a pdf file, after compiling with xelatex :</p>
<p><a href="http://alexkrispin.files.wordpress.com/2010/09/example_lettre_isodoc.png"><img class="alignnone size-medium wp-image-435" title="example_lettre_isodoc" src="http://alexkrispin.files.wordpress.com/2010/09/example_lettre_isodoc.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>You can find the source file of this example in <a href="http://github.com/alexandre-k/repository_alexandre_krispin/blob/master/templates_for_XeLaTeX/letter/template_letter_isodoc/example_letter.tex">my repository at Github</a>.</p>
<p>If you have any problem, don&#8217;t hesitate to leave a comment.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexkrispin.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexkrispin.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexkrispin.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexkrispin.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/alexkrispin.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/alexkrispin.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/alexkrispin.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/alexkrispin.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexkrispin.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexkrispin.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexkrispin.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexkrispin.wordpress.com/433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexkrispin.wordpress.com/433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexkrispin.wordpress.com/433/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=433&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://alexkrispin.wordpress.com/2010/09/27/writing-an-application-letter-with-xelatex/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c525bdd7a10e1af7026c8b55a2d9a50d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexkrispin</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/09/letter_form.png?w=300" medium="image">
			<media:title type="html">letter_form</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/09/example_lettre_isodoc.png?w=300" medium="image">
			<media:title type="html">example_lettre_isodoc</media:title>
		</media:content>
	</item>
		<item>
		<title>Writing an article with XeLaTeX : part 2</title>
		<link>http://alexkrispin.wordpress.com/2010/09/26/writing-an-article-with-xelatex-part-2/</link>
		<comments>http://alexkrispin.wordpress.com/2010/09/26/writing-an-article-with-xelatex-part-2/#comments</comments>
		<pubDate>Sun, 26 Sep 2010 00:22:52 +0000</pubDate>
		<dc:creator>alexandre krispin</dc:creator>
				<category><![CDATA[XeLaTeX]]></category>

		<guid isPermaLink="false">http://alexkrispin.wordpress.com/?p=418</guid>
		<description><![CDATA[Writing an article is nothing special, but it might require some skills if your are not used to and want to use some special packages. When I was using pdflatex, one of those I was constantly using was ClassicThesis. Indeed, ClassicThesis is really an amazing package. It is based on the style of The Element <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=418&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Writing an article is nothing special, but it might require some skills if your are not used to <img src='http://s0.wp.com/latex.php?latex=%5CLaTeX&amp;bg=ffffff&amp;fg=666666&amp;s=0' alt='&#92;LaTeX' title='&#92;LaTeX' class='latex' /> and want to use some special packages. When I was using pdflatex, one of those I was constantly using was ClassicThesis. Indeed, ClassicThesis is really an amazing package. It is based on the style of <em>The Element of Typographic Style</em>, written by Robert Bringhurst. If you don&#8217;t know this famous book, then look here :<br />
<a href="http://www.amazon.com/Elements-Typographic-Style-Robert-Bringhurst/dp/0881791326">The Elements of Typographic Style at amazon.com</a><br />
Or<br />
<a href="http://en.wikipedia.org/wiki/The_Elements_of_Typographic_Style">The Elements of Typographic Style at wikipedia.org</a><br />
If you are also interested to this, maybe you should take a look here for an application of this book to the web typography :<br />
<a href="http://webtypography.net/">The Elements of Typographic Style applied to the web</a></p>
<p>Anyway, the purpose of this post is to show you a template I have made in order to use classicthesis for an article, and to be able to compile the .tex file with XeLaTeX. To make it work, you have to do the little trick I have previously described :<br />
<a href="http://alexkrispin.wordpress.com/2010/09/25/using-the-classicthesis-package-with-xelatex/">Modifying the classicthesis package to make it work when compiling the *.tex file with xelatex instead of pdflatex.</a></p>
<p>Also, I have uploaded the template to <a href="http://github.com/alexandre-k/repository_alexandre_krispin/blob/master/templates_for_XeLaTeX/article/template_classicthesis/template_article_classicthesis.tex">my repository at Github</a>. The following is a short description of this template.</p>
<blockquote><p>\documentclass[10pt,a4paper]{scrartcl} % KOMA-Script article<br />
\usepackage{xltxtra} %some packages for xelatex<br />
\usepackage[frenchb<br />
%arabic<br />
%english<br />
]{babel} %for french. If you write in english, then you might want to<br />
%get a try to polyglossia</p></blockquote>
<p>First I have put the basic packages to write an article which will be compiled with XeLaTeX. But notice that since I am french I use babel, but if, for example, you are indian, english, japanese, etc, then get a try to polyglossia.</p>
<blockquote><p>%\setmainfont[Numbers=OldStyle,Ligatures=Historic]{TeX Gyre Pagella}</p>
<p>%If you want other fonts, try the following<br />
%\setmainfont{Charis SIL}<br />
%\setmainfont{URW Palladio L}<br />
%\setmainfont{Linux Libertine O}<br />
%\setmainfont{Gentium Book Basic}</p>
<p>%For japanese input :<br />
\newfontfamily\ja[Scale=0.8]{IPA明朝}</p></blockquote>
<p>The above shows you the setup for the fonts. If you don&#8217;t want the default font used with the ClassicThesis package, then uncomment any font you want to use instead. I have also included the setup to write in japanese, remove it if you don&#8217;t want it.</p>
<p>If you plan to write in japanese  your entire articles, then set IPA明朝 as your main font, and if you plan to write in any other language, then set the font corresponding to your language as the main font. If you don&#8217;t know what is the font corresponding to your language, then look at the tips I have previously written <a href="http://alexkrispin.wordpress.com/2010/09/24/font-with-xelatex-troubleshooting/">here</a>.</p>
<blockquote><p>\usepackage{color} %If you want to use it within your text, use the<br />
%command \textcolor{spot}{your text}<br />
\definecolor{spot}{rgb}{0.6,0,0}<br />
\definecolor{boxframe}{rgb}{0.6,0,0}<br />
\definecolor{boxfill}{rgb}{1,.95,.95}</p></blockquote>
<p>Here I have set a color, just in case I would need it.</p>
<blockquote><p>\usepackage{hyperref}<br />
\hypersetup{%<br />
colorlinks=true, linktocpage=true, pdfstartpage=3, pdfstartview=FitV,%<br />
% uncomment the following line if you want to have black links (e.g., for printing)<br />
%colorlinks=false, linktocpage=false, pdfborder={0 0 0}, pdfstartpage=3, pdfstartview=FitV,%<br />
breaklinks=true, pdfpagemode=UseNone, pageanchor=true, pdfpagemode=UseOutlines,%<br />
plainpages=false, bookmarksnumbered, bookmarksopen=true, bookmarksopenlevel=1,%<br />
hypertexnames=true, pdfhighlight=/O,%hyperfootnotes=true,%nesting=true,%frenchlinks,%<br />
urlcolor=blue, linkcolor=blue, citecolor=green, %pagecolor=RoyalBlue,%<br />
%urlcolor=Black, linkcolor=Black, citecolor=Black, %pagecolor=Black,%<br />
pdftitle={Article},%the title<br />
pdfauthor={Alexandre Krispin},%your name<br />
pdfsubject={},%<br />
pdfkeywords={},%<br />
pdfcreator={XeLaTeX},%<br />
pdfproducer={A happy XeLaTeX user}%<br />
}</p></blockquote>
<p>Here is nothing special, the usual hyperref setup I use.</p>
<p>\usepackage{enumitem} %if you want to customize lists<br />
\usepackage{array} %texdoc array<br />
\usepackage{natbib} % an extension to allow author-year citations<br />
% along wih numerical citations. For more<br />
% informations, texdoc natbib<br />
\usepackage{eukdate} %to redefine the default layout of the date format<br />
\usepackage{textcomp} %some special characters<br />
\usepackage{url} %for url<br />
\usepackage{longtable} %for long tables<br />
\usepackage{textcomp} %additional characters<br />
\usepackage{amsmath} %for maths<br />
\usepackage{graphicx} %to include graphics<br />
\usepackage{wrapfig} %to get nice wrap of figures<br />
\usepackage[nochapters]{classicthesis}<br />
\usepackage[nochapters]{classicthesis-ldpkg}</p>
<p>Some useful packages. Add or remove some if you need or don&#8217;t need something. There is also the command loading the ClassicThesis package.</p>
<blockquote><p>\title{\rmfamily\normalfont\spacedallcaps{<br />
The so-called Iran&#8217;s threat%The title of your article<br />
}}<br />
\subtitle{\rmfamily\normalfont\spacedallcaps{<br />
Facts and analysis<br />
}}<br />
\author{\spacedlowsmallcaps{<br />
Alexandre Krispin    %author name and first name<br />
}}</p>
<p>\begin{document}</p>
<p>\maketitle</p>
<p>%\begin{abstract}</p>
<p>%\noident<br />
%********************************<br />
%The abstract of your article<br />
%*******************************</p>
<p>%\end{abstract}</p>
<p>\tableofcontents</p>
<p>%\section{}</p>
<p>%\subsection{}</p></blockquote>
<p>The usual opening setup, with an abstract and a table of content, nothing special.</p>
<p>Here are screenshots showing you how the template looks like. The first screenshot :</p>
<p><a href="http://alexkrispin.files.wordpress.com/2010/09/template_article_classicthesis_first_page.png"><img class="alignnone size-medium wp-image-419" title="Template_article_classicthesis_First_page" src="http://alexkrispin.files.wordpress.com/2010/09/template_article_classicthesis_first_page.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>And the second screenshot, which show another page :</p>
<p><a href="http://alexkrispin.files.wordpress.com/2010/09/template_article_classicthesis_example_2.png"><img class="alignnone size-medium wp-image-420" title="template_article_classicthesis_example_2" src="http://alexkrispin.files.wordpress.com/2010/09/template_article_classicthesis_example_2.png?w=300&#038;h=168" alt="" width="300" height="168" /></a></p>
<p>I have pushed the source file of this example to <a href="http://github.com/alexandre-k/repository_alexandre_krispin/blob/master/templates_for_XeLaTeX/article/template_classicthesis/example_of_article.tex">my repository at Github</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexkrispin.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexkrispin.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexkrispin.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexkrispin.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/alexkrispin.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/alexkrispin.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/alexkrispin.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/alexkrispin.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexkrispin.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexkrispin.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexkrispin.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexkrispin.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexkrispin.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexkrispin.wordpress.com/418/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=418&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://alexkrispin.wordpress.com/2010/09/26/writing-an-article-with-xelatex-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c525bdd7a10e1af7026c8b55a2d9a50d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexkrispin</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/09/template_article_classicthesis_first_page.png?w=300" medium="image">
			<media:title type="html">Template_article_classicthesis_First_page</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/09/template_article_classicthesis_example_2.png?w=300" medium="image">
			<media:title type="html">template_article_classicthesis_example_2</media:title>
		</media:content>
	</item>
		<item>
		<title>Using the classicthesis package with XeLaTeX</title>
		<link>http://alexkrispin.wordpress.com/2010/09/25/using-the-classicthesis-package-with-xelatex/</link>
		<comments>http://alexkrispin.wordpress.com/2010/09/25/using-the-classicthesis-package-with-xelatex/#comments</comments>
		<pubDate>Sat, 25 Sep 2010 01:23:47 +0000</pubDate>
		<dc:creator>alexandre krispin</dc:creator>
				<category><![CDATA[XeLaTeX]]></category>

		<guid isPermaLink="false">http://alexkrispin.wordpress.com/?p=408</guid>
		<description><![CDATA[Compiling an article or anything else with classicthesis package will return errors. Indeed, something written and compiled with the classicthesis package loaded must be compiled with pdflatex (and maybe also latex, I don&#8217;t know). Anyway, here is a little trick to compile your documents with XeLaTeX using your prefered template. First of all, we have <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=408&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Compiling an article or anything else with classicthesis package will return errors. Indeed, something written and compiled with the classicthesis  package loaded must be compiled with pdflatex (and maybe also latex, I don&#8217;t know).</p>
<p>Anyway, here is a little trick to compile your documents with XeLaTeX using your prefered template. First of all, we have to make a backup of our file classicthesis.sty. If you use Ubuntu and have installed TeXlive with your package manager, do as follows either with a terminal or your file manager with root privileges (for this, type Alt+F2 and enter gksu nautilus in the prompt) :</p>
<blockquote><p>sudo cp /usr/share/texmf-texlive/tex/latex/classicthesis/classicthesis-ldpkg.sty /usr/share/texmf-texlive/tex/latex/classicthesis/classicthesis-ldpkg_backup.sty</p></blockquote>
<p>If you have installed TeXlive with the installation script install-tl, then do as follows :</p>
<blockquote><p>sudo cp /usr/local/texlive/2010/tex/latex/classicthesis/classicthesis-ldpkg.sty /usr/local/texlive/2010/tex/latex/classicthesis/classicthesis-ldpkg_backup.sty</p></blockquote>
<p>Then, open classicthesis-ldpkg.sty in a text editor, let say gedit. If you have installed TeXlive with your package manager :</p>
<blockquote><p>
gksu gedit /usr/share/texmf-texlive/tex/latex/classicthesis/classicthesis-ldpkg.sty
</p></blockquote>
<p>And if not :</p>
<blockquote><p>
gksu gedit /usr/local/texlive/2010/tex/latex/classicthesis/classicthesis-ldpkg.sty
</p></blockquote>
<p>In this file, you will have to comment the following lines :</p>
<blockquote><p>% ********************************************************************<br />
% Using PDFLaTeX:<br />
% ********************************************************************<br />
\RequirePackage[pdftex,hyperfootnotes=false,pdfpagelabels]{hyperref}  % backref linktocpage pagebackref<br />
\pdfcompresslevel=9<br />
\pdfadjustspacing=1<br />
\RequirePackage[pdftex]{graphicx} % PDFTeX driver for graphicx<br />
%\DeclareGraphicsRule{*}{mps}{*}{} % enables use of MetaPost graphics with pdflatex </p>
<p>%*******************************************************<br />
% for German texts to get \autoref macros right<br />
\renewcommand{\figureautorefname}{Figure}<br />
\renewcommand{\tableautorefname}{Table}<br />
\renewcommand{\partautorefname}{Part}<br />
\renewcommand{\chapterautorefname}{Chapter}<br />
\renewcommand{\sectionautorefname}{Section}<br />
\renewcommand{\subsectionautorefname}{Section}<br />
\renewcommand{\subsubsectionautorefname}{Section}</p></blockquote>
<p>Then, save your file. Here is a screenshot of what I get after commenting on the left side, and before on the right side :<br />
<a href="http://alexkrispin.files.wordpress.com/2010/09/commenting_lines_in_classicthesis-ldpkg-sty.png"><img src="http://alexkrispin.files.wordpress.com/2010/09/commenting_lines_in_classicthesis-ldpkg-sty.png?w=300&#038;h=168" alt="" title="commenting_lines_in_classicthesis-ldpkg.sty" width="300" height="168" class="alignnone size-medium wp-image-409" /></a></p>
<p>That&#8217;s all, folks ! Now if you compile a file with XeLaTeX using the classicthesis package, it will work. I will write soon a post about it, and will show you a sample of file I have successfully compiled.</p>
<p>EDIT : There is no need to comment the lines :</p>
<blockquote><p>
\renewcommand{\figureautorefname}{Figure}<br />
\renewcommand{\tableautorefname}{Table}<br />
\renewcommand{\partautorefname}{Part}<br />
\renewcommand{\chapterautorefname}{Chapter}<br />
\renewcommand{\sectionautorefname}{Section}<br />
\renewcommand{\subsectionautorefname}{Section}<br />
\renewcommand{\subsubsectionautorefname}{Section}</p></blockquote>
<p>But in order to get mathematical symbols working with the specific setup of XeLaTeX, we have to comment the following lines :</p>
<blockquote><p>
{%<br />
        % default: Palatino<br />
        \RequirePackage[osf,sc]{mathpazo} % Palatino with real small caps and old style figures<br />
        \linespread{1.05} % a bit more for Palatino<br />
    }
</p></blockquote>
<p>Which are in the file classicthesis.sty, lines 183-187 (don&#8217;t forget to comment the &#8220;{&#8221; l. 183). With that, everything will work fine with math font setup and unicode-math with XeLaTeX.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexkrispin.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexkrispin.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexkrispin.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexkrispin.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/alexkrispin.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/alexkrispin.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/alexkrispin.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/alexkrispin.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexkrispin.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexkrispin.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexkrispin.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexkrispin.wordpress.com/408/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexkrispin.wordpress.com/408/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexkrispin.wordpress.com/408/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexkrispin.wordpress.com&amp;blog=16066066&amp;post=408&amp;subd=alexkrispin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://alexkrispin.wordpress.com/2010/09/25/using-the-classicthesis-package-with-xelatex/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c525bdd7a10e1af7026c8b55a2d9a50d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alexkrispin</media:title>
		</media:content>

		<media:content url="http://alexkrispin.files.wordpress.com/2010/09/commenting_lines_in_classicthesis-ldpkg-sty.png?w=300" medium="image">
			<media:title type="html">commenting_lines_in_classicthesis-ldpkg.sty</media:title>
		</media:content>
	</item>
	</channel>
</rss>
