A dummy package in Ubuntu for texlive

I was trying today to install bibtex2html in Ubuntu Precise, and I got the following message from the terminal:

~$ sudo apt-get install bibtex2html
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  lmodern luatex ocaml-base-nox tex-common texlive-base texlive-binaries
  texlive-common texlive-doc-base texlive-luatex

Now, I have already installed TeXLive 2012 manually, therefore I do not need lmodern, luatex, etc. I could find this page with instructions. Basically, I installed equivs, created a file texlive-local taking the example from the above address as model (noting, that, for example texlive’s version in precise is 2009-15), then ran:

$ equivs-build texlive-local

This created a file texlive-local_2009-15_all.deb, which I could install with:

$ sudo dpkg -i texlive-local_2009-15_all.deb

and then I could install bibtex2html without unnecessary extra packages.

In case it is useful for anybody else, here is the texlive-local file I used.

Posted in Ubuntu | Tagged | Leave a comment

TikZ figures in org mode files

TikZ images deserve a footnote in the Org-manual. For future reference, I include an example that seems to work.

Say we have a tikz diagram, in a file diagram.tex such as:

\begin{tikzpicture}
  \draw (0,0) grid (7,5);
  \draw (0,0) node[below left] {$A$};
  \draw (7,5) node[above right] {$B$};
  \fill (0,0) circle (2pt);
  \fill (7,5) circle (2pt);
\end{tikzpicture}

Then we can include it in an org file:

#+title: A test

* A TikZ figure

#+name: diag
[[./diagram.tex]]

It helps to set org-latex-image-default-width to the empty string, to avoid resizing the image when exporting to LaTeX. See the discusion here.

Posted in LaTeX | Tagged | Leave a comment

Org mode 8.0

Org mode was updated recently to version 8.0, and together with many great features, an unfortunate consequence it brought is that many lovely features of org2blog/wp no longer work. There is hope for the future, but in the meantime, I will post with Emacs 24.3.1, and the org-mode that comes with it (Org-mode version 7.9.3f).

Posted in Emacs | Tagged | Leave a comment

Updating bibsnarf for arxiv.org

bibsnarf.el is a nice tool to get BibTeX entries conveniently from Emacs. Even though it seems that it has not been updated since 2007, it still works with mathscinet, but not with arxiv.org. With the following redefinition, bibsnarf works for me with arxiv:

(defun bsn-arxive-url (author title)
  (concat "http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=PRE&"
          "&aut_req=YES&aut_logic=AND&author=" (mm-url-form-encode-xwfu author)
          "&ttl_req=YES&ttl_logic=AND&title=" (mm-url-form-encode-xwfu title)
          "&data_type=BIBTEX"))

It would be very nice to be able to use bibsnarf with the version of mathscinet at MR lookup.

Posted in Emacs | Tagged , | 3 Comments

Close to numbered macros in LaTeX

I think it is unfortunate that one cannot use numbers in macro names in \LaTeX. Using the xkeyval package, I could obtain something close to it:

\documentclass{article}

\usepackage{xkeyval}

\makeatletter
\define@cmdkey[GRA]{small}{i}{}

\newcommand{\atest}[1]{
  \setkeys[GRA]{small}{#1}%
  \ifcase\cmdGRA@small@i
  \or % i = 1
  A
  \or % i =2
  B
  \or % i =2
  C
  \fi
}
\makeatother

\begin{document}

\atest{i=1} % prints A

\atest{i=2} % prints B

\atest{i=3} % prints C

\end{document}
Posted in LaTeX | Tagged | Leave a comment

Sage 4.7.1 in Ubuntu Oneiric

Since I am starting a clean install of the new Ubuntu, I proceeded to reinstall Sage. After the usual steps, and running sage, I got an error message, which I had not seen before, starting with:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)

/usr/local/share/sage-4.7.1/local/lib/python2.6/site-packages/IPython/ipmaker.pyc in force_import(modname)
     64         reload(sys.modules[modname])
     65     else:
---> 66         __import__(modname)
     67 
     68 

and ending with:

/usr/local/share/sage-4.7.1/local/lib/python2.6/site-packages/numpy/linalg/linalg.py in <module>()
     21         isfinite, size, finfo, absolute, log, exp
     22 from numpy.lib import triu
---> 23 from numpy.linalg import lapack_lite
     24 from numpy.matrixlib.defmatrix import matrix_power
     25 from numpy.compat import asbytes

ImportError: libgfortran.so.3: cannot open shared object file: No such file or directory
Error importing ipy_profile_sage - perhaps you should run %upgrade?
WARNING: Loading of ipy_profile_sage failed.

After some trial and error, I found good keywords to ask google:

sage importerror ubuntu 11.10 libgfortran.so.3

The first result: apt get – How to install gfortran?, from the AskUbuntu site, had the answer: install the package libgfortran3.

Posted in Math | Tagged , | 2 Comments

A simple example

This is my first attempt at using tkz-euclide.

\begin{tikzpicture}
  \tkzDefPoint(0,0){B}
  \tkzDefPoint(8,0){A}
  \tkzDefPoint(7,4){C}
  \tkzDefPoint(1,8){D} 
  \tkzDrawSegment(A,B)
  \tkzDrawSegment(A,C)
  \tkzDrawSegment(C,D)
  \tkzDrawSegment(B,D)
  \tkzDrawSegment(B,C)
  \tkzDrawSegment(A,D)
  \tkzDefMidPoint(C,D)
  \tkzGetPoint{M}
  \tkzInterLL(C,B)(A,D) \tkzGetPoint{P}
  \tkzDrawPoints(A,B,C,D,M,P) 
  \tkzLabelPoints(A,B)
  \tkzLabelPoints[above](C,D)
  \tkzLabelPoints[below](M,P)
  \tkzCentroid(B,P,D)\tkzGetPoint{G}\tkzLabelPoint(G){\Large 4}
  \tkzCentroid(A,P,C)\tkzGetPoint{H}\tkzLabelPoint(H){\Large 1}
  \tkzCentroid(A,P,B)\tkzGetPoint{I}\tkzLabelPoint(I){\Large 2}
\end{tikzpicture}

Posted in LaTeX | Tagged | Leave a comment