# Tag Info

48

TeX was rewritten in Pascal. Actually, using a literate programming system called WEB, invented by Knuth himself. This system uses Pascal for the programming and it uses TeX for the documentation. The source code of TeX was published as a book: http://www.amazon.com/Computers-Typesetting-B-TeX-Program/dp/0201134373.

41

TeX is written in WEB (a literate programming language created by D. E. Knuth). Originally, WEB source was translated into Pascal (a subset of Pascal) via tangle to produce executable and translated into TeX via weave to produce documentation of the code. Both programs have themselves been written in WEB. Today, TeXLive uses web2c to translate directly WEB ...

32

The tex.web file contains 24985 lines at the moment. This is in the literate-programming style, so has a lot of what you might call comments. When passed through tangle (e.g. tangle tex.web), you get Pascal code, but this is comparable to the code produced by a JavaScript minifier: statements are all jammed together on the line and there are line breaks at ...

21

It is definitely not 0xFF, but “Control-L” or ASCII 0x0C (decimal 12), called “form feed” (this is why your viewer shows it as FF). As you probably know, Knuth started using computers when they weren't like the ones we use today. When the teletype was the only interface, character Control-L was used to tell the teletype “advance to the end of the form”, so ...

12

Here is a small hello.web, that doesn't use much of the features of WEB: @* Introduction. This program takes an integer $n$ as input, and prints Hello world'' $n$ times. @p program HELLO(input, output); var n: integer; i: integer; begin read(n); for i := 1 to n do begin writeln('Hello world'); end; end. @* Index. Not much to it. ...

12

Check Taco's CXTeX; "A hand-converted C version of TeX". I think one can throw some C++ syntactic sugar on top of it, but IMO that is as far as you can go without rethinking the whole TeX structure.

11

It's an old control character for a page break (form feed), used long time ago for marking the new page for printers. It's 0x0C in HEX, also represented as Control + L. WinEdt shows it as ^L - underlined L. Notepad++ show it as FF.

10

That's not from “The TeXbook”, but is rather the typeset version of the WEB source for TeX (the program). This is available in the TeX Live distribution (possibly also with MiKTeX) as a hyperlinked PDF file, with texdoc tex or from texdoc.net. The red numbers are hyperlinks pointing to the corresponding module or section. If I hover on a link I get the ...

10

If you built TeX Live with the included Build script, the converted files should be under Work/texk/web2c/; there you will find tex0.c, mf0.c etc. To build only TeX and MetaFont, you can pass something like --disable-all-pkgs --enable-tex --enable-mf --without-mf-x-toolkit --without-x to configure (see README.config for general build option documentation) ...

10

To supplement ShreevatsaR excellent answer, here is the beginning of tex.p, the “tangled” form of tex.web {4:}{9:}{$C-,A+,D-}{[$C+,D+]}{:9}program TEX;label{6:}1,9998,9999; {:6}const{11:}memmax=30000;memmin=0;bufsize=500;errorline=72; halferrorline=42;maxprintline=79;stacksize=200;maxinopen=6;fontmax=75; fontmemsize=20000;paramsize=60;nestsize=40;maxstrings=...

9

Have a look at the source code for LuaTeX: It contains no Pascal code anymore. All of it has been converted by hand to C.

7

As Patrick pointed out, HTML is what you are looking for, it provides the features you need: Standard coding pattern (if I interpret that correctly) Works well on the WWW Works on almost all available platforms No need to recompile TeX was never designed for producing content for on screen reading, it was designed to generate pages to print books. PDF ...

6

I recently created a (Windows) build of Web2c.exe using Microsoft's Visual Studio and posted some notes describing the process on my blog. To date, I've built tangle and weave from their .web and .ch files: next step TeX! Those notes don't cover every step, but they might help if you want to have a go yourself, whether you are using Windows or Linux. You can ...

5

pdf2htmlEX can convert PDF to HTML without losing format.

5

I would recommend packing this change into the system change file for eTeX, etex.sys. It is the eTeX equivalent of TeX's tex.ch and using both is difficult because tangle only accepts one changefile. If you read etex_gen.tex you will see that you are expected to include all tex.ch changes in etex.sys. The alternative would be to apply a separate changefile ...

5

Firstly: LuaTeX is a descendant of CXTeX. Why do I say this? I cannot read Dutch, but I notice certain similarities between these two papers both by Taco Hoekwater: De CXTeX distributie (MAPS 30, Voorjar (Spring) 2004) and LuaTEX says goodbye to Pascal (MAPS 39, EuroTeX 2009). :-) So when the latter paper says: In the winter of 2008–2009, we invested a ...

