Posts tagged LaTeX

More StackExchange sites

The Stack­Ex­change site on Sta­tis­ti­cal Analy­sis is about to go into pri­vate beta test­ing. This is your last chance to com­mit if you want to be part of the pri­vate beta test­ing. Don’t worry if you miss out — it will only be a week before it is then open to the public.

There is also a Stack­Ex­change site pro­posal for TeX, LaTeX and friends. Pre­sum­ably that means that most of the LaTeX ques­tions on Stack­Over­flow will then move to this new site. It still needs a cou­ple of hun­dred more peo­ple to com­mit before it can be launched, so if you are inter­ested in LaTeX, please com­mit to being part of it.

Another site pro­posal that may be of inter­est to read­ers of this blog is the one on Eng­lish lan­guage usage.

A few pro­pos­als are already open to the pub­lic for beta test­ing. One that I’ve been using a lit­tle is Web Apps which is use­ful for ques­tions on Gmail, Google reader, Word­Press, etc.

  • Share/Bookmark

Tags: , , , ,

Online collaborative writing

Every­one who has writ­ten a paper with another author will know it can be tricky mak­ing sure you don’t end up with two ver­sions that need to be merged. The good news is that the days of send­ing updated drafts by email back­wards and for­wards is finally over (hav­ing lasted all of 20 years — I can barely imag­ine writ­ing papers before email).

Non-LaTeX solu­tions

If you are will­ing to forgo the ben­e­fits of LaTeX, there are a few solu­tions available:

  • Google Docs. This is my favourite non-LaTeX solu­tion, partly because it inte­grates seam­lessly with other Google prod­ucts and also because you know there are a lot of smart peo­ple work­ing at mak­ing the prod­uct even bet­ter. It is easy to save the doc­u­ment as a pdf or in MS-Word for­mat when it is fin­ished. I use it reg­u­larly for short notes and non-mathematical documents.
  • Zoho offers a large and mature suite of prod­ucts for online col­lab­o­ra­tion includ­ing online writ­ing.  I’ve never used it, but the reviews sug­gest it is an excel­lent alter­na­tive to Google Docs.
  • Microsoft Docs is the lat­est player in this space. Cur­rently you must sign on with a Face­book account and you can only col­lab­o­rate with Face­book friends. That seems a lit­tle odd, as many peo­ple (includ­ing me) tend to keep our work col­leagues and our face­book friends as dis­tinct groups with lit­tle if any over­lap. MS Docs is built using Microsoft Office 2010, so pre­sum­ably it has more facil­i­ties than Google docs. On the other hand, as a new prod­uct it prob­a­bly has a lot more bugs as well.
  • Doc­Verse. This is a plug-in for Microsoft Office which allows sev­eral peo­ple to work on the same doc­u­ment and even dis­cuss the doc­u­ment via a chat panel. Not being very fond of MS-Office, I haven’t tried it.

LaTeX solu­tions

I’ve been watch­ing the var­i­ous online LaTeX tools for the past year as they have devel­oped. Finally, one of them appears to now be usable for real col­lab­o­ra­tive writ­ing. I am cur­rently using Scrib­TeX to write a paper with two coau­thors. There is no need for any of us to have a local LaTeX instal­la­tion (although we all do).  One author must set up a “project” for the paper which con­tains any graph­ics, bib files, local sty files and one or more tex files. Then start work edit­ing the tex files online. Just click “Com­pile” to process the file and the pdf ver­sion appears in another win­dow. The file is saved online so every­one has access to exactly the same ver­sion.  If you use any pack­ages from CTAN, they will be included auto­mat­i­cally. Here is the win­dow (in a browser) show­ing the paper I am cur­rently work­ing on.

Other authors can be invited to join the project pro­vided they have first reg­is­tered on Scrib­TeX (which is free). Then all authors will be edit­ing the up-to-date ver­sion. It is easy to roll back to an ear­lier ver­sion and it is pos­si­ble to see who mod­i­fied what. The free account allows up to three projects with one col­lab­o­ra­tor (i.e., two authors) per project. For $6 per month you are allowed 10 projects with up to six authors on each. For $10 per month, there are no lim­its (other than 1Gb of storage).

