40

Regarding LaTeX I understand terms such as class, package, and so on but I don't understand the meaning of template as used by many questioners. Is it what is traditionally called a package or class or is it an example of a complete TeX document where the user edits the textual content, or ...?

7
  • 6
    Regarding what many unexperienced (and lazy ones, as well) users demand they understand by a template the 'working' document where they just change some minor things and everything should be out of the box.
    – user31729
    Commented May 14, 2016 at 18:18
  • 1
    github.com/johannesbottcher/templateConfusion This question even came up in Barbara's column, asking for any help on defining the topic.
    – Johannes_B
    Commented May 14, 2016 at 18:39
  • 3
    Thanks for asking that question, just so we have it around. It seems like a lot of newcomers just want the equivalent of what people use as word processor templates (i.e. a document that contains all of the formatting you may need and dummy content as filler, then you just copy-paste and edit). Clearly, they have never been told about separating form and content and they just want to use TeX because someone told them it was fancy.
    – ienissei
    Commented May 14, 2016 at 19:25
  • 3
    I've added an answer. The language is aimed at anyone who might read it, clearly not directly to you, Peter.
    – Alan Munn
    Commented May 14, 2016 at 19:49

7 Answers 7

48

As one of the resident linguists here, I'd like to add my two cents to this discussion.

First off, language meanings aren't carved in stone (or in dictionaries), but are essentially determined by language use. And although there are some experienced LaTeX users on the site who would like to prescribe a particular meaning to the term, this is fundamentally a losing battle. So we need to look at (i) the people who tend to use the term (new users, mainly) and (ii) the contexts in which they seem to use the term.

It's fairly clear that most new users think of a template as a TeX document which, upon the addition of some content, will produce a document with particular formatting characteristics, a document type, so to speak. Although some users do seem to use it as roughly synonymous to 'document class' (e.g. I'm using the tufte-latex template).

This is partially where the confusion comes about when this term gets used with experienced users. We clearly distinguish between document types from tokens of a particular document type. We implement this by means of a class or a package, of course (see Customizing LaTeX - create a document class or a package? for some discussion on the distinction).

So often times part of the answer to a new user's request for a 'template' will lead to pointing them to a particular document class or package that helps to produce a document of the type they are requesting. But I think users who make such requests expect more than just this. They expect also, a sample document using that class or package so that they can see how a full document would look like. The sample document should have most of the basic elements but not much content.

I maintain a thesis class for my university. In addition to the class itself and the documentation, I also provide a commented 'template' which is a TeX document which uses the class and contains most of the basic elements needed. This gets new users started on using the class quite quickly, and certainly make my life easier in providing support, since it fends off most basic user questions.

So a 'template' for most users is a TeX document (a token) that instantiates a particular type of document.

If we keep this in mind when answering questions, it might be helpful for everyone.

P.S. I don't think that characterizing users who request such documents as 'lazy' is helpful or even accurate.

