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

<channel>
	<title>Lennart&#039;s weblog &#187; LaTeX</title>
	<atom:link href="http://blog.karssen.org/category/latex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.karssen.org</link>
	<description>Open source, computers, Africa and other more (or less) interesting stuff.</description>
	<lastBuildDate>Thu, 02 Feb 2012 19:15:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>RefTeX, how could I have missed this?</title>
		<link>http://blog.karssen.org/2011/08/21/reftex-how-could-i-have-missed-this/</link>
		<comments>http://blog.karssen.org/2011/08/21/reftex-how-could-i-have-missed-this/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 20:34:49 +0000</pubDate>
		<dc:creator>LCK</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Emacs]]></category>

		<guid isPermaLink="false">http://blog.karssen.org/?p=176</guid>
		<description><![CDATA[I&#8217;ve been using Emacs and LaTeX for more than ten years now and still I keep learning. For example, last Friday I came across Stephen Eglen&#8217;s ESS (Emacs Speaks Statistics) tutorial. In his slides he mentioned RefTeX. I had heard of it before, but for some reason I thought it was either a set of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://www.gnu.org/software/emacs/">Emacs</a> and <a href="http://www.latex-project.org/">LaTeX</a> for more than ten years now and still I keep learning. For example, last Friday I came across <a href="http://www.damtp.cam.ac.uk/user/sje30/ess11/">Stephen Eglen&#8217;s ESS (Emacs Speaks Statistics) tutorial</a>. In his slides he mentioned <a href="http://www.gnu.org/software/auctex/reftex.html">RefTeX</a>. I had heard of it before, but for some reason I thought it was either a set of LaTeX styles or an <a href="http://www.gnu.org/software/auctex/index.html">AUCTeX</a> replacement and consequently, I never looked into it.</p>
<p>This time, however, I made the small effort of looking up RefTeX&#8217;s website and lo and behold, it&#8217;s neither of the two things I thought it was. Instead, it is an extension to LaTeX that makes inserting citation, references, index entries and labels a breeze. Even if you don&#8217;t (want to) use all its capabilities, <a href="http://www.gnu.org/software/auctex/manual/reftex.html#SEC9">the following keystrokes</a> are worth the effort:</p>
<table width="100%">
<col width="50" valign="top" />
<col valign="top" />
<tr>
<td><code>C-c =</code></td>
<td>Show table of contents of the document (also a great way to walk through your document)
<td></tr>
<tr>
<td><code>C-c (</code></td>
<td>Insert a label at point</td>
</tr>
<tr>
<td><code>C-c )</code></td>
<td>Insert a reference to some label</td>
</tr>
<tr>
<td><code>C-c [</code></td>
<td>Search in your bibliography (either BibTeX or <code>thebibliography</code> environment) to insert citations</td>
</tr>
</table>
<p>To start using RefTeX in a document you are already editing simple run</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;">M-x reftex-mode</pre></div></div>

<p>Insert the following in <code>.emacs</code> file if you want to load RefTeX on startup</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">;; Enable RefTeX</span>
<span style="color: #66cc66;">&#40;</span>add-hook 'LaTeX-mode-hook 'turn-on-reftex<span style="color: #66cc66;">&#41;</span>   <span style="color: #808080; font-style: italic;">; with AUCTeX LaTeX mode</span>
<span style="color: #66cc66;">&#40;</span>add-hook 'latex-mode-hook 'turn-on-reftex<span style="color: #66cc66;">&#41;</span>   <span style="color: #808080; font-style: italic;">; with Emacs latex mode</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.karssen.org/2011/08/21/reftex-how-could-i-have-missed-this/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A LaTeX example environment</title>
		<link>http://blog.karssen.org/2009/11/15/a-latex-example-environment/</link>
		<comments>http://blog.karssen.org/2009/11/15/a-latex-example-environment/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 22:28:50 +0000</pubDate>
		<dc:creator>LCK</dc:creator>
				<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://blog.karssen.org/?p=54</guid>
		<description><![CDATA[Edit: Since the LaTeX beamer class already contains an example environment I renamed mine to latexample During my stay at the National University of Rwanda I gave a LaTeX course to the Master&#8217;s students of the department of mathematics. For this course I wrote my own lecture notes (which I will put up on the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Edit:</strong> Since the LaTeX beamer class already contains an example environment I renamed mine to <code>latexample</code></p>
<p>During my stay at the <a href="http://www.nur.ac.rw">National University of Rwanda</a> I gave a LaTeX course to the Master&#8217;s students of the department of mathematics. For this course I wrote my own lecture notes (which I will put up on the web some other time), and already quite early in the process I found out I wanted an environment or something similar that would allow me to split the page in two and display some LaTeX code in the first column and the resulting output in the second column. It took me some time to figure it out (and it&#8217;s far from perfect and/or fool-proof), but it does the trick for most simple examples I wanted to show.</p>
<p>So, without further ado, here&#8217;s the code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">dvipsnames,pdftex</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">xcolor</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">definecolor</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">lstbgcolor</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">rgb</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">0.9,0.9,0.9</span><span style="color: #E02020; ">}</span> 
&nbsp;
<span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">listings</span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\lstloadlanguages</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">[<span style="color: #C08020; font-weight: normal;">LaTeX</span>]TeX</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">fancyvrb</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #E02020; ">\</span><span style="color: #800000;">newenvironment</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">latexample</span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">1</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">language={<span style="color: #2020C0; font-weight: normal;">[LaTeX</span>]TeX</span><span style="color: #E02020; ">}]</span>
<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\lstset</span><span style="color: #E02020; ">{</span>backgroundcolor=<span style="color: #E02020; ">\</span><span style="color: #800000;">color</span>{lstbgcolor</span><span style="color: #E02020; ">}</span>,
    keywordstyle=<span style="color: #E02020; ">\</span><span style="color: #800000;">color</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">rgb</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">0,0,1</span><span style="color: #E02020; ">}</span>,
    commentstyle=<span style="color: #E02020; ">\</span><span style="color: #800000;">color</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">rgb</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">0.133,0.545,0.133</span><span style="color: #E02020; ">}</span>,
    stringstyle=<span style="color: #E02020; ">\</span><span style="color: #800000;">color</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">rgb</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">0.627,0.126,0.941</span><span style="color: #E02020; ">}</span>,
    breaklines=true,
    prebreak = <span style="color: #E02020; ">\</span><span style="color: #800000;">raisebox</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">0ex</span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">0ex</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">0ex</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\ensuremath</span><span style="color: #E02020; ">{</span><span style="color: #800000; font-weight: normal;">\hookleftarrow</span></span><span style="color: #E02020; ">}}</span>,
    frame=single,
    language=<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">[<span style="color: #C08020; font-weight: normal;">LaTeX</span>]TeX</span><span style="color: #E02020; ">}</span>,
    basicstyle=<span style="color: #800000; font-weight: normal;">\footnotesize</span><span style="color: #E02020; ">\</span><span style="color: #800000;">ttfamily</span>, #1<span style="color: #E02020; ">}</span>
  <span style="color: #800000; font-weight: normal;">\VerbatimEnvironment</span><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">VerbatimOut</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">latexample.verb.out</span><span style="color: #E02020; ">}}</span>
  <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #0000D0; font-weight: normal;">VerbatimOut</span></span><span style="color: #E02020; ">}</span><span style="color: #800000; font-weight: normal;">\noindent</span>
  <span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">minipage</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">0.5<span style="color: #800000; font-weight: normal;">\linewidth</span></span><span style="color: #E02020; ">}</span>
    <span style="color: #800000; font-weight: normal;">\lstinputlisting</span><span style="color: #E02020; ">[</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">latexample.verb.out</span><span style="color: #E02020; ">}</span><span style="color: #2C922C; font-style: italic;">%</span>
  <span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">minipage</span></span><span style="color: #E02020; ">}</span><span style="color: #800000; font-weight: normal;">\qquad</span>
  <span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">minipage</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">0.4<span style="color: #800000; font-weight: normal;">\linewidth</span></span><span style="color: #E02020; ">}</span>
    <span style="color: #E02020; ">\</span><span style="color: #800000;">input</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">latexample.verb.out</span><span style="color: #E02020; ">}</span>
  <span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">minipage</span></span><span style="color: #E02020; ">}\\</span>
