Hacker News new | past | comments | ask | show | jobs | submit login
LaTeX Templates (latextemplates.com)
238 points by VelNZ on Feb 22, 2013 | hide | past | favorite | 63 comments



One of the occasional arguments we've had in the LedgerSMB community is whether to ditch LaTeX. The arguments in favor have to do with UTF8 support and internationalization, and the fact that 'everybody knows alternatives!'

In the end we've opted to keep it because LaTeX is so good at doing what it does, and because our dependencies can be hacked to use XeTeX (for UTF-8 input) and so we are working to ensure that XeTeX support gets back upstream instead. Additionally for documentation LaTeX source is quite easy to read compared to the alternatives like DocBook, and LaTeX is also much more expressive.

Sooner or later I expect we will factor out our invoice logic into document classes and packages and try to get that on CTAN. Maybe then it will be worth putting many of our templates on a site like this one (this site even)


pdflatex can handle UTF8 as well:

    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}


We haven't had a lot of luck using that for utf8. Also the character set is relatively limited (can't do Korean characters for example that way).


I use LaTex for a lot of my note taking (for typesetting all equations certainly). When I first started using it, I remember the absolute horror of trying to get it to work with BibTex. The learning curve is relatively steep for non-programmers (I learnt it basically in parallel with learning to code) but it's certainly one of the most valuable tools I've learned and one I continually come back to for a huge range of projects. Certainly in an academic environment it continues to surprise me that everyone isn't taught LaTex in their first year of a PhD.


Quick comment on bibtex: if you use emacs, reftex mode is essential. My current setup is:

* A directory and git repo for each paper (use your own VCS as desired)

* A separate git repo for my global bibtex file and a few heavily used .tex files (i.e. tcilatex.tex for sciword coauthors); this repo is set up as a submodule for all of the individual papers and they refer to their local version of the bibtex file.

* Really short, memorable bibkeys in the bibtex file (I first saw this recommended on I think stack overflow, but can't find a link right now). For a single author, first three characters of the name and last two characters of the year: Engle (1982) becomes Eng82; (by example...) Engle and Granger (1987) becomes EnG87; Sargent, Williams and Zha (2006) becomes SWZ06; etc.

This way I can just type most of the citations I need off the top of my head. The few I can't remember, I'll forget the year and searching by the first author via reftex takes about 5 seconds.

But, more and more for personal and not-for publication notes, I find myself just typing in the unicode and sticking with a plain text file.

edit: I'd love to hear other people's setup too, it took me a while to converge to this one and I'm sure there are better approaches.


I'll describe my setup for writing academic publications in LaTeX.

I use Papers which is available for Windows and OS X. Their software is quite easy to use. Papers can export your library to BibTeX, so I simply export it to the directory of the document I'm writing, include it as usual.

Now the best part, for referencing as I'm writing... Papers comes with this overlay when you press Control+M in OS X. This overlay consists of just a box to type in, you type the title of the paper or author names and it comes up with a search result, select the paper you want and press enter, you can then press enter again to add a LaTeX citation into your document or add more papers to cite multiple papers at once. Since you've exported the library to BibTeX using Papers, the citekey matches. I can't imagine how any solution could be easier than this.


Thanks for sharing that. RefTeX is about that easy: "Ctrl-[" then choose a citation style, then regexp search of the bibtex database with the option to choose multiple papers.

If you update a paper's citation details (say someone's working paper gets published, so you have to add a journal, etc.) how do you make that change across directories? Do you re-export from papers for each one?


Yeah, unfortunately you have to go in and manually export as BibTeX after every change to your reference library. It's not very annoying if you are writing one paper but I can see how that would be annoying if you're writing many at once. I suppose one could point LaTeX towards one master library in one location which you export to...


Probably my biggest "eureka" moment was when I realized that I don't publish enough papers a year for bibtex file management to really be something that I needed to optimize... unfortunately I realized that long after I'd optimized the hell out of my bibtex file management.


Haha, I actually started using Papers because it was the only software that was a reference manager that synched highlights and notes in papers with my iPad. The BibTeX integration was a pleasant surprise!