There are a few other sim­i­lar solu­tions in development:

  • LaTeX Labs. This is in the early stages of devel­op­ment, but has the cool fea­ture that the doc­u­ments are stored on Google Docs so there is vir­tu­ally unlim­ited stor­age. It is still miss­ing a lot of fea­tures, but shows promise.
  • Ver­bo­sus. This is a lit­tle harder to use than Scrib­TeX and does not come with all CTAN pack­ages pre-installed. But it has a nice text edi­tor and project man­age­ment interface.
  • Mon­key­TeX is also try­ing to solve the same prob­lem. It’s inter­face is a lit­tle more prim­i­tive than the oth­ers, but there are nearly 6000 users and 12000 doc­u­ments stored, so it can’t be too bad. There is appar­ently a screen­cast to intro­duce its fea­tures, but it wouldn’t dis­play in Chrome so I didn’t look further.

None of these three seem ready for reg­u­lar use yet, but I can rec­om­mend Scrib­TeX. Please try it out and let me know (via com­ments) how you get on.

  • Share/Bookmark

Tags: ,

Making a poster in beamer

This week, I made my first poster. Although I’ve been an aca­d­e­mic for more than 20 years, I’ve never had to make a poster before. Some of my coau­thors have made posters about our joint research, and two of them have even won prizes (although I can’t take any credit for them). But this week, our depart­ment is dis­play­ing posters from all research staff about our recent work.

Here is my poster (click for pdf ver­sion):

It was done using beamer which turns out to be as good for posters as it is for slides. I used the beam­er­poster pack­age which comes with a few themes. None of the themes were quite what I wanted, so I adapted one. Here it is in case any­one else wants to use it. I’ve also made a tem­plate based on the poster above.

  • Share/Bookmark

Tags: ,

LaTeX templates for Monash

I have updated my LaTeX tem­plates for use at Monash so they no longer depend on HyTeX. Tem­plates are pro­vided for pro­duc­ing a work­ing paper and a PhD the­sis in the Depart­ment of Econo­met­rics & Busi­ness Sta­tis­tics at Monash Uni­ver­sity. Peo­ple at other uni­ver­si­ties are wel­come to adapt the tem­plates for their own institutions.

  • Share/Bookmark

Tags: ,

My standard LaTeX preamble

When I was a PhD stu­dent, I found I needed a lot of LaTeX func­tion­al­ity that did not then exist. So I wrote my own pack­age which has served me well for about 20 years. It is called HyTeX.sty (the name being a shame­less take-off of LaTeX from Leslie Lamport as well as a homonym of High-Tech). The advan­tage of hav­ing my own pack­age is that almost every file starts with

\documentclass{article}
\usepackage{hytex}
\begin{document}

All the other pack­ages that I use are called from within HyTeX.sty.

After 20 years of using HyTeX, I’ve decided it is time to put it to rest. Most of the func­tion­al­ity in the pack­age is now avail­able in pack­ages on CTAN, and usu­ally with more fea­tures and facil­i­ties. Fur­ther, when I work with coau­thors, I need to send them the lat­est ver­sion of HyTeX as well (as I revise it from time to time).

So from now on, I’m only using pack­ages from CTAN. These are auto­mat­i­cally avail­able to all my coau­thors so we don’t have any issue with dif­fer­ent ver­sions (pro­vided they keep their TeX imple­men­ta­tion up to date!).

An imme­di­ate con­se­quence of this is that I need to replace my stan­dard pre­am­ble. After exper­i­ment­ing a lit­tle, here is what I am now using:

\usepackage{graphicx,hyperref,amsmath,natbib,bm,url,microtype,todonotes}
\usepackage[australian]{babel}
\usepackage[a4paper,text={16.5cm,25.2cm},centering]{geometry}
\usepackage[compact,small]{titlesec}
\setlength{\parskip}{1.2ex}
\setlength{\parindent}{0em}
\clubpenalty = 10000
\widowpenalty = 10000
\usepackage{kpfonts}
\usepackage[T1]{fontenc}

