LaTeX
April 23, 2007 10:09 AM   Subscribe

Help me with lists in LaTeX! And I'd like some general advice about whether LaTeX and LyX are worth the hassle.

I'm using LyX on Windows XP. I want to make a list that looks something like this:

A.1) a) i) Text here.
ii) Text here.
iii) Text here.
b) Some text here.

B.3) Some text here.

B.6) Some text here.

Is this possible in LyX? If not, how easy is it to do in LaTeX itself?

More importantly: I get the impression that the answer to this question might not be trivial. I may need to do this kind of non-standard formatting quite often. Given that, is it worth sticking with LaTeX? I know I could hack together a list that looked OK in Word without so much hassle, so I'm wondering if LaTeX/LyX etc are worth the effort.

I'm writing a number of essays and short answers per week (a few of which contain equations and tables of statistics), and later in the year will start my undergraduate dissertation in the social sciences. I'm pretty competent with software in general, but my aim is to find a word-processing setup which lets me get on with writing, rather than one which has maximum geek-points.
posted by Aloysius Bear to Computers & Internet (22 answers total) 3 users marked this as a favorite
 
Response by poster: AskMe thieved my &nbsp's! I wanted the parts and sub-parts of question A.1) to be nicely aligned.
posted by Aloysius Bear at 10:11 AM on April 23, 2007


Best answer: LaTeX for Novices: Ordered and unordered lists, with custom descriptions.
posted by Blazecock Pileon at 10:24 AM on April 23, 2007 [1 favorite]


LaTeX is seriously worth the effort, especially in academia. Take the time to format it right the first time---and that might be a bit more effort than a one-off in Word---and it'll pay off for every single essay you write. In Word, the formatting you did last time is of no use tomorrow. In LaTeX, you put the right commands in a template and you're set.

More than once, I've gone straight to the deadline on an essay, sat up all night churning the content, woken up, ran latex once, bibtex, latex, printed out perfectly-formatted and cross-referenced copy and ran with it to submit. I can trust implicity that there will not be bad breaks, or widows and orphans, that foonotes will be in the right place and it'll all look great. LaTeX takes away *all* the thinking about presentation, which is as it should be. Write, compile, print. Done.
posted by bonaldi at 10:32 AM on April 23, 2007


Don't underestimate the value of repeatability that a solution built on LyX/TeX/LaTeX infrastructure gives.
posted by mmascolino at 11:14 AM on April 23, 2007


Response by poster: Blazecock Pileon, that looks great.

By editing the LyX code manually, I've got the list structure sorted (more or less). The LyX interface doesn't seem to allow nesting lists in description lists: it changes the whole description item to an ordered list item if I try to enter an enumerated list.

Next question...
How, in LyX, can I have a description item with multiple paragraphs? For the description item "B.3", I want to write a few paragraphs. Whenever I hit return, LyX adds a new description item. I'm sure there's a way to fix in the raw LyX code, but that kind of defeats the point of using LyX as a graphical editor in the first place.
posted by Aloysius Bear at 11:43 AM on April 23, 2007


In Word, the formatting you did last time is of no use tomorrow.

Well that's just silly. Word has styles and templates. Most people choose to ignore them, but that's because people just want their text bold dammit.
posted by smackfu at 11:45 AM on April 23, 2007 [1 favorite]


The answers to my question here might be generally helpful, though I would guess you've probably already seen them.

Now that I've been using LaTeX for a little while, I would highly recommend it for the reasons bonaldi mentioned. The key to making this a really good solution for you would be to create commands to make your life easier. I've found The Not So Short Introduction to LaTeX [PDF] very valuable.

Also, keep in mind that several people answering my question suggested that LyX will play nicely with LaTeX class files, so if you wanted to create one and then do your writing in LyX, that might work nicely. (Or, it could fail miserably.)
posted by JMOZ at 11:54 AM on April 23, 2007


LaTeX is definitely nice, particularly if you're going to be doing the same sort of formatting each time, so you can set up a template-ish document and just fill in the content every time.

