LaTeX is powerful language for typesetting. It’s very flexible, too. But many times, the writer is stuck with certain symbols, which he/she doesn’t know how to typeset in LaTeX. There’s a wonderful long list of symbols available as PDF file (you can download it from the sidebar of this blog), which is mostly helpful in finding the required symbols. You must have learnt about it in my earlier post. The symbols in the PDF file are sorted after packages.

Nonetheless, if you are looking for very particular symbol with very unique design, it can be pain to go through all pages. Well, there’s a good web-based solution to it, which classifies the symbols based on your writing/sketch.

 

You just do the sketch of the symbol you are looking for, of course, using mouse and you get all the variants of it on the right side with mentions to required package for it. Isn’t it sweet and easy? This works so well, that I found many symbols or variants of them in just few seconds.

This is called Detexify Squared, a project conceived by Philipp Kühl and Daniel Kirsch. I appreciate their efforts. This is surely going to make life of many LaTeX users easier. Please spread the word using services below!

 

I do not know how many of you had problem to get iCloud account displaying in Mail App of iPhone. I thought it appears in this app after I activated iCloud mail in Settings. Unfortunately, it wasn’t the case. So I found a simple solution. I used the same IMAP server for iCloud, which I used for MobileMe. And voila! I get all the iCloud mails in Mail App on iPhone.

Here’s the screenshot of the setting:

20111015-213013.jpg

The coordinates of any objects in astronomy is given in right ascension and declination, sort of latitude and longitude for the sky. For example, for Altair, one of the brightest star in the sky, it has RA of [19 50 46.99] and DEC of [+08 52 05.95]. Only declination needs plus or minus sign, like latitude on Earth’s surface. So I save these information in IDL in variable such as, RA1, RA2, RA3, DEC1, DEC2, DEC3. Of course, I save last part of RA and DEC in floating number, whereas other variable are of integer. When I want to print it with following command:

IDL > print, RA1, RA2, RA3, DEC1, DEC2, DEC3, format='(I3,I3,F6.2,4x,I3,I3,F6.2)'

I get the output:

 19 50 46.99      8 52  5.95

which is perfectly fine for quick look-up. As you see, the format defines how the output should look like. It prints 3 digit integer, aligned to right. And if the integer is of less than 3 digits, then non-existing integer part is replaced by backspace. I used this fact to make some space between two entries, like DEC1 and DEC2. Without this hassle for backspace, the output would have looked like:

 195046.99     8525.95

Quite bad, right? So having prepending backspace is good thing. But for printing purpose, in publication or in thesis, it is better if they were shown like this:

 19 50 46.99    +08 52 05.95

So I need 0 rather than backspace before 8 and 5.95. And I want the plus sign for DEC1 part, too. So let’s look at how to add 0s first!

For integer formatting it is easy. I replace I3 with I03. Quite simple, well, the output will be like this:

019050 46.99    008052  5.95

Quite bad. But there’s a solution. You can replace I3 by I3.2, and voila, you have quasi-required output:

 19 50 46.99     08 52  5.95

It says that out of three required space for integer, only two should be occupied, and if there is only one digit integer, then second space prepending to it shall be replaced by 0. Unfortunately, the same trick doesn’t work for floating number, where decimal number in format are used to define decimal places. If I replace F6.2 by F06.2, I get the following output:

 19 50 46.99     08 52005.95

I didn’t find any easy solution to that, nonetheless, there’s a workaround. I add 1x before defining format for floating number and replace I6.2 by I05.2 to include zero in the output. It looks like now:

 19 50 46.99     08 52 05.95

Almost perfect! We are just missing the plus (or minus) sign. It can be done by adding + to format like I+3.2. Beware, + sign in format doesn’t mean only for plus sign, but also minus. Instead of +, if you give - sign, then it has different meaning. Because, as default, all outputs are right aligned, the - in format allows it to align to left. It is not meant for minus sign in the output.

