ArticleslgStudy

computer science

GNU TeXmacs

GNU TeXmacs is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand GNU TeXmacs rather than just read about it. In short: GNU TeXmacs, sometimes typeset as TeXmacs, is a scientific word processor and typesetting component of the GNU Project. It originated as a variant of GNU Emacs with TeX functionalities, though it shares no code with those programs, while using TeX fonts.

GNU TeXmacs — main illustration
GNU TeXmacs — illustration

Key takeaways

  • GNU TeXmacs belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect GNU TeXmacs to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of GNU TeXmacs from memory before moving on to harder problems.

Reference excerpt

GNU TeXmacs, sometimes typeset as TeXmacs, is a scientific word processor and typesetting component of the GNU Project. It originated as a variant of GNU Emacs with TeX functionalities, though it shares no code with those programs, while using TeX fonts. It is written and maintained by Joris van der Hoeven and a group of developers. The program produces structured documents with a WYSIWYG user interface. New document styles can be created by the user. The editor provides high-quality typesetting algorithms and TeX and other fonts for publishing professional looking documents.

Background As a structured WYSIWYG editor and document preparation system, TeXmacs is similar to earlier structured document editors, such as Interleaf (first release 1985), Framemaker (1986), SoftQuad Author/Editor (1988), Lilac, Grif (1991), and Thot; there was also academic research into interactive editing of complex typographical constructs represented logically. In the 2000s and 2010s, interest on interactive editing of structured text encouraged the development of programs intended for scholars in the humanities; an example of this is CWRC-Writer, a visual XML editor with "Close-to-WYSIWYG editing and enrichment of scholarly texts with meaningful visual representations of markup".

Features

Like in many WYSIWYG editors (such as Microsoft Word), authors manipulate a document on screen which should print to a similar-looking paper copy. The goal of TeXmacs is to provide a WYSIWYG editor that nevertheless makes it possible to write correctly structured documents with aesthetically pleasing typesetting results. Despite its name, TeXmacs is not a front-end to TeX or LaTeX. However, TeXmacs documents can be converted to either TeX or LaTeX. LaTeX also can be imported (to some extent), and both import from and export to HTML, Scheme, Verbatim, and XML is provided; the HTML export is stylable with CSS (since version 1.99.14). There is a converter for MathML as well, and TeXmacs can output PDF and PostScript for printing. TeXmacs can handle mathematical formulas, tables, images, cross-references and citations. It can be used as a front-end to a number of computer algebra systems such as Maxima, FriCAS and SageMath, and can in turn integrate some of their output into its typesetting. TeXmacs also supports a Scheme extension language called Guile for customizing the program and writing extensions. It also features a presentation mode and a small technical drawing editor and there are plans to evolve towards a complete scientific office suite with spreadsheet capabilities. An implementation of spreadsheets is present starting from version 1.99.12; spreadsheets in TeXmacs can take advantage of plugins (for example Python or Maxima) to compute cell values. TeXmacs currently runs on most Unix-based architectures including Linux, FreeBSD, Cygwin, Haiku and macOS. Along with the Cygwin version, a native port is available for Microsoft Windows.

The TeXmacs editor In the TeXmacs editor structure and appearance of the document are represented at the same time; the structure is made evident to the user by surrounding logical units of the document in nested focus frames carrying color cues that are displayed according to the movement of the cursor. A detailed description of the structure in the proximity of the cursor is provided in the footer of the editor window, finely selectable with left-right arrow presses. In the editor it is possible to switch between text mode and source mode editing, and support for the composition of macros is present; the source editor is syntax-aware.

Mathematical typography TeXmacs facilitates the inputting of mathematical formulas by mapping sequences of keyboard presses to symbols. For example, the symbol ⇒ can be input by typing =>. Some symbols have no such representation (⇑ for instance). These can be input with Tab ↹ key (e.g. for ⇑ the key presses are =>Tab ↹Tab ↹ . This keyboard-based entry differs from other formulae editors, that tend to provide point-and-click menus for this task.

Batch processing It is possible to use TeXmacs as a batch processor (which is LaTeX's usual operation mode), using X virtual framebuffer to avoid opening unwanted windows while processing. For example, the command

generates a PDF file "article.pdf" from a TeXmacs document "article.tm".

The TeXmacs format All TeXmacs documents or document fragments can be thought of as trees (the concept of tree exists as well in the SGML markup language, to which the Texmacs format is similar). For instance, the tree

represents the formula

x+y+12+y+z (written here with the TeX markup used by Wikipedia) and is turned by TeXmacs' own typesetting engine into a typeset formula, here inserted as an image:

TeXmacs trees are represented in TeXmacs files as strings, and in the TeXmacs editor as the typeset representation of the document together with its interactive behaviour. In the on-screen representation of the TeXmacs tree, the cursor movement represents the movement inside the tree. On disk, three representations of the TeXmacs format exist: a native representation, an XML representation and a representation with Scheme S-expressions; the Scheme representation is useful for the interfacing with Scheme programs.

Typesetting and document control The typesetting process converts TeXmacs trees into boxes. Evaluation of TeXmacs trees proceeds by reduction of the primitives, that is by evaluation of macro applications. The typesetting primitives are designed to be very fast and are built-in into the editor; the rendering of many of the primitives can be customized through the built-in environment variables; the stylesheet language allows users to write new primitives as macros on top of the built-in primitives. TeXmacs uses a global algorithm for "line-breaking" (similar to the TeX one) and in addition uses a global algorithm for "page-breaking"; the page-breaking algorithm takes into account floating objects (figures, table, footnotes) and multi-column content.

Document control Documents can be controlled through a native macro system and through Guile-Scheme. It is possible to customize the editor's menus and keybindings and to act programmatically on the document tree.

… excerpt ends here. Continue reading the full article.

Illustrations

GNU TeXmacs illustration
GNU TeXmacs illustration
GNU TeXmacs: A screenshot showing mathematical formulas and italic font. A cyan focus frame surrounds the innermost environment (a formula environment) the cursor is in, while the subtle gray box surrounds another active tag (the theorem environment).
A screenshot showing mathematical formulas and italic font. A cyan focus frame surrounds the innermost environment (a formula environment) the cursor is in, while the subtle gray box surrounds another active tag (the theorem environment).
GNU TeXmacs illustration
GNU TeXmacs illustration

Worked examples

Example 1 — a first encounter with GNU TeXmacs

Start with the simplest possible case. Write down what GNU TeXmacs claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to GNU TeXmacs before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about GNU TeXmacs ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of GNU TeXmacs

In research
GNU TeXmacs appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses GNU TeXmacs in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
GNU TeXmacs is common in secondary-school and first-year university syllabi. It links to neighbouring topics Cross-platform free software, Emacs, Free TeX editors, so understanding it makes those chapters shorter.
In everyday life
Look for GNU TeXmacs outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “GNU TeXmacs” →

How to study GNU TeXmacs in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what GNU TeXmacs means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain GNU TeXmacs out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is GNU TeXmacs in simple terms?

GNU TeXmacs, sometimes typeset as TeXmacs, is a scientific word processor and typesetting component of the GNU Project. It originated as a variant of GNU Emacs with TeX functionalities, though it shares no code with those programs, while using TeX fonts.

Why does GNU TeXmacs matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study GNU TeXmacs?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on GNU TeXmacs.

Tags

  • Cross-platform free software
  • Emacs
  • Free TeX editors
  • Free typesetting software
  • Free word processors
  • GNU Project software
  • Linux word processors
  • MacOS word processors
  • TeX editors
  • Windows word processors

Keep exploring