13.11.2015 Views

my Latex and Tex4ht cheat sheet

my Latex cheat sheet - 12000.org

my Latex cheat sheet - 12000.org

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

% !TEX TS-program = lualatex<br />

\documentclass{article}<br />

\usepackage{luacode}<br />

\usepackage{amsmath}<br />

%------------------------<br />

\begin{luacode*}<br />

function split(str, pat)<br />

--http://lua-users.org/wiki/SplitJoin<br />

-- NOTE: use {n = 0} in Lua-5.0<br />

local t = {}<br />

local fpat = "(.-)" .. pat<br />

local last_end = 1<br />

local s, e, cap = str:find(fpat, 1)<br />

while s do<br />

if s ~= 1 or cap ~= "" then<br />

table.insert(t,cap)<br />

end<br />

last_end = e+1<br />

s, e, cap = str:find(fpat, last_end)<br />

end<br />

if last_end

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!