So finally the following IDL code gives the required output:

IDL> print, RA1, RA2, RA3, DEC1, DEC2, DEC3, format='(I3.2,I3,F6.2,4x,I+3.2,I3,1x,F05.2)'

 19 50 46.99    +08 52 05.95

I guess it was way to long explanation for simple problem. But I was interested in explaining how I went about it. I hope you enjoyed it. You can find more and detailed information on format codes here:
http://star.pst.qub.ac.uk/idl/Format_Codes.html

Enhanced by Zemanta

I was looking for Astronomical symbols in LaTeX, esp. for the Sun. And I thought probably there’s only one package available for it. As it seems there are quite a few many of them. I found them in the huge LaTeX symbol list available as PDF online. Here’s the snapshot of the astronomical symbol page:

Astronomical Symbols Snapshot

Interestingly, in the same list, these symbols are listed as Astrological symbols, too. Quite a slap in the face of any Astronomers! :-) Well, I used the wasysym package which has many more useful symbols. Nonetheless, you can decide which package you like, since microscopically those symbols are little different than other. So I recommend every LaTeX user should download the comprehensive list of symbols. You won’t regret it. The reader of this blog can download it from the sidebar of this blog. The name of the file is “latex-symbol-list.pdf”.

A series paper sizes

Standard in paper sizes is very useful information, if you are stationary-fan or you go to conferences, which tells you what size the poster should be. The idea behind standards in paper sizes is quite simple, that any lower number size is the half of the other higher number size. But I still prefer to have simple chart in mind. But this time I have this beautiful sketch which tells you about paper sizes in engineering drawing sketch style. And this diagram also has usual American sizes like letter and legal imprinted on it for comparison. I guess readers would find it pretty useful for their references.

I have been away for long time, since I was busy with my research and presently I’m writing my thesis to the end. Well, I’m working on large number of stellar objects and, of course, I have to provide basic information about them in tabular form at the end of the thesis. So I needed not a simple tabular form usually used in \LaTeX, but I have to use another package to make it seamless over many pages. And I think longtable package is perfect for it. Here I tell you how to do it.

So first you have to add this package in preamble of your document:

\usepackage{longtable}

And, then, you can add the following template for longtable wherever you want to add the table:

\begin{center}
% add \scriptsize , if the default font is too big to float the table within boundaries
\begin{longtable}{ l c r r }
%Here is the caption, the entry inside [] is the table of contents entry,
%the entry inside {} is the title that will appear on the first page of the
%table.
\caption[Table of something]{Table of something and more} \label{tab:table_label} \\

%This is the header for the first page of the table...
\hline \hline \\[-2ex]
\multicolumn{1}{l}{Column 1} &
\multicolumn{1}{c}{Column 2} &
\multicolumn{1}{c}{Column 3} &
\multicolumn{1}{c}{Column 4} \\[0.5ex] \hline
\\[-1.8ex] % for better-looking spacing
\endfirsthead % end of the header on first page of the table

%This is the header for the remaining page(s) of the table...
\multicolumn{4}{c}{{\tablename} \thetable{} -- Continued} \\[0.5ex]
\hline \hline \\[-2ex]
\multicolumn{1}{l}{Column 1} &
\multicolumn{1}{c}{Column 2} &
\multicolumn{1}{c}{Column 3} &
\multicolumn{1}{c}{Column 4} \\[0.5ex] \hline
\\[-1.8ex] % you can change this later part for the table should look different on subsequent pages
\endhead % End of header for remaining pages

%This is the footer for all pages except the last page of the table...
\\[-1.3ex] % Specify any spacing you prefer for the footer
\multicolumn{7}{l}{{Continued on Next Page\ldots}} \\
\endfoot % End of footer for all but last pages of the table

%This is the footer for the last page of the table...
\\[-1.8ex] \hline \hline
\endlastfoot % End of footer on the last page

