2

I have been wondering about this questions for a quite some time and now that I am about to write my first research paper in software engineering and I want to be efficient doing it in LaTex and actually spend time on the content and quality of the paper and not waste time on the syntax of LaTeX.

It seems to me from my experience with working with LaTeX and also from talking to other people that LaTeX is not a standard programming language with a base syntax that people can learn and reason about the statement that they are writing LaTeX code. For example, it seems to me that if I have a specific problem such as printing a bibliography in a specific order, creating a table, changing the fonts, or formatting a document, people search online how to do it and the responses are always a pieces of code without an actual explanation of the logic in the code that they wrote. What I usually do and most people I talk to do the same is to simply copy and paste the responses in their documents and it "magically" works. But I wish I could arrive to those answers myself! Unfortunately, I have not found ways or resources to properly learn LaTeX like a programming language in the sense that I could reason about why the responses I get work, instead of just copying and pasting code that other people wrote.

Is this a feeling that other people have? If not, what am I doing wrong and what can I do to avoid wasting time when I write LaTeX documents?

EDIT: The main goal of this question is asking about the thought process and methodology to learn LaTeX and write it code without actually copying and pasting examples from other sources.

  • 3
    Well, this is a question that will provoke opinion based answers. Learning is a process, but glueing answers from here or other sites or documents together does not really provide a quick learning effect, I think (yes, opinion-based ;-)) –  Mar 29 '17 at 19:41
  • Have you looked at this post: http://tex.stackexchange.com/q/11/101651? – CarLaTeX Mar 29 '17 at 19:42
  • The best way is probably to take a look at the documentations of the packages you use. – Bernard Mar 29 '17 at 19:43
  • You should definitely try searching this website for "beginner LaTeX" or "suggested packages", and so on: this site is packed with many question like yours. – Moriambar Mar 29 '17 at 19:46
  • 1
    @Bernard But the documentations in most packages are example driven, instead of a true API that you can reason about the interface that they provide and how you have to organize the statements to obtain what you want. Again, in most cases, I see people going to the documentation, copying, and pasting the examples in there. – Miguel Velez Mar 29 '17 at 19:46
  • 1
    To all people who have commented so far: Do you write your own LaTeX code without copying and pasting responses found elsewhere? And if so, does that mean you have more experience than I do and I just need to read introductory LaTeX books to have more practice with the language? – Miguel Velez Mar 29 '17 at 19:49
  • The documentations show you how to use the commands and environments defined by the packages, which each aims at realising some specific layout. That is of course a slow process, as you have to learn what the packages do exactly. – Bernard Mar 29 '17 at 19:53
  • I think it depends on what 'level' of *TeX you want to engage with. If I were writing 'my first research paper' about a topic in software engineering, I don't think learning the deep innards of natbib.sty or biblatex.sty (e.g.) would be particularly helpful for learning how to output a bibliography. But learning the user-level commands from the documentation would be useful. – jon Mar 29 '17 at 19:54
  • some people learn by copying examples, some people learn by reading the manual, personally I read the tex and latex books before writing a latex document. – David Carlisle Mar 29 '17 at 19:57
  • But some people who work with LaTeX have told me that they just search how to do something and copy the responses they get. On the other hand, when writing a program in another language, they can reason about what they want to achieve and what commands to use to get that. To me, this seems like "programming" in LaTeX is different than programming in other languages such as Java, Python, Ruby, you name it! – Miguel Velez Mar 30 '17 at 01:09
  • 2
    I think this is a genuine question, and the problem is real. I'm sure that in practice, most people do learn LaTeX by copying examples. To add to the problem, many examples do not come with explanations, so people end up with weird mental models and misconceptions about LaTeX (such as for instance, that it is a programming language). Introductory LaTeX books are also written "helpfully", telling the user how to get things done in the ideal case, rather than revealing what is actually happening. When the user's mental model doesn't match the program, the user experience suffers eventually. – ShreevatsaR Mar 30 '17 at 01:28
  • 1
    To put it differently, LaTeX is a leaky abstraction. Because of its excellent set of macros which are very close to the human side of things (expressing what is the author's mind), the user can fall into the illusion that they express things abstractly and LaTeX magically produces “ideal” output, rather than the reality: LaTeX is an impressive edifice of macros with poor error-checking (because of the limitations of the time), written in a language that is not very good, on top of a typesetting system (TeX) fundamentally concerned with the page and where to put down ink and characters on it. – ShreevatsaR Mar 30 '17 at 01:31
  • Of the example “problems” in the question: the solution to “printing a bibliography in a specific order” would probably involve knowledge of the macros (a program) that someone has written for bibliographies, that for “creating a table” has probably more to do with typesetting, “changing the fonts” is a different part of the TeX typesetting engine + ecosystem of related programs, and “formatting a document” may be a question about page design. These are all very different things, though it's impressive that LaTeX is good enough to give the illusion that the user is working with one system. – ShreevatsaR Mar 30 '17 at 01:36
  • The antidote for all this, IMO, is to spend some time and learn TeX. The best book I've found for this, which is at the same time a gentle introduction and reveals what's going on in enough detail to make you practically an expert, is Seroul & Levy's A Beginner's Book of TeX. Then, having learned TeX, and having the confidence that you'll more or less be able to reproduce any printed page you see (though not always with elegant input), you can better appreciate LaTeX for what it is. And know enough about TeX macros to understand examples (but it's taste whether you enjoy or avoid them). – ShreevatsaR Mar 30 '17 at 02:27
  • @ShreevatsaR gave a really nice explanation to what I was asking. I really liked your comments! – Miguel Velez Mar 30 '17 at 13:55

0 Answers0