Some days I feel like my PhD is in LaTeX, with some computer science on the side.


It reminds me of when people were doing PowerPoint in school. People thought spending three hours in PowerPoint meant you actually did something productive, but all that time got you were some decent-looking presentations. You still had to write the actual content itself.

Keynote is great here, because the default settings are pretty great as it is, so you have fewer ways of deluding yourself into thinking you are being productive, when you are actually just procrastinating by rearranging the furniture on the Titanic.


>Certainly in an academic environment it continues to surprise me that everyone isn't taught LaTex in their first year of a PhD.

I work in a academic environment as well, and I give it another 10-20 years until it will be widespread for everything - currently my supervisors want me to write everything in .doc as they don't know LaTeX and don't want to learn (no time, which I can understand).

It's not very widespread in the life sciences, I'm afraid.


I still haven't figured out if the general trend is up/down for LaTeX (I have a vested interest, CTO of SpanDeX.io, but I'm not sure).

My argument against "give it another 10-20 years" is that LaTeX has already been around forever. I know people even in math, physics, and CS that never use LaTeX (in favor of Word). Which I find silly and strange, but it is what it is.

Of course, I'm hoping that new online editors like SpanDeX.io and LaTeXTemplates are the adrenaline shot that LaTeX needs for wider adoption.


If someone makes it to graduate school without knowing LaTeX, I would suspect chances are high they don't really have any interest in changing their routine then. They're busy, and hey, word has been working in university for several years already!

If I wanted to increase LaTeX adoption, I would get undergrads hooked on it. I bailed to LaTeX my second year of undergrad and never looked back. Even with papers for the english department it was great, if only because it just looked that much better than all the Word formatted papers from my peers. The fact that it made bibliographies dead simple was just icing on the cake, it practically felt like cheating. Get undergraduates to understand those "sly" benefits and they'll be willing to take a night off from binge drinking to learn it. At least more willing than a grad student anyway.


My CS department (undergrad) pushed LaTeX heavily. It was required for all senior thesis projects and we had this one Unix guru of a professor who seemed to know every there is to know about LaTeX.

Some of us even became proficient enough to take notes real-time during discrete math and numerical calculus lectures.

> Even with papers for the english department it was great, if only because it just looked that much better than all the Word formatted papers from my peers.

Back in college I used to get compliments on how good my papers looked from humanities professors just because it was typeset in LaTeX. Fun times.


If you dont mind me asking, where did you go to school?


I'm not saryant, but the school of CS at St Andrews (UK) briefly teaches us LaTeX in second(?) year, and encourages us to use it to write all our reports, essays, etc.

(OT: I also got complimented in high school for my physics coursework being typeset nicely. :D None of the other teachers seemed to really notice, though.)


Trinity University, San Antonio.

http://cs.trinity.edu/

(Yes, their website is ancient)


I've used plain TeX for my christmas letters for years because it looks so much better than word. LaTeX feels like overkill if I don't need to number equations and floats.


> Of course, I'm hoping that new online editors like SpanDeX.io and LaTeXTemplates are the adrenaline shot that LaTeX needs for wider adoption.

I am a long-term Latex user and have recently tried one of those online editors. I have two basic gripes with all of them: It's not vim and I don't want to put my papers onto someone else's cloud. Except for that, it seemed nice but the editor itself was a bit sluggish compared to a local program. Continuous compilation is also a good idea, but compared to compilation on my local computer it was just slow enough to drive me insane (wait around for 2-3 seconds every time that I want to see a change...).

But I can imagine that, if they can be made snappy, they would be quite a nice starting point for novice users and people who don't want to maintain a local installation.


> I am a long-term Latex user and have recently tried one of those online editors. I have two basic gripes with all of them: It's not vim and I don't want to put my papers onto someone else's cloud.

Fair enough -- use Lyx. It's free and open source. It doesn't require you to take the security and other risks of a cloud scheme.

http://www.lyx.org/

I don't understand why more people don't use Lyx for Latex production. It's not as slick as some Web-based apps, but it also doesn't have their drawbacks.