A few words of expla­na­tion may be in order.

  • The first line loads a lot of stan­dard pack­ages that I use all the time.
  • The latex default page size is awful, so I load geom­e­try to set up the page to some­thing more sensible.
  • The latex default sec­tion head­ings seem too large and too widely spaced to me, hence the use of titlesec. This pack­age also allows me to do a lot of addi­tional fine-tuning if required.
  • I pre­fer para­graphs with spaces between them and no inden­ta­tion; this is achieved by set­ting the lengths of \parskip and \parindent accordingly.
  • The set­tings for \clubpenalty and \widowpenalty pre­vent orphans and wid­ows.
  • One of my pet peeves is the US date for­mat “March 21, 2010″ which seems to me to be in the wrong order. I pre­fer “21 March 2010″ so that the time units increase in size: day month year. I fix this using the babel pack­age with the australian option.
  • Finally, I am sick of the stan­dard LaTeX font “Com­puter Mod­ern Roman”. It’s actu­ally a very good font, but it is used so much I find it tire­some. So I’m using kpfonts instead which includes a com­plete set of fea­tures includ­ing math­e­mat­ics as well as non-math char­ac­ters and looks a lit­tle more inter­est­ing with­out being distracting.

I’d be inter­ested to know how this pre­am­ble com­pares with the stan­dard pre­am­bles used by other LaTeXers.

  • Share/Bookmark

Tags:

Using Google Reader

Google Reader is a fan­tas­tic way to keep track of new papers that are appear­ing in many dif­fer­ent jour­nals, and also to fol­low some of the inter­est­ing research blogs (and blogs on other top­ics) that are out there. Google Reader checks web­sites for you and lets you know of any new mate­r­ial that appears. Instead of you hav­ing to look at dozens of dif­fer­ent web­sites to dis­cover new infor­ma­tion, all you need to do is open up Google Reader and all the infor­ma­tion comes to you. In some ways it is like an email account, but where the mes­sages con­tain new addi­tions to web­sites that you are inter­ested in.

Google Reader is called an “RSS reader” because it reads RSS feeds. RSS stands for “Really Sim­ple Syn­di­ca­tion”. A web­site with an RSS feed makes it pos­si­ble to track addi­tions to the site with­out actu­ally vis­it­ing it your­self.  There are other RSS read­ers, but Google Reader is the most widely used. Recently Google Reader added a facil­ity so that it now also tracks sites that don’t have RSS feeds.

If you haven’t used it before, here’s how to get started.

  1. Go to www.google.com/reader and log in. If you already have a Google account (e.g., you’re a Gmail user), then just use your usual Google details. If you don’t have a Google account, then you will need to set one up.

     

  2. Click “Add sub­scrip­tion” and type the URL of any web­site you want to track.
  3. When you are read­ing a web­site that you would like to sub­scribe to, click the orange RSS but­ton that looks like this: .
    A mod­ern browser such as Fire­fox or Chrome will fig­ure out that you want to sub­scribe to the RSS feed. If that doesn’t work, just copy the link address and paste it into the “Add sub­scrip­tion” box in Google Reader.

Each morn­ing I read through any­thing new on Google Reader includ­ing new research papers in jour­nals that I track, new arti­cles on some sta­tis­tics blogs that I fol­low, etc. In fact, I have over 500 sub­scrip­tions! I don’t read every arti­cle or it would take all day, but I do scan the head­lines and read what looks interesting.

It can take a while to col­lect all the sub­scrip­tions for jour­nals you might want to read. To make it easy, you can just piggy-back on my jour­nal col­lec­tion (which cov­ers all sta­tis­tics jour­nals, both fore­cast­ing jour­nals, plus a few econo­met­rics and demog­ra­phy jour­nals, as well as all sta­tis­ti­cal preprints on arxiv). Click here if you want to sub­scribe to all the same jour­nals as me.

If you are inter­ested in R, R-bloggers is very use­ful as it com­bines the posts from a large num­ber of blogs about R.  Just go to the site and click on the RSS feed icon and you will be able to add a sub­scrip­tion to your Google Reader account.

For those who like to keep up with LaTeX, the TeX com­mu­nity aggre­ga­tor does some­thing sim­i­lar for blog­gers writ­ing about LaTeX and related top­ics. Again, just click on the RSS feed icon.

