Absolutely brilliant idea this, having texlive as a javascript module - magic!
I've managed to configure several packages (float
, titling
, caption
) into this with great result.
Process to add package:
- Grab .tds.zip of package from CTAN
- Unzip the .tds.zip package to
./texlive/texmf-dist/
- Update
./texlive.lst
and ./texlive/texmf-dist/ls-R
by running the following (I have this saved as bash .sh file in the ./
directory)
find texlive -type d -exec echo {}/. \; | sed 's/^texlive//g' >texlive.lst
find texlive -type f | sed 's/^texlive//g' >>texlive.lst
cd texlive/texmf-dist/
ls -R -1 > ls-R
That all seems to work fine. Now the issue is in trying to get pgfplots to run.
Process to configure pgfplots:
- Download
pgfplots.tds.zip
from CTAN
- Extract contents to
./texlive/texmf-dist/
- Run above script to update
./texlive/texmf-dist/ls-R
and ./texlive.lst
.
- Test in web browser.
- It lists missing files (
tikz.sty
which belongs to the pgf
package)
- Repeat this process with
pgf.tds.zip
from CTAN
- More dependencies (
everyshi.sty
which belongs to the ms
package)
- Repeat this process with
ms.tds.zip
from CTAN
- More dependencies (
xcolor.sty
which belongs to xcolor
package)
- Repeat this process with
xcolor.tds.zip
from CTAN
- All dependencies met huzzah!
Problems:
Here's the compile log...
analysis.php:221 This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010)
analysis.php:221 restricted \write18 enabled.
analysis.php:221 entering extended mode
analysis.php:221 (./input.tex
analysis.php:221 LaTeX2e <2015/10/01> patch level 1
analysis.php:221 (//texmf-dist/tex/latex/base/article.cls
analysis.php:221 Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
analysis.php:221 (//texmf-dist/tex/latex/base/size10.clo))
analysis.php:221 (//texmf-dist/tex/latex/tools/array.sty)
analysis.php:221 (//texmf-dist/tex/latex/caption/caption.sty
analysis.php:221 (//texmf-dist/tex/latex/caption/caption3.sty
analysis.php:221 (//texmf-dist/tex/latex/graphics/keyval.sty)))
analysis.php:221 (//texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)
analysis.php:221 (//texmf-dist/tex/latex/graphics/graphicx.sty
analysis.php:221 (//texmf-dist/tex/latex/graphics/graphics.sty
analysis.php:221 (//texmf-dist/tex/latex/graphics/trig.sty)
analysis.php:221 (//texmf-dist/tex/latex/latexconfig/graphics.cfg)
analysis.php:221 (//texmf-dist/tex/latex/pdftex-def/pdftex.def
analysis.php:221 (//texmf-dist/tex/generic/oberdiek/infwarerr.sty)
analysis.php:221 (//texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))
analysis.php:221 (//texmf-dist/tex/latex/float/float.sty)
analysis.php:221 (//texmf-dist/tex/latex/geometry/geometry.sty
analysis.php:221 (//texmf-dist/tex/generic/oberdiek/ifpdf.sty)
analysis.php:221 (//texmf-dist/tex/generic/oberdiek/ifvtex.sty)
analysis.php:221 (//texmf-dist/tex/generic/ifxetex/ifxetex.sty))
analysis.php:221 (//texmf-dist/tex/latex/pgfplots/pgfplots.sty
analysis.php:221 (//texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex)
analysis.php:221 (//texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty
analysis.php:221 (//texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
analysis.php:221 (//texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
analysis.php:221 (//texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
analysis.php:221 (//texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex))
analysis.php:221 (//texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
analysis.php:221 (//texmf-dist/tex/latex/ms/everyshi.sty))
analysis.php:221 (//texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex))
analysis.php:221 (//texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
analysis.php:221 (//texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty
analysis.php:221 (//texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
analysis.php:221 (//texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
analysis.php:221 (//texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex))
analysis.php:221 (//texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg)
analysis.php:221 (//texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
analysis.php:221 (//texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def)))
analysis.php:221 (//texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex))
analysis.php:221 (//texmf-dist/tex/latex/xcolor/xcolor.sty
analysis.php:221 (//texmf-dist/tex/latex/latexconfig/color.cfg))
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
analysis.php:221 (//texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
analysis.php:221 (//texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
analysis.php:221 (//texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex
analysis.php:221 (//texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex
analysis.php:221 ))) (//texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex))
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex))
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex)))
analysis.php:221 (//texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex)
analysis.php:221 (//texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex)
analysis.php:221 (//texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty)
analysis.php:221 (//texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty))
analysis.php:221 (//texmf-dist/tex/latex/pgf/utilities/pgffor.sty
analysis.php:221 (//texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty
analysis.php:221 (//texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex))
analysis.php:221 (//texmf-dist/tex/latex/pgf/math/pgfmath.sty
analysis.php:221 (//texmf-dist/tex/generic/pgf/math/pgfmath.code.tex))
analysis.php:221 (//texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
analysis.php:221 (//texmf-dist/tex/generic/pgf/math/pgfmath.code.tex)))
analysis.php:221 (//texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
analysis.php:221 (//texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex)
analysis.php:221 Runaway argument?
analysis.php:221 {badness wa
analysis.php:221 ! TeX capacity exceeded, sorry [main memory size=250000].
analysis.php:221 <argument> badness war
analysis.php:221 nings for centered text/.is if
analysis.php:221 l.1093 ...xt/.is if=tikz@warn@for@narrow@centered}
analysis.php:221
analysis.php:221 ! ==> Fatal error occurred, no output PDF file produced!
analysis.php:221 Transcript written on input.log.
Attempted solutions:
- It might be a memory problem? PGFPlots is apparently quite a memory intensive package and there's the error message
! TeX capacity exceeded, sorry [main memory size=250000].
in the log.
- First attempt is that from the wiki which suggests changing the
pdftex.set_TOTAL_MEMORY(memsize_in_bytes)
so here's my javascript call to compile.
pdftex.set_TOTAL_MEMORY(512*1024*1024).then(function() {
pdftex.FS_createLazyFile('/', 'carne.jpg', '../../images/carne.jpg', true, true);
pdftex.FS_createLazyFile('/', 'histogram.png', document.getElementById("month-canvas").toDataURL(), true, true);
pdftex.on_stdout = logCompilation;
pdftex.on_stderr = logCompilation;
pdftex.compile(sourceCode).then(function(pdf) {
showCompilingIndicator(false);
if (pdf) { //pdf === false
window.open(pdf);
}
});
});
- Note that I set use
pdftex.set_TOTAL_MEMORY(512*1024*1024)
which is a ridiculously large number and it doesn't change the result
- Googling points to modifying the
./texlive/texmf.cnf
file and adding memory parameters so I try something like this (again with large values), this is my ./texlive/texmf.cnf
file
% (Public domain.)
% This texmf.cnf file should contain only your personal changes from the
% original texmf.cnf (for example, as chosen in the installer).
%
% That is, if you need to make changes to texmf.cnf, put your custom
% settings in this file, which is .../texlive/YYYY/texmf.cnf, rather than
% the distributed file (which is .../texlive/YYYY/texmf-dist/web2c/texmf.cnf).
% And include *only* your changed values, not a copy of the whole thing!
%
TEXMFLOCAL = $SELFAUTOPARENT/texmf-local
TEXMFVAR = /home/thunder/emsdk_portable/texlive.js/home/texmf-var
main_memory=1000000000
extra_mem_bot=4000000
font_mem_size=1000000
pool_size=6000000
buf_size=6000000
- I've added the
main_memory
, extra_mem_bot
, font_mem_size
, pool_size
and buf_size
variables.
- Attempted playing around with the values and some configurations result in the
Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 67108864, or (2) set Module.TOTAL_MEMORY before the program runs.
error message (regardless of my pdftex.set_TOTAL_MEMORY
call)
- You can somewhat arbitrarily change the values up and in this particular configuration attempting to compile results in the following log:
...
analysis.php:221 (//texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex)
analysis.php:221 Runaway argument?
analysis.php:221 {badness wa
analysis.php:221 ! TeX capacity exceeded, sorry [main memory size=4250000].
analysis.php:221 <argument> badness war
analysis.php:221 nings for centered text/.is if
analysis.php:221 l.1093 ...xt/.is if=tikz@warn@for@narrow@centered}
analysis.php:221
analysis.php:221 ! ==> Fatal error occurred, no output PDF file produced!
analysis.php:221 Transcript written on input.log.
- Investigated
./texlive/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex
, deleting or modifying this in any way (ie shortening it so that it doesn't occupy so much memory) results in the same error, only after the next file in the sequence that it needs to fetch to compile.
- According to this post you should after altering the
texmf.cnf
run some kind of utility called texhash
to populate sub-dependent files to actually fully configure the memory changes. My issue is calling texhash
alters the local install, not the texlive.js folder I don't know what subchanges are actually needed! Similarly this post suggests similar but with fmtutil
needing to be called - same issue, I don't know how to call this on the texlive.js directory.
Conclusions
I don't think anything I've done has impacted the available memory to the compiler, even though I've been able to alter the [main memory size=250000]
to [main memory size=4250000]
in the logs (which is 17 times larger) I think this is just a misreporting or I'm not altering the right kind of memory (number of strings, etc). Any ideas?