theojones2 / nibbletex Goto Github PK
View Code? Open in Web Editor NEWThis repository contains two programs written to allow the Nibbleblog blogging engine to work with LaTeX.
License: GNU General Public License v3.0
This repository contains two programs written to allow the Nibbleblog blogging engine to work with LaTeX.
License: GNU General Public License v3.0
The file latex2wpstyle.py contains several definitions that determine the appearance of the WordPress/Nibbleblog translation. It should be self-explanatory to change the way sections, subsections, proofs and theorem-like environments are typeset, and to change the numbering scheme for theorem-like environments.
The variable $$ {M}&fg=000000$$ in latex2wpstyle.py contains a list of pairs of strings. For every pair, every occurrence of the first string in the document is replaced by an occurrence of the second before proceeding to the conversion from LaTeX to WordPress. If you want to use simple macros (which do not involve parameter-passing) then edit $$ {M}&fg=000000$$ to add support for your own LaTeX macros. (You will have to define the macros in macrosblog.tex as well, otherwise you will not be able to compile your LaTeX file and preview it.)
Add emref and numbered equations support.
It is possible to refer to equations and
theorems via the {\em ref}, {\em eqref} and {\em label} LaTeX
commands, for example to Equation (\ref{eq:test}),
to Equation \eqref{eq:lemma},
and to Lemma \ref{lm:main} above.
Some macros are already defined. For example, backslash-E produces an expectation symbol:
$$ \mathop{\mathbb E}{x \in X} f(x) := \sum{x\in X} \mathop{\mathbb P} [x] \cdot f(x) &fg=000000$$
Some more macros (see the LaTeX source)
Lemma 1 (Main) Let $$ {\cal F}&fg=000000$$ be a total ramification of a compactifier, then
$$ \forall g \in {\cal F}. g^2 = \eta \ \ \ \ \ (1)&fg=000000$$
The (modifiable) numbering scheme is that lemmas, theorems, propositions, remarks and corollaries share the same counters, while exercises and examples have each their own counter.
Theorem 2 The adèle of a number field is never hyperbolically transfinite.
Proof: Left as an exercise.
Exercise 1 Find a counterexample to Theorem 2.
Exercise 2 (Advanced) Prove Lemma 1.
Note that accented characters are allowed. Unfortunately, Erdös's name cannot be properly typeset in HTML. (Note that to get the above approximation, you need to type backslash-H-space-o, rather than backslash-H-{o}. Both are good in LaTeX, but only the second is recognized by LaTeX2WP.)
One can correctly type the names of Håstad, Szemerédi, Čech, and so on.
and unnumbered equations
Unnumbered equations can be created with the double-dollar sign command or with the backslash-square bracket command.
You can nest a bold text inside an emphasized text or viceversa.
The theorem-like environments theorem, lemma, proposition, remark, corollary, example and exercise are defined, as is the proof environment.
The LaTex commands to type $, %, and & are supported outside math mode, and % and & are supported in math mode as well:
The section symbol § is also supported.
Nibbleblog has trouble if a LaTeX expression containing a $$ {<}&fg=000000$$ symbol, such as $$ {x^2 < x^2 + 1}&fg=000000$$ is followed by an expression containing a $$ {>}&fg=000000$$ symbol, such as $$ {(x+y)^2 > (x+y)^2 - 3}&fg=000000$$. This is fixed by converting the inequality symbols into ``HTML character codes.'' Always write the symbols $$ {<}&fg=000000$$ and $$ {>}&fg=000000$$ in math mode.
and without borders as in
\begin{tabular}{ccc}
\end{tabular}
(The tabular environments will be centered in Nibbleblog, but
not in the LaTeX preview.)
Add support for eqnarray:
\begin{eqnarray_}
f(x) & < & x^2 - y^2
& = & (x+y) \cdot (x-y)
\end{eqnarray_}
It is possible to have numbered equations
\begin{equation} \label{eq:test} \frac 1 {x^2} \ge 0 \end{equation}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.