On physics…

Чтобы построить полную теорию, фактов всегда достаточно, не хватает только фантазии.
Д. Блохинцев

[There are always enough facts to build a complete theory, only fantasy is lacking.
D. Blokhintsev]

Continue reading

Drawing the crystal lattice in LaTeX

While LaTeX packages TikZ and PStricks  (see previous post) extensively support 2D, the  3D support is somewhat limited: z-coordinate (depth) is not accounted for in certain cases, so the the newer object declaration or higher layer “covers” older object or lower layer.

Possible solution is using Asymptote package. It comes with additional bonuses like inlining code into TeX code, export into various image formats and even embedding PRC graphics within PDF files. Just what one needs for imaging the crystal structure! :-)

Continue reading

Gitit and ikiwiki

About a year ago in a search for notes-taking software I chose git & haskell based wiki: gitit.

This wiki had certain advantages like:

  • git, mercury or darcs as a storage backend,
  • enhanced pandoc flavored markdown,
  • really lots of other markup languages (basically, anything supported by pandoc),
  • export of the wiki pages into any pandoc-supported format,
  • comes with a Happstack-based web-server, and by default is ready for you at localhost:5001,
  • highlighting support for various programming languages,
  • it’s quite fast, and doesn’t consume too much resources,

However, among the drawbacks I’ll mention:

  • installation of ghc+packages. Really, I need ghc on my system solely for gitit and git-annex,
  • only a few methods for authentication and access management,
  • not many plugins, however, most of the really needed things are already there.

I found wiki-based notes very handy, and soon we all used them for family planning in our home net. However, when I decided to move the wiki from my desktop to a small Raspberry Pi server, I faced some problems. The first and main one is memory constraints (256 or 512 Mb RAM). Well, it is possible to run ghc on a Pi, but it in the end it seems to me as an unnecessary thing there. So I decided to try out perl-based ikiwiki.

It is much more feature-rich than gitit:

  • more scm as a storage backend,
  • number of plugins (especially, ‘contrib’ ones) extending functionality far beyond gitit’s (and, yes!, pandoc support),
  • automatic page generation based on tags/posts etc…

However,

  • out of the box markdown is slightly weaker, than gitit’s,
  • page generation consumes considerable computing power. Raspberry Pi stumbles on it…
  • needs a web-server, (it’s not really a drawback).

It’s a bit difficult to compare these wiki-engines, as they target slightly different niches. Gitit is “stupid wiki content tracker”. It takes 3, no, 2 minutes to fire it up, and then it simply works. However, if you want something more elaborate, but not as large as doku- or mediawiki, ikiwiki is a best choice.
With some time spent for its tuning, it becomes multi-purpose site.

If you want to check these wikis functionality, but hesitate to install them, check out gitit and ikiwiki sandboxes or create your own ikiwiki driven site at branchable.

From funtoo to gentoo

Finally switched back from funtoo to gentoo after 2 years.
Git-based portage tree, concept of the flora overlay and flavored profiles are really nice & cool ideas!
However, outdated portage tree is a pain in the ass for me… :-(
Guys, why not just importing everything from gentoo portage, patching whatever you need to patch, and mask whatever you need to mask?
GCC-4.7.4 and 4.8.1 are too unstable? Just do not keyword or simply mask them. But let them be in a tree.

TikZ vs. PSTricks

LaTeX boasts nearly perfect means of  drawing and visualizing scientific data and schemes. Among them there are: Metapost, Asymptote, PSTricks and TikZ .

  • Metapost is a programming language, interpreted into either PS or SVG. It looks like to be the first approach to the Tex-graphics in its kin.
  • Asymptote is a programming vector graphics language, inspired by Metapost, allowing to expand TeX capabilities from 2D into 3D. It also has capabilities in exporting drawings in different formats.
  • PSTricks is a collection of macros allowing the direct inclusion of Post Script language in TeX. Creation of graphs can be simplified by additional packages like pst-plot and many, many others (check out the examples section on the homepage). Roughly, PSTricks is able doing everything PS can, and also is limited by it.
  • TikZ/PGF is a package, consisting of lower-level (PGF) programming language and higher level (TiKZ) user-friendly layer for it. It is quite similar to PSTricks, however the “raw” PS support is more limited.

Having some experience with the last of them, I prefer  TiKZ over PSTricks.
The reasons are:

  • Easier PDF output in TikZ (can be achieved in PSTricks using pst-pdf package or by latex && dvipdf ),
  • inline picture inclusion, e.g. \tikz \draw[domain=0:360,smooth,variable=\t] plot ({sin(\t)},\t/360,{cos(\t)});
  • more powerful mathematical engine, ( in PSTricks one could use pst-math, pst-func, pst-add and others);
  • VERY powerful concept of \datavisualization , one could also use pfgplots package for the same result,
  • powerful nodes and graphs packages,
  • easier extension of TikZ package for your needs using pgf-language.