<span style="color: #E02020; ">}</span></pre></td></tr></table></div>

<p>In the first seven lines the necessary packages are loaded, the other lines make up the definition of the environment. In line 9 the environment is given its name and we define one argument. In lines 10 to 18 we define the options for the listing environment. Then, in line 19 we use <code>\VerbatimEnvironment</code> followed by the <code>VerbatimOut</code> environment from the <code>fancyvrb</code> package to write everything that&#8217;s inside the environment into a file called <code>latexample.verb.out</code>. This concludes the actions that are done at the opening of the example environment. When the example environment is closed lines 20 to 26 are executed. The <code>VerbatimOut</code> is closed and then we start setting up to minipages. The left one contains the text we put into the example environment as an <code>lstlisting</code> read from the <code>latexample.verb.out</code> file (line 22), the right one contains the rendered text by using LaTeX&#8217;s <code>\input</code> command (line 25). </p>
<p>This is what it looks like:<br />
<a class="thickbox" rel="" href='http://blog.karssen.org/wp-content/gallery/posts/latexexample-table.png' title=''><img src='http://blog.karssen.org/wp-content/gallery/posts/thumbs/thumbs_latexexample-table.png' alt='latexexample-table.png' class='ngg-singlepic ngg-none' /></a><br />
This example was made with the following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">verbatim</span></span><span style="color: #E02020; ">}</span>
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">latexample</span></span><span style="color: #E02020; ">}</span>
  ... LaTeX code here ...
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">latexample</span></span><span style="color: #E02020; ">}</span>
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">verbatim</span></span><span style="color: #E02020; ">}</span>
&nbsp;
A simple demonstration of the <span style="color: #800000; font-weight: normal;">\verb</span>|tabular| environment can be given like this:
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">latexample</span></span><span style="color: #E02020; ">}[</span><span style="color: #E02020; ">]</span>
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">tabular</span></span><span style="color: #E02020; ">}{</span><span style="color: #E02020; "><span style="color: #2020C0; font-weight: normal;">|c|c|c|</span></span><span style="color: #E02020; ">}</span>
  <span style="color: #E02020; ">\</span><span style="color: #800000;">hline</span>
  <span style="color: #800000; font-weight: normal;">\multicolumn</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">3</span><span style="color: #E02020; ">}{</span><span style="color: #E02020; "><span style="color: #2020C0; font-weight: normal;">|c|</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">AAA</span><span style="color: #E02020; ">}</span> <span style="color: #E02020; ">\\</span>
  <span style="color: #E02020; ">\</span><span style="color: #800000;">hline</span>
  123 <span style="color: #E02020; ">&amp;</span> <span style="color: #800000; font-weight: normal;">\multicolumn</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">2</span><span style="color: #E02020; ">}{</span><span style="color: #E02020; "><span style="color: #2020C0; font-weight: normal;">c|</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">456</span><span style="color: #E02020; ">}\\</span>
  <span style="color: #E02020; ">\</span><span style="color: #800000;">hline</span>
  BBB <span style="color: #E02020; ">&amp;</span> CCC <span style="color: #E02020; ">&amp;</span> DDD <span style="color: #E02020; ">\\</span>
  <span style="color: #E02020; ">\</span><span style="color: #800000;">hline</span>
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">tabular</span></span><span style="color: #E02020; ">}</span>
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">latexample</span></span><span style="color: #E02020; ">}</span></pre></td></tr></table></div>