5

The implementation of \TeX is done in tex.web. This file is a generic implementation which must be tailored to an operating system or, in general, to a specific computer and a Pascal compiler. For example, file name conventions and the input and output procedures must be changed to meet the specifications of a particular system and if the Pascal compiler ...

4

You're increase of the pool size lead to additional memory requirements. So you do not need any other changes to eTeX, you have to increase the provided memory. In your Javascript versions, the amount of memory is set in the "compiler". For your settings you would need 32906 pages of memory, but there is an impmentation limit at 32767 pages. Luckily you can ...

4

To illustrate WEB a bit better, here is a rather elaborate version of the hello-world program that uses most of the main features of WEB: named and unnamed sections; simple, numeric, and parametric macros; some formatting and indexing controls; and, most exotic of all, the string pool. All that the program does is print “Hello world” N times after reading ...

3

Do not really understand all parts of your question. tex4ht can be used to convert (La)TeX to MathML. Read more at: http://www.tug.org/applications/tex4ht/mn-commands.html#QQ1-9-37 There was similar question here: Convert Latex to MathJax-HTML about converting LaTeX to MathML and even loading mathjax scripts. Not every (La)TeX construction can be easily ...

3

I haven't seen any cweb for a long time but... There is a latex-cweb package for using LaTeX with CWEB, or there is the plain/miniltx collection that allows you to use \includegraphics from plain, or you can perhaps process the plain TeX output in latex using the plain package.

3

Unlike tex.web which was from the beginning intended by Knuth for producing both a documented book of the source code listing (Computers & Typesetting Volume B, TeX: The Program) and the actual program of TeX, the file pdftex.web is simply a changed tex.web that was done with the primary goal of producing a working and usable pdfTeX program, with no ...

3

Some additional sources of information. In 1987, Knuth gave a series of lectures on mathematical writing; these also often discussed computer science writing. He devoted two lectures to literate programming, naturally using WEB (CWEB was also developed in 1987, but the lectures may well predate it). While the whole series consists of twenty-one lectures, ...

2

most of the ones that you can normally set in texmf.cnf are shown at the end of the log If I run tex \\tracingstats=1 \\bye the log shows \$ more texput.log This is TeX, Version 3.14159265 (TeX Live 2019) (preloaded format=tex 2019.7.26) 1 AUG 2019 18:56 **\tracingstats=1 \bye Here is how much of TeX's memory you used: 1 string out of 497973 10 ...

2

Look down in the built tex.tex file and you'll see 84 \def\title{\TeX82} 85 \def\topofcontents{\hsize 5.5in 86 \vglue 0pt plus 1fil minus 1.5in 87 \def\?##1]{\hbox to 1in{\hfil##1.\ }} 88 } 89 \def\botofcontents{\vskip 0pt plus 1fil minus 1.5in} (line numbers added for reference).

2

I'm currently developing a free open source tool that can convert LaTeX to a single HTML file. Its called PDBF (https://github.com/uds-datalab/PDBF) and runs on win/linux/mac. Instructions: Make sure you have a Java Runtime (version >= 1.7) installed Download latest version of PDBF: https://github.com/uds-datalab/PDBF/archive/gh-pages.zip Unpack archive ...

2

I managed to get a LaTeX format working with web2js, though with some caveats. Here's a working (for me) sequence of steps. Get web2js: either download the zip file and unzip, or run git clone https://github.com/kisonecat/web2js.git Get tex.web: download using your browser, or run: wget http://mirrors.ctan.org/systems/knuth/dist/tex/tex.web Get etex.ch:...

2

Use @/ to add a manual line break in the cweave output: { @<print hello world@>@/ return 0; } produces

2

With ACM-Reference-Format.bst you can add the date of access of an URL to the lastaccessed field (only for @misc entries, though). \documentclass[format=acmlarge, review=false, screen=true]{acmart} \usepackage{filecontents} \begin{filecontents}{\jobname.bib} @misc{elk, author = {Anne Elk}, title = {A Theory on Brontosauruses}, year ...

2

The tool is tangle try: tangle inputfile changefile outputfile poolfile If not available with standard distributions, try ctangle. Also instructive is to read webman. Good reference here.

Only top voted, non community-wiki answers of a minimum length are eligible