Commit 4613758f authored by Bengt Giger's avatar Bengt Giger
Browse files

Initial commit after moving from private repo

parents
FROM fedora:33
LABEL maintainer="Bengt Giger <bgiger@ethz.ch>"
COPY laweb /usr/local/bin/laweb
COPY laweb.sty /usr/share/texlive/texmf-local/tex/latex/laweb.sty
COPY laweb.cfg /usr/share/texlive/texmf-local/tex/latex/laweb.cfg
COPY laweb-wrapper.sh /usr/local/bin/laweb-wrapper.sh
RUN dnf install -y texlive-tikz-dependency texlive-tex4ht texlive-scheme-full texlive-ifluatex
WORKDIR /home/workdir
VOLUME [ "/home/workdir" ]
CMD /usr/local/bin/laweb
# laweb
LaTeX to HTML converter
## Docker Setup with WSL
Add "/mnt/c/Program Files/Docker/Docker/resources/bin" to your path.
# laweb
LaTeX to HTML converter for D-MATH
## Docker Setup with WSL
Add "/mnt/c/Program Files/Docker/Docker/resources/bin" to your path.
version: '3.4'
services:
laweb:
image: laweb
build:
context: .
dockerfile: ./Dockerfile
#!/usr/bin/env bash
pdflatex -shell-escape $1
pdflatex -shell-escape $1
#htlatex $1 "laweb,uni-html4" " -cmozhtf"
htlatex $1 "laweb,xhtml" " -cmozhtf"
rm $1.idv
rm $1.lg
rm $1.tmp
rm $1.dvi
rm $1.4tc
rm $1.4ct
rm $1.xref
rm $1.auxlock
#!/usr/bin/env bash
if [ "$(pwd)" != "/home/workdir" ]; then
cd /home/workdir
fi
/usr/local/bin/laweb $1
% Based on https://www.12000.org/my_notes/faq/LATEX/htse54.htm
% Addition from https://tex.stackexchange.com/questions/574945/htlatex-ignores-value-in-brackets-in-item-statement-when-using-itemize
\Preamble{mathml}
\Configure{VERSION}{}
\Configure{DOCTYPE}{\HCode{<!DOCTYPE html>\Hnewline}}
\Configure{HTML}{\HCode{<html>\Hnewline}}{\HCode{\Hnewline</html>}}
\Configure{@HEAD}{}
\Configure{@HEAD}{\HCode{<meta charset="UTF-8" />\Hnewline}}
\Configure{@HEAD}{\HCode{<meta name="generator" content="TeX4ht
(http://www.cse.ohio-state.edu/\string~gurari/TeX4ht/)" />\Hnewline}}
\Configure{@HEAD}{\HCode{<link
rel="stylesheet" type="text/css"
href="\expandafter\csname aa:CssFile\endcsname" />\Hnewline}}
\Configure{@HEAD}{\HCode{%
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
\unexpanded{inlineMath: [ ['$','$'], ["\\(","\\)"] ],}
\unexpanded{displayMath: [ ['$$','$$'], ["\\[","\\]"] ],}
processEscapes: true
},
"HTML-CSS": { availableFonts: ["TeX"] }
});
</script>
}}
\Configure{@HEAD}{\HCode{<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>}}
\Configure{@HEAD}{\HCode{<style type="text/css">
.MathJax_MathML {text-indent: 0;}
</style>}}
\Configure{@HEAD}{\HCode{<style type="text/css">
img { width: 100\% }
</style>}}
\catcode`\:=11
\ConfigureList{itemize}%
{\EndP\HCode{<div \a:LRdir
class="custom-itemize"><div class="item-head">}%
\PushMacro\end:itm \global\let\end:itm=\empty}
{\PopMacro\end:itm \global\let\end:itm \end:itm
\ifvmode \IgnorePar\fi
\EndP\HCode{</div></div>}\ShowPar}
{\end:itm \global\def\end:itm{\EndP\Tg</div>\Tg<div class="item-head">}}
{\HCode{</div><div class="item-content">}}
\Css{.item-head{float:left;width:2em;clear:left;}}
\Css{.item-content{margin-left:2em;}}
\catcode`\:=12
\begin{document}
\EndPreamble
\ProvidesPackage{laweb}[LaWeb Package]
\usepackage{tikz,graphicx,tikz-dependency}
\usetikzlibrary{external}
\tikzset{
png copy/.style={
external/system call={
pdflatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource";
convert -density 300 -transparent white "\image.pdf" "\image.png"
}
}
}
\tikzset{png copy}
\makeatletter
\@ifpackageloaded{tex4ht}{
\tikzexternalize[mode=only graphics]
\tikzset{png export/.style={/pgf/images/external info,/pgf/images/include external/.code={\includegraphics[width=\pgfexternalwidth,height=\pgfexternalheight]{##1.png}}}}
\tikzset{png export}
}{
\tikzexternalize
\tikzset{pdf export/.style={/pgf/images/external info,/pgf/images/include external/.code={\includegraphics[width=\pgfexternalwidth,height=\pgfexternalheight]{##1.pdf}}}}
\tikzset{pdf export}
}
\makeatother
\ifdefined\HCode
\renewcommand\webonly[1]{\HCode{#1}}
\renewcommand\texonly[1]{}%
\else
\renewcommand\webonly[1]{}%
\renewcommand\texonly[1]{#1}
\fi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment