Giter Site home page Giter Site logo

kisonecat / web2js Goto Github PK

View Code? Open in Web Editor NEW
111.0 5.0 13.0 949 KB

Convert TeX's pascal to javascript

License: Other

JavaScript 18.41% Yacc 2.09% TeX 20.71% OpenEdge ABL 1.99% xBase 39.32% Shell 7.70% C 0.24% Prolog 0.25% Roff 0.37% Makefile 0.63% Perl 8.29%

web2js's Introduction

web2js

This is a Pascal compiler that targets WebAssembly, designed specifically to compile TeX so it can be run inside the browser. More specifically, this repository includes a TeX engine called jsTeX which is like LuaTeX but instead of embedding Lua it embeds JavaScript.

Importantly, the jsTeX engine passes the trip tests which you can verify by running make test.

There is a live demo and a short overview available at

J. Fowler, Both TEX and DVI viewers inside the web browser, TUGboat, Volume 40 (2019), No. 1.

Prerequisites

This projects depends on NodeJS for executing the javascript. To post-process the WebAssembly, you will need wasm-opt on your path.

You will need a full TeX installation (e.g., TeX Live) with access to kpsewhich in order that library.js can find the necessary TeX files. You also need tie and tangle to turn the WEB sources into Pascal which can be fed to the compiler.

The contents of the texk, triptrap, and etexdir subdirectories were copied from tug.org via

mkdir texk
rsync -a --delete --exclude=.svn tug.org::tldevsrc/Build/source/texk/web2c/tex.web texk
rsync -a --delete --exclude=.svn tug.org::tldevsrc/Build/source/texk/web2c/triptrap .
rsync -a --delete --exclude=.svn tug.org::tldevsrc/Build/source/texk/web2c/etexdir .

Getting started

After cloning this repository, run npm install.

Then run

make core.dump

to apply the changefiles, compile the resulting Pascal source to WebAssembly, and run initex.js to produce a format file and its corresponding memory dump.

Then you can run TeX on a file called sample.tex with

node tex.js sample.tex

jsTeX

The main innovation of jsTeX is \directjs primitive similar to LuaTeX's \directlua. For example,

\documentclass[12pt]{article}

\newcommand{\cubeit}[1]{\directjs{
  tex.print('$');
  tex.print(`#1^3 = ${#1*#1*#1}`);
  tex.print('$');
}}

\begin{document}

Let's multiply eight by eight by eight.  \cubeit{8}

\end{document}

Inside \directjs, the JavaScript function tex.print can be used to emit strings back into TeX for further processing.

web2js's People

Contributors

kisonecat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

web2js's Issues

tex.js \\tracingstats=1 \\bye => no output result

Exspected:

`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 string characters out of 6220659
5898 words of memory out of 5000000
926 multiletter control sequences out of 15000+600000
14794 words of font info for 50 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191
1i,0n,0p,1b,6s stack positions out of 5000i,500n,10000p,200000b,80000s
No pages of output.`

input file test01.tex:

\tracingstats=1
\bye

=> test01.log

This is TeX, Version 3.14159265 (preloaded format=plain 1776.7.4) 4 JUL 1776 12:00
**\input samples/test01.tex
(samples/test01.tex )
No pages of output.


**The stats are not displayed.**

The current date is not displayed in the TeX banner

From a log:

