Showing posts with label latex. Show all posts
Showing posts with label latex. Show all posts

Wednesday, May 16, 2012

Latex with Adobe Illustrator

I have been a linux user for a long time but last year I bought a laptop with a digitizer screen and the lack of good results in linux made me switch to Win 7. In the last year, I have learned that a lot of GPL software is ported to Windows and the switch is not painful at all. Problem is that the last update in one of my favorite page editing software: Inkscape has made my figure editing work flow (I never thought I would use this word) stall a little. So, I decided to give Adobe Illustrator a try as CS education is not so expensive. 

Basically, I need to add latex formulas to Illustrator, there's a nice script to do so here. I encountered a minor problem with this script; it seems like page frame is no longer the last element in the pdf compiled by pdflatex. Thus, the formulas generated by the script and imported into Illustrator were lacking the first element and had a full A4page frame. 

The script file is efficiently commented and a quick look into it brought me to Line 66:
for( var i=grp.pageItems[0].pageItems.length-1; --i>=0; )
After a few iterations, I found that the page frame is now the first page item and so the final modified line is:
for( var i=grp.pageItems[0].pageItems.length; --i>=1; )
This fixed my problem and now I have complete latex formulas in Illustrator with just the minimal frame around the object.

I hope this solves your issues too.

Monday, November 8, 2010

Tunning your Latex in a Linux box

Whenever I install Latex, in particular the texmf installation that comes with Ubuntu, I always end up missing some style, class and bibliography files. In order to fix this, I always do the following:

  1. Copy the files' directories that I'm missing to /usr/share/texmf/tex/latex/ for styles (*.sty) and classes (*.cls); and to /usr/sare/texmf/bibtex/bst/ for bibliographic styles (*.bbt, *.bst)
  2. Make sure the directories are accessible for all users: chmod 755 -r /usr/share/texmf/tex/latex/ /usr/sare/texmf/bibtex/bst/
  3. Reload texmf with: sudo texhash
This always works for me whenever I do a fresh install and have to install the proprietary classes and styles from OSA, IOP and APS.

Revtex 4.1 needs particular attention in Ubuntu, as the natbib package in the current distro is the old natbib. In order to make available the new natbib I do the following:

  1. Download natbib.ins and natbib.dtx and all the .bst files from http://tug.ctan.org/tex-archive/macros/latex/contrib/natbib/
  2. Compile the instaler: latex natbib.ins
  3. Copy the result to a natbib folder in /usr/share/texmf/tex/latex/ for styles (*.sty) and /usr/sare/texmf/bibtex/bst/ for bibliographic styles (*.bbt, *.bst)
  4. Make sure the directories are accessible for all users.
  5. Reload texmf with: sudo texhash

Now, everything should be ready to use the nice features of natbib in Revtex4-1 like \cite{SomeCite, *SomeOtherCite} in order to put SomeCite and SomeOtherCite in the same reference number without having to do it by hand.

I hope you find this helpful.