Developer(s) | GNU Project |
---|---|
Stable release | |
Repository | |
Written in | C++ |
Operating system | Linux, Windows, macOS, Unix-like [2] |
Platform | x86, x86-64 |
Type | Word processor |
License | GPL-3.0-or-later [3] |
Website | www |
GNU 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. [4] It is written and maintained by Joris van der Hoeven and a group of developers. [5] 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.
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), [6] Lilac, [7] Grif (1991), [8] and Thot; [9] there was also academic research into interactive editing of complex typographical constructs represented logically. [10] [11]
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". [12]
On another side of the editing and document preparation world, a program for visual interaction with structured texts written in LaTeX is LyX, which does not aim at WYSIWYG editing but at visual representation of the structure (WYSIWYM).
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. [13] 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; [14] 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. [15]
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.
In the TeXmacs editor structure and appearance of the document are represented at the same time; [16] 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. [17] 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. [16] 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. [18]
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. [19]
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
$ xvfb-run texmacs --convert article.tm article.pdf --quit
generates a PDF file "article.pdf" from a TeXmacs document "article.tm".
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
(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. [20] 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.
The typesetting process converts TeXmacs trees into boxes. [21] 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.
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.
TeXmacs macros provide a means of structured input (as in TeX/LaTeX) and they are immediately typeset, at the same time maintaining editable input fields. They are written in source code, although the WYSIWYG editor can aid in their composition through the translation of visual structures into their syntax. [22]
Scheme is embedded in TeXmacs through GNU Guile; the editor itself can be controlled in this way: [21] menus and keybindings can be customized. Scheme commands can be invoked interactively inside TeXmacs documents, can be invoked from the command line and from inside TeXmacs macros. TeXmacs trees can be passed to Scheme in different forms: as "passive trees" (convenient to manipulate content directly using standard Scheme routines on lists), as "active trees" (keep track of the position of the tree inside the global document tree and can be used to programmatically modify documents), and in a "hybrid" representation.
Graphics objects are also part of the TeXmacs format and can be manipulated programmatically from Scheme. An example of TeXmacs graphics generated in a TeXmacs Scheme session is shown below together with the session which generated the image. Images generated programmatically in a Scheme session can also be edited using the internal drawing editor, as they are inserted in the document as a tree; Scheme scripts can also be executed through the extern
TeXmacs macro—in this case only the typeset material is available in the document and no direct editing is possible (the modifications must be made within the Scheme code).
Scheme](definepi(acos-1));; A function to define a point in the TeXmacs graphics format using two coordinatesScheme](define(ptxy)‘(point,(number->stringx),(number->stringy)));; Set pointsScheme](definexC(-(*2(cos(/pi3)))))Scheme](defineyC(*2(sin(/pi3))))Scheme](definepA(pt-20))Scheme](definepB(pt20))Scheme](definepC(ptxCyC))Scheme](definetA(pt-2.3-0.5))Scheme](definetB(pt2.1-0.5))Scheme](definetC(pt(-xC0.2)(+yC0.2)));; Generate graphicsScheme](stree->tree‘(with"gr-geometry"(tuple"geometry""400px""300px""center")(graphics(with"color""blue"(text-at(TeXmacs),(pt-0.55-0.75)))(with"color""black"(arc,pA,pC,pB))(with"color""black"(line,pA,pB))(with"color""red"(cline,pA,pB,pC))(with"color""black"(text-at"A",tA))(with"color""black"(text-at"B",tB))(with"color""black"(text-at"C",tC)))))
TeXmacs has back-ends supporting many technologies.
Plugin output can be embedded within TeXmacs documents using "executable switches"; [23] in this way one can switch back and forth between a given input to the system and the corresponding output, which blends seamlessly in the document.
LaTeX is a software system for typesetting documents. LaTeX markup describes the content and layout of the document, as opposed to the formatted text found in WYSIWYG word processors like Google Docs, LibreOffice Writer and Microsoft Word. The writer uses markup tagging conventions to define the general structure of a document, to stylise text throughout a document, and to add citations and cross-references. A TeX distribution such as TeX Live or MiKTeX is used to produce an output file suitable for printing or digital distribution.
A markuplanguage is a text-encoding system which specifies the structure and formatting of a document and potentially the relationships among its parts. Markup can control the display of a document or enrich its content to facilitate automated processing.
In computer programming, a macro is a rule or pattern that specifies how a certain input should be mapped to a replacement output. Applying a macro to an input is known as macro expansion.
TeX, stylized within the system as TeX, is a typesetting program which was designed and written by computer scientist and Stanford University professor Donald Knuth and first released in 1978. The term now refers to the system of extensions – which includes software programs called TeX engines, sets of TeX macros, and packages which provide extra typesetting functionality – built around the original TeX language. TeX is a popular means of typesetting complex mathematical formulae; it has been noted as one of the most sophisticated digital typographical systems.
A text editor is a type of computer program that edits plain text. An example of such program is "notepad" software. Text editors are provided with operating systems and software development packages, and can be used to change files such as configuration files, documentation files and programming language source code.
troff, short for "typesetter roff", is the major component of a document processing system developed by Bell Labs for the Unix operating system. troff and the related nroff were both developed from the original roff.
In computing, WYSIWYG, an acronym for what you see is what you get, refers to software that allows content to be edited in a form that resembles its appearance when printed or displayed as a finished product, such as a printed document, web page, or slide presentation. WYSIWYG implies a user interface that allows the user to view something very similar to the result while the document is being created. In general, WYSIWYG implies the ability to directly manipulate the layout of a document without having to type or remember names of layout commands.
Desktop publishing (DTP) is the creation of documents using dedicated software on a personal ("desktop") computer. It was first used almost exclusively for print publications, but now it also assists in the creation of various forms of online content. Desktop publishing software can generate page layouts and produce text and image content comparable to the simpler forms of traditional typography and printing. This technology allows individuals, businesses, and other organizations to self-publish a wide variety of content, from menus to magazines to books, without the expense of commercial printing.
LyX is an open source, graphical user interface document processor based on the LaTeX typesetting system. Unlike most word processors, which follow the WYSIWYG paradigm, LyX has a WYSIWYM approach, where what shows up on the screen roughly depicts the semantic structure of the page and is only an approximation of the document produced by TeX.
LilyPond is a computer program and file format for music engraving. One of LilyPond's major goals is to produce scores that are engraved with traditional layout rules, reflecting the era when scores were engraved by hand.
Typesetting is the composition of text for publication, display, or distribution by means of arranging physical type in mechanical systems or glyphs in digital systems representing characters. Stored types are retrieved and ordered according to a language's orthography for visual display. Typesetting requires one or more fonts. One significant effect of typesetting was that authorship of works could be spotted more easily, making it difficult for copiers who have not gained permission.
In computing, What You See Is What You Mean is a paradigm for editing a structured document. It is an adjunct to the better-known WYSIWYG paradigm, which displays the result of a formatted document as it will appear on screen or in print—without showing the descriptive code underneath.
Pretty-printing is the application of any of various stylistic formatting conventions to text files, such as source code, markup, and similar kinds of content. These formatting conventions may entail adhering to an indentation style, using different color and typeface to highlight syntactic elements of source code, or adjusting size, to make the content easier for people to read, and understand. Pretty-printers for source code are sometimes called code formatters or beautifiers.
Texinfo is a typesetting syntax used for generating documentation in both on-line and printed form with a single source file. It is implemented by a computer program released as free software of the same name, created and made available by the GNU Project from the Free Software Foundation.
An XML editor is a markup language editor with added functionality to facilitate the editing of XML. This can be done using a plain text editor, with all the code visible, but XML editors have added facilities like tag completion and menus and buttons for tasks that are common in XML editing, based on data supplied with document type definition (DTD) or the XML tree.
GNU Ubiquitous Intelligent Language for Extensions is the preferred extension language system for the GNU Project and features an implementation of the programming language Scheme. Its first version was released in 1993. In addition to large parts of Scheme standards, Guile Scheme includes modularized extensions for many different programming tasks.
This article provides basic comparisons for notable text editors. More feature details for text editors are available from the Category of text editor features and from the individual products' articles. This article may not be up-to-date or necessarily all-inclusive.
Emacs, originally named EMACS, is a family of text editors that are characterized by their extensibility. The manual for the most widely used variant, GNU Emacs, describes it as "the extensible, customizable, self-documenting, real-time display editor". Development of the first Emacs began in the mid-1970s, and work on GNU Emacs, directly descended from the original, is ongoing; its latest version is 29.4 , released June 2024.
Scientific WorkPlace is a software package for scientific word processing on Microsoft Windows and OS X.
The following is a comparison of TeX editors.
Since TeXmacs is not a LaTeX front-end, it follows that we can only ensure correct conversions for a (quite large) sublanguage of LaTeX.