News for hackers. Stuff that matters.
Re:What is LaTeX and Why You Should Care by sophacles on Tuesday August 03, 2010 @11:53AM (#1571588)
How appropriate, I just finished a paper today and submitted it for review. LaTeX is awesome and sucky at the same time. On the awesome side, you have structure separate from formatting. This comes with lots of benefits as mentioned in the article. It also allows you to use the concept of imports (or includes if you will), so you can have a well factored paper. It also allows you to do sane things like footnote, cite and reference diagrams and sources without a need for explicit number tracking -- just give everything a unique identifier that works for you. Finally if you do well enough with your structuring you can output not just different file formats like pdf or ps or whatnot, you can also output completely different styles. It is pretty simple to wrap your core with the trappings of IEEE style for one version and a book-like style for another.

On the sucky side, the toolchain is notoriously difficult and cryptic. For some reason you have to make multiple passes of various tools by hand (or with a makefile -- i reccommend http://code.google.com/p/latex-makefile/ it just works). The syntax can be a bit inconsistent. The worst is the errors tho, sometimes it is impossible to figure out why all your figures are showing up at the end of the document instead of in-place, or why all your references are failing to point at anything.

Overall tho, it is a fantastic system :)

Re:What is LaTeX and Why You Should Care by drunkpotato on Tuesday August 03, 2010 @12:57PM (#1571822)
I've started using org-mode to write my papers, then convert to LaTeX. Not perfect, but I find it's more natural to write in org-mode and helps me focus on the content instead of drifting off onto the internet to research macros. (Now I can drift off to read HN instead, a vast improvement in non-productivity.)

I've started thinking of TeX as the assembly language of document formatting, LaTeX as C, and org-mode as... pick your favorite higher-level language here, I'll go with Python.

Not a perfect metaphor, but in terms of paper productivity it feels that way.

Re:What is LaTeX and Why You Should Care by rbonvall on Tuesday August 03, 2010 @03:08PM (#1572303)

  > I've started thinking of TeX as the assembly language of document formatting
I remember having read a Knuth interview saying exactly that's what he intended TeX to be. He was also surprised that everyone settled for LaTeX instead of creating their own TeX dialect designed specifically for their own needs.
Re:What is LaTeX and Why You Should Care by surki on Tuesday August 03, 2010 @02:33PM (#1572162)

  > Not perfect, but I find it's more natural to write in org-mode 
Do you have any specifics on the problems you faced? I produced my master thesis entirely using orgmode without any problem. (defined custom latex class, with different kind of ToC etc, not that difficult)
Re:What is LaTeX and Why You Should Care by drunkpotato on Tuesday August 03, 2010 @02:47PM (#1572216)
I suppose it depends on what you mean by "problems". I don't think org-mode is coming up short in some fashion.

Org-mode is great for structural editing and tables, and simplifies some aspects of LaTeX (images, for sure). I still find myself "dropping down" into LaTeX. I don't think it's an inherent weakness in org-mode, it's just that now I keep track of org-mode and LaTeX commands.

Re:What is LaTeX and Why You Should Care by bigfudge on Tuesday August 03, 2010 @06:26PM (#1572982)
I've not tried org-mode, but I've started using Markdown with pandoc (http://johnmacfarlane.net/pandoc/) to do much the same thing. Markdown makes actually writing much quicker and more readable, but you can still insert raw LaTeX where you want to do something extra (e.g. \cite).

Additionally, Markdown is far less threatening to technophobe collaborators. I've successfully written grant applications with clinicians using Markdown in an etherpad document (free hosted version at http://piratepad.net/), which I later converted to LaTeX/pdf for submission. They would never have put up with writing lists or headings in straight LaTeX.

EDIT:I should have stated that pandoc is a nice tool for conversion between a bunch of formats including Markdown, Latex, Html, s5, reST, RTF, epub and a few others. In response to the comments below about conversion to word always sucking, pandoc provides the least sucky attempt I've found so far.

Re:What is LaTeX and Why You Should Care by strlen on Tuesday August 03, 2010 @05:31PM (#1572825)
I tried using LaTeX with org-mode as well, but I've found that writing a paper / permanent document in LaTeX feels more natural than doing so in org-mode (org-mode being more suited to taking notes).

I did use LaTeX to take notes all through college and it has certainly helped ingrain it well into my muscle memory.

Re:What is LaTeX and Why You Should Care by scott_s on Tuesday August 03, 2010 @05:08PM (#1572762)
Could you post a sample source in org-mode, the Latex it produced, and then the final pdf? I've tried going through documentation to get a feel for it, but everything I've found focuses on features in isolation, and are not focused on using it to write full papers.
Re:What is LaTeX and Why You Should Care by ciniglio on Sunday August 08, 2010 @05:08AM (#1585096)
Not my work, but something I found after having my curiosity piqued by this thread: http://www.mail-archive.com/[email protected]/msg04582.h... . And here's the blog post that led me to it: http://www.mfasold.net/blog/2009/02/using-emacs-org-mode-to-... .
Re:What is LaTeX and Why You Should Care by tome on Tuesday August 03, 2010 @01:16PM (#1571892)
Can you automatically convert from org-mode to LaTeX?
Re:What is LaTeX and Why You Should Care by drunkpotato on Tuesday August 03, 2010 @01:27PM (#1571935)
M-x org-export or C-c C-e brings up a menu of options for export, including HTML, LaTeX, and Docbook. The org-mode manual has good information:

http://orgmode.org/manual/LaTeX_002fPDF-export-commands.html

Re:What is LaTeX and Why You Should Care by peterb on Tuesday August 03, 2010 @01:27PM (#1571930)
Re:What is LaTeX and Why You Should Care by sophacles on Tuesday August 03, 2010 @01:16PM (#1571889)
This is interesting. How do you do your conversion?
Re:What is LaTeX and Why You Should Care by johngunderman on Tuesday August 03, 2010 @04:30PM (#1572642)
M-x org-export-as-latex
Re:What is LaTeX and Why You Should Care by petrilli on Tuesday August 03, 2010 @12:04PM (#1571630)
You probably know, but the reason there are multiple passes is because once a page is typeset, you can't go back and "fix" it. TeX is very page-centric. So references, for example, aren't "knowable" until you've typeset all the pages. Then the next pass goes through and updates the forward references.

It could be done another way, but in the era that TeX was developed, it would have required more memory than was realistically available most of the time. I find that once I've run it twice, I can get away with single runs usually after that until I'm ready for the "definitive" version. Until then, I'm less concerned with whether the cross-reference is right, than whether there is a cross-reference in that location at all.

Re:What is LaTeX and Why You Should Care by shasta on Tuesday August 03, 2010 @02:09PM (#1572076)
You know, gcc uses multiple passes, too, internally. If gcc were to use latex's model, you'd have to run it multiple times to get a working executable. Mind you, it would produce an executable every time, but those first ones would just crash. Latex can produce some nice looking documents, but as a technology, it's shoe strings and bubble gum.
Re:What is LaTeX and Why You Should Care by mturmon on Tuesday August 03, 2010 @06:39PM (#1573014)
The only problem is that the cross-references may be out of sync. This is usually not a serious barrier to readability.

Another gcc analogy is a dependence on a third-party library whose API keeps changing. Then you'd have to run gcc once to regenerate the library, and once on the client using the library.

Peeling that back a level, the analogy is between files like libfoo.a and foo_defs.h (for gcc) and files like section1.aux and document.bbl (for latex).

Re:What is LaTeX and Why You Should Care by aeroevan on Tuesday August 03, 2010 @09:37PM (#1573400)
LaTeX will warn you when the references are out of sync, and there is no reason why it can't make a second (or third) pass internally without having to call (pdf)latex manually again and throwing .aux .log .other_random_stuff files everywhere.
Re:What is LaTeX and Why You Should Care by parfe on Wednesday August 04, 2010 @09:26AM (#1574420)
So whip up a shell script and call it "better_latex" mark it +x and call the real exe multiple times. Now it's an improved version that does it internally, just like gcc
Re:What is LaTeX and Why You Should Care by neilc on Wednesday August 04, 2010 @01:18AM (#1573718)
I just use LaTeX-Mk or a similar package, which takes care of multiple runs of LaTeX fairly well.

http://latex-mk.sourceforge.net/

Re:What is LaTeX and Why You Should Care by rbonvall on Tuesday August 03, 2010 @03:02PM (#1572275)
After using (and writting) several ugly Makefiles for compiling LaTeX, I discovered rubber (http://www.pps.jussieu.fr/~beffara/soft/rubber/) and never looked back. It is packaged at least in the standard Ubuntu and Fedora repos.

I use the following Makefile wrapper around it:

    DOC = memoria

    all:
            rubber --pdf $(DOC)
    clean:
            rubber --pdf --clean $(DOC)

    .PHONY: all clean
It handles biblography, knows how many times recompile and discovers dependencies.
Re:What is LaTeX and Why You Should Care by scott_s on Tuesday August 03, 2010 @01:42PM (#1571974)
I took a look at the Makefile, and I'm not entirely comfortable using it while not knowing exactly what it's doing. I normally don't require to know and have control over everything, but with Latex, the less unknowns I have, the better I feel.

This is what I've been using, inherited from a colleague/committee member/friend:

  PAPER = paper_name
  SECTIONS = $(PAPER) abstract introduction design results conclusions

  default: $(PAPER).pdf

  $(PAPER).bbl: $(PAPER).bib
          pdflatex $(PAPER).tex
          bibtex $(PAPER)

  $(PAPER).pdf: $(PAPER).bbl $(foreach SECTION,$(SECTIONS),$(SECTION).tex)
          pdflatex $(PAPER).tex
          pdflatex $(PAPER).tex
          pdflatex $(PAPER).tex

  clean:
          -rm -f *~
          -rm -f $(PAPER).aux $(PAPER).log $(PAPER).out $(PAPER).bbl $(PAPER).blg
          -rm -f $(PAPER).idx $(PAPER).ilg $(PAPER).ind $(PAPER).dvi $(PAPER).toc
          -rm -f $(PAPER).pdf
Re:What is LaTeX and Why You Should Care by joegaudet on Tuesday August 03, 2010 @01:56PM (#1572028)
For a remedy to the "sucky side" if you have a mac + TextMate, it all _just works_. You do everything you would normally do, and then hit cmd + R which will run the typesetter.

My buddy during my undergrad used LaTeX, at the time the thought of debugging my documents seemed insane (though he could do some amazing ninja stuff like rebuilding his graphs in matlab and importing them on build). Since starting my masters, I've taken it up, and yes it is awesome.

Re:What is LaTeX and Why You Should Care by necubi on Wednesday August 04, 2010 @12:26AM (#1573644)
Even better, use LaTeX watching (ctrl-cmd-w) with a pdf viewer that supports pdf sync (like Skim) and the output updates every time you save.
Re:What is LaTeX and Why You Should Care by d_c on Tuesday August 03, 2010 @02:45PM (#1572205)
The latex mode in TextMate is really awesome :)
Re:What is LaTeX and Why You Should Care by tome on Tuesday August 03, 2010 @12:55PM (#1571813)
You can do "imports", and you can also factor anything that's repeated into macros. The problem is that the lack of namespaces and weird scoping rules are so antiquated that it's painful to use when I know many programming languages that do the job far better.

On the other hand, it does support currying of macros!

Re:What is LaTeX and Why You Should Care by scottdw on Tuesday August 03, 2010 @02:25PM (#1572136)
For those using a windows environment I find TeXworks (http://www.tug.org/texworks/) is an easily installable TeX environment.
Re:What is LaTeX and Why You Should Care by Lewisham on Tuesday August 03, 2010 @01:31PM (#1571943)
I use rake-latex for my workflow, which is also pretty awesome: http://devel.softeng.ox.ac.uk/trac/softeng/wiki/Utilities/Ra...

My main TeX annoyance is tables, but I don't think anyone has come up with a decent way of expressing them in a textual manner.