Here is a list of sta­tis­tics research blogs. Check them out and sub­scribe to any­thing that takes your fancy.

This web­site has an RSS feed, as do my other web­sites. Just click the orange but­ton at the top-right of the page and select “Google Reader” and then you will receive any new posts I make in your Google Reader account.

  • Share/Bookmark

Tags: , , , ,

Top four LaTeX mistakes

There is a nice post today by John Cook on the top four LaTeX mis­takes. I see these all the time in draft papers by my stu­dents and co-authors.

  • Share/Bookmark

Tags:

Controlling figure and table placement in LaTeX

It can be frus­trat­ing try­ing to get your fig­ures and tables to appear where you want them in a LaTeX doc­u­ment. Some­times, they just seem to float off onto another page of their own accord. Here is a col­lec­tion of tools and ideas that help you get con­trol of those pesky floats. Read the rest of this entry »

  • Share/Bookmark

Tags:

Squeezing space with LaTeX

I’ve been writ­ing a grant appli­ca­tion with a 10-page limit, and as usual it is dif­fi­cult to squeeze every­thing in. No, I can’t just change the font as it has to be 12 point with at least 2 cm mar­gins on an A4 page. For­tu­nately, LaTeX is packed full of pow­er­ful fea­tures that help in squeez­ing it all in. Here are some of the tips I’ve used over the years.

Make your text block as big as pos­si­ble. The sim­plest way to do that is using the geom­e­try package:

\usepackage[text={16cm,24cm}]{geometry}

Use a com­pact font such as Times Roman:

\usepackage{mathptmx}

Remove the spac­ing between para­graphs and have a small para­graph indentation

\setlength{\parskip}{0cm}
\setlength{\parindent}{1em}

Remove space around sec­tion headings.

\usepackage[compact]{titlesec}
\titlespacing{\section}{0pt}{2ex}{1ex}
\titlespacing{\subsection}{0pt}{1ex}{0ex}
\titlespacing{\subsubsection}{0pt}{0.5ex}{0ex}

Beware of enu­mer­ated and item­ized lists. Instead, replace them with com­pact lists.

\usepackage{paralist}
\begin{compactitem}
\item ...
\end{compactitem}
\begin{compactenum}
\item ...
\end{compactenum}

If you are allowed, switch­ing to dou­ble col­umn can save heaps of space.

\usepackage{multicols}
\begin{multicols}{2}
...
\end{multicols}

If the rules say 12pt, you can usu­ally get away with 11.5pt with­out any­one noticing:

\begin{document}\fontsize{11.5}{14}\rm

When you get des­per­ate, you can squeeze the inter-line spac­ing using

\linespread{0.9}

There is also a savetrees pack­age which does a lot of squeez­ing, but the results don’t always look nice, so it is bet­ter to try one or more of the above tricks instead.

A few more tricks are explained here and here.

  • Share/Bookmark

Tags: ,

Converting eps to pdf

Now that there is a way to sync a pdf file and tex file in both direc­tions, the only remain­ing rea­son to use dvi files is when the graph­ics are in eps format.

How­ever, that prob­lem has also been solved for those using Mik­TeX 2.8 or TeXLive 2009. In Mik­TeX 2.8, sim­ply include the pack­age epstopdf along with graphicx. (As noted in the com­ments below, even this step is not nec­es­sary in TeXLive 2009.) Then when you use pdfla­tex, the eps files will be auto­mat­i­cally con­verted to pdf at com­pile time. (The con­ver­sion only hap­pens the first time you process the file, and is skipped if there is already a pdf file with the same name.)

For exam­ple:

\documentclass{article}
\usepackage{graphicx,epstopdf}
\begin{document}
\includegraphics[width=\textwidth]{fig1}
\end{document}

Then even though the only graph­ics file avail­able is fig1.eps, this will still be processed ok using pdfla­tex or pdf­tex­ify. On the first pass, a new file called fig1-eps-coverted-to.pdf is cre­ated and inserted at the appro­pri­ate place. See the doc­u­men­ta­tion for more options and details.

Thanks to Joseph Wright for bring­ing this to my attention.

Dvi is dead. Long live pdf.

  • Share/Bookmark

Tags: ,