15

I read that LaTeX is all about "typesetting". What does that mean? What is typesetting?

I read some FAQs, they showed the code, not the output.

Following are my needs and I am not sure whether LaTeX is what I need, or I am looking in the wrong direction.

  • I don't write books, but I study a topic from different online sources and then plug in what is important in a text file.
  • I need to create an index (like we have in books). I should be able to click on that index link to be taken to that chapter. It should be easy to edit the indexes, and well as insert new chapters in between the previous ones.
  • I am a programmer, therefore I need to write properly indented code in a text file (which doesn't support automatic indenting). The code and the explanation has to be in the same file.
  • Sometimes, I need to create some flowcharts/UML too. I have tools for doing the same, but I want that those images be pasted in my text file.

Is LaTeX perfect for these needs?

topskip
  • 37,020
  • 2
    All of this should be possible. More importantly, what is your intended result, a website, a PDF, a report for university/your employer? – Psirus Feb 08 '12 at 06:33
  • 3
    Well, LaTeX can certainly work with your requirements. Things like the index and linking are simple to manage and automatic with makeindex and hyperref. You should never need to edit the actual index itself once set up. There are a number of packages for handling code, such as listings which can do what you need too. UML was addressed in this question. – qubyte Feb 08 '12 at 06:35
  • @Psirus My output should be a Pdf. :) – Aquarius_Girl Feb 08 '12 at 06:35
  • @MarkS.Everitt Thanks, that was helpful. Can I "paste" uml images instead of drawing them? – Aquarius_Girl Feb 08 '12 at 06:37
  • @AnishaKaul: I'm afraid that I'm not sure. I've never used UML diagrams myself. There will probably be a suitable solution though. – qubyte Feb 08 '12 at 06:39
  • @MarkS.Everitt It is not particularly about UML, can I paste "any" kind of images? – Aquarius_Girl Feb 08 '12 at 06:41
  • @AnishaKaul: You can include any sort of image - up to some limitations depending on the exact setting of your document. One side remark, in order to keep this site consistent, please consider one question at a time. The comments, in general are not suppose to serve as a discussion platform. Feel free to look around the site's previous questions, and if you don't find the one you're after -> post a new (separated) question. – Dror Feb 08 '12 at 07:05
  • @Dror Alright, will take care next time. – Aquarius_Girl Feb 08 '12 at 07:08
  • 1
    @AnishaKaul: A brief answer to your question is that pdflatex (which you will most likely use) allows JPG, PNG and PDF images. You don't cut and paste, rather you include them. http://en.wikibooks.org/wiki/LaTeX/Importing_Graphics – qubyte Feb 08 '12 at 07:19
  • @MarkS.Everitt Very helpful again, thanks. If you combine all those comments of yours and write an answer, I'll upvote you, and I would have selected your answer if you would have done this before. – Aquarius_Girl Feb 08 '12 at 07:27
  • @AnishaKaul: Thanks. I would keep adn's answer as the accepted one though, since his answer is more complete and includes a link to the showcase. – qubyte Feb 08 '12 at 07:38
  • @MarkS.Everitt Yes of course, he gave the detailed answer before you, so I won't take away the points from him. ;) – Aquarius_Girl Feb 08 '12 at 07:46
  • 2
    http://nitens.org/taraborelli/latex could be interesting for you. It contains some examples (only the output, not the code) why typesetting with LaTeX could be preferred. – jofel Feb 08 '12 at 08:51

2 Answers2

12

As wikipedia defines it:

Typesetting is the composition of text by means of types.

That is, the creation of text by arranging glyphs or symbols in a proper way. Thus, what TeX does is to facilitate the settings for the format and the typesetting (how to put the text in your document, maybe you need two columns or one, maybe you need certain margins, and you can write your text once and change the format easily). And LaTeX facilitates the writing and the typesetting by providing a set of macros to use. (See more details on the difference between LaTeX and TeX and what are they.)

I think that (La)TeX and friends are really good for any type of document that you want to write, given that you want to put enough effort to reach certain level that allows you to write it as easily as other type of software. Consequently, the use of (La)TeX allows you to reuse part or all your text, and diagrams easily. There is a huge community and examples out there that can help you get wherever you want to go. Moreover, there are many packages that will help you do fancy things. (See this showcase of some possibilities.)

For example, for the code that you want to use, you can highlighted and re use it using the listings package, for your graphics you can use TikZ or PSTricks. Also, you can include and place the figures any way you want, for an idea of what you can do see this.

adn
  • 11,233
  • 2
    Most of the time those FAQs are for showing how to use it, assuming that you already want to use it. But, if you want to see the capabilities I suggest you to see this site. It is not by any means complete, but shows different examples that may help you imagine all the potential (La)TeX has to offer. – adn Feb 08 '12 at 06:58
  • @AnishaKaul: In many cases you can simply compile the codes provided in FAQs. Or, if it is not a minimal working example (MWE), you can put it into a minimal document and compile. – Dror Feb 08 '12 at 07:09
  • @Dror Thanks for the info, but actually before doing anything I just wanted to know whether I was looking in the right direction or not. – Aquarius_Girl Feb 08 '12 at 07:11
8

Well, LaTeX can certainly work with your requirements. Things like the index and linking are simple to manage and automatic with makeindex and hyperref. You should never need to edit the actual index itself once set up. There are a number of packages for handling code, such as listings which can do what you need too.

For UML diagrams, there was a discussion in this question. If you have a simple image of a UML diagram to place in your document, then pdflatex, which you will likely use, supports PNG, JPG, and PDF. Rather than cut and paste, images are included.

David Carlisle
  • 757,742
qubyte
  • 17,299