> I don't understand why more people don't use Lyx for Latex production.

LyX is still not Vim. Or Emacs, for that matter. That may sound a little closed-minded, but when you basically spend your entire life in one editor (as a programmer) adapting to a different editor is a big pain, and very frustrating, because nothing works the way you expected it.

In my experience emulation of these editors in others is shoddy at best (I'm looking at you, SublimeText.) Not to mention I'm losing my favorite plugins, that I've grown used to. The only acceptable Vim emulation I've seen is Evil — for Emacs. And even there I couldn't stand to use it.


> LyX is still not Vim. Or Emacs, for that matter.

All true. It took a while for me to be productive with Lyx -- it's too different from most other editing environments. In fact, one of the first things they say in their documentation is that Lyx isn't a text editor -- it's really meant for document creation, not everyday editing. So that's an entirely valid criticism.

Nevertheless, after one ascends the difficult learning curve, the results can be beautiful, classic LaTex output, with little effort.


I used LyX for about a year and in that time it tuned from a dream into a nightmare. The problem is that at some point if your typesetting is complex then you need some LaTeX package that LyX doesn't support and have to resort to inline TeX code. The horrid LaTeX code that LyX generates does not play nice and a huge amount of time gets wasted trying to find a LyX-friendly way to express something which would have been a few lines of LaTeX. Don't even get me started on Lyx's Rube Goldberg support for custom document classes.


Your use of Lyx is of longer duration and at a deeper level than mine, so ... thank you for posting.


I don't have a problem about "geeking out" with LaTeX `\' slashes, but frankly, what you mention about LyX is right. Thought you might appreciate this writeup by someone else who also agrees on your LyX viewpoint....

http://yihui.name/en/2012/10/lyx-vs-latex/

Enjoy the read.


When I used LyX (years ago) typing in equations was slow and buggy (slow means anything longer than typing in text). Plus it doesn't/didn't export very clean source code and, for people who have used latex in a text editor even for only 3 or 4 years, the menus and toolbars are completely unnecessary: I know 99.9% of the macros I use and the ones I don't know are esoteric.

    latexmk -pvc 
gives continuous compilation from the command line FWIW.


In my corner of CS (overlap w/ computer-music, game development, and HCI), the trend seems to be down.

One reason is that Word is actually decent for writing papers these days. I still use LaTeX mainly because I prefer to write in vim rather than in a WYSIWYG editor, but the difference in output quality is much smaller than it was 10 years ago. For example, Word does auto-hyphenation now (though it's off by default), which is necessary to make the common 2-column justified conference-paper format look at all decent. The kerning has also improved, and the reference-management story is much better than it used to be (there's a built-in reference manager that works ok, and Zotero integration is very nice). Figure placement still sucks, but it sucks in LaTeX too (in a different way).

Another reason is that when collaborating with people outside academia, they rarely know LaTeX. So I find myself writing my own papers in LaTeX, but collaborative papers in Word. Many people from industry really like Word's "track changes" mode as well.


I think where LaTeX still wins over GUI tools such as Word is once you figure out how to make it do what you want, the method you used is now documented right in the LaTeX source. With a GUI tool, it's hard to go back and remember exactly where you clicked and what setting you changed, especially when you pick up a document months later and ask yourself, "how did I make it look like that?"


You might be interested in pandoc: it allows you to write your documents in LaTeX or Markdown and then it can automatically convert it to docx, odt, html, LaTeX, Markdown, and more. For straigtforward[0] documents this works great.

[0] documents containing text, headings, notes, figures, tables, code listings, mathematics, hyperlinks, lists, references.


Interesting, thanks for pointing out the updated version of what "straightforward" means. Last time I looked at Markdown you couldn't do a lot of things I needed in it, such as figures, footnotes, and references, so I didn't give it very serious consideration. But it looks like pandoc has extended the original Markdown into some kind of Markdown++, which covers just about everything I usually need.


In pandoc you can also use raw mode, which will just pass through all tex commands you use in your markdown file.

    pandoc text.md --parse-raw -t latex -o text.tex
Then you can proceed to compile this to a pdf with pdflatex.


> I still haven't figured out if the general trend is up/down for LaTeX (I have a vested interest, CTO of SpanDeX.io, but I'm not sure).

It seems to go around in cycles. There is a very heavy anti-LaTeX movement that I occasionally run into. There are also a lot of people who use it and would not recommend anything else.

> My argument against "give it another 10-20 years" is that LaTeX has already been around forever. I know people even in math, physics, and CS that never use LaTeX (in favor of Word). Which I find silly and strange, but it is what it is.

This is very true. And what I find more annoying is the argument that we need to move to DocBook because somehow that's more accessible (and yet it isn't either as accessible or as powerful).

There are a few things that hurt LaTeX adoption in some environments though and I want to mention here. These are generally from my experiences participating on various TeXLive-related email lists.

There is an expectation at least in the XeTeX community from what I have seen that everyone will manually upgrade to the latest and greatest quickly. With many of the TeX distribution, there isn't a lot of thought given to long-term support. This makes things like running hosted services for mission critical apps which use LaTeX somewhat problematic.

I ran into the dreaded "we can't start because you are using something 7 years old" message and the only help I could get was "upgrade." Not helpful when trying to package software that people are running on production services. Not helpful at all.

I will follow up with you on email (from my personal account, chris.travers@gmail.com). I think that one of the things that LaTeX really needs to get wider support is a set of community resources for longer-term support, for people who are happy to accept workarounds if it means being able to support earlier versions etc.

I am in the process of trying to get a hosting service up for LedgerSMB and we use LaTeX for a lot of stuff internally (the hosting solution will use XeTeX). I think a rising tide here would help both us and the community out.

> Of course, I'm hoping that new online editors like SpanDeX.io and LaTeXTemplates are the adrenaline shot that LaTeX needs for wider adoption.

I think it may help. It certainly comes along at a good time.


The advice to "upgrade" for LaTeX is pretty disappointing given the heavy, heavy emphasis on long-term compatibility for TeX itself.


After some time using LaTeX I think is a very useful tool and probably online editors will help to the wide use of it.

As I see it now, the variety of editors for Mac, Windows and Linux may cause problems when migrating from one environment to the other. Hopefully this will be over with tools like SpanDeX.

BTW, congrats for your tool, have been using it for few hours and feels awesome.


I learned LaTeX the summer after my undergrad, and rely on it now. Nevertheless, I'm not surprised that few others in my department, outside of my group, use it. When work needs to be shared or collaborated on, the simplest, lowest common denominator (Word or LO) wins out.


Check out pandoc (a markdown variant).


What’s LO?


LibreOffice, I suppose.


Permit me to be coarse for the sake of simplicity and tell you that the only LaTeX template you should spend your time and energy on is tufte-latex: http://news.ycombinator.com/item?id=1572530.

It even has a snazzy guide for setting it up on Stack Exchange: http://tex.stackexchange.com/questions/6483/setting-up-a-lat....

It’s pretty much all you need, and configuring LaTeX can turn into a rabbit hole you will never get out of. Try writing your project in tufte-latex, and I am sure you’ll find that it fits the bill perfectly. I do recall something about having to install an additional package to colour the hyperlinks or something to that extent, though.

I have some old templates—even some boilerplate lying around—so you can drop me a tweet or something, if it isn’t working for you, and I’ll throw something up in a gist.


Your suggestion seems direct and opinionated, even blunt, but I wouldn't call it "coarse". You're more polite and helpful here than a lot of people are.


Always interesting to see some templates for LaTeX -- but if the "selection" made in the CV section is an indication of the overall thought that have gone into the rest of the site, I don't really see that it offer much over searching CTAN[1] and looking at the pdf-examples that are usually included with the useful packages/templates available there ?

As I've recently been looking at writing up a CV with LaTeX, I've seen quite a few rather awful templates -- and the site happens to list both examples of the worst and best I found after a quick search on CTAN...

