<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.3" -->
<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/"
	>

<channel>
	<title>olpa, OSS developer</title>
	<link>http://uucode.com/blog</link>
	<description>advocating olpa's open source developments</description>
	<pubDate>Tue, 01 Jun 2010 10:06:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>
	<language>en</language>
			<item>
		<title>python wtf: strip() eats too much</title>
		<link>http://uucode.com/blog/2010/06/01/python-wtf-strip-eats-too-much/</link>
		<comments>http://uucode.com/blog/2010/06/01/python-wtf-strip-eats-too-much/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 10:04:20 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2010/06/01/python-wtf-strip-eats-too-much/</guid>
		<description><![CDATA[Many of python-xml code is probably wrong. Tracing a bug, I found an interesting WTF. A minimal example:

import string
s1 =  "\xa0x\xa0"
s2 = u"\xa0x\xa0"
print repr(s1.strip())
print repr(s2.strip())
print repr(s2.strip(string.whitespace))

And what we see in the output?

'\ xa0x\ xa0'
u'x'
u'\ xa0x\ xa0'

The second line is different from the others two, and a programmer 99.99% expects that all the three lines [...]]]></description>
			<content:encoded><![CDATA[<p>Many of python-xml code is probably wrong. Tracing a bug, I found an interesting WTF. A minimal example:</p>
<p><code><pre>
import string
s1 =  "\xa0x\xa0"
s2 = u"\xa0x\xa0"
print repr(s1.strip())
print repr(s2.strip())
print repr(s2.strip(string.whitespace))
</pre></code></p>
<p>And what we see in the output?</p>
<p><code><pre>
'\ xa0x\ xa0'
u'x'
u'\ xa0x\ xa0'
</pre></code></p>
<p>The second line is different from the others two, and a programmer 99.99% expects that all the three lines should be the same.</p>
<p>Formally, Python is correct. The unicode class of whitespace includes also the unbreakable space. But let&#8217;s think further. We can split the whitespace class on two further subclasses, (in TeX terms) droppable glue and undroppable kern. And <tt>split()</tt> shouldn&#8217;t touch the latter.</p>
<p>Fortunately, there is a workaround by specifying <tt>string.whitespace</tt> explicitly.</p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2010/06/01/python-wtf-strip-eats-too-much/feed/</wfw:commentRss>
		</item>
		<item>
		<title>running TeX tools from non-standard locations</title>
		<link>http://uucode.com/blog/2010/04/28/running-tex-tools-from-non-standard-locations/</link>
		<comments>http://uucode.com/blog/2010/04/28/running-tex-tools-from-non-standard-locations/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 06:51:35 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[TeX]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2010/04/28/running-tex-tools-from-non-standard-locations/</guid>
		<description><![CDATA[In some configurations (for example, when using MacTeX), if you copy a TeX-related binary to non-standard location, the tool stops working. More precisely, if a tool uses kpathsea library, special setup is required. More practically, is you compile something like dvisvgm, it might not work.
Discussion: pointing kpathsea to the correct texmf tree.
Summary: texmf.cnf defines search [...]]]></description>
			<content:encoded><![CDATA[<p>In some configurations (for example, when using MacTeX), if you copy a TeX-related binary to non-standard location, the tool stops working. More precisely, if a tool uses <a href="http://tug.org/kpathsea/">kpathsea</a> library, special setup is required. More practically, is you compile something like <a href="http://dvisvgm.sourceforge.net/">dvisvgm</a>, it might not work.</p>
<p>Discussion: <a href="http://tug.org/pipermail/tex-k/2010-April/002153.html">pointing kpathsea to the correct texmf tree</a>.</p>
<p>Summary: texmf.cnf defines search paths in terms of SELFAUTO* variables (at least, in vanilla TeXLive and MacTeX 2009). Therefore, kpathsea looks for files relative to the location of the calling program.</p>
<p>Therefore, to find the files, the calling program should be located in the right place or all the AUTO-based search paths should be redefined. For me, the following wrapper implements the second idea:</p>
<p>&#8212;&#8211; textool.sh: begin<br />
<code><pre>
#!/bin/bash

for i in         \
  TEXMFMAIN      \
  TEXMFDIST      \
  TEXMFLOCAL     \
  TEXMFSYSVAR    \
  TEXMFSYSCONFIG \
  TEXMFCNF       
do
  export $i=`kpsewhich -expand-var "$"$i` 
done

"$@"
</pre></code><br />
&#8212;&#8211; textool.sh: end</p>
<p>Running kpsewhich in a wrong location doesn&#8217;t work:</p>
<p><code><pre>
$ ./kpsewhich psfonts.map
warning: kpathsea: configuration file texmf.cnf not found in
these directories: ...
$ export export TEXMFCNF='{/usr/local/texlive/2009/.....
$ ./kpsewhich psfonts.map
$
</pre></code></p>
<p>But the wrapper helps:</p>
<p><code><pre>
$ textool.sh ./kpsewhich psfonts.map
/usr/local/texlive/2009/texmf-var/fonts/map/dvips/updmap/psfonts.map
$ textool.sh ./a.out 
psfonts.map=/usr/local/texlive/2009/....../psfonts.map
$
</pre></code></p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2010/04/28/running-tex-tools-from-non-standard-locations/feed/</wfw:commentRss>
		</item>
		<item>
		<title>finding deleted files in a subversion repository</title>
		<link>http://uucode.com/blog/2010/04/26/finding-deleted-files-in-a-subversion-repository/</link>
		<comments>http://uucode.com/blog/2010/04/26/finding-deleted-files-in-a-subversion-repository/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 10:32:33 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2010/04/26/finding-deleted-files-in-a-subversion-repository/</guid>
		<description><![CDATA[I needed file which was deleted some time ago. Thanks to Subversion, the task is easy as long as you remember the name of the file. Unfortunately, it wasn&#8217;t a case. Fortunately, I found a magic spell. In the directory where the file was located, say: svn log &#8211;verbose, and the output will contain all [...]]]></description>
			<content:encoded><![CDATA[<p>I needed file which was deleted some time ago. Thanks to Subversion, the task is easy as long as you remember the name of the file. Unfortunately, it wasn&#8217;t a case. Fortunately, I found a magic spell. In the directory where the file was located, say: <tt>svn log &#8211;verbose</tt>, and the output will contain all the names and the revisions.</p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2010/04/26/finding-deleted-files-in-a-subversion-repository/feed/</wfw:commentRss>
		</item>
		<item>
		<title>XML to paper publishing with manual intervention</title>
		<link>http://uucode.com/blog/2010/04/15/xml-to-paper-publishing-with-manual-intervention/</link>
		<comments>http://uucode.com/blog/2010/04/15/xml-to-paper-publishing-with-manual-intervention/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 07:01:29 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[publishing]]></category>

		<category><![CDATA[science]]></category>

		<category><![CDATA[TeX]]></category>

		<category><![CDATA[TeXML]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2010/04/15/xml-to-paper-publishing-with-manual-intervention/</guid>
		<description><![CDATA[My paper &#8220;XML to paper publishing with manual intervention&#8221; is accepted for XATA 2010 (XML: Aplicações e Tecnologias Associadas), 19 and 20 May, Vila do Conde, Portugal. Abstract:
Existing tools consider XML to paper conversion as one black box step and provide control only through predefined options. With this approach, tuning the layout of output documents [...]]]></description>
			<content:encoded><![CDATA[<p>My paper &#8220;XML to paper publishing with manual intervention&#8221; is accepted for <a href="http://www.eseig.ipp.pt/conferencias/xata2010/index.php?lang=en">XATA 2010</a> (XML: Aplicações e Tecnologias Associadas), 19 and 20 May, Vila do Conde, Portugal. Abstract:</p>
<p>Existing tools consider XML to paper conversion as one black box step and provide control only through predefined options. With this approach, tuning the layout of output documents is a burdensome task.</p>
<p>The paper advocates a new workflow for XML to paper conversion, in which a separate step allows the user to fine control the layout. The changes made by the user are remembered and later can be automatically re-applied during publishing an updated version of the document.</p>
<p>A possible technical implementation for the workflow is suggested. TeX is used as a typesetting engine. XML to TeX conversion is made using XSLT and TeXML. The management of changes is performed by diff and patch tools.</p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2010/04/15/xml-to-paper-publishing-with-manual-intervention/feed/</wfw:commentRss>
		</item>
		<item>
		<title>unicode math in xelatex</title>
		<link>http://uucode.com/blog/2010/03/26/unicode-math-in-xelatex/</link>
		<comments>http://uucode.com/blog/2010/03/26/unicode-math-in-xelatex/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 08:43:18 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[TeX]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2010/03/26/unicode-math-in-xelatex/</guid>
		<description><![CDATA[In XeTeX, an unicode version of TeX, it&#8217;s logical to use unicode math. However, till now (march 2010) unicode math publishing doesn&#8217;t work directly out of the box. Here are two solutions, one is fast (and not so wrong) and one is probably the future standard.
The LaTeX code to compile is:

\documentclass{minimal}
...SOMETHING...
\begin{document}
$$\sin(\alpha+\beta) = \sin α \cos [...]]]></description>
			<content:encoded><![CDATA[<p>In XeTeX, an unicode version of TeX, it&#8217;s logical to use unicode math. However, till now (march 2010) unicode math publishing doesn&#8217;t work directly out of the box. Here are two solutions, one is fast (and not so wrong) and one is probably the future standard.</p>
<p>The LaTeX code to compile is:</p>
<p><code><pre>
\documentclass{minimal}
...SOMETHING...
\begin{document}
$$\sin(\alpha+\beta) = \sin α \cos β + \cos\alpha \sin\beta$$
$$\int\!\!\!\int_D dx\,dy$$
\end{document}
</pre></code></p>
<p>Note that &#8220;alpha&#8221; and &#8220;beta&#8221; are written both as command sequences and as unicode characters.</p>
<p>The part marked &#8220;&#8230;SOMETHING&#8230;&#8221; is a placeholder for setup.</p>
<h2>Fast, no so wrong way</h2>
<p>If the goal is only to:</p>
<p>* allow the greek letters as unicode symbols, and<br />
* it is not important which math font is used,</p>
<p>then the simplest solution is:</p>
<p>* make the greek letters active,<br />
* define the greek letters as the corresponding commands:</p>
<p>Replace the placeholder &#8220;&#8230;SOMETHING&#8230;&#8221; with:</p>
<p><code><pre>
\catcode`\^^^^03b1=13
\let^^^^03b1=\alpha
\catcode`\^^^^03b2=13
\let^^^^03b2=\beta
</pre></code></p>
<p>Repeat it for the all possible letters.</p>
<h2>unicode-math package</h2>
<p>This package is not yet released on CTAN. Latest developmental and archived historical versions of this package are available from GitHub: <a href="http://github.com/wspr/unicode-math">http://github.com/wspr/unicode-math</a>.</p>
<p>Given that the author, Will Robertson, is also the author of such packages as fontspec, xltxtra, euenc etc, I think that unicode-math will be a standard way to have unicode math in XeLaTeX.</p>
<p>After installing this package, I succesfully compiled the test document using the following &#8220;&#8230;SOMETHING&#8230;&#8221;:</p>
<p><code><pre>
\usepackage{unicode-math}
\setmathfont{[Asana-Math]}
</pre></code></p>
<p>The font Asana-Math can be found on TeX Live 2009 DVD (and probably on 2007 and 2008 too). The square brackets around the name forces xelatex to search for a .otf/.ttf-file instead of getting the font from OS. In my case, xelatex somehow found the font automatically, I didn&#8217;t need to give the full path.</p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2010/03/26/unicode-math-in-xelatex/feed/</wfw:commentRss>
		</item>
		<item>
		<title>entering special characters in vim</title>
		<link>http://uucode.com/blog/2010/03/10/entering-special-characters-in-vim/</link>
		<comments>http://uucode.com/blog/2010/03/10/entering-special-characters-in-vim/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 07:13:38 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2010/03/10/entering-special-characters-in-vim/</guid>
		<description><![CDATA[Time to time, I forget it. Found again in some wiki: &#8220;Entering special characters&#8220;. In short: ^Vnnn or ^Vxnn. Note also: &#8220;how to input diacritic characters&#8220;.
]]></description>
			<content:encoded><![CDATA[<p>Time to time, I forget it. Found again in some wiki: &#8220;<a href="http://vim.wikia.com/wiki/Entering_special_characters">Entering special characters</a>&#8220;. In short: ^Vnnn or ^Vxnn. Note also: &#8220;<a href="http://uucode.com/blog/2008/09/20/how-to-input-diacritic-characters/">how to input diacritic characters</a>&#8220;.</p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2010/03/10/entering-special-characters-in-vim/feed/</wfw:commentRss>
		</item>
		<item>
		<title>converting sourceforge.net repository from CVS to subversion</title>
		<link>http://uucode.com/blog/2010/03/09/converting-sourceforgenet-repository-from-cvs-to-subversion/</link>
		<comments>http://uucode.com/blog/2010/03/09/converting-sourceforgenet-repository-from-cvs-to-subversion/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 05:06:50 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2010/03/09/converting-sourceforgenet-repository-from-cvs-to-subversion/</guid>
		<description><![CDATA[Probably there is no need to switch from CVS to subversion, but I&#8217;m starting to forget the options of the cvs command, therefore decided to migrate. Unfortunately, there is no button &#8220;convert&#8221; on the site, therefore I had to find how to do it manually.
A quick search gave a migration notes of Audacity: CVS To [...]]]></description>
			<content:encoded><![CDATA[<p>Probably there is no need to switch from CVS to subversion, but I&#8217;m starting to forget the options of the <tt>cvs</tt> command, therefore decided to migrate. Unfortunately, there is no button &#8220;convert&#8221; on the site, therefore I had to find how to do it manually.</p>
<p>A quick search gave a migration notes of Audacity: <a href="http://wiki.audacityteam.org/wiki/CVS_To_SVN_Migration">CVS To SVN Migration</a>. To get a better understanding what is happening, I read the following documents:</p>
<p>* <a href="http://svnbook.red-bean.com/en/1.5/svn.forcvs.convert.html">Version Control with Subversion / Converting a Repository from CVS to Subversion</a><br />
* <a href="http://cvs2svn.tigris.org/cvs2svn.html">cvs2svn Documentation</a></p>
<p>The dump was easy to produce:</p>
<p><code><pre>
$ rsync -av --delete-delay rsync://PROJECT.cvs.sourcefor
   ge.net/cvsroot/PROJECT/* PROJECT-cvsbackup/

$ cvs2svn --dumpfile=svndump PROJECT-cvsbackup > cvs2svn.log
</pre></code></p>
<p>The task of importing the dump was more challenging, but also easy solved thanks to the sourceforge documentation: <a href="http://sourceforge.net/apps/trac/sourceforge/wiki/SVN%20adminrepo">Managing your Subversion Repository with adminrepo</a></p>
<p>This moves the dump on the sourceforge servers and logs in:</p>
<p><code><pre>
$ rsync -aiv svndump USER,PROJECT@web.sourceforge.net:.
$ ssh -t USER,PROJECT@shell.sourceforge.net create
</pre></code></p>
<p>And this what happens after logging in:</p>
<p><code><pre>
$ mv /home/groups/P/PR/PROJECT/svndump .
$ adminrepo --checkout svn
$ rm -rf /svnroot/PROJECT/*
$ svnadmin create /svnroot/PROJECT/
$ svnadmin load /svnroot/PROJECT < svndump
$ adminrepo --save
</pre></code></p>
<h2>Project options</h2>
<p>Remembered after writing this post: one must to activate subversion before doing the conversion:</p>
<p>Project admin -> Feature settings -> Available Features</p>
<p>After conversion, disable CVS.</p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2010/03/09/converting-sourceforgenet-repository-from-cvs-to-subversion/feed/</wfw:commentRss>
		</item>
		<item>
		<title>setting up a local macports repository</title>
		<link>http://uucode.com/blog/2010/02/12/setting-up-a-local-macports-repository/</link>
		<comments>http://uucode.com/blog/2010/02/12/setting-up-a-local-macports-repository/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 13:20:01 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2010/02/12/setting-up-a-local-macports-repository/</guid>
		<description><![CDATA[Many OSes have port systems, Mac OS X has too. Macports provides a lot of useful software, but not all. If a software can&#8217;t be in the macports for some reason (for example, the software isn&#8217;t intended for public), one has to setup a local macports repository.
Private Portfiles
For one-computer use, there is no need for [...]]]></description>
			<content:encoded><![CDATA[<p>Many OSes have port systems, Mac OS X has too. <a href="http://www.macports.org/">Macports</a> provides a lot of useful software, but not all. If a software can&#8217;t be in the macports for some reason (for example, the software isn&#8217;t intended for public), one has to setup a local macports repository.</p>
<h2>Private Portfiles</h2>
<p>For one-computer use, there is no need for a complete setup. There is enough to say something like &#8220;<tt>sudo port install -d -v</tt>&#8221; in the directory with a <tt>Portfile</tt>.</p>
<p>For details, see the official documentation. For introduction, read the book &#8220;Mac OS X Tiger for Unix Geeks&#8221;, the chapter &#8220;Creating and Installing Packages&#8221;, section &#8220;Creating DarwinPorts packages&#8221;.</p>
<h2>What is required</h2>
<p>1) I use the following structure for the local repository:</p>
<pre><code>
files/
  ... distribution archives ...
ports/
  PortIndex
  myorg/
    port1
    ...
    portN
  _resources/
    port1.0/
      fetch/
        mirror_sites.tcl
      group/
        syspython25-1.0.tcl
        syspython26-1.0.tcl
</code></pre>
<p>2) Access to the local ports server is available only through rsync (01.02.2010: probably things changed). A possible content of <tt>/etc/rsyncd.conf</tt>:</p>
<pre><code>
[orgmacports]
  path = ....../ports
  comment = My Organization MacPorts, the port files
  exclude = .** **~
</code></pre>
<p>To check: &#8220;<tt>rsync rsync://myhost.mydomain/orgmacports/</tt>&#8220;. This lists the content of the directory &#8220;<tt>ports</tt>&#8220;.</p>
<p>3) Unfortunately, macports system can&#8217;t download files through rsync (01.02.2010: maybe already able to). Therefore, share the content of &#8220;<tt>files</tt>&#8221; through FTP or HTTP.</p>
<p>4) Define the repository in &#8220;<tt>/opt/local/etc/macports/sources.conf</tt>&#8220;:</p>
<pre><code>
rsync://rsync.macports.org/release/ports/ [default,nosync]
rsync://myhost.mydomain/orgmacports/
</code></pre>
<p>Note that I&#8217;ve added &#8220;nosync&#8221; to the main macports reposotory: playing with the local repository, one says &#8220;sync&#8221; often, and no-sync for the main repo safes time.</p>
<p>To check, execute &#8220;<tt>$ sudo port -v sync</tt>&#8220;. The output should contain a note about synchronitzation with the local repository.</p>
<h2>Inside _resources</h2>
<p>I do not remember exactly why I had to add the file &#8220;<tt>mirror_sites.tcl</tt>&#8221; (nothing worked without this file). Also, I removed a lot of code, so the current version looks so:</p>
<pre><code>
# $Id$
namespace eval portfetch::mirror_sites { }

set portfetch::mirror_sites::sites(macports) {
    http://svn.macports.org/repository/macports/distfiles/
    http://svn.macports.org/repository/macports/distfiles/general/:nosubdir
    http://svn.macports.org/repository/macports/downloads/
}

set portfetch::mirror_sites::sites(macports_distfiles) {
    http://distfiles.macports.org/:mirror
    http://trd.no.distfiles.macports.org/:mirror
    http://arn.se.distfiles.macports.org/:mirror
}
</code></pre>
<p>The files &#8220;syspython25-1.0.tcl&#8221; and &#8220;syspython26-1.0.tcl&#8221; are my private groups, which define the settings to compile modules for the system python.</p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2010/02/12/setting-up-a-local-macports-repository/feed/</wfw:commentRss>
		</item>
		<item>
		<title>TeXML is not at XML Prague 2010</title>
		<link>http://uucode.com/blog/2010/02/12/texml-is-not-at-xml-prague-2010/</link>
		<comments>http://uucode.com/blog/2010/02/12/texml-is-not-at-xml-prague-2010/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 05:12:23 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[TeXML]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2010/02/12/texml-is-not-at-xml-prague-2010/</guid>
		<description><![CDATA[To my great surprise, TeXML presentation was not accepted for XML Prague 2010. It&#8217;s so unexpected, that I&#8217;m even not upset, only puzzled. TeXML is one of a few projects which are somehow revolutionary. Seems it&#8217;s my fault I didn&#8217;t make it clear. The abstract, the reviews and conclusions follow.
Abstract
TeXML: XML to PDF through LaTeX
TeXML [...]]]></description>
			<content:encoded><![CDATA[<p>To my great surprise, TeXML presentation was not accepted for <a href="http://www.xmlprague.cz/2010/index.html">XML Prague 2010</a>. It&#8217;s so unexpected, that I&#8217;m even not upset, only puzzled. TeXML is one of a few projects which are somehow revolutionary. Seems it&#8217;s my fault I didn&#8217;t make it clear. The abstract, the reviews and conclusions follow.</p>
<h2>Abstract</h2>
<p>TeXML: XML to PDF through LaTeX</p>
<p>TeXML is an approach to XML to PDF conversion, an alternative to the XSLT/FO way. The characteristic features are:</p>
<p>* LaTeX is used as a typesetting engine.<br />
* XML logical markup is converted to LaTeX logical markup.<br />
* The low-level formatting details are hidden in LaTeX style files, not in conversion scripts.<br />
* XML to LaTeX conversion scripts are straightforward thanks to an intermediate XML-based language.<br />
* Generated LaTeX code is human-friendly and ready for modification.</p>
<p>To be a real alternative to the established standard, TeXML needs unique competitive advantages. The main are:</p>
<p>* Poor quality auto-layout artifacts in generated PDFs can be fixed by editing LaTeX code.<br />
* Separation of work is encouraged: programmers do programming, and typesetting specialists do layout definition.<br />
* The process is based on open-source tools.</p>
<p>The paper is written from the XML perspective. Only basic knowledge of LaTeX is assumed. TeXML is compared with alternative TeX-based XML-to-PDF projects. Practical experience of using TeXML in production is given. Problems and listed together with the solutions. An appendix provides an example of a simple publishing project, with step-by-step instructions how to convert XML to PDF using TeXML approach.</p>
<h2>Reviews</h2>
<p><b>Neutral</b></p>
<p>I think that TeXML is not new project and given it&#8217;s non-mainstream technology I don&#8217;t think that XML Prague is right venue for having presentation about it.</p>
<p><b>Reject</b></p>
<p>There&#8217;s nothing new in this paper that hasn&#8217;t been said in the last 10 years. Furthermore there is no paper attached.</p>
<p><b>Strong Reject</b></p>
<p>lacks enough detail to make a positive decision</p>
<p><b>Reject</b></p>
<p>Not matching this year&#8217;s topics.</p>
<p><b>Reject</b></p>
<p>The paper presents a tool for generating PDF output from XML via an XML representation of LaTeX called TeXML, which seems to be a useful light-weight approach for producing high-quality output in the kinds of applications where TeX excels. This topic, however, is a bit distant from the conference focus for this year.</p>
<h2>Conclusion</h2>
<p>My habit of sending an abstract only and writing the paper later has failed here: 2 rejects of 5 reviews. As of not matching this year&#8217;s topics, usually it doesn&#8217;t matter.</p>
<p>For me, it seems the failure is due to a bit of unluck. Being of non-mainstream (thanks to the first reviewer for pointing it to me), I get reviewers who a bit distant from publishing XML on paper and don&#8217;t see any use for TeXML. Contrary, the real users of TeXML are excited with it, and I believe the users more than reviewers.</p>
<p>TODO:</p>
<p>Re-write the abstract and paper so that even reviewers not in topic understand that something important happens.</p>
<p>Finally release the working DocBook stylesheets to be less non-mainstream.</p>
<p>Rework the site, add more new documentation.</p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2010/02/12/texml-is-not-at-xml-prague-2010/feed/</wfw:commentRss>
		</item>
		<item>
		<title>chess diagrams on A6 cards using LaTeX - 2/2</title>
		<link>http://uucode.com/blog/2009/12/04/chess-diagrams-on-a6-cards-using-latex-22/</link>
		<comments>http://uucode.com/blog/2009/12/04/chess-diagrams-on-a6-cards-using-latex-22/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 05:40:23 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[chess]]></category>

		<category><![CDATA[TeX]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2009/12/04/chess-diagrams-on-a6-cards-using-latex-22/</guid>
		<description><![CDATA[In the first part I wrote: &#8220;put to a template in your favourite text processor&#8221;. Attached is a template (class-file) for LaTeX and an example, the explanations are below.
It seems that skak is the package to typeset chess using LaTeX. (See also an earlier post, &#8220;chess publishing in latex, starting&#8221;.)
Unfortunately, sometimes skak ignores castling moves. [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://uucode.com/blog/2009/11/27/chess-diagrams-on-a6-cards-using-latex-12/">the first part</a> I wrote: &#8220;put to a template in your favourite text processor&#8221;. <a href="http://uucode.com/blog/wp-content/uploads/2009/12/diakarte.zip">Attached</a> is a template (class-file) for LaTeX and an example, the explanations are below.</p>
<p>It seems that <a href="http://www.ctan.org/tex-archive/fonts/chess/skak/">skak</a> is the package to typeset chess using LaTeX. (See also an earlier post, &#8220;<a href="http://uucode.com/blog/2009/09/15/chess-publishing-in-latex-starting/">chess publishing in latex, starting</a>&#8221;.)</p>
<p>Unfortunately, sometimes skak ignores castling moves. I&#8217;m going to produce a minimal example and submit a bug report. But at the moment, in case case of such error, use the command <tt>\fenboard</tt> to correct a position.</p>
<p>My class <tt>diakarte</tt> imports <tt>skak</tt> and defines two new commands:</p>
<p><tt>\therest{&#8230;}</tt>: the argument is centered horizontally using <tt>\centerline</tt> and then centered vertically in the rest of the text flow.</p>
<p><tt>\restcomment{&#8230;}</tt>: the argument is centered horizontally using <tt>\centerline</tt> and then attached to the previous <tt>\therest</tt>.</p>
<p>Something like this:</p>
<p><code><pre>
\therest{\showboard}
\restcomment{What now?}
</pre></code></p>
<p>A complete example demonstrates also advanced usage. It is included in the zip-file with <a href="http://uucode.com/blog/wp-content/uploads/2009/12/diakarte.zip">diakarte package</a>.</p>
<p>If you&#8217;ve found the package useful, please drop me a note in comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2009/12/04/chess-diagrams-on-a6-cards-using-latex-22/feed/</wfw:commentRss>
		</item>
		<item>
		<title>chess diagrams on A6 cards using LaTeX - 1/2</title>
		<link>http://uucode.com/blog/2009/11/27/chess-diagrams-on-a6-cards-using-latex-12/</link>
		<comments>http://uucode.com/blog/2009/11/27/chess-diagrams-on-a6-cards-using-latex-12/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 05:00:45 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[chess]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2009/11/27/chess-diagrams-on-a6-cards-using-latex-12/</guid>
		<description><![CDATA[As a part of improvement in chess, it is often recommended to analyze positions. The idea is good, but how to find time to do it? One option is to use otherwise unproductive time: walking, in bus, queues etc. I have printed positions with me, and always can analyze something.
After different attempts, the best so [...]]]></description>
			<content:encoded><![CDATA[<p>As a part of improvement in chess, it is often recommended to analyze positions. The idea is good, but how to find time to do it? One option is to use otherwise unproductive time: walking, in bus, queues etc. I have printed positions with me, and always can analyze something.</p>
<p>After different attempts, the best so far option is found:</p>
<p>* I use thick paper index cards of size A6.<br />
* To hold all the card together, I use foldback clips.</p>
<h2>Printing, preprinting</h2>
<p>Many printers have a special slot to put thick paper into the printer.</p>
<p>I though it is enough to 1) put an A6 card to the slot, 2) print an A6 pdf/ps-file. Unfortunately, no. Regardless of the card size, the printer prints the document like on an A4 paper. As result, the text appears outside the card.</p>
<p>After spending time experimenting with CUPS, I gave up. The next easiest solution is to correctly position an A6 sheet on an A4 sheet.</p>
<p>After some calculations: if I want 1cm margins on A6, I should set the following margins for A4:</p>
<p>* left, right: 64mm<br />
* top: 1cm<br />
* bottom: 159mm</p>
<p>These values are best put to a template in your favourite text processors.</p>
<p>Just for a case, A-sizes: <a href="http://en.wikipedia.org/wiki/A4_paper">http://en.wikipedia.org/wiki/A4_paper</a></p>
<p><a href="http://uucode.com/blog/2009/12/04/chess-diagrams-on-a6-cards-using-latex-22/">Part 2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2009/11/27/chess-diagrams-on-a6-cards-using-latex-12/feed/</wfw:commentRss>
		</item>
		<item>
		<title>TexML and unicode characters for math operators</title>
		<link>http://uucode.com/blog/2009/11/25/texml-and-unicode-characters-for-math-operators/</link>
		<comments>http://uucode.com/blog/2009/11/25/texml-and-unicode-characters-for-math-operators/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 04:18:12 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[TeX]]></category>

		<category><![CDATA[TeXML]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2009/11/25/texml-and-unicode-characters-for-math-operators/</guid>
		<description><![CDATA[Bug (?) report: &#8220;after switching from LaTeX(pdflatex) to XeTeX(xelatex) as the PDF generator something has ceased to work. Mathematical operators given as unicode characters in math formulas do not show up in the final document.´´
The letter continues:
I&#8217;ve diagnosed the problem. The cause is a change in the encoding option of the TexML converter, from -eISO-8859-1 [...]]]></description>
			<content:encoded><![CDATA[<p>Bug (?) report: &#8220;after switching from LaTeX(pdflatex) to XeTeX(xelatex) as the PDF generator something has ceased to work. Mathematical operators given as unicode characters in math formulas do not show up in the final document.´´</p>
<p>The letter continues:</p>
<p>I&#8217;ve diagnosed the problem. The cause is a change in the encoding option of the TexML converter, from <code>-eISO-8859-1</code> to <code>-eUTF-8</code>, as expected by XeTeX. Previously some unicode characters were automagically converted to the corresponding LaTeX mathematical symbols, but now they are just copied to the generated LaTeX code.</p>
<p>I&#8217;ve solved the problem myself by a quick-and-dirty hack of <code>texmlwr.py</code>. A new conditional section in <code>writech(...)</code> before the chained tests for TeXML modes forces the conversion inside math mode, regardless of the particular output encoding.</p>
<p><code><pre>
263c263
 &lt;     # First attempt to write symbol as-is
---
 &gt;     # First attempt to write symbol as-is  **** IF NOT IN MATH MODE ****
264a265,276
 &gt;     if self.mode == MATH:
 &gt;       #
 &gt;       # Math mode, lookup math map
 &gt;       #
 &gt;       try:
 &gt;         chord = ord(ch)
 &gt;         if chord &gt; 255:                            # no Latin-1
 &gt;           self.stream.write(unimap.mathmap[chord])
 &gt;           return                                             # return
 &gt;       except:
 &gt;         pass
 &gt;
</pre></code></p>
<h2>My coment</h2>
<p>So, XeTeX (and probably other TeXs, I think) doesn&#8217;t interpret the unicode math correctly. The solution is to avoid the unicode math and use the corresponding escape sequences instead.</p>
<p>I&#8217;m afraid it&#8217;s the only available solution right now. However, I vaguely remember discussions in XeTeX mailing list and articles in TUGboat, therefore I&#8217;d like to spend some time in looking for an alternative. Probably a magic option for XeTeX cures the problem.</p>
<p>Finally, I asked for a few examples of TeXML, generated TeX and PDF files (both correct and not). Hopefully, I&#8217;ll have a bit of time to find a better solution.</p>
<h2>26.03.2010, solution</h2>
<p><a href="http://uucode.com/blog/2010/03/26/unicode-math-in-xelatex/">unicode math in xelatex</a></p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2009/11/25/texml-and-unicode-characters-for-math-operators/feed/</wfw:commentRss>
		</item>
		<item>
		<title>running Fritz&#038;Fertig (eng: Fritz and Chesster) in the parental control mode (Mac OS X)</title>
		<link>http://uucode.com/blog/2009/09/24/running-fritzfertig-eng-fritz-and-chesster-in-the-parental-control-mode-mac-os-x/</link>
		<comments>http://uucode.com/blog/2009/09/24/running-fritzfertig-eng-fritz-and-chesster-in-the-parental-control-mode-mac-os-x/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 04:27:16 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[chess]]></category>

		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2009/09/24/running-fritzfertig-eng-fritz-and-chesster-in-the-parental-control-mode-mac-os-x/</guid>
		<description><![CDATA[I purchased &#8220;Fritz und Fertig: Schach lernen und trainieren (&#8221;Fritz and Chesster: learn to play chess&#8220;, other languages also available). My opinion is simple: it&#8217;s a masterpiece and the best ever computer game for children.
Unfortunately, I got technical problems. Fortunately, solved them.
The main issue is that my Mac Mini can&#8217;t read the CD. Therefore, I [...]]]></description>
			<content:encoded><![CDATA[<p>I purchased &#8220;<a href="http://www.chessbase.com/shopd/product.asp?pid=558">Fritz und Fertig: Schach lernen und trainieren</a> (&#8221;<a href="http://www.chessbase.com/shop/product.asp?pid=165">Fritz and Chesster: learn to play chess</a>&#8220;, other languages also available). My opinion is simple: it&#8217;s a masterpiece and the best ever computer game for children.</p>
<p>Unfortunately, I got technical problems. Fortunately, solved them.</p>
<p>The main issue is that my Mac Mini can&#8217;t read the CD. Therefore, I tried to rip the disk and use the image. To my big surprise, it worked. No idiotic anti-copy protection.</p>
<p>Ripping a CD. Probably user-friendly tools exist, but I used something like this:</p>
<pre><code>
$ sudo umount /Volumes/Fritz\ und\ Fertig
$ sudo dd if=/dev/disk1s1s2 of=ff.iso
</code></pre>
<p>To mount the image, just click on &#8220;<tt>ff.iso</tt>&#8221; in Finder.</p>
<p>But can you click on the image in Simplified Finder (parental control works)? Probably yes, but I don&#8217;t know how. Therefore, I wrote a wrapper script &#8220;<tt>FritzUndFertiz.command</tt>&#8220;:</p>
<pre><code>
#!/bin/sh

open /Users/.....path.to.../ff.iso
sleep 5
open '/Volumes/Fritz und Fertig/Fritz - OS X/Fritz und Fertig'
</code></pre>
<p>To run the script, set the executable flag (&#8221;<tt>chmod +x FritzUndFertiz.command</tt>&#8221; in the console). Move the script to &#8220;MyApplications&#8221;, try to run, allow all the required programs, and &#8211;</p>
<p>The child can run Fritz&#038;Fertig without assistance.</p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2009/09/24/running-fritzfertig-eng-fritz-and-chesster-in-the-parental-control-mode-mac-os-x/feed/</wfw:commentRss>
		</item>
		<item>
		<title>chess publishing in latex, starting</title>
		<link>http://uucode.com/blog/2009/09/15/chess-publishing-in-latex-starting/</link>
		<comments>http://uucode.com/blog/2009/09/15/chess-publishing-in-latex-starting/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 04:43:28 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[chess]]></category>

		<category><![CDATA[TeX]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2009/09/15/chess-publishing-in-latex-starting/</guid>
		<description><![CDATA[I&#8217;m experimenting with LaTeX and chess. As there is no &#8220;for dummies&#8221; information in internet, my notes (even if incorrect) could be useful for beginners.
So, the step 1. Print some game or some position.
I opened &#8220;LaTeX Graphics Companion&#8221; (first edition, 1999, probably I should upgrade) and read about chess. The package I needed is named [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m experimenting with LaTeX and chess. As there is no &#8220;for dummies&#8221; information in internet, my notes (even if incorrect) could be useful for beginners.</p>
<p>So, the step 1. Print some game or some position.</p>
<p>I opened &#8220;LaTeX Graphics Companion&#8221; (first edition, 1999, probably I should upgrade) and read about chess. The package I needed is named (surprise!) <tt>chess</tt>.</p>
<p>It&#8217;s a real monster. You put the moves in, and the package automatically traces how the figures move (including en passant etc). At any moment, it can typeset a diagramm. Very impressive!</p>
<p>It&#8217;s an overkill for me. All I need is diagramms. And after I found that the symbol &#8220;|&#8221; has a special meaning and can conflict with the usual use, I decided to find something else.</p>
<p>There is a number of chess-packages on CTAN. However, it was easy to minimize the choice. As the important question for me is &#8220;how to select/change a chess font&#8221;, I immediately was interested in the actively developing packages:</p>
<p>* <a href="http://tug.ctan.org/tex-archive/fonts/chess/enpassant/">enpassant</a>, a collection of type1 chessfonts ready for TeX, and<br />
* <a href="http://tug.ctan.org/tex-archive/macros/latex/contrib/chessfss/">chessfss</a>, chess fontselection scheme.</p>
<p>The author is Ulrike Fischer, the both packages are not in TeX Live, only on CTAN. In the package notes, it is said that the font collection is supported by the package &#8220;skak&#8221;:</p>
<p>* <a href="http://www.ctan.org/tex-archive/fonts/chess/skak/">skak</a>, fonts and macros for typesetting chess games.</p>
<p>The package &#8220;skak&#8221; seems an improvement of &#8220;chess&#8221;. It is included in TeX Live. The package provides sample files as documentation, this is enough to start using the package. The first steps are even easier with this program:</p>
<p>* <a href="http://pgn2ltx.sourceforge.net">Pgn2ltx</a> - A program for converting PGN (Portable Game Notation) data into a LaTeX input file. By Dirk Baechle, GPL2.</p>
<p>At the end, one more useful link:</p>
<p>* <a href="http://www.enpassant.dk/chess/homeeng.htm">EN PASSANT - Nørresundby Chess Club</a>. En Passant is a chess site with free chess software and resources for chess publishing like chess fonts, diagram utilities, graphics and more. En Passant is the homepage of Nørresundby Chess Club in Denmark.</p>
<p>TODO: check that I really can change chess fonts.</p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2009/09/15/chess-publishing-in-latex-starting/feed/</wfw:commentRss>
		</item>
		<item>
		<title>my wrappers around &#8220;includegraphics&#8221;</title>
		<link>http://uucode.com/blog/2009/07/20/my-wrappers-around-includegraphics/</link>
		<comments>http://uucode.com/blog/2009/07/20/my-wrappers-around-includegraphics/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 04:33:23 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[TeX]]></category>

		<category><![CDATA[TeXML]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2009/07/20/my-wrappers-around-includegraphics/</guid>
		<description><![CDATA[To put an image to a document, LaTeX provides the command &#8220;\includegraphics&#8220;. As it often happens, due to LaTeX was designed for manual typesetting, this command is a nightmare for automatic generation. For a long time, I use a wrapper to solve 99% of the problems.
I.
\RequirePackage{grffile}
Without this package, code
\includegraphics{ANSIboat.v1.pdf}

raises the dummy error:

! LaTeX Error: Unknown [...]]]></description>
			<content:encoded><![CDATA[<p>To put an image to a document, LaTeX provides the command &#8220;<tt>\includegraphics</tt>&#8220;. As it often happens, due to LaTeX was designed for manual typesetting, this command is a nightmare for automatic generation. For a long time, I use a wrapper to solve 99% of the problems.</p>
<h3>I.</h3>
<pre style='color:#000000;background:#ffffff;'><code><span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>RequirePackage</span><span style='color:#808030; '>{</span>grffile<span style='color:#808030; '>}</span></code></pre>
<p>Without this package, code</p>
<pre><code>\includegraphics{ANSIboat.v1.pdf}</pre></code>

raises the dummy error:
</pre>
<pre><code>! LaTeX Error: Unknown graphics extension: .boat.v1.pdf.</code></pre>
<h3>II.</h3>
<pre style='color:#000000;background:#ffffff;'><code><span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>def</span><span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>includegraphicsII</span><span style='color:#808030; '>[</span><span style='color:#808030; '>#</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span><span style='color:#808030; '>#</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>{</span><span style='color:#696969; '>%</span>
<span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>IfFileExists</span><span style='color:#808030; '>{</span><span style='color:#808030; '>#</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>}</span><span style='color:#808030; '>{</span><span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>includegraphics</span><span style='color:#808030; '>[</span><span style='color:#808030; '>#</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span><span style='color:#808030; '>{</span><span style='color:#808030; '>#</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>}</span><span style='color:#808030; '>}</span><span style='color:#808030; '>{</span><span style='color:#696969; '>%</span>
<span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>typeout</span><span style='color:#808030; '>{</span>! LaTeX warning: File `<span style='color:#808030; '>#</span><span style='color:#008c00; '>2</span>' not found.<span style='color:#808030; '>}</span><span style='color:#696969; '>%</span>
<span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>includegraphics</span><span style='color:#808030; '>[</span><span style='color:#808030; '>#</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span><span style='color:#808030; '>{</span>dummy.pdf<span style='color:#808030; '>}</span><span style='color:#808030; '>}</span><span style='color:#808030; '>}</span>
</code></pre>
<p>If there is no image file, LaTeX</p>
<p>* annonces this problem to the console and the log file,<br />
* uses the image &#8220;dummy.pdf&#8221; instead</p>
<h3>III.</h3>
<pre style='color:#000000;background:#ffffff;'><code><span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>catcode</span>`<span style='color:#808030; '>\</span><span style='color:#808030; '>_</span>=<span style='color:#008c00; '>11</span>
<span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>edef</span><span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>ImageUnderscore</span><span style='color:#808030; '>{</span><span style='color:#808030; '>_</span><span style='color:#808030; '>}</span>
<span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>catcode</span>`<span style='color:#808030; '>\</span><span style='color:#808030; '>_</span>=<span style='color:#008c00; '>8</span>
<span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>def</span><span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>Image</span><span style='color:#808030; '>[</span><span style='color:#808030; '>#</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span><span style='color:#808030; '>#</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>{</span><span style='color:#808030; '>{</span><span style='color:#696969; '>%</span>
<span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>let</span><span style='color:#808030; '>\</span><span style='color:#808030; '>_</span>=<span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>ImageUnderscore</span>
<span style='color:#808030; '>\</span><span style='color:#800000; font-weight:bold; '>includegraphicsII</span><span style='color:#808030; '>[</span><span style='color:#808030; '>#</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span><span style='color:#808030; '>{</span><span style='color:#808030; '>#</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>}</span><span style='color:#808030; '>}</span><span style='color:#808030; '>}</span>
</code></pre>
<p>This allows to specify a file name with the underscore symbol using the standard LaTeX escaping rules:</p>
<pre><code>\Image{ANSI\_boat.pdf}</code></pre>
<p>instead of</p>
<pre><code>\includegraphicsII{ANSI_boat.pdf}</code></pre>
<p>Benefit: no need for special escaping rules in an automatic XML to LaTeX converter.</p>
<p>Actually, the code must be extended, to include &#8220;<code>\{</code>&#8221;, &#8220;<code>\textless</code>&#8221; and other special symbols, but it&#8217;s TODO.</p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2009/07/20/my-wrappers-around-includegraphics/feed/</wfw:commentRss>
		</item>
		<item>
		<title>importing as module when a file has a non-identifier name</title>
		<link>http://uucode.com/blog/2009/06/12/importing-as-module-when-a-file-has-a-non-identifier-name/</link>
		<comments>http://uucode.com/blog/2009/06/12/importing-as-module-when-a-file-has-a-non-identifier-name/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 11:18:07 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2009/06/12/importing-as-module-when-a-file-has-a-non-identifier-name/</guid>
		<description><![CDATA[I need to reuse a function in a file. The usual way is just to import this file as a module. But what to do if the name is &#8220;bad&#8221;? The following doesn&#8217;t work:

import foo-bar as foo_bar
foo_bar.callme()

After trials and errors, the desired magic found: 

foo_bar = __import__('foo-bar', globals(),  locals(), [], -1)
foo_bar.callme()

See Python Documentation for [...]]]></description>
			<content:encoded><![CDATA[<p>I need to reuse a function in a file. The usual way is just to import this file as a module. But what to do if the name is &#8220;bad&#8221;? The following doesn&#8217;t work:</p>
<pre><code>
import foo-bar as foo_bar
foo_bar.callme()
</code></pre>
<p>After trials and errors, the desired magic found: </p>
<pre><code>
foo_bar = __import__('foo-bar', globals(),  locals(), [], -1)
foo_bar.callme()
</code></pre>
<p>See Python Documentation for details: in some cases you don&#8217;t want to use <tt>__import__</tt>.</p>
<p>The best solution is, obviously, to rename file. But I wanted to find an answer to this importing challenge.</p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2009/06/12/importing-as-module-when-a-file-has-a-non-identifier-name/feed/</wfw:commentRss>
		</item>
		<item>
		<title>sharing files from linux to windows</title>
		<link>http://uucode.com/blog/2009/04/27/sharing-files-from-linux-to-windows/</link>
		<comments>http://uucode.com/blog/2009/04/27/sharing-files-from-linux-to-windows/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 10:32:28 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[windows]]></category>

		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2009/04/27/sharing-files-from-linux-to-windows/</guid>
		<description><![CDATA[Yes, one installs and configures Samba. All I need is to access a big folder in the read-only mode. The quick and dirty solution is:
In smb.conf:

security = share
guest account = nobody

[my-svn]
  comment = SVN files
  path = /path/to/svn
  read only = yes
  public = yes
  guest ok = yes

]]></description>
			<content:encoded><![CDATA[<p>Yes, one installs and configures Samba. All I need is to access a big folder in the read-only mode. The quick and dirty solution is:</p>
<p>In <tt>smb.conf</tt>:</p>
<pre>
security = share
guest account = nobody

[my-svn]
  comment = SVN files
  path = /path/to/svn
  read only = yes
  public = yes
  guest ok = yes
</pre>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2009/04/27/sharing-files-from-linux-to-windows/feed/</wfw:commentRss>
		</item>
		<item>
		<title>calling batch files with &#8216;exit&#8217;</title>
		<link>http://uucode.com/blog/2009/02/22/calling-batch-files-with-exit/</link>
		<comments>http://uucode.com/blog/2009/02/22/calling-batch-files-with-exit/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 15:07:40 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2009/02/22/calling-batch-files-with-exit/</guid>
		<description><![CDATA[Consider &#8216;main.bat&#8216;

call child1.bat
call child2.bat

What happens after &#8216;child1.bat&#8216; is finished?
I reasonably expected that &#8216;child2.bat&#8216; is executed. In a ideal world, yes.
In the real world, the first script contains the command &#8216;exit&#8216;, and this commands not only exists from &#8216;child1.bat&#8216;, but also terminates &#8216;main.bat&#8216;. Therefore, &#8216;child2.bat&#8216; isn&#8217;t executed. I don&#8217;t have words to comment this behavior.
As a [...]]]></description>
			<content:encoded><![CDATA[<p>Consider &#8216;<tt>main.bat</tt>&#8216;</p>
<pre><code>
call child1.bat
call child2.bat
</code></pre>
<p>What happens after &#8216;<tt>child1.bat</tt>&#8216; is finished?</p>
<p>I reasonably expected that &#8216;<tt>child2.bat</tt>&#8216; is executed. In a ideal world, yes.</p>
<p>In the real world, the first script contains the command &#8216;<tt>exit</tt>&#8216;, and this commands not only exists from &#8216;<tt>child1.bat</tt>&#8216;, but also terminates &#8216;<tt>main.bat</tt>&#8216;. Therefore, &#8216;<tt>child2.bat</tt>&#8216; isn&#8217;t executed. I don&#8217;t have words to comment this behavior.</p>
<p>As a workaround, I constructed the following. Not sure it&#8217;s correct, but right now it works for me.</p>
<pre><code>
start /B /wait child1.bat
start /B /wait child2.bat
</code></pre>
<p>And the order of the arguments is important. &#8220;<tt>/B wait</tt>&#8221; makes the trick, &#8220;<tt>/wait /B</tt>&#8221; doesn&#8217;t.</p>
<p>From documentation:</p>
<p>* /B: Start application without creating a new window. The application has ^C handling ignored. Unless the application enables ^C processing, ^Break is the only way to interrupt the application<br />
* /WAIT: Start application and wait for it to terminate</p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2009/02/22/calling-batch-files-with-exit/feed/</wfw:commentRss>
		</item>
		<item>
		<title>extending a virtual disk in vmware</title>
		<link>http://uucode.com/blog/2008/12/26/extending-a-virtual-disk-in-vmware/</link>
		<comments>http://uucode.com/blog/2008/12/26/extending-a-virtual-disk-in-vmware/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 17:11:30 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2008/12/26/extending-a-virtual-disk-in-vmware/</guid>
		<description><![CDATA[Extending a virtual disk in vmware
1. Backup!
2. Somewhere in the vmware installation directory, there is a tool named &#8220;vmware-vdiskmanager.exe&#8220;. There is a lot of options, for resize use &#8220;-x&#8220;:
vmware-vdiskmanager.exe -x 8Gb ...path.to.vm..../vm_disk.vmdk
(hint: type the command manually, do not copy/paste from web. Otherwise you can get typographical spaces or minuses instead of the usual ones.)
3. The [...]]]></description>
			<content:encoded><![CDATA[<p>Extending a virtual disk in vmware</p>
<p>1. Backup!</p>
<p>2. Somewhere in the vmware installation directory, there is a tool named &#8220;<b>vmware-vdiskmanager.exe</b>&#8220;. There is a lot of options, for resize use &#8220;<b>-x</b>&#8220;:</p>
<pre><code>vmware-vdiskmanager.exe -x 8Gb ...path.to.vm..../vm_disk.vmdk</code></pre>
<p>(hint: type the command manually, do not copy/paste from web. Otherwise you can get typographical spaces or minuses instead of the usual ones.)</p>
<p>3. The disk is extended, now it&#8217;s time to update the partition table and the disk &#8220;C&#8221; to match the new size of the disk. Several options are availabe, they are listed in vmware&#8217;s knowledge base:</p>
<p><a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&#038;cmd=displayKC&#038;externalId=1647">VMware Virtual Disk Manager Does Not Expand Partitions</a><br />
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&#038;cmd=displayKC&#038;externalId=1647</p>
<p>I tried GParted LiveCD and it worked:</p>
<p><a href="http://gparted.sourceforge.net/livecd.php">GParted &#8212; Live CD/USB/PXE/HD</a><br />
http://gparted.sourceforge.net/livecd.php</p>
<p>GParted run automatically, I had no problems to use it.</p>
<p>4. When Windows started, it noticed that something strange had happended with the disk and executed &#8220;chkdsk&#8221;. The tool validated that everything is in order, and Windows started as usual. With a bigger system disk.</p>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2008/12/26/extending-a-virtual-disk-in-vmware/feed/</wfw:commentRss>
		</item>
		<item>
		<title>wrong but fast fix</title>
		<link>http://uucode.com/blog/2008/12/12/wrong-but-fast-fix/</link>
		<comments>http://uucode.com/blog/2008/12/12/wrong-but-fast-fix/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 05:05:27 +0000</pubDate>
		<dc:creator>olpa</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://uucode.com/blog/2008/12/12/wrong-but-fast-fix/</guid>
		<description><![CDATA[After a small system upgrade an application started to crash with the message:
*** glibc detected *** sylpheed: double free or corruption (out): 0x0839e818 ***
The right thing is to trace the application and submit a bug report to the author, but I found a fast workaround. Set an environment variable before running the program:
export MALLOC_CHECK_=0
]]></description>
			<content:encoded><![CDATA[<p>After a small system upgrade an application started to crash with the message:</p>
<pre>*** glibc detected *** sylpheed: double free or corruption (out): 0x0839e818 ***</pre>
<p>The right thing is to trace the application and submit a bug report to the author, but I found a fast workaround. Set an environment variable before running the program:</p>
<pre>export MALLOC_CHECK_=0</pre>
]]></content:encoded>
			<wfw:commentRss>http://uucode.com/blog/2008/12/12/wrong-but-fast-fix/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