This is TeX, Version 3.14159265 (INITEX)  4 JUL 1776 12:00
**lplain.tex \dump
(lplain.tex Preloading the plain format: codes, registers,! 

4 JUL 1776 is not the current date
It's just a default that Knuth left in tex.web for system-dependent changes to replace with a function for getting current date and time.

Cannot build the project due to missing Makefile target

Multiple problems building project:

For Makefile, target bigmem.ch does not exist, therefore does not compile.

Even if removing bigmem.ch and bigmem-changes.ch from Makefile, got a very obscure error in node compile.js (something about jump target label 9998 not found).

Hoping to use this in a project with circuitikz, would very much appreciate you checking this error out. I suspect perhaps you did not git add all your .ch files from local (specifically, bigmem.ch)?

I am running on Ubuntu with full TeXLive in case that helps.

Web deployment core.dump size

In your tikzjax project, you were able to deploy the core.dump file with only 500 KB of WASM. However, my core.dump is ~160MB due to the 2500 pages of memory. How did you have such a lightweight deployment package?

My goal is to enable circuitikz, amsmath, and siunitx support for tikzjax basically.

`node-kpathsea` Version 1.1.0 doesn't exist

node-kpathsea Version 1.1.0 doesn't exist on NPM, and even if I downgrade it (to the one available version 1.0.0), I cannot get it to properly install:

Console output
npm ERR! code 1
npm ERR! path C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
npm ERR!   kpathsea.cc
npm ERR! C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea\src\node_kpathsea.h(4,10): fatal error C1083: Cannot open include file: 'kpathsea/kpathsea.h': No such file or directory [C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea\build\kpathsea.vcxproj]
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.2 found at "C:\Program Files\Python39\python.exe"
npm ERR! gyp info find VS using VS2019 (16.10.31321.278) found at:
npm ERR! gyp info find VS "H:\Visual Studio"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Program Files\Python39\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'msvs',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\user\\Documents\\Repositories\\web2js\\node_modules\\node-kpathsea\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\user\\AppData\\Local\\node-gyp\\Cache\\14.18.1\\include\\node\\common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\\Users\\user\\AppData\\Local\\node-gyp\\Cache\\14.18.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\14.18.1\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\user\\Documents\\Repositories\\web2js\\node_modules\\node-kpathsea',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'C:\\Users\\user\\Documents\\Repositories\\web2js\\node_modules\\node-kpathsea\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn H:\Visual Studio\MSBuild\Current\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
npm ERR! gyp info spawn args   '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args   '/nologo',
npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `H:\Visual Studio\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onExit (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea     
npm ERR! gyp ERR! node -v v14.18.1
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Local\npm-cache_logs\2021-10-24T12_15_35_174Z-debug.log

Complete Log
0 verbose cli [
0 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli   'C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli   'install'
0 verbose cli ]
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:C:\Users\user\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:C:\Users\user\Documents\Repositories\web2js\.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\user\.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:C:\Users\user\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 6ms
19 timing npm:load:configload Completed in 6ms
20 timing npm:load:setTitle Completed in 0ms
21 timing npm:load:setupLog Completed in 1ms
22 timing npm:load:cleanupLog Completed in 2ms
23 timing npm:load:configScope Completed in 0ms
24 timing npm:load:projectScope Completed in 1ms
25 timing npm:load Completed in 11ms
26 timing config:load:flatten Completed in 2ms
27 timing arborist:ctor Completed in 0ms
28 timing arborist:ctor Completed in 1ms
29 timing arborist:ctor Completed in 0ms
30 timing arborist:ctor Completed in 0ms
31 timing idealTree:init Completed in 50ms
32 timing idealTree:userRequests Completed in 0ms
33 silly idealTree buildDeps
34 silly fetch manifest node-kpathsea@^1.0.0
35 http fetch GET 200 https://registry.npmjs.org/node-kpathsea 88ms
36 silly placeDep ROOT [email protected] OK for: [email protected] want: ^1.0.0
37 silly fetch manifest bindings@^1.3.0
38 silly fetch manifest nan@^2.8.0
39 http fetch GET 304 https://registry.npmjs.org/bindings 49ms (from cache)
40 http fetch GET 304 https://registry.npmjs.org/nan 77ms (from cache)
41 timing idealTree:#root Completed in 170ms
42 silly placeDep ROOT [email protected] OK for: [email protected] want: ^1.3.0
43 silly placeDep ROOT [email protected] OK for: [email protected] want: ^2.8.0
44 silly fetch manifest [email protected]
45 http fetch GET 304 https://registry.npmjs.org/file-uri-to-path 43ms (from cache)
46 timing idealTree:node_modules/node-kpathsea Completed in 45ms
47 silly placeDep ROOT [email protected] OK for: [email protected] want: 1.0.0
48 timing idealTree:node_modules/bindings Completed in 0ms
49 timing idealTree:node_modules/file-uri-to-path Completed in 0ms
50 timing idealTree:node_modules/nan Completed in 1ms
51 timing idealTree:buildDeps Completed in 219ms
52 timing idealTree:fixDepFlags Completed in 0ms
53 timing idealTree Completed in 270ms
54 timing reify:loadTrees Completed in 271ms
55 timing reify:diffTrees Completed in 3ms
56 silly reify moves {}
57 timing reify:retireShallow Completed in 0ms
58 timing reify:createSparse Completed in 1ms
59 timing reify:loadBundles Completed in 0ms
60 silly audit bulk request {
60 silly audit   amdefine: [ '1.0.1' ],
60 silly audit   'ansi-styles': [ '3.2.1' ],
60 silly audit   'balanced-match': [ '1.0.2' ],
60 silly audit   binaryen: [ '89.0.0' ],
60 silly audit   'brace-expansion': [ '1.1.11' ],
60 silly audit   chalk: [ '2.4.2' ],
60 silly audit   cjson: [ '0.3.0' ],
60 silly audit   'color-convert': [ '1.9.3' ],
60 silly audit   'color-name': [ '1.1.3' ],
60 silly audit   colors: [ '1.4.0', '0.5.1' ],
60 silly audit   'concat-map': [ '0.0.1' ],
60 silly audit   diff: [ '5.0.0' ],
60 silly audit   'ebnf-parser': [ '0.1.10' ],
60 silly audit   'escape-string-regexp': [ '1.0.5' ],
60 silly audit   escodegen: [ '1.3.3' ],
60 silly audit   esprima: [ '1.1.1' ],
60 silly audit   estraverse: [ '1.5.1' ],
60 silly audit   esutils: [ '1.0.0' ],
60 silly audit   'flex-js': [ '1.0.5' ],
60 silly audit   'fs.realpath': [ '1.0.0' ],
60 silly audit   glob: [ '7.2.0' ],
60 silly audit   'has-flag': [ '3.0.0' ],
60 silly audit   inflight: [ '1.0.6' ],
60 silly audit   inherits: [ '2.0.4' ],
60 silly audit   jison: [ '0.4.18' ],
60 silly audit   'jison-lex': [ '0.3.4' ],
60 silly audit   jsonlint: [ '1.6.0' ],
60 silly audit   JSONSelect: [ '0.4.0' ],
60 silly audit   JSV: [ '4.0.2' ],
60 silly audit   'lex-parser': [ '0.1.4' ],
60 silly audit   'log-symbols': [ '2.2.0' ],
60 silly audit   minimatch: [ '3.0.4' ],
60 silly audit   nomnom: [ '1.5.2' ],
60 silly audit   once: [ '1.4.0' ],
60 silly audit   'path-is-absolute': [ '1.0.1' ],
60 silly audit   pegjs: [ '0.10.0' ],
60 silly audit   'source-map': [ '0.1.43' ],
60 silly audit   'supports-color': [ '5.5.0' ],
60 silly audit   underscore: [ '1.1.7' ],
60 silly audit   wrappy: [ '1.0.2' ],
60 silly audit   'node-kpathsea': [ '1.0.0' ],
60 silly audit   bindings: [ '1.5.0' ],
60 silly audit   nan: [ '2.15.0' ],
60 silly audit   'file-uri-to-path': [ '1.0.0' ]
60 silly audit }
61 timing reifyNode:node_modules/bindings Completed in 44ms
62 timing reifyNode:node_modules/node-kpathsea Completed in 48ms
63 timing reifyNode:node_modules/file-uri-to-path Completed in 53ms
64 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 352ms
65 timing auditReport:getReport Completed in 354ms
66 silly audit report {}
67 timing auditReport:init Completed in 0ms
68 timing reify:audit Completed in 355ms
69 timing reifyNode:node_modules/nan Completed in 540ms
70 timing reify:unpack Completed in 540ms
71 timing reify:unretire Completed in 1ms
72 timing build:queue Completed in 1ms
73 info run [email protected] install node_modules/node-kpathsea node-gyp rebuild
74 info run [email protected] install { code: 1, signal: null }
75 timing reify:rollback:createSparse Completed in 17ms
76 timing reify:rollback:retireShallow Completed in 0ms
77 timing command:install Completed in 14723ms
78 verbose stack Error: command failed
78 verbose stack     at ChildProcess. (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
78 verbose stack     at ChildProcess.emit (events.js:400:28)
78 verbose stack     at maybeClose (internal/child_process.js:1058:16)
78 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
79 verbose pkgid [email protected]
80 verbose cwd C:\Users\user\Documents\Repositories\web2js
81 verbose Windows_NT 10.0.22000
82 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
83 verbose node v14.18.1
84 verbose npm  v7.15.0
85 error code 1
86 error path C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea
87 error command failed
88 error command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
89 error Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
89 error   kpathsea.cc
89 error C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea\src\node_kpathsea.h(4,10): fatal error C1083: Cannot open include file: 'kpathsea/kpathsea.h': No such file or directory [C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea\build\kpathsea.vcxproj]
90 error gyp info it worked if it ends with ok
90 error gyp info using [email protected]
90 error gyp info using [email protected] | win32 | x64
90 error gyp info find Python using Python version 3.9.2 found at "C:\Program Files\Python39\python.exe"
90 error gyp info find VS using VS2019 (16.10.31321.278) found at:
90 error gyp info find VS "H:\Visual Studio"
90 error gyp info find VS run with --verbose for detailed information
90 error gyp info spawn C:\Program Files\Python39\python.exe
90 error gyp info spawn args [
90 error gyp info spawn args   'C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
90 error gyp info spawn args   'binding.gyp',
90 error gyp info spawn args   '-f',
90 error gyp info spawn args   'msvs',
90 error gyp info spawn args   '-I',
90 error gyp info spawn args   'C:\\Users\\user\\Documents\\Repositories\\web2js\\node_modules\\node-kpathsea\\build\\config.gypi',
90 error gyp info spawn args   '-I',
90 error gyp info spawn args   'C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
90 error gyp info spawn args   '-I',
90 error gyp info spawn args   'C:\\Users\\user\\AppData\\Local\\node-gyp\\Cache\\14.18.1\\include\\node\\common.gypi',
90 error gyp info spawn args   '-Dlibrary=shared_library',
90 error gyp info spawn args   '-Dvisibility=default',
90 error gyp info spawn args   '-Dnode_root_dir=C:\\Users\\user\\AppData\\Local\\node-gyp\\Cache\\14.18.1',
90 error gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
90 error gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\14.18.1\\\\<(target_arch)\\\\node.lib',
90 error gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\user\\Documents\\Repositories\\web2js\\node_modules\\node-kpathsea',
90 error gyp info spawn args   '-Dnode_engine=v8',
90 error gyp info spawn args   '--depth=.',
90 error gyp info spawn args   '--no-parallel',
90 error gyp info spawn args   '--generator-output',
90 error gyp info spawn args   'C:\\Users\\user\\Documents\\Repositories\\web2js\\node_modules\\node-kpathsea\\build',
90 error gyp info spawn args   '-Goutput_dir=.'
90 error gyp info spawn args ]
90 error gyp info spawn H:\Visual Studio\MSBuild\Current\Bin\MSBuild.exe
90 error gyp info spawn args [
90 error gyp info spawn args   'build/binding.sln',
90 error gyp info spawn args   '/clp:Verbosity=minimal',
90 error gyp info spawn args   '/nologo',
90 error gyp info spawn args   '/p:Configuration=Release;Platform=x64'
90 error gyp info spawn args ]
90 error gyp ERR! build error
90 error gyp ERR! stack Error: `H:\Visual Studio\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
90 error gyp ERR! stack     at ChildProcess.onExit (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
90 error gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
90 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
90 error gyp ERR! System Windows_NT 10.0.22000
90 error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
90 error gyp ERR! cwd C:\Users\user\Documents\Repositories\web2js\node_modules\node-kpathsea
90 error gyp ERR! node -v v14.18.1
90 error gyp ERR! node-gyp -v v7.1.2
90 error gyp ERR! not ok
91 verbose exit 1

Another thing, is there anything (legal or something?) stopping you from distributing the core.dump files etc.? If not, why not create Releases here on GitHub with the Files attached.
This would really help others use your Project!

Create Docker environment

web2js has some dependencies to produce core.dump. It is hard to setup the local environment, therefore I want the Docker environment.

FROM adnrv/texlive:full 

# Update tex packages
RUN tlmgr update --self --all

ARG WORKDIR=/usr/var
WORKDIR ${WORKDIR}

# Install apt pacakges
RUN apt update && apt install -y \
  build-essential \
  cmake \
  git \
  libkpathsea-dev \
  python3-pip

# Install npm and node
ARG NODE_MAJOR_VERSION=14
ARG NODE_MINOR_VERSION=14.18.1
RUN wget https://deb.nodesource.com/node_${NODE_MAJOR_VERSION}.x/pool/main/n/nodejs/nodejs_${NODE_MINOR_VERSION}-deb-1nodesource1_amd64.deb \
  && apt install ./nodejs_${NODE_MINOR_VERSION}-deb-1nodesource1_amd64.deb \
  && rm nodejs_${NODE_MINOR_VERSION}-deb-1nodesource1_amd64.deb

# Install binaryen
ARG BINARYEN_VERSION=91
RUN wget https://github.com/WebAssembly/binaryen/archive/refs/tags/version_${BINARYEN_VERSION}.tar.gz \
  && tar -zxf version_${BINARYEN_VERSION}.tar.gz \
  && cd binaryen-version_${BINARYEN_VERSION} \
  && cmake . && make \
  && make install \
  && cd ../ && rm -rf binaryen-version_${BINARYEN_VERSION} version_${BINARYEN_VERSION}.tar.gz

# Install node packages
COPY package.json ${WORKDIR}/
RUN npm install

# Build
COPY . ${WORKDIR}/

# Produce tex.wasm and core.dump
RUN make core.dump

# Compile sampleLatex.tex by running
# RUN node tex.js sample/sampleLatex

This is my Dockerfile but ! I can't read TEX.POOL. error has occurred at node initex.js.

The following is that log.

! I can't read TEX.POOL.
[Object: null prototype] {
  '0': Memory [WebAssembly.Memory] {},
  getStackPointer: [Function: 20],
  setStackPointer: [Function: 21],
  main: [Function: 385],
  asyncify_start_unwind: [Function: 386],
  asyncify_stop_unwind: [Function: 387],
  asyncify_start_rewind: [Function: 388],
  asyncify_stop_rewind: [Function: 387]
}
! I can't read TEX.POOL.

This message is sent out from the source file but I don't know what is needed or wrong.
tex.pool file is certainly exist by tangle. How can I fix it?

eTeX instead of TeX => ! You have to increase POOLSIZE.

No problems if I take exactly your instruction steps:

  1. tangle -underscore tex.web
  2. ...
  3. compile.js
  4. initex.js

If I try with eTeX:

  1. tangle -underscore tex.web etex.ch
  2. renaming etex.src to plain.tex so the format file fits
  3. ...
  4. compile.js
  5. initex.js
    => error:
    ! You have to increase POOLSIZE.

I have a TeX Live 2019 distribution under Windows 10, for more background of this issue see TeX SX: Detailed description of my case

Your example drawing a circle with TikZ works with eTeX:

This is e-TeX, Version 3.14159265-2.6 (preloaded format=latex 2019.2.23)
**entering extended mode
(sample.tex
LaTeX2e <2018-04-01> patch level 5
(sample.aux) ABD: EveryShipout initializing macros [1] (sample.aux) )
Output written on sample.dvi (1 page, 2976 bytes).
Transcript written on sample.log.

How to fix this?
What am I doing wrong?

I think my etex.ch file doesn't contain all necessary changes, e.g. memory managament pool_size ....

Do you have a working etex.ch or ready-to-use etex.web?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.