Slashdot Mirror


Electronic Publishing Using Free Software?

Arkaein asks: "I am planning on electronically self publishing a book that I want to write, typeset, and create diagrams for on my Linux PC. Most of the diagrams for the book will be generated through scripted custom software, and I want the final product to be as compact as possible. I would like some advice from Slashdot on what Free Software tools I should use, with an emphasis on scripting efficiency. I am planning on using hyperlinked PDF for the final book format. To date I have used LateX for writing basic papers and have created vector images using Xfig and raster images edited using The GIMP. I used dvipdfm to convert my results into PDF. What I haven't done is create a hyperlinked PDF document, or generated xfig, postscript or any other vector image format through software, or worked on any document project of this magnitude before. I have thought about using raster images, my current software used for web content similar to what will go into the book creates raster images which I convert to PNG, this works well because the images are fairly simple diagrams with few colors and compress very well. I estimate that the 200 or so images I need for my book would require about 10K each as high-res PNGs for a total of 2 MB. This sounds acceptable, but would probably be smaller with higher image quality in vector format. Are LaTeX, Xfig and dvipdfm the answers, or do I need to look in other directions?"

11 of 41 comments (clear)

  1. dvipdfm by Satai · · Score: 2, Informative

    dvipdfm is quite capable of generating most everything you could want in PDF; it can do hyperlinks and thumbnails and so on.

    the xfig format has several different vector-based software designers -- as in, there are several programs on CTAN that'll convert specially formatted commands into xfig format.

    my personal opinion is that you have everything you need with those three tools.

  2. PDFLaTeX by tfinniga · · Score: 5, Informative

    Look mom, I even got the funky capitalization right!

    I know a guy who had a good experience using PDFLaTeX with pretty much the same method you are using. I think he did some of his figures as eps and others as png. PDFLaTeX allowed for the hyperlinks that the LaTeX -> ps -> pdf method won't get you. I found a pretty good summary here. Might be good if you're already familiar with LaTeX.

    --
    Powered by Web3.5 RC 2
    1. Re:PDFLaTeX by bcrowell · · Score: 4, Informative
      I've used pdflatex for some open-source physics textbooks (1 2 3). I get the impression that the tex->dvi->pdf route is more of a historical artifact, and in most cases it's just simpler and more efficient to do tex->pdf directly using pdflatex. If you use certain features that are specific to the latex implementation as opposed to pdftex, then you can't do pdftex, but that shouldn't be an issue for a new project like yours.

      ...does it use nice fonts (can't remember at the moment which are Type 1 and which are Type 3)?
      Pdftex automatically generates output that looks good in Acrobat Reader, whereas the tex->dvi->pdf method by default generates those horrible-looking bitmaps.

      Can it easily handle both raster images (probably in PNG) and more importantly vector image formats (of which I've currently only used postscript/eps)?
      Yes. It handles PNG just fine, but since you're concerned about size, you might want to convert those to JPG. For vector graphics, you just need to convert your EPS files to PDF, using the epstopdf script that comes with the latex distribution. Those PDFs then get embedded in the big PDF by pdftex.

      I can't remember if the specific problem was using embedded EPS images, which I see from the pdflatex website that pdflatex cannot handle
      Not an issue. Just convert to PDF.

      About your tight space requirements again: you may find by experiment that some pictures give a smaller PDF if you convert your line art to JPG, while others are more compact if you leave them as vector graphics.

      Pdftex doesn't play nicely with old versions of Acrobar Reader, so make sure to warn your readers to use AR 5.0 or later. (It generates PDFs that meet Adobe's spec for earlier versions of AR, but there are bugs in the earlier versions that cause them to garble certain things.) Don't know if this applies to the tex->dvi->pdf method.

  3. lyx, graphviz, sodipodi? by BigBadaboom · · Score: 4, Informative

    Around here even the experienced latex-ers use Lyx for editing their tex documents.
    Xfig sounds a scary and rather masochistic way to go... how about Graphviz for flow charts and other similar graphics, and Sodipodi for your vector graphics?

  4. pdfLaTeX and the Memoir class by zrail · · Score: 4, Informative

    I would use pdfLaTeX to produce pdf directly from LaTeX source. It can generate hyperlinks automatically when it creates the table of contents and the index. Also, I would use the Memoir class to provide layout macros. This offers much more flexibility in layout than the generic LaTeX classes, and the first part of the manual is a great reference for typesetting in general.

    They're both in CTAN, which I assume you know about since you already use LaTeX.

    1. Re:pdfLaTeX and the Memoir class by jhealy1024 · · Score: 2, Informative

      I heartily second the use of pdfLaTeX!

      I have written a book (well, a 100-page thesis, but it's essentially a book). I wrote it entirely in LaTeX, using EPS figures generated from Adobe Illustrator and my own custom software. Later versions of the doc, however, are all pure PDF, using pdflatex, Illustrator-generated PDFs, and my own PDFs. (If you're really bored, you can download my thesis at: http://www.logn.net/penrose/download/PenroseEmpire sThesis.pdf.)

      Since you're starting from scratch, and you're looking to produce a PDF file, I'd suggest using pdfLaTeX (which is often included with newer distributions of latex). Try typing `pdflatex` at the command line to see if you have it.

      pdflatex works almost exactly like latex, but it uses PDF as its native file format. That means that it produces PDF files natively, and can import PDF files as graphics seamlessly. Note that other solutions work well also (such as the other post's suggestion of dvipdfm), but if you're starting from scratch (or close enough), pdflatex is seamless to produce hyperlinked PDF documents with a minimum of fuss. With packages like hyperref, pdflatex will autogenerate links to figures, chapters, sections, and so on, as well as custom links defined in the source code.

      Most good programs can produce PDF natively (such as dia); otherwise ghostscript (using the ps2pdf tool) can convert postscript to PDF, and almost anything can produce postscript.

      If you're producing your own figures, the PDF format isn't too hard. Someone above suggested that your software produce postscript directly. That works fine, but you should know that PDF is basically just like postscript, except that it includes a little header info and can be compressed (it has other tricks too, but for simple graphics, that's all you need to know). I wrote a quick PDF output library for my software -- it wasn't too hard. Plus, you might be able to find a library that will do it for you now (I wrote my stuff a few years ago). If you can, go native with PDF, as that way you won't have to convert to PDF from anything.

      The output is highly professional, works on almost any platform, prints beautifully, and costs nothing to you to produce. If you are halfway good at LaTeX, it's what I would recommend.

    2. Re:pdfLaTeX and the Memoir class by bcrowell · · Score: 2, Informative

      Since you're starting from scratch, and you're looking to produce a PDF file, I'd suggest using pdfLaTeX (which is often included with newer distributions of latex). Try typing `pdflatex` at the command line to see if you have it.
      Make sure it's a recent version. Many latex distributions include ridiculously old, nonfunctional versions of pdflatex. Check pdflatex --version, and make sure it's at least 1.1-ish.

  5. LyX by GigsVT · · Score: 2, Informative

    LyX is a nice frontend to LaTeX. There are several packages for LaTeX hyperlinked PDFs, like Prosper and hyperref. You should be able to do pretty well with a combination of those.

    The LaTeX that LyX creates is neat and readable, so it shouldn't be a problem to hand tweak it if you need to.

    --
    I've had enough abrasive sigs. Kittens are cute and fuzzy.
  6. DocBook is great, but the toolchain is piss-poor by Nice2Cats · · Score: 4, Informative
    DocBook is seriously neat -- if you can get somebody else to do the job of getting it to the end format. Avoid this job at all costs, as it will drive you completely up the wall.

    The problem is that the people behind DocBook don't seem to want to have anything to do with the tool chain that takes the source file and turns it into something you can actually publish. This means that putting all the programs together to get DocBook XML to, say, PDF and then getting it looking the way you want can be a royal pain in the ass even if your distributor has included and configured the important stuff for you.

    Then, there are two types of DocBook - XML and SGML, so at any given time, you are bound to be looking at the wrong documentation for the wrong tool when trying to get to your target format. DocBook SGML is less of a problem, if you have a choice, use it. Getting from DocBook XML to anything but HTML/XHTML seems to still be rather non-trivial.

    Again, if you don't have to deal with any of that (for example, if you are submitting stuff to the Linux Documentation Project) it is pretty neat. If the DocBook people had gone whole hog and provided a comprehensive tool set along with the standard, it would rock big time.

    As it is, I'd think twice before recommending it to somebody who just wants to get ink on paper.

  7. Some advice... by ianezz · · Score: 5, Informative
    From my (little) experience:
    • Save yourself the burden of typing LaTeX directly, and get a good front-end like LyX. Btw, it can also import existing (not-too-convoluted) LaTeX, just in case you already started writing. TeXmacs could be another option if your book is on a mathematical subject.
    • For vectorial diagrams and images, get Sketch and Dia and forget everything else (except perhaps Xfig, which comes handy sometimes). Sketch does a decent job at importing simple PostScript by itself (so you can retouch it), and of course it exports PS and EPS. For importing complex PostScript you may also use it together with pstoedit, which supports the Sketch format natively.
    • For graphs and trees have a look at Graphviz, which can generate beautiful outputs (both EPS or bitmapped) from simple textual descriptions of nodes and arcs (and it saves you
  8. ConTeXt tex macros by ehetzner · · Score: 2, Informative

    I highly recommend examining the ConTeXt macro package for TeX. It is perhaps more difficult to use than LaTeX, but it is much easier to get it to look like what you want. Also, it is very much pdfTeX aware, and part of the purpose seems to be the creating of screen documents, hyperlinked pdfs, etc. Take a look here