I use it for lab reports, memos, and drafts for publication, and whenever I create a new document type, I "Save As" the file without any content in it (after I've gotten the sections and other stuff squared away) so I can use it again later. Saves me lots of time.

And once you've used LaTeX for a while, anything MS Word produces just looks like crap. Seriously, I don't know why they can't make it typeset decently, but it doesn't.

That said, LaTeX isn't a very good outliner, if you're taking minutes and just want something that lets you type and does all the formatting automagically. If you find yourself doing a lot of outlining, it might be worth your while to get a good program dedicated to that, particularly one that exports to some format that you can then convert to Latex. A lot of programs have XML or XHTML export now, which might be there.

On the Mac there are a lot of very rabid fans of OmniOutliner, but I admit I really haven't used it that much, and I don't know what the workflows from there to Latex would be like. I'm sure there are similar products for the PC (unless Word killed them all) but that might be better asked in a separate question.
posted by Kadin2048 at 11:55 AM on April 23, 2007


Best answer: I don't know a damn thing about LyX, but in straight LaTeX you would normally use nested enumerate environments to get a result like the one you want; the code would look something like this:
\begin{enumerate}
\item
\begin{enumerate}
\item
\begin{enumerate}
\item
\begin{enumerate}
\item Text here.
\item Text here.
\item Text here.
\end{enumerate}
\item Some text here.
\end{enumerate}
\end{enumerate}
\item
\begin{enumerate}
\item Some text here.
\item Some text here.
\end{enumerate}
There are a few things that you'd have to tweak to get the output exactly as you have it above, though.
  1. The enumerate environment normally has the item labels (nested from top to bottom) as 1., (a), i., and A. You would need to flip them around to get the style you want. To do this, you would redefine the \labelenum commands in the preamble, for example: \renewcommand{\labelenumi}{\Alph{enumi}.} would give you the right top-level label. If you also want the first *and* second-level numbers to be printed on every second-level item as you have in your example, you would use something like \renewcommand{\labelenumii}{\Alph{enumi}.\arabic{enumii})}
  2. If you actually want to skip numbers between items (i.e., start at 3, then jump to 6), you would need to recent the enum counters before each item. So before the item on the second level you wanted to be item 6, you would issue the command \setcounter{enumii}{5} and then proceed as normal with the item.
  3. You have the first bunch of nested labels all on one line, i.e. A. 1) a) i). This is not something I know how to do in LaTeX; as far as I can tell, LaTeX always inserts a line between successive nested levels. (It does get the indentation right, though, so you don't need to worry about that.) Perhaps there's a LaTeX guru out there that knows how to do this better than I; I would guess that this would, at a minimum, need a custom list environment.

posted by Johnny Assay at 11:59 AM on April 23, 2007 [2 favorites]


I'm currently using Latex to write my PhD thesis (with WinEdt, not LyX). When I'm not feeling too good about the contents, I draw some comfort from the fact that it at least looks great. I have to say that if you don't absolutely love the way Latex output looks and you're not doing a lot of math then it may not necessarily be the best choice in your case. My supervisor is one of the most productive people I've ever met and he doesn't bother with it.

I'll also say that as a new user I was quite disappointed with Latex's table handling. And the collaborative features in Word are really useful if you know how to use them well, and even if you don't, it's a lot easier to throw Word documents around via email. Don't get me wrong, I still love Latex but it does have its downside.
posted by teleskiving at 12:09 PM on April 23, 2007


Well that's just silly. Word has styles and templates. Most people choose to ignore them, but that's because people just want their text bold dammit.

Yes, you can set up generic templates, but I think it's the divorce between content and presentation that makes them really work in LaTeX. EG, I can write a whole thing in plain text, then LaTeX it and the typesetting will be done beautifully. If I had to transplant it into Word, I'd then have to go over manually and apply styles, format the tables and so on. LaTeX does all that for me.

And having plain text allows you to use the whole unix chain, from Perl to diff, to work on your text, instead of hoping what you want is in a Word menu somewhere.
posted by bonaldi at 12:12 PM on April 23, 2007


Best answer: I know a bit about LyX, having written my master's thesis in it. I definitely recommend it unless you plan on cutting and pasting in a lot of tables or pictures, as I think Office apps are better for that.

However, lists are easy in LyX. You don't have to use custom \enumerate tags (or whatever they're called) because lists are built into Lyx.

