研究生们总在某个阶段脑筋就会有点不正常。Because all research students are insane at one time or another.
Friday, October 30, 2009
Book design with LaTeX
I'm now embarking on a series of blog posts on how I produced the Grid Computing Cluster report with LaTeX for the Malaysian LaTeX User blog. Look for posts tagged with 'bookdesign'.
Monday, October 19, 2009
Tuesday, October 13, 2009
Flock!
I'm testing out Flock, a "social Web browser" that comes bundled with an blog editor. Mainly because I'm sick of getting disconnected (Baaaad streamyx! Baaaad uni network! Baaad!) halfway through authoring a post. It's supposed to be very Web 2.0 and everything.
I looked at some desktop blogging clients alternatives, but they're either only available for Windows, or they're not free. If most websites and features load alright in Flock I'd probably even ditch Safari altogether.
I looked at some desktop blogging clients alternatives, but they're either only available for Windows, or they're not free. If most websites and features load alright in Flock I'd probably even ditch Safari altogether.
Friday, October 9, 2009
Accessing Package Documentations
LaTeX package authors are awesome, not only because they develop and maintain so many goodies for the convenience of other LaTeX users (especially those of us who aren't that well-versed with TeX), but also because they fully document the usage of their packages. (Well most of them anyway.)
How do you access these documentations and manuals, though? Do you google (or search on CTAN) and download the manuals every time you want to look up the details of user commands in, say, the glossaries package? Occasionally, though, you may find that the manuals you just downloaded are the wrong versions for the package files installed on your system.
Chances are that the documentations are already installed on your system, when you first installed those packages. They're usually located in $TEXMF/doc/tex/latex, or $TEXMF/doc/bibtex for BibTeX-related packages.
There's an easier way to look up a package's documentation than manually navigating the TEXMF trees, though. In TeXLive (that's probably what you have if you're on a *nix or Mac system), type
$ texdoc glossaries (or whatever package you're interested in)
at the shell prompt. Voíla! The documentation for the glossaries package would open automatically for your perusal.
If the file that appears seem like an example file demonstrating a package's functionalities and not the documentation proper, try
$ texdoc --list glossaries
instead. You'll be presented with an interactive list from which you can select the file you want to open.
MikTeX users on Windows can use the command
mthelp glossaries
at the command prompt or from the "Start → Run" dialog instead. A browser window would open, listing possible documentation files associated with the package name you supplied. Click on a link to view the file you're interested in. And if you trust the system enough to hit upon the "main" documentation file at the first try, use
mthelp --view glossaries
instead.
How do you access these documentations and manuals, though? Do you google (or search on CTAN) and download the manuals every time you want to look up the details of user commands in, say, the glossaries package? Occasionally, though, you may find that the manuals you just downloaded are the wrong versions for the package files installed on your system.
Chances are that the documentations are already installed on your system, when you first installed those packages. They're usually located in $TEXMF/doc/tex/latex, or $TEXMF/doc/bibtex for BibTeX-related packages.
There's an easier way to look up a package's documentation than manually navigating the TEXMF trees, though. In TeXLive (that's probably what you have if you're on a *nix or Mac system), type
$ texdoc glossaries (or whatever package you're interested in)
at the shell prompt. Voíla! The documentation for the glossaries package would open automatically for your perusal.
If the file that appears seem like an example file demonstrating a package's functionalities and not the documentation proper, try
$ texdoc --list glossaries
instead. You'll be presented with an interactive list from which you can select the file you want to open.
MikTeX users on Windows can use the command
mthelp glossaries
at the command prompt or from the "Start → Run" dialog instead. A browser window would open, listing possible documentation files associated with the package name you supplied. Click on a link to view the file you're interested in. And if you trust the system enough to hit upon the "main" documentation file at the first try, use
mthelp --view glossaries
instead.
Malaysian LaTeX Users
I just signed on as an author on the Malaysian LaTeX Users blog! :D
I'm just wondering how long I can keep this stint up though? *Peers at own lonely, lonely blog*
I'm just wondering how long I can keep this stint up though? *Peers at own lonely, lonely blog*
Using .eps Graphics with PDF output
For quite some time now, the
That is to say, if you are generating to a
But what if you want a
Well, you could always convert it manually to a .pdf yourself with GhostScript or GIMP, of course. But now the process can be automated if you're using MikTeX 2.8 or TeXLive 2009, as highlighted by Rob Hyndman.
In MikTeX 2.8, use the
If all you have is
If you're using TeXLive 2009, you don't even have to load
graphicx
package would automatically sort out which file types to use whenever it encounters \includegraphics{some_file}
, where the extension of some_file
is not specified.That is to say, if you are generating to a
.dvi
, the system would look for some_file.eps
. If you are generating to a .pdf
, it looks for some_file.{pdf|jpg|png}
. But what if you want a
.pdf
and you work with .pdf, .jpg and .png graphic files, but suddenly you received a .eps graphics from your collaborator? (This actually happened to a lecturer at my university.)Well, you could always convert it manually to a .pdf yourself with GhostScript or GIMP, of course. But now the process can be automated if you're using MikTeX 2.8 or TeXLive 2009, as highlighted by Rob Hyndman.
In MikTeX 2.8, use the
epstopdf
package together with graphicx
, like so:\documentclass{article} \usepackage{graphicx,epstopdf} \begin{document} \includegraphics[width=\textwidth]{some_file} \end{document}
If all you have is
some_file.eps
, it will be automatically converted to a some_file-eps-converted-to.pdf
during the first time the LaTeX document is compiled and included in the final document output.If you're using TeXLive 2009, you don't even have to load
epstopdf
explicitly, but I say include it anyway, for portability's sake.
Friday, September 25, 2009
Batch Transcoding with VLC 1.0.x
After I upgraded my VLC player to v1.0.x, I realised my batch transcoding script stopped working. After much tinkering with the syntax and googling, I've got it working again. Here is the updated script:
#!/bin/bash vcodec="mp4v" acodec="mp4a" bitrate="3072" arate="192" ext="mp4" mux="mp4" # Modify the path to VLC on your machine accordingly vlc="/Applications/VLC.app/Contents/MacOS/VLC" fmt="MPG" dst="/Dest/Path/" for a in *$fmt; do echo $a $vlc -I dummy -vvv "./$a" --sout="#transcode{vcodec=$vcodec,\ vb=$bitrate,acodec=$acodec,ab=$arate}:std{mux=$mux,\ dst=\"$dst$a.$ext\",access=file}" vlc://quit touch -m -r $a $dst$a.$ext done
Wednesday, September 16, 2009
Book Printed — Finally
Early this year I was asked to help compile a technical report/book for a grid computing research project that I'm involved in. Essentially it's a group of researchers from different disciplinary backgrounds (grid computing, medical imaging, animation, mathematics, natural language processing, software engineering, networking, ...) coming together to "grid-enable" their own existing applications so that the apps run faster etc.
"But not too technical, so that even lay-people can understand what we're doing. Make it look as professional as possible," I was told.
Look professional? Gee, great excuse for me to run wild with LaTeX. Whether it was the right decision might be debatable, and I haven't solved all issues to perfection (e.g. CMYK colour model with "true black")... but we managed it!
Chasing after the chapter write-ups. Playing with design ideas. Lots and lots of experimenting with the
And finally all is done. We have now 200 copies of the thing. Not for sale (which would've been a nightmare with the royalties, we're not that gung-ho yet... maybe the next one. If there's a next time.) but for distribution.
Great, great thanks to the team members (principle investigators and research officers) for the write-ups, Pn Norliza for the proof-reading, Mr Tan for pointing us in the right directions every now and then, Hooi Leng for handling the liaising and PO procedures with the printing company. Couldn't have done any of this without any of you.
"But not too technical, so that even lay-people can understand what we're doing. Make it look as professional as possible," I was told.
Look professional? Gee, great excuse for me to run wild with LaTeX. Whether it was the right decision might be debatable, and I haven't solved all issues to perfection (e.g. CMYK colour model with "true black")... but we managed it!
Book's Printed and Published!!
@BOOK{GridATUSM:Report, title = {Grid Computing Cluster: The Development and Integration of Grid Services and Applications}, publisher = {Platform for Information Communication Technology Research, Universiti Sains Malaysia}, year = {2009}, editor = {Bahari Belaton and Lim, Lian Tze}, address = {Penang, Malaysia}, isbn = {978-983-3986-58-3}, }
Chasing after the chapter write-ups. Playing with design ideas. Lots and lots of experimenting with the
memoir
, tikz
and various other packages. Searching for free stock photos. Adjusting the various margins and skips and spacing so that each chapter fill up each page just right. Writing to and calling the National Library to get an ISBN number and CIP data. Hiccups along the way due to requests in design changes, mismatches with the printing company's technical specs etc...And finally all is done. We have now 200 copies of the thing. Not for sale (which would've been a nightmare with the royalties, we're not that gung-ho yet... maybe the next one. If there's a next time.) but for distribution.
Great, great thanks to the team members (principle investigators and research officers) for the write-ups, Pn Norliza for the proof-reading, Mr Tan for pointing us in the right directions every now and then, Hooi Leng for handling the liaising and PO procedures with the printing company. Couldn't have done any of this without any of you.
Friday, July 17, 2009
Tuesday, June 30, 2009
Farewell Eitan
Eitan Gurari, the author of TeX4ht — the best LaTeX to HTML/OO.o/etc conversion system that I've come across — has died. :-(
He was a most helpful soul on comp.text.tex . RIP Eitan.
(Yes yes yes, no tribute to MJ and yet one for Eitan, I'm a geek, yes.)
He was a most helpful soul on comp.text.tex . RIP Eitan.
(Yes yes yes, no tribute to MJ and yet one for Eitan, I'm a geek, yes.)
Tuesday, June 2, 2009
RegEx Tutorial and Tools
Great article and resources round-up about regular expressions at SmashingMagazine! One for the bookmarks.
Thursday, May 7, 2009
Begone, ._whatever!
So Finder in OSX has this quirky habit of creating a ._blah for every blah file when transferring file between operating systems, due to the AppleDouble system and resource forking. (No idea what those mean exactly, but you can always ask Google.)
David Olinsky left this nugget of a solution as a comment here:
export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
UPDATED: as well as this attribute, introduced in Leopard as noted by nzight:
export COPYFILE_DISABLE=true
Thank goodness! Now stick those in your .bash_profile...
Oh and to remove those blasted files:
David Olinsky left this nugget of a solution as a comment here:
export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
UPDATED: as well as this attribute, introduced in Leopard as noted by nzight:
export COPYFILE_DISABLE=true
Thank goodness! Now stick those in your .bash_profile...
Oh and to remove those blasted files:
> find . -iname '._*' -exec rm -rf {} \;
Friday, April 10, 2009
PicasaWeb adds automatic translation of comments
While uploading photos to PicasaWeb this morning, I was surprised when non-English comments were automatically translated to English. The results are rather entertaining, yet still demonstrating the usefulness of machine translation to non-speakers of the source language: (admit it O blog reader! Yes, you, 'cause I know there's no one else who reads this blog!)
(Original link)
(Original link)
(Original link)
![]() | S.Shen Apr 9, 2009 12:10 PM | 孩子越来越像爸爸了。 Children more and more like a father. Do not be angry mother ha ~ |
![]() | Lian Tze Apr 10, 2009 11:17 AM | 呵呵,没生气啦,早就 Oh, you did not angry, identified long ago are still ⋯ ⋯ stomach for ultrasound scan is the father had been a remake version of the |
(Original link)
![]() | S.Shen Apr 9, 2009 12:09 PM | 好可爱 Good lovely |
![]() | Lian Tze Apr 10, 2009 11:11 AM | 可爱得爆⋯⋯不是爆灯 Too cute not burst burst ⋯ ⋯ lights, is our brain will soon burst. ;-) |
Wednesday, April 8, 2009
Periodic Table of Typography
Compiled by Cam. Nice one to hang on a cubicle wall. Bound to confuse people, or not: perhaps they'll just assume that I'm now dabbling in Chemistry and not some funny nutty typography and leave me alone.
Friday, March 20, 2009
Batch transcoding with VLC
I have a bunch of MPG videos from my videocam but neither iPhoto nor iMovie would recognise them. Now VLC has a transcoding wizard that'd do the conversion to MP4 nicely, but to do it interactively through the GUI is just too tedious. Using this tip from the VideoLAN Wiki, I used a script to perform the batch transcoding:
If you want to try this on Linux or Windows, you should use
#!/bin/bash vcodec="mp4v" acodec="mp4a" bitrate="3072" arate="192" ext="mp4" mux="mp4" vlc="/Applications/VLC.app/Contents/MacOS/clivlc" fmt="MPG" dst="/Dest/Path/" for a in *$fmt; do $vlc -I dummy -vvv "./$a" --sout "#transcode{vcodec=$vcodec,\ vb=$bitrate,acodec=$acodec,ab=$arate}:standard{mux=$mux,\ dst=\"$dst$a.$ext\",access=file}" vlc://quit touch -m -r $a $dst$a.$ext done
If you want to try this on Linux or Windows, you should use
vlc
instead of clivlc
. I included the touch
command so that the transcoded videos would still have the original capture date/time as their last modified date.
Thursday, March 12, 2009
ISBN to BibTeX Converter
Kenjutsu posted about an ISBN to BibTeX converter in comp.text.tex. Given an ISBN e.g. 0471976970, it returns:
The author of the converter stated that he's obliged to include the link to Amazon to comply with the terms and conditions for using Amazon's Web Service API to generate the information.
The converter accepts both 10- and 13-digit ISBNs, but doesn't seem to be able to recognise books with editors instead of authors (you know, a collection of articles). Still, it can be useful.
@book{0471976970,
Author = {D. Grune and H. Bal and C. Jacobs and K. Langendoen},
Title = {Modern Compiler Design},
Publisher = {Wiley},
Year = {2000},
ISBN = {0471976970},
URL = {http://www.amazon.com/Modern-Compiler-Design-D-Grune/dp/0471976970%3FSubscriptionId%3D0JYN1NVW651KCA56C102%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0471976970}
}
The author of the converter stated that he's obliged to include the link to Amazon to comply with the terms and conditions for using Amazon's Web Service API to generate the information.
The converter accepts both 10- and 13-digit ISBNs, but doesn't seem to be able to recognise books with editors instead of authors (you know, a collection of articles). Still, it can be useful.
Friday, March 6, 2009
Episode IV — now in ASCII art!
I first came across this at Random Determinism, where there's an embedded YouTube version as well. But I thought to myself: Is this a geeky blog, or what?[1] And so — open up a terminal and go
Enjoy!
[1] OMG I can't believe I just admitted that OMG OMG OMG OMG...
telnet towel.blinkenlights.nl
Enjoy!
[1] OMG I can't believe I just admitted that OMG OMG OMG OMG...
Tuesday, March 3, 2009
The Pink Jedi Again
Notice the giant Vader in the background? :)
This would make a nice parody movie poster. One of these days, when I have some precious free time on my hands...
Wednesday, February 4, 2009
Little Jedi in Pink
Pretty in Pink.
MC turned out to know more about Star Wars than I do. The moment he saw Hui Ning in this new dress, he made a beeline for the camel humps at the Penang Municipal Park.
Correction: As it turned out eventually, no, MC doesn't know more about Star Wars than I do — Banthas don't have humps.
MC turned out to know more about Star Wars than I do. The moment he saw Hui Ning in this new dress, he made a beeline for the camel humps at the Penang Municipal Park.
Correction: As it turned out eventually, no, MC doesn't know more about Star Wars than I do — Banthas don't have humps.
Subscribe to:
Posts (Atom)