For others that are interested -- the best resource I've found so far is actually a nice blog series on using the article-class for CV:

http://www.texdev.net/2011/11/05/writing-a-curriculum-vitae-...

Also worth a read (but cover much of the same):

http://texblog.org/2012/04/25/writing-a-cv-in-latex/

[1] http://www.ctan.org/

edit: typo, minor clarification


Just a nitpick: I had to look at the source for "professional table" and was surprised to see the booktabs package used because, to quote their documentation

> You will not go far wrong if you remember two simple guidelines at all times:

> 1. Never, ever use vertical rules.

> 2. Never use double rules.

Violating half the 'nevers'!! But, more seriously, the documentation for some LaTeX packages is breathtakingly good (booktabs, amsmath, beamer, tikz, to name a few off the top of my head) and it would be really helpful if the site pointed newcomers to some of it. Especially in the case I mentioned, where the template is just a demonstration of one package.


I found LaTeXTemplates just a little over a year ago when I was looking for (shockingly) LaTeX templates, and it was /the only/ resource with decent usable templates (in terms of source readability and having actually-pretty templates). I'm the CTO of SpanDeX.io and we jumped on site integration shortly after we launched, because LaTeXTemplates is badass. I see many of you have hit our site after checking out LaTeXTemplates, so I'm glad some of you find the gallery & the integrations useful! Cheers.


Is LaTeX only for academic papers?

I have a client who needs to put a large volume of brochure-ready technical specifications on both the web and rendered as attractive downloadable as PDFs, in a hopefully machine-readable format. Really curious if LaTeX is ever used as a solution in commercial applications where business users are most familiar with word - or is that the wrong application?


I once did this for a client that needed spec sheets with unit-specific test data from a database. LaTeX is great because it is easy to generate programmatically. Making nice PDFs is easy.

Exporting to HTML via htlatex is possible, but may require a lot of fine-tuning. Depending on the content, it may be easier to generate the LaTeX/PDF and HTML separately, or to generate only parts of the HTML using htlatex.

LaTeX special symbols are much easier to use than UTF8. It is easier to type -- and be sure that you have properly entered -- en-dashes, non-breaking spaces, fractions, degree symbols, directional quotation marks, and other non-keyboard characters.


It is certainly not only for academic papers. See [this thread](http://tex.stackexchange.com/questions/40720/latex-in-indust...) for example. But it may not be suitable in the environment you describe, the learning curve could be too steep for "business users [...] familiar with word". It could work however if they only need to edit something you built and are at least capable of editing html.


I find writelatex.com to be immensely useful.


Wow, the Tufte template is an excellent resource .. I am going to print it and put it right alongside the real Tufte's, its that good! :)

This collection is definitely going to make me use LaTeX one of these days. Of course, I've been saying that for decades now.


I wonder though, where was the "real Tufte" typeset?


I keep clicking the orange text below the share buttons, trying to get more info. I think it should be a link, to the same place as the title of the template links to.

I love it and I'm going to use the code template for my next assignment.

You have anything to draw DFAs?


tikz is awesome for this. I believe that DFAs are one of the examples described in the manual.



love the site and 'What is LaTeX' and 'Why' are really informative for a beginner like myself


Is my understanding correct that LaTex can not handle UTF-8?


No, it isn't.

    \usepackage[utf8]{inputenc}


There are a number of ways to handle UTF-8 in LaTeX, but the methods are all somewhat irritating in various ways.

I haven't had a lot of luck with inputenc. My understanding is that it breaks things up into escape sequences internally which is neat but doesn't give you some things that would be nice because your default fonts don't support it.

I have used xetex a bit more and found it more helpful. However it has some other rough corners

Luatex also handles UTF8 natively. Answer is "it's complicated." And hence your solutions depend entirely on what you are trying to do.


Use lualatex


Or XeTeX for that matter, even though I suspect LuaTeX may very well be the future.


If it was up an hour ago, it certainly isn't now.


Just increased the VPS RAM to 1.2Gb, up again now ;) Not used to this kind of traffic...


Seems pretty interesting. Definitely a useful bookmark.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: