Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I wish to turn several of my blog article series into a PDF e-book but I have never used LaTeX before for creating books.

For example, I want to take my Awk One-Liners Explained article series, improve it and turn it into a book.

I'll probably start with this guide that I found - http://www.math.mun.ca/~edgar/thesis.html But that is just a small template. Any other tips, tricks and suggestions for doing it?

share|improve this question
    
@Peteris Krumins for general tips about typography look at are-there-any-good-general-typesetting-books-references –  pmav99 Apr 28 '11 at 10:31
    
@Peteris: Welcome to tex.sx! It's not necessary to sign your questions (as there is already a box with your username below it) or to begin them with a greeting. –  doncherry Apr 28 '11 at 10:31
    
possible duplicate tex.stackexchange.com/questions/644/… –  pmav99 Apr 28 '11 at 10:31
    
Are you going to rewrite your articles afresh or do you want to convert from whatever-format to LaTeX first? –  Andrew Stacey Apr 28 '11 at 11:09
    
Thanks for the comments everyone. –  Peteris Krumins Apr 28 '11 at 11:14
show 4 more comments

3 Answers

up vote 11 down vote accepted

I think that you should try using either scrbook or the memoir document class. They are designed for this kind of work. IMHO Memoir has better documentation so you'll propably find it easier to configure it the way you want it.

There is also memdesign, which used to be part of the documentation of memoir.

share|improve this answer
    
Thanks, I'll try memoir first! –  Peteris Krumins Apr 28 '11 at 11:15
    
Of course (as you hinted with “IMHO”) “better documentation” is highly subjective. I find the KOMA-Sript book to be a very good documentation. –  cgnieder Dec 21 '12 at 14:06
    
@cgnieder I said that I think that memoir has better documentation. I didn't claim that KOMA-Script's was bad. Also it has been a year and a half since the post. Perhaps things have changed since then. –  pmav99 Dec 22 '12 at 21:45
    
@pmav99 I did get that. I tried to say that I disagree. But then I am German and until only a few months ago the English documentation to KOMA-Script was bad if existent at all, unlike the German one which has been published as a book, so ... –  cgnieder Dec 22 '12 at 21:52
add comment

If you don't have TeX habbits yet, I'd recommend using Koma-Script's scrbook right away instead of the book class.

Also, you might want to have syntax highliting for your examples. I'd recommended using minted for that, as it is quite flexible and powerful.

share|improve this answer
    
@Raphnik + 1 for minted. An alternative is texments –  pmav99 Apr 28 '11 at 10:18
    
@pmav99: Ah nice, I didn't know there was another Pygments package. –  ℝaphink Apr 28 '11 at 10:20
2  
listings is a native LaTeX package for code listings and syntax highlighting. It does not require Python or shell escaping. –  ipavlic Apr 28 '11 at 10:25
    
That is true, but texments is much easier to configure. –  pmav99 Apr 28 '11 at 10:29
    
and flexible... I've had to make syntax highlighting for non-standard languages, and writing Python modules for that is very easy. –  ℝaphink Apr 28 '11 at 10:33
add comment

From the comments,

Andrew, I am going to copy/paste the text into Latex file, I think. And then re-format it so it actually looked good. – Peteris Krumins

It would be absolutely heretical and the greatest of programming sins for a blog that focuses on programming to cut and paste content from a CMS into a LaTeX text file!

TeX is more than just a typesetting system. It's a full-fledged programming language and Turing complete. Although it might arguably at first glance appear insane to have a Turing complete programming language for a task like typesetting it makes sense the more you explore the needs of a typesetting system.

No other software implemented in the 1970s remains absolutely and unquestionably dominant in its domain other than TeX and the collection of macros known as LaTeX, which was developed in the eighties. The typesetting algorithms developed by Knuth and the glue-and-boxes model of text layout was a piece of absolute genius. One of the most masterful examples of capturing an extremely complex problem using an extremely simple model. It's beautiful and you are now using it in a somewhat different and handicapped way to display content within a browser. This is the part of TeX that is amazingly, gloriously, magnificently brilliant.

Welcome to our community, pick up a bit of skills in TeX/LaTeX programming and use whatever language you are comfortable with to pick up the content from your database and automatically generate the LaTeX content. For a person with your computer skills it shouldn't take more than two weekends.

Here is some code for inspiration:

\documentclass{article}
\long\def\aPieceOfCode{%
  This is a Piece of code that I need to type out in a number of ways.
  First pick the contents from the CMS and store it in macro. Then call them through your typesetter macros and hey it can even display maths \formula\ without the use of JavaScript!
}
\def\formula{$a=b^2+23 $}
\def\displayMyCode#1{#1}

\begin{document}
\displayMyCode{\aPieceOfCode}
\end{document}
share|improve this answer
    
Ahh... but extracting the code out of some arbitrary markup and into your \def, now that is a tricky problem. Also, not a problem TeX is particularly good at solving---despite being turing complete. TeX is an amazing piece of work, but it has a very narrow focus. –  Sharpie Apr 29 '11 at 0:58
    
@Sharpie Depends. If you have been storing html code in the CMS then it is hard, but if you have been storing it as for example wiki markup then it is easier. –  Yiannis Lazarides Apr 29 '11 at 4:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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