Qortora · Search · Indexed page

en.wikipedia.orgFetched 2026-08-15T06:35:23Z

TeX - Wikipedia

TeX - Wikipedia Jump to content Main menu Main menu move to sidebar hide Navigation Main page Contents Current events Random article About Wikipedia Contact us Contribute Help Learn to edit Community portal Recent changes Upload file Special pages Search Search Appearance Donate …

Open original source · Full cached text

TeX - Wikipedia Jump to content Main menu Main menu move to sidebar hide Navigation Main page Contents Current events Random article About Wikipedia Contact us Contribute Help Learn to edit Community portal Recent changes Upload file Special pages Search Search Appearance Donate Create account Log in Personal tools Donate Create account Log in Contents move to sidebar hide (Top) 1 History Toggle History subsection 1.1 Version Numbering 2 Pronunciation and spelling 3 Syntax 4 Design Toggle Design subsection 4.1 Mathematical spacing 4.2 Hyphenation and justification 4.3 Metafont 4.4 Macro language 5 Operation 6 Uses Toggle Uses subsection 6.1 Chemistry notation 6.2 XML publication 7 Development 8 Distributions and extensions 9 License 10 Community 11 Editors 12 Extensions 13 See also 14 Notes 15 References 16 External links Toggle the table of contents TeX 47 languages العربية Беларуская Български বাংলা Bosanski Català کوردی Čeština Dansk Deutsch Esperanto Español Eesti Euskara فارسی Suomi Français Gaeilge Galego Magyar Հայերեն Bahasa Indonesia Italiano 日本語 한국어 Lietuvių മലയാളം Nederlands Norsk bokmål Occitan Polski Português Română Русский Srpskohrvatski / српскохрватски Slovenčina Slovenščina Српски / srpski Svenska தமிழ் ไทย Українська اردو Vèneto Tiếng Việt 粵語 中文 Edit links Article Talk English Read Edit View history Tools Tools move to sidebar hide Actions Read Edit View history General What links here Related changes Upload file Permanent link Page information Cite this page Get shortened URL Switch to legacy parser Print/export Download as PDF Printable version In other projects Abstract Wikipedia Wikimedia Commons Wikibooks Wikidata item Appearance move to sidebar hide From Wikipedia, the free encyclopedia Typesetting system For other uses, see Tex (disambiguation). This article's lead section may be too short to adequately summarize the key points. Please consider expanding the lead to provide an accessible overview of all important aspects of the article. (July 2025) (Learn how and when to remove this message) {{cite web|url=https://ctan.org/tex-archive/systems/knuth/dist/tex |title=CTAN |access-date=December 23, 2025}}</ref>"},"latest_release_date":{"wt":"{{start date and age|df=yes|2021|2|5}}"},"latest preview version":{"wt":""},"latest preview date":{"wt":"<!-- {{Start date and age|df=yes|YYYY|MM|DD}} -->"},"operating_system":{"wt":"[[Cross-platform]]"},"genre":{"wt":"[[Typesetting]]"},"programming_language":{"wt":"[[WEB]]/[[Pascal (programming language)|Pascal]]"},"license":{"wt":"[[Permissive free software license|Permissive free software]]"},"website":{"wt":"{{URL|https://tug.org/}}"}},"i":0}}]}'>TeX Developer Donald Knuth Release 1978; 48 years ago (1978) Stable release 3.141592653[1] / 5 February 2021; 5 years ago (2021-02-05) Written in WEB/Pascal Operating system Cross-platform Type Typesetting License Permissive free software Website tug.org Repository svn.tug.org:8369/texlive/ TeX Filename extension .tex Internet media type application/x-tex Initial release 1978; 48 years ago (1978) Type of format Document file format TeX (/tɛx/), stylized as TeX, is a free and open source software typesetting program that was designed and written by computer scientist and Stanford University professor Donald Knuth[2] 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.[3] TeX is widely used in academia, especially in mathematics, computer science, economics, political science, engineering, linguistics, physics, statistics, and quantitative psychology. It has long since displaced Unix troff (the previously favored formatting system) in most Unix installations (although troff still remains as the default formatter of the UNIX documentation). It is also used for many other typesetting tasks, especially as the basis for LaTeX, ConTeXt, and other macro packages. TeX was designed with two main goals in mind: to allow anybody to produce high-quality books with minimal effort, and to provide a system that would give exactly the same results on all computers, at any point in time (together with the Metafont language for font description and the Computer Modern family of typefaces).[4] TeX is free software, which made it accessible to a wide range of users. History [edit] When the first paper volume of Knuth's The Art of Computer Programming was published in 1968,[5] it was typeset using hot metal typesetting on a Monotype machine. This method, dating back to the 19th century, produced a "classic style" appreciated by Knuth.[6] When the second edition was published, in 1976, the whole book had to be typeset again because the Monotype technology had been largely replaced by phototypesetting, and the original fonts were no longer available. When Knuth received the galley proofs of the new book on 30 March 1977, he found them inferior. Disappointed, Knuth set out to design his own typesetting system. Knuth saw for the first time the output of a high-quality digital typesetting system, and became interested in digital typography. On 13 May 1977, he wrote a memo to himself describing the basic features of TeX.[7] He planned to finish it on his sabbatical in 1978 (though ultimately the language's syntax was not frozen until 1989[citation needed]). Guy Steele happened to be at Stanford during the summer of 1978, when Knuth was developing his first version of TeX. When Steele returned to the Massachusetts Institute of Technology that autumn, he rewrote TeX's input/output (I/O) to run under the Incompatible Timesharing System (ITS) operating system. The first version of TeX, called TeX78, was written in the SAIL programming language to run on a PDP-10 under Stanford's WAITS operating system.[8] For later versions of TeX, Knuth invented the concept of literate programming, a way of producing compilable source code and cross-linked documentation typeset in TeX from the same original file. The language used is called WEB and produces programs in DEC PDP-10 Pascal. TeX82, a new version of TeX rewritten from scratch, was published in 1982. Among other changes, the original hyphenation algorithm was replaced by a new algorithm written by Frank Liang. TeX82 also uses fixed-point arithmetic instead of floating-point, to ensure reproducibility of the results across different computer hardware,[9] and includes a real, Turing-complete programming language, following intense lobbying by Guy Steele.[10] In 1989, Donald Knuth released new versions of TeX and Metafont.[11] Despite his desire to keep the program stable, Knuth realized that 128 different characters for the text input were not enough to accommodate foreign languages; the main change in version 3.0 of TeX is thus the ability to work with 8-bit inputs, allowing 256 different characters in the text input. TeX3.0 was released on March 15, 1990.[12] Version Numbering [edit] Since version 3, TeX has used an idiosyncratic version numbering system, where updates have been indicated by adding an extra digit at the end of the decimal, so that the version number asymptotically approaches π. This is a reflection of the fact that TeX is now very stable, and only minor updates are anticipated. The current version of TeX is 3.141592653; it was last updated in 2021.[13] The design was frozen after version 3.0, and no new feature or fundamental change will be added, so all newer versions will contain only bug fixes.[14] Even though Donald Knuth himself has suggested a few areas in which TeX could have been improved, he indicated that he firmly believes that having an unchanged system that will produce the same output now and in the future is more important than introducing new features. For this reason, he has stated that the "absolutely final change (to be made after my death)" will be to change the version number to π, at which point all remaining "bugs" will become "features".[15] Likewise, versions of Metafont after 2.0 asymptotically approach e (currently at 2.7182818), and a similar change will be applied after Knuth's death.[14] Pronunciation and spelling [edit] The name TeX is intended by its developer to be pronounced /tɛx/, with the final consonant of loch.[16] The letters of the name are meant to represent the capital Greek letters tau, epsilon, and chi, as TeX is an abbreviation of τέχνη (ΤΕΧΝΗ technē), Greek for both "art" and "craft", which is also the root word of technical. English speakers often pronounce it /tɛk/, like the first syllable of technical. Knuth instructs that it be typeset with the "E" below the baseline and reduced spacing between the letters. This is done, as Knuth mentions in his TeXbook, to distinguish TeX from other system names such as TEX, the Text EXecutive processor (developed by Honeywell Information Systems).[17] Syntax [edit] TeX commands commonly start with a backslash and are grouped with curly braces. Almost all of TeX's syntactic properties can be changed on the fly, which makes TeX input hard to parse by anything but TeX itself. TeX is a macro- and token-based language: many commands, including most user-defined ones, are expanded on the fly until only unexpandable tokens remain, which are then executed. Expansion itself is practically free from side effects. Tail recursion of macros takes no memory, and if-then-else constructs are available. This makes TeX a Turing-complete language even at the expansion level.[18] The system can be divided into four levels: in the first, characters are read from the input file and assigned a category code (sometimes called "catcode", for short). Combinations of a backslash (actually, any character of category zero) followed by letters (characters of category 11) or a single other character are replaced by a control-sequence token. In this sense, this stage is like lexical analysis, although it does not form numbers from digits. In the next stage, expandable control sequences (such as conditionals or defined macros) are replaced by their replacement text. The input for the third stage is then a stream of characters (including the ones with special meaning) and unexpandable control sequences (typically assignments and visual commands). Here, the characters get assembled into a paragraph, and TeX's paragraph breaking algorithm works by optimizing breakpoints over the whole paragraph. The fourth stage breaks the vertical list of lines and other material into pages. The TeX system has precise knowledge of the sizes of all characters and symbols, and using this information, it computes the optimal arrangement of letters per line and lines per page. It then produces a DVI file ("DeVice Independent") containing the final locations of all characters. This DVI file can then be printed directly given an appropriate printer driver, or it can be converted to other formats. Nowadays, pdfTeX is often used, which bypasses DVI generation altogether.[19] The base TeX system understands about 300 commands, called primitives.[20] These low-level commands are rarely used directly by users, and most functionality is provided by format files (predumped memory images of TeX after large macro collections have been loaded). Knuth's original default format, which adds about 600 commands, is Plain TeX.[21] The most widely used format is LaTeX, originally developed by Leslie Lamport, which incorporates document styles for books, letters, slides, etc., and adds support for referencing and automatic numbering of sections and equations. Another widely used format, AMS-TeX, i…