2
  • 2
    Perhaps worth adding that as other approaches to document preparation (most obviously word processors) lend themselves to a a 'take this document and modify it' approach to providing the 'standard' formatting, there is an obvious reason that 'templates' get promoted generally. (Such approaches also often rely on the document itself to supply/maintain the formatting.)
    – Joseph Wright
    Commented May 14, 2016 at 19:53
  • Excellent answer (I also maintain my org's \documentclass and "stencil" document to get them started) Commented Sep 11, 2017 at 10:19
35

The term isn't used (in that sense) anywhere in latex itself.

It is usually means a small sample document that loads up some particular class and selection of packages and has some dummy text, so people can just start from that and edit rather than read enough documentation to build a new document from scratch.

16

A template is a complete example code for example to write the formalias for the master thesis of a special university. Then there are added special commands to insert author, etc. at the required place, fullfilling the given title page etc. of the special university.

The problem with template is that a lot of them are buggy ...

The template uses classes (for example the class thesis.cls), which defines the layout of the paper and if needed special packages to add special funtions to the paper.

Other example: moderncv.cls is a class, including a template example.tex to create an cv.

10

That very same question has been asked before by Barbara Beeton in TUGboat

That question is impossible to answer though, because the term template is not defined for LaTeX.

Let's take a look from different perspectives.

Why is someone searching for a template?

Almost all users using that term want a base to start with. A mould to pour in content. An example to write a letter, or a thesis, a table with colored rows or something else and customize it to suit the requirements.

I am just working on my template for my bachelor report and have problems with the headers.

Can somebody share a template for this table?

Some users looking for a template are rather searching for a special style.

I like that template because it has colored headers.

Does someone have a nice looking thesis template?


Where can i get a template?

Let's have a look at where templates are available online.

  • There are journal templates, often available at the journal homme page, often based on a special in-house class. The user opens a zip-file and finds a skeleton document along with some other needed files and can input his own text. Since a journal has a fixed layout, the style is fixed. Often so fix that it is merely impossible to alter the style.

  • There are templates for theses or CVs (and other stuff), some on CTAN, some not. They differ in quality. When downloaded from a web site, usually a zip is provided, with a sample document and supporting files. Some of those zip files are simple, merely pure examples of a normal latex file. Others are complex structures of directories, complex classes, a bunch of stuff. Usually, at least a bit of expertise goes into those documents.

  • Overleaf and ShareLaTeX (and others) also provide templates. You can open a template and jhust start writing your journal article or thesis (it is advertised as such on one of the sites). Creating a template is as easy as pushing the Publish as template button, for every document you want. There is an incredible amount of templates around.


Can template usage get messy?

Yes, for sure. It occasionally happens that a user found the template of the International Journal for Wombat Research (IJWR) nice for his homework assignment. Just the headers and footers need to be fixed, and the margins. For a fixed journal layout, this isn't that easy.

Many templates are unmaintained. They often use old or conflicting packages, some templates even cannot be compiled with a current TeX Live1.


Some more thoughts can be found in Template Confusion.


Conclusion

It is hard to put a label on the word template and one has to find out what is meant at every instance. If someone is eager to discuss the template issue to find some solutions or common terms, or even has some ideas, please write a mail to [email protected]. You can also drop into our chat room.


1 An Indian university provides a LaTeX thesis template starting with \documentstyle[epsfig]{article}.

2
8

I've discovered that I'm a Grumpy Old Man (GOM) but I want to thank everyone who has answered and obviously put a lot of thought into it. As a GOM, and considering the other answers I'm now thinking of a Template as being example (La/TeX) code, preferably as a complete example document or as a code snippet for a particular task. I think that my summary word is `Example'. Putting on the GOM hat I feel that, given a Template, questioners should be able, perhaps with a little effort and reading of the documentation, to generate the document that they want.

I've just come across a website http://www.LaTeXTemplates.com which has many LaTeX examples. Perhaps this explains the popularity of `Template'.

5
  • no arguing, plus one.
    – Johannes_B
    Commented May 17, 2016 at 19:30
  • @Johannes_B. Thank you. I'm hoping that this was for my anser but have a strong suspicion that it was admitting I'm a GOM. Commented May 18, 2016 at 19:29
  • Template = Example.
    – Johannes_B
    Commented May 18, 2016 at 19:34
  • I am grumpy, though not old. I don't have a smartphone. Says all i guess.
    – Johannes_B
    Commented May 18, 2016 at 19:35
  • The site you are mentioning in the edit is the reason for my grumpyness and insanity. Most of the examples are just bad examples.
    – Johannes_B
    Commented May 19, 2016 at 4:40
3

A good and common synonym for Template is Form. Templates aid in achieving sameness. Templates do that by setting or constraining visual or physical parameters of some productive process. Which aspects are duplicated by a template will vary by domain. For example, in a text document, the visual parameters of style are set by the template; but in the domain of manufacturing, a template is a physical object that either restricts movement parameters of material acted on by tools or restricts movement of tools acting on material. Across all domaines though, the point is efficient modes of achieving sameness in production.

2

I think this particular usage of the word template comes from Microsoft Word users. In that application, a template is essentially an example document with placeholder text and styling that can be customized to suit one's needs. Word ships with several templates for letters, invoices, agendas, etc.

Templates can be pretty sophisticated with their own styles (in the MS Word sense) and even macros (I think). I think the best analogue of this kind of template in the TeX universe is document class.

1
  • 1
    Documentclass along with an example document, so you have the placeholder text.
    – Johannes_B
    Commented May 20, 2016 at 8:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .