TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am about to write a couple of books using LaTeX. I am fairly used to producing small LaTeX articles using Sweave and R, but I have never written a book using LaTeX and I am not conversant with the LaTeX practices standard for writing books.

Also, though I have a few ideas about how to structure such a big document, not having written a book in LaTeX myself, I don't know what works and what doesn't in the long run.

The books I am writing are:

  • A book with a lot of charts and code (in R), and a few tables. I'll be using Sweave with this.
  • A book with a lot of text and a few images. I'll be quoting passages and quite a few poems. An entire section/chapter could consist of poetry.

Here are my questions (answers with examples/references will be appreciated):

  1. What techniques/best-practices should I follow in writing the books using LaTeX? What are the packages that are typically helpful?
  2. What are the packages in LaTeX that I could/should use for typesetting poetry?
  3. Sweave is nice enough for including R code, but I would like something that looks more professional. I have seen and used listings, and though I still don't have a set of options which looks fancy enough, I am guessing listings will do with enough tweaking. Am I missing out on anything? Should I be using listings with any other package? Do you have nice listings templates to share?
  4. Any nice templates for writing books? Or helpful online resources specific to writing books with LaTeX?
share|improve this question

closed as too broad by Jubobs, Peter Jansson, Martin Schröder, Svend Tveskæg, cmhughes Mar 1 '14 at 20:19

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

Welcome to TeX.sx! This site works best if you ask one question at the time. – N.N. Apr 4 '12 at 20:26
IMHO two great resources to begin with: A Few Notes on Book Design and The Memoir Class for Configurable Typesetting, both from memoir's author Peter Wilson (manual maintained by Lars Madsen). :) – Paulo Cereda Apr 5 '12 at 1:07
Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – Jubobs Mar 1 '14 at 18:58
up vote 7 down vote accepted

For a general introduction to book design using LaTeX, do check out A Few Notes on Book Design by Peter Wilson. Obviously, there's no single "correct" answer as to how a book ought to be designed. If you have considerable freedom in selecting a design (as seems to be implied by your question), you could start by simply taking a close look at the layouts of some books -- whether they're in the same field as the book you intend to publish or not -- and decide what parts of the overall design of these books you like (or dislike). Among the criteria should be

  • size of page and of textblock within each page?
  • are there (wide) margins containing supplemental notes, callouts, etc.?
  • use of running headers?
  • layout of sectioning headers (chapters, sections, subsections, etc)
  • font and font sizes?
  • use of color (including "bold" (i.e., more black than normal text font))?
  • use of boxes and other visually appealing techniques?
  • quality of paper (shiny, matte, feel to touch)
  • if the book will be available in electronic format: use of hyper-linking of materials

And so on... Have fun!

share|improve this answer

Since you mentioned R, I would recommend you to use the knitr package instead of Sweave. You can go to the package website to know more about it: http://yihui.name/knitr It is much more flexible and customizable than Sweave. For example, you only need to call render_listings() in order to switch to the listings package (e.g. http://yihui.name/knitr/demo/listings/). Recently I also started thinking on writing a book: https://github.com/yihui/knitr-book The basic sketch is there, and I'm writing with markdown instead of LaTeX since the former is much easier to write; I can convert markdown files to LaTeX later with pandoc if I want. I have finished the knitr book using knitr and LyX.

share|improve this answer
Hey, I have started using knitr. Thanks for a job well done. – Soumendra Apr 8 '13 at 19:37
@Soumendra good -- now I have finished a book based on knitr :) – Yihui Apr 8 '13 at 23:18
Almost an year down the line, I have made a complete switch to knitr, and I don't know how I could ever live without it. – Soumendra Mar 5 '14 at 12:56

I apologize in advance for this being not much of an answer--but as N.N. mentioned in his comment, you'll get much better responses if you ask each of your questions separately.

  1. and 4. I'm also a beginner at LaTeX, but I've been using the memoir class to write a book, and it's been incredibly helpful. It has built-in support for chapter headings, page headers and footers, indices, etc.

  2. You might find this article helpful.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.