% Now the data...
data_c1 & data_c2 & data_c3 & data_c4 \\
data_c1 & data_c2 & data_c3 & data_c4 \\
% more data here
data_c1 & data_c2 & data_c3 & data_c4 \\
data_c1 & data_c2 & data_c3 & data_c4 \\
% data end

\end{longtable}
\end{center}

Please read the accompanying comments and make necessary changes. And that’s all, you have your long table, which spans many pages and looks great.

One more thing: I had a problem with width of the table. I had way too many columns to accomodate within the boundaries. I used \scriptsize to make the fontsize reasonably small. It didn’t help, too. So the best solution is to present the table in landscape mode. Unfortunately, you can’t do that within longtable, but you have to use another package, called landscape. So add the following line in your preamble:

\usepackage{lscape}

And after that, just change the environment from center to landscape in the template above. This solves the problem and you have beautiful table.

In my earlier blog post, I talked on how to make an iPhone like WebApp for desktop. But it’s a time for yet another wonderful device, Apple iPad, which provides even larger screen and one would definitely like to make use of large screen function available on iPad. There shall be bunch of web services, which created customized interface for iPhone, and now working on providing customized interface for iPad. Google has already taken the first step in customizing Google Mail interface in accordance to screen size available on iPad. And others shall definitely follow the suit soon.

Google Mail for Apple iPad via Google Mobile Blog

Google Mail for Apple iPad via Google Mobile Blog

Like iPhone interface, this iPad experience is also pretty kewl and like in case of iPhone, one can also make this interface as WebApp on Desktop using SSBs (site specific browser) like Fluid and Prism. Since iPad uses Safari as its browser, it is much easier to create iPad interface using Fluid. Just like described in the earlier post, one has to create an simple web app using Fluid. Then change user agent to other… and put the following string into it:

Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10

Now just restart the the web app and you have very sleek iPad interface to your favorite web service. This at least seems to work on Google Mail, but it should also be possible to any other web service which has customized interface for iPad.

Nonetheless, I would still prefer iPhone interface for some web services like Google Tasks or Instapaper, since it is quite small, compact and sweet.

There are many IDL routines available for reading FITS file, a standard for astronomical data, but I have never been happy with their use for pretty simple thing of displaying the spectrum of the object. fits_read gives you the header and flux, but never the wavelength scale. readfits can also be useful, but it does so many other things, that I decided to write reading routine on my own.

Of course, I had to make use of fits_read to get the header and flux information from the FITS file. What is actually missing is the wavelength scale. So I create a wavelength array by taking header information from the FITS file. Header saves the value of the starting wavelength as CRVAL1 and the size of the increment as CDELT1. Now creating the wavelength array is not that difficult. My IDL routine is called myreadfits.pro and the source code is given below.

pro myreadfits, file, wavel, flux

fits_read, file, flux, header
crpos=where(strmid(header,0,6) eq "CRVAL1")
cr=strmid(header[crpos[0]],9,60)+0.
cdeltpos=where(strmid(header,0,6) eq "CDELT1")
cdelt=strmid(header[cdeltpos[0]],9,60)+0.
wavel=findgen(n_elements(flux))*cdelt+cr

end

There are many web services customized for iPhone experience. Sometimes they excel those for normal web browsers. They also come handy, when you are not interested in giving whole desktop just for one web service, like e.g. SocialThing! or Google Tasks. And the Safari iPhone experience is also quite sleek and very minimalistic. There is a workaround for it, where you can make these WebApps as Desktop Apps.

The solution is creating a WebApp using Fluid. Just create a normal web app as instructed. After creating it, launch it! Now what you have to do is to change the User Agent setting, so that it is recognized as Mobile Safari not as a desktop Safari. Under the application menu you can find User Agent. Now select Other… There you put the following string:

Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11 Safari/525.20

Now restart the just created application and you have iPhone optimized WebApp on Desktop. This workaround was made for Gmail Tasks, which seems to be working with other apps.

Follow

Get every new post delivered to your Inbox.