<p>In the first seven lines the necessary packages are loaded, the other lines make up the definition of the environment. In line 9 the environment is given its name and we define one argument. In lines 10 to 18 we define the options for the listing environment. Then, in line 19 we use <code>\VerbatimEnvironment</code> followed by the <code>VerbatimOut</code> environment from the <code>fancyvrb</code> package to write everything that&#8217;s inside the environment into a file called <code>latexample.verb.out</code>. This concludes that actions that are done before the text is rendered. When the environment is closed lines 20 to 26 are executed. The <code>VerbatimOut</code> is closed and then we start setting up to minipages. The left one contains the text we put into the example environment as an <code>lstlisting</code> read from the <code>latexample.verb.out</code> file (line 22), the right one contains the rendered text by using LaTeX&#8217;s <code>\input</code> command (line 25). </p>
<p>The environment accepts an optional argument. This argument can be one or more options that are passed on to the <>lstset</code> option list for the <code>lstlisting</code> environment. By default it is set to <code>language={[LaTeX]TeX}</code>. For some reason that I haven't been able to identify yet, the argument must be given, even if empty (see the example above, which starts the evironment with <code>\begin{latexample}[]</code>. The two <code>[]</code> give the empty option list. This is the reason why in line 17 of the definition we set <code>language={[LaTeX]TeX}</code>, even though I also did this in the environment definition in line 9. I wanted to make the argument optional, but haven't gotten it to work that way. </p>
<p>So, as mentioned earlier, this environment is far from perfect. Things that involve counters (like <code>\chapter</code> and other sectioning commands, but also numbered equations and figures) don't work in the sense that the numbering in the example is not separate from the rest of the document. So if you put a numbered equation in the example the equations following the example will have their numbers increased by one. I'm working on a slightly more complex definition of the latexample environment that closes that bug. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.karssen.org/2009/11/15/a-latex-example-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using tikz to generate an abstract box in LaTeX</title>
		<link>http://blog.karssen.org/2009/09/14/using-tikz-to-generate-an-abstract-box-in-latex/</link>
		<comments>http://blog.karssen.org/2009/09/14/using-tikz-to-generate-an-abstract-box-in-latex/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 20:49:12 +0000</pubDate>
		<dc:creator>LCK</dc:creator>
				<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://blog.karssen.org/?p=52</guid>
		<description><![CDATA[LaTeX is a document preparation system that I used for most texts I&#8217;ve written since my Master&#8217;s thesis, the largest project being my PhD thesis. Recently a friend of mine asked me if I could help him creating a boxed abstract. Normally a \framebox{} would have done the trick, but he wanted the word &#8220;Abstract&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>LaTeX is a document preparation system that I used for most texts I&#8217;ve written since my Master&#8217;s thesis, the largest project being my PhD thesis. </p>
<p>Recently a friend of mine asked me if I could help him creating a boxed abstract. Normally a \framebox{} would have done the trick, but he wanted the word &#8220;Abstract&#8221; in the top left corner of the box. I tried a few variations on his start, but in the end I realised I could try my newly developped tikz skills on it. Together with Google I came up with the following solution that loads the tikz package and then defines the \abstractbox{} command.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="latex" style="font-family:monospace;">  <span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">tikz</span><span style="color: #E02020; ">}</span>
  <span style="color: #800000; font-weight: normal;">\usetikzlibrary</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">shapes,shadows</span><span style="color: #E02020; ">}</span>
  <span style="color: #800000; font-weight: normal;">\tikzstyle</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">abstractbox</span><span style="color: #E02020; ">}</span> = <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">draw=black, fill=white, rectangle, 
  inner sep=10pt, style=rounded corners, drop shadow=<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">fill=black,
  opacity=1</span>}</span><span style="color: #E02020; ">]</span>
  <span style="color: #800000; font-weight: normal;">\tikzstyle</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">abstracttitle</span><span style="color: #E02020; ">}</span> =<span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">fill=white</span><span style="color: #E02020; ">]</span>