Here's how:
Choose "Enumerate" from the select menu at the upper left (at least, that's where it is on my machine). Assuming you are just in the standard layout, it currently says "Standard". Change it to Enumerate.

You now have a list. If you want to create a sub-item in the list, when you are in Enumerate mode, click the button that looks like an arrow pointing to the right (there probably is a shortcut/menu option, but I can't remember it right now). If you want to keep at that level of indentation, hit Alt(Option)-enter at the end of each line instead of just enter. Otherwise, the next line will lose its indentation.

As it stands, my version of Enumeration uses the following labels:
1.
(a)
i.
A.

If you want to change this, I believe you do this by changing the LaTeX preamble. Searching google for LyX and Enumerate will show you where to go on from there.

Incidentally, unless you absolutely MUST create a new Paragraph with a capital p, one sneaky thing to do in order to mimic a new paragraph without leaving the description area is to hit shift-enter, which creates a line break but not a new paragraph. Thus, the text stays in whatever element you're editing at the moment.
posted by Deathalicious at 2:12 PM on April 23, 2007


Deathalicious's answer is probably better, because she or he is more familiar with Lyx, but in LaTeX I would just use a forced linebreak, like this: \\
To start a new "paragraph" inside any of the list environments.

I highly recommend the package "booktabs" btw -- it makes much prettier tables, much more fluidly, than with plain LaTeX.
posted by janell at 2:49 PM on April 23, 2007


LaTeX is worth the initial effort if you can amortize it over lots of documents (as in, you're going to be writing more than one scientific paper or something similar where LaTeX shines).

Actually, it's worth it if you prefer logical layout (begin abstract ... end abstract) vs WYSIWIG. I found LaTeX much easier for merging texts - pulling in two technical reports and making them chapters. LaTeX makes this sort of thing transparently simple.

That said, I'm not in academia anymore, and the only time I use LaTeX is when I'm updating the resume I created while in academia.
posted by zippy at 2:59 PM on April 23, 2007


A vote for No, LaTeX is not worth the hassle. It does have great value for sneering down your nose at non-users -- but us non-users look pityingly at users and think "Life's too short..." Put the extra time into the content, not the presentation.

I guess a more sophisticated way to choose would be to think what documents you will be producing in the future. If you will be repetitively formatting very similar documents within a LaTeX/LyX-using community then it may be a sensible choice. If you will produce carefully-formatted documents rarely, or will produce a variety of documents for different purposes or you don't have easy access to an expert, then I suggest you stick with a WYSIWYG word-processor --- with Word winning on the ease of getting help when you have to do something tricky.
posted by Idcoytco at 4:58 PM on April 23, 2007


Put the extra time into the content, not the presentation.

But this is exactly where LaTeX shines. You spend your time structuring and writing your document, not fussing with font selections.

LaTeX is also hugely more reliable than Word. LaTeX won't ever eat your equations or reformat your paper for no apparent reason or suddenly make your footnotes un-editable or unrecoverably crash any of the other weirdnesses that Word has actually done to me in real life. As long as your OS doesn't munge your .tex file, you're okay. It was crap like this that finally drove me away from Word for most purposes.
posted by ROU_Xenophobe at 5:22 PM on April 23, 2007


You spend your time structuring and writing your document, not fussing with font selections.

OTOH, this question was (originally) about just such fussing with formatting issues.
posted by smackfu at 7:41 PM on April 23, 2007


It does have great value for sneering down your nose at non-users -- but us non-users look pityingly at users and think "Life's too short..."

Life's too short for me to do math in handwriting that I can't read, and thus have to rework every time I go back to it.

Anyway, to answer the "is it worth it" question - try a document or two. You'll either love it immediately or hate it just as fast.
posted by spaceman_spiff at 7:45 PM on April 23, 2007


Also, for you LaTeX haters in the thread -- you should know that LyX is designed so the experience is nearly like using Word or some other word processor. You can open it up and start typing away and use the various drop downs/buttons to add bold, italic, headings, etc. It really isn't difficult at all. And if you're adding citations to your paper, the built in BiBTex module makes it really, really easy.

I would definitely recommend against writing up LaTeX in a text editor since that requires a lot of wrangling, but using LyX is really, really easy.
posted by Deathalicious at 1:26 AM on April 24, 2007


And, and under no circumstances should people print stuff out in the default Computer Modern font. The version of LyX I have can do a lot of fonts, including Palatino. Only use Computer Modern if you're using LyX exclusively to rub LaTeX in other people's faces.
posted by Deathalicious at 1:28 AM on April 24, 2007


I find LyX to be the fastest and most reliable solution of all the options mentioned on this page. Their mailing list is a good resource for questions like this one.
posted by lunchbox at 5:12 PM on April 25, 2007


Response by poster: The Lyx wiki mentions a hack to get "1." and "a)" onto the same line.
posted by Aloysius Bear at 5:37 PM on May 3, 2007


« Older VOIP for n00bs   |   Touchscreen applications? Newer »
This thread is closed to new comments.