&nbsp;
  <span style="color: #E02020; ">\</span><span style="color: #800000;">newcommand</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\boxabstract</span></span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">2</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fill=white</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">
    <span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #0000D0; font-weight: normal;">center</span></span><span style="color: #E02020; ">}</span>
      <span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">tikzpicture</span></span><span style="color: #E02020; ">}</span>
        <span style="color: #800000; font-weight: normal;">\node</span> <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">abstractbox, #1</span><span style="color: #E02020; ">]</span> (box)
        <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #0000D0; font-weight: normal;">minipage</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">0.80<span style="color: #800000; font-weight: normal;">\linewidth</span></span><span style="color: #E02020; ">}</span>
<span style="color: #2C922C; font-style: italic;">%            \setlength{\parindent}{2mm}</span>
            <span style="color: #800000; font-weight: normal;">\footnotesize</span> #2
          <span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">minipage</span></span><span style="color: #E02020; ">}}</span>;
        <span style="color: #800000; font-weight: normal;">\node</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">abstracttitle, right=10pt</span><span style="color: #E02020; ">]</span> at (box.north west) <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">Abstract</span><span style="color: #E02020; ">}</span>;
      <span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">tikzpicture</span></span><span style="color: #E02020; ">}</span>
    <span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">center</span></span><span style="color: #E02020; ">}</span>
  <span style="color: #E02020; ">}</span></pre></td></tr></table></div>

<p>The resulting PDF looks like this:<br />
<img src='http://blog.karssen.org/wp-content/gallery/posts/latex-abstract.png' ><br />
Note that since the actual text is set in a minipage normal indentation is not set. This can be circumvented by uncommenting the line that sets the \parindent. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.karssen.org/2009/09/14/using-tikz-to-generate-an-abstract-box-in-latex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

