diff options
author | rautenberg <rautenberg@in-silico.ch> | 2016-11-15 09:50:15 +0100 |
---|---|---|
committer | rautenberg <rautenberg@in-silico.ch> | 2016-11-15 09:50:15 +0100 |
commit | bb7b0826eb05d9875e9bbda7c12395526b45e5c4 (patch) | |
tree | d0870e55d26f56152148893b8d2697d8553c4eee | |
parent | af041aa51ab38be2ca15e995f112828f03d13117 (diff) |
clean up, enhance Makefile
-rw-r--r-- | Makefile | 19 | ||||
-rw-r--r-- | beamercolorthemeIST.sty | 2 | ||||
-rw-r--r-- | beamerthemeIST.sty | 16 | ||||
-rw-r--r-- | markdown.lua | 1257 | ||||
-rw-r--r-- | markdown.sty | 518 | ||||
-rw-r--r-- | markdown.tex | 519 | ||||
-rwxr-xr-x | md2tex.sh | 5 | ||||
-rw-r--r-- | postertemplate.tex | 22 |
8 files changed, 44 insertions, 2314 deletions
@@ -1,21 +1,28 @@ PDFLATEX = pdflatex -shell-escape BIBTEX = bibtex -MD=$(wildcard ./markdown_blocks/*.md) +MD = $(wildcard ./markdown_blocks/*.md) +MDTEX = $(wildcard ./markdown_blocks/*.tex) +CLEAN_EXT = .aux .bbl .blg .log .nav .out .snm .toc + + + # Poster 1 -lazar-poster.pdf: - ./md2tex.sh +exampleposter: + ./md2tex.sh postertemplate.tex $(PDFLATEX) postertemplate.tex $(BIBTEX) postertemplate $(PDFLATEX) postertemplate.tex $(PDFLATEX) postertemplate.tex # Poster 2 -lazar-poster2.pdf: - ./md2tex.sh +exampleposter2: + ./md2tex.sh postertemplate_2.tex $(PDFLATEX) postertemplate_2.tex - +clean: + for file in $(MDTEX) ; do echo remove $$file; rm $$file ; done + for ext in $(CLEAN_EXT); do echo remove ./*$$ext; rm -f ./*$$ext; done # pandoc nano-lazar.md --bibliography=references.bibtex --latex-engine=pdflatex --filter ./inline.rb --filter pandoc-crossref --filter pandoc-citeproc -o nano-lazar.pdf diff --git a/beamercolorthemeIST.sty b/beamercolorthemeIST.sty index ff00cef..4978f4d 100644 --- a/beamercolorthemeIST.sty +++ b/beamercolorthemeIST.sty @@ -15,6 +15,7 @@ \definecolor{darkgrey}{HTML}{333333} \definecolor{darkred}{HTML}{330000} \definecolor{alertTitleBG}{HTML}{8A2128} +\definecolor{exampleTitleBG}{HTML}{397159} \definecolor{darkblue}{HTML}{2C5B80} \definecolor{i6colorscheme1}{HTML}{2E5E84} % head and footlines \definecolor{i6colorblockbg}{HTML}{2E5E84} % e.g. for block title bg @@ -67,6 +68,7 @@ % example environment \setbeamercolor*{example title}{fg=white,bg=i6colorscheme1} +\setbeamercolor*{block title example}{fg=black,bg=i6colorschemeHeadline} \setbeamerfont{example title}{size=\large,series=\bf} % alert environment diff --git a/beamerthemeIST.sty b/beamerthemeIST.sty index a307927..c970d00 100644 --- a/beamerthemeIST.sty +++ b/beamerthemeIST.sty @@ -43,6 +43,22 @@ \end{beamercolorbox} } +% setup exampleblock +\setbeamertemplate{block example begin}{ + \vskip3ex + \begin{beamercolorbox}[rounded=true,shadow=true,sep=0ex,ht=3.4ex,dp=-0.2ex,colsep=0.9ex]{block title example}% + \usebeamerfont*{block title example}\textbf{\insertblocktitle} + \end{beamercolorbox}% + %{\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}% + \usebeamerfont{block body example}% + \begin{beamercolorbox}[colsep*=.75ex,sep=.75ex,vmode]{block body example}% + \ifbeamercolorempty[bg]{block body example}{\vskip-.25ex}{\vskip-.75ex}\vbox{}% + } + \setbeamertemplate{block example end}{ + \end{beamercolorbox} +} + + % setup alertblock \setbeamertemplate{block alerted begin}{ \vskip3ex diff --git a/markdown.lua b/markdown.lua deleted file mode 100644 index bddbcaa..0000000 --- a/markdown.lua +++ /dev/null @@ -1,1257 +0,0 @@ --- --- Copyright (C) 2009-2016 John MacFarlane, Hans Hagen --- --- Permission is hereby granted, free of charge, to any person obtaining --- a copy of this software and associated documentation files (the --- "Software"), to deal in the Software without restriction, including --- without limitation the rights to use, copy, modify, merge, publish, --- distribute, sublicense, and/or sell copies of the Software, and to --- permit persons to whom the Software is furnished to do so, subject to --- the following conditions: --- --- The above copyright notice and this permission notice shall be included --- in all copies or substantial portions of the Software. --- --- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, --- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY --- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, --- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE --- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- --- Copyright (C) 2016 Vít Novotný --- --- This work may be distributed and/or modified under the --- conditions of the LaTeX Project Public License, either version 1.3 --- of this license or (at your option) any later version. --- The latest version of this license is in --- --- http://www.latex-project.org/lppl.txt --- --- and version 1.3 or later is part of all distributions of LaTeX --- version 2005/12/01 or later. --- --- This work has the LPPL maintenance status `maintained'. --- The Current Maintainer of this work is Vít Novotný. --- --- Send bug reports, requests for additions and questions --- either to the GitHub issue tracker at --- --- https://github.com/witiko/markdown/issues --- --- or to the e-mail address <witiko@mail.muni.cz>. --- --- MODIFICATION ADVICE: --- --- If you want to customize this file, it is best to make a copy of --- the source file(s) from which it was produced. Use a different --- name for your copy(ies) and modify the copy(ies); this will ensure --- that your modifications do not get overwritten when you install a --- new release of the standard system. You should also ensure that --- your modified source file does not generate any modified file with --- the same name as a standard file. --- --- You will also need to produce your own, suitably named, .ins file to --- control the generation of files from your source file; this file --- should contain your own preambles for the files it generates, not --- those in the standard .ins files. --- -local metadata = { - version = "2.1.3", - comment = "A module for the conversion from markdown to plain TeX", - author = "John MacFarlane, Hans Hagen, Vít Novotný", - copyright = "2009-2016 John MacFarlane, Hans Hagen; 2016 Vít Novotný", - license = "LPPL 1.3" -} -if not modules then modules = { } end -modules['markdown'] = metadata -local lpeg = require("lpeg") -local unicode = require("unicode") -local md5 = require("md5") -local M = {} -local defaultOptions = {} -defaultOptions.blankBeforeBlockquote = false -defaultOptions.blankBeforeCodeFence = false -defaultOptions.blankBeforeHeading = false -defaultOptions.cacheDir = "." -defaultOptions.citationNbsps = true -defaultOptions.citations = false -defaultOptions.definitionLists = false -defaultOptions.hashEnumerators = false -defaultOptions.hybrid = false -defaultOptions.fencedCode = false -defaultOptions.footnotes = false -defaultOptions.preserveTabs = false -defaultOptions.smartEllipses = false -defaultOptions.startNumber = true -defaultOptions.tightLists = true -local upper, gsub, format, length = - string.upper, string.gsub, string.format, string.len -local concat = table.concat -local P, R, S, V, C, Cg, Cb, Cmt, Cc, Ct, B, Cs, any = - lpeg.P, lpeg.R, lpeg.S, lpeg.V, lpeg.C, lpeg.Cg, lpeg.Cb, - lpeg.Cmt, lpeg.Cc, lpeg.Ct, lpeg.B, lpeg.Cs, lpeg.P(1) -local util = {} -function util.err(msg, exit_code) - io.stderr:write("markdown.lua: " .. msg .. "\n") - os.exit(exit_code or 1) -end -function util.cache(dir, string, salt, transform, suffix) - local digest = md5.sumhexa(string .. (salt or "")) - local name = util.pathname(dir, digest .. suffix) - local file = io.open(name, "r") - if file == nil then -- If no cache entry exists, then create a new one. - local file = assert(io.open(name, "w")) - local result = string - if transform ~= nil then - result = transform(result) - end - assert(file:write(result)) - assert(file:close()) - end - return name -end -function util.table_copy(t) - local u = { } - for k, v in pairs(t) do u[k] = v end - return setmetatable(u, getmetatable(t)) -end -function util.expand_tabs_in_line(s, tabstop) - local tab = tabstop or 4 - local corr = 0 - return (s:gsub("()\t", function(p) - local sp = tab - (p - 1 + corr) % tab - corr = corr - 1 + sp - return string.rep(" ", sp) - end)) -end -function util.walk(t, f) - local typ = type(t) - if typ == "string" then - f(t) - elseif typ == "table" then - local i = 1 - local n - n = t[i] - while n do - util.walk(n, f) - i = i + 1 - n = t[i] - end - elseif typ == "function" then - local ok, val = pcall(t) - if ok then - util.walk(val,f) - end - else - f(tostring(t)) - end -end -function util.flatten(ary) - local new = {} - for _,v in ipairs(ary) do - if type(v) == "table" then - for _,w in ipairs(util.flatten(v)) do - new[#new + 1] = w - end - else - new[#new + 1] = v - end - end - return new -end -function util.rope_to_string(rope) - local buffer = {} - util.walk(rope, function(x) buffer[#buffer + 1] = x end) - return table.concat(buffer) -end -function util.rope_last(rope) - if #rope == 0 then - return nil - else - local l = rope[#rope] - if type(l) == "table" then - return util.rope_last(l) - else - return l - end - end -end -function util.intersperse(ary, x) - local new = {} - local l = #ary - for i,v in ipairs(ary) do - local n = #new - new[n + 1] = v - if i ~= l then - new[n + 2] = x - end - end - return new -end -function util.map(ary, f) - local new = {} - for i,v in ipairs(ary) do - new[i] = f(v) - end - return new -end -function util.escaper(char_escapes, string_escapes) - local char_escapes_list = "" - for i,_ in pairs(char_escapes) do - char_escapes_list = char_escapes_list .. i - end - local escapable = S(char_escapes_list) / char_escapes - if string_escapes then - for k,v in pairs(string_escapes) do - escapable = P(k) / v + escapable - end - end - local escape_string = Cs((escapable + any)^0) - return function(s) - return lpeg.match(escape_string, s) - end -end -function util.pathname(dir, file) - if #dir == 0 then - return file - else - return dir .. "/" .. file - end -end -M.writer = {} -function M.writer.new(options) - local self = {} - options = options or {} - setmetatable(options, { __index = function (_, key) - return defaultOptions[key] end }) - self.suffix = ".tex" - self.space = " " - self.nbsp = "\\markdownRendererNbsp{}" - function self.plain(s) - return s - end - function self.paragraph(s) - return s - end - function self.pack(name) - return [[\input"]] .. name .. [["\relax]] - end - self.interblocksep = "\\markdownRendererInterblockSeparator\n{}" - self.eof = [[\relax]] - self.linebreak = "\\markdownRendererLineBreak\n{}" - self.ellipsis = "\\markdownRendererEllipsis{}" - self.hrule = "\\markdownRendererHorizontalRule{}" - local escaped_chars = { - ["{"] = "\\markdownRendererLeftBrace{}", - ["}"] = "\\markdownRendererRightBrace{}", - ["$"] = "\\markdownRendererDollarSign{}", - ["%"] = "\\markdownRendererPercentSign{}", - ["&"] = "\\markdownRendererAmpersand{}", - ["_"] = "\\markdownRendererUnderscore{}", - ["#"] = "\\markdownRendererHash{}", - ["^"] = "\\markdownRendererCircumflex{}", - ["\\"] = "\\markdownRendererBackslash{}", - ["~"] = "\\markdownRendererTilde{}", - ["|"] = "\\markdownRendererPipe{}", } - local escaped_minimal_chars = { - ["{"] = "\\markdownRendererLeftBrace{}", - ["}"] = "\\markdownRendererRightBrace{}", - ["%"] = "\\markdownRendererPercentSign{}", - ["\\"] = "\\markdownRendererBackslash{}", } - local escaped_minimal_strings = { - ["^^"] = "\\markdownRendererCircumflex\\markdownRendererCircumflex ", } - local escape = util.escaper(escaped_chars) - local escape_minimal = util.escaper(escaped_minimal_chars, - escaped_minimal_strings) - if options.hybrid then - self.string = function(s) return s end - self.uri = function(u) return u end - else - self.string = escape - self.uri = escape_minimal - end - function self.code(s) - return {"\\markdownRendererCodeSpan{",escape(s),"}"} - end - function self.link(lab,src,tit) - return {"\\markdownRendererLink{",lab,"}", - "{",self.string(src),"}", - "{",self.uri(src),"}", - "{",self.string(tit or ""),"}"} - end - function self.image(lab,src,tit) - return {"\\markdownRendererImage{",lab,"}", - "{",self.string(src),"}", - "{",self.uri(src),"}", - "{",self.string(tit or ""),"}"} - end - local function ulitem(s) - return {"\\markdownRendererUlItem ",s, - "\\markdownRendererUlItemEnd "} - end - - function self.bulletlist(items,tight) - local buffer = {} - for _,item in ipairs(items) do - buffer[#buffer + 1] = ulitem(item) - end - local contents = util.intersperse(buffer,"\n") - if tight and options.tightLists then - return {"\\markdownRendererUlBeginTight\n",contents, - "\n\\markdownRendererUlEndTight "} - else - return {"\\markdownRendererUlBegin\n",contents, - "\n\\markdownRendererUlEnd "} - end - end - local function olitem(s,num) - if num ~= nil then - return {"\\markdownRendererOlItemWithNumber{",num,"}",s, - "\\markdownRendererOlItemEnd "} - else - return {"\\markdownRendererOlItem ",s, - "\\markdownRendererOlItemEnd "} - end - end - - function self.orderedlist(items,tight,startnum) - local buffer = {} - local num = startnum - for _,item in ipairs(items) do - buffer[#buffer + 1] = olitem(item,num) - if num ~= nil then - num = num + 1 - end - end - local contents = util.intersperse(buffer,"\n") - if tight and options.tightLists then - return {"\\markdownRendererOlBeginTight\n",contents, - "\n\\markdownRendererOlEndTight "} - else - return {"\\markdownRendererOlBegin\n",contents, - "\n\\markdownRendererOlEnd "} - end - end - local function dlitem(term, defs) - local retVal = {"\\markdownRendererDlItem{",term,"}"} - for _, def in ipairs(defs) do - retVal[#retVal+1] = {"\\markdownRendererDlDefinitionBegin ",def, - "\\markdownRendererDlDefinitionEnd "} - end - retVal[#retVal+1] = "\\markdownRendererDlItemEnd " - return retVal - end - - function self.definitionlist(items,tight) - local buffer = {} - for _,item in ipairs(items) do - buffer[#buffer + 1] = dlitem(item.term, item.definitions) - end - if tight and options.tightLists then - return {"\\markdownRendererDlBeginTight\n", buffer, - "\n\\markdownRendererDlEndTight"} - else - return {"\\markdownRendererDlBegin\n", buffer, - "\n\\markdownRendererDlEnd"} - end - end - function self.emphasis(s) - return {"\\markdownRendererEmphasis{",s,"}"} - end - function self.strong(s) - return {"\\markdownRendererStrongEmphasis{",s,"}"} - end - function self.blockquote(s) - return {"\\markdownRendererBlockQuoteBegin\n",s, - "\n\\markdownRendererBlockQuoteEnd "} - end - function self.verbatim(s) - local name = util.cache(options.cacheDir, s, nil, nil, ".verbatim") - return {"\\markdownRendererInputVerbatim{",name,"}"} - end - function self.fencedCode(i, s) - local name = util.cache(options.cacheDir, s, nil, nil, ".verbatim") - return {"\\markdownRendererInputFencedCode{",name,"}{",i,"}"} - end - function self.heading(s,level) - local cmd - if level == 1 then - cmd = "\\markdownRendererHeadingOne" - elseif level == 2 then - cmd = "\\markdownRendererHeadingTwo" - elseif level == 3 then - cmd = "\\markdownRendererHeadingThree" - elseif level == 4 then - cmd = "\\markdownRendererHeadingFour" - elseif level == 5 then - cmd = "\\markdownRendererHeadingFive" - elseif level == 6 then - cmd = "\\markdownRendererHeadingSix" - else - cmd = "" - end - return {cmd,"{",s,"}"} - end - function self.note(s) - return {"\\markdownRendererFootnote{",s,"}"} - end - function self.citations(text_cites, cites) - local buffer = {"\\markdownRenderer", text_cites and "TextCite" or "Cite", - "{", #cites, "}"} - for _,cite in ipairs(cites) do - buffer[#buffer+1] = {cite.suppress_author and "-" or "+", "{", - cite.prenote or "", "}{", cite.postnote or "", "}{", cite.name, "}"} - end - return buffer - end - - return self -end -M.reader = {} -function M.reader.new(writer, options) - local self = {} - options = options or {} - setmetatable(options, { __index = function (_, key) - return defaultOptions[key] end }) - local function normalize_tag(tag) - return unicode.utf8.lower( - gsub(util.rope_to_string(tag), "[ \n\r\t]+", " ")) - end - local expandtabs - if options.preserveTabs then - expandtabs = function(s) return s end - else - expandtabs = function(s) - if s:find("\t") then - return s:gsub("[^\n]*", util.expand_tabs_in_line) - else - return s - end - end - end - local syntax - local blocks_toplevel - local blocks - local inlines, inlines_no_link, inlines_nbsp - - local function create_parser(name, grammar) - return function(str) - local res = lpeg.match(grammar(), str) - if res == nil then - error(format("%s failed on:\n%s", name, str:sub(1,20))) - else - return res - end - end - end - - local parse_blocks = create_parser("parse_blocks", - function() return blocks end) - local parse_blocks_toplevel = create_parser("parse_blocks_toplevel", - function() return blocks_toplevel end) - local parse_inlines = create_parser("parse_inlines", - function() return inlines end) - local parse_inlines_no_link = create_parser("parse_inlines_no_link", - function() return inlines_no_link end) - local parse_inlines_nbsp = create_parser("parse_inlines_nbsp", - function() return inlines_nbsp end) - local percent = P("%") - local at = P("@") - local comma = P(",") - local asterisk = P("*") - local dash = P("-") - local plus = P("+") - local underscore = P("_") - local period = P(".") - local hash = P("#") - local ampersand = P("&") - local backtick = P("`") - local less = P("<") - local more = P(">") - local space = P(" ") - local squote = P("'") - local dquote = P('"') - local lparent = P("(") - local rparent = P(")") - local lbracket = P("[") - local rbracket = P("]") - local circumflex = P("^") - local slash = P("/") - local equal = P("=") - local colon = P(":") - local semicolon = P(";") - local exclamation = P("!") - local tilde = P("~") - - local digit = R("09") - local hexdigit = R("09","af","AF") - local letter = R("AZ","az") - local alphanumeric = R("AZ","az","09") - local keyword = letter * alphanumeric^0 - local internal_punctuation = S(":;,.#$%&-+?<>~/") - - local doubleasterisks = P("**") - local doubleunderscores = P("__") - local fourspaces = P(" ") - - local any = P(1) - local fail = any - 1 - local always = P("") - - local escapable = S("\\`*_{}[]()+_.!<>#-~:^@;") - - local anyescaped = P("\\") / "" * escapable - + any - - local tab = P("\t") - local spacechar = S("\t ") - local spacing = S(" \n\r\t") - local newline = P("\n") - local nonspacechar = any - spacing - local tightblocksep = P("\001") - - local specialchar = S("*_`&[]<!\\.@-") - - local normalchar = any - - (specialchar + spacing + tightblocksep) - local optionalspace = spacechar^0 - local eof = - any - local nonindentspace = space^-3 * - spacechar - local indent = space^-3 * tab - + fourspaces / "" - local linechar = P(1 - newline) - - local blankline = optionalspace * newline / "\n" - local blanklines = blankline^0 - local skipblanklines = (optionalspace * newline)^0 - local indentedline = indent /"" * C(linechar^1 * newline^-1) - local optionallyindentedline = indent^-1 /"" * C(linechar^1 * newline^-1) - local sp = spacing^0 - local spnl = optionalspace * (newline * optionalspace)^-1 - local line = linechar^0 * newline - + linechar^1 * eof - local nonemptyline = line - blankline - - local chunk = line * (optionallyindentedline - blankline)^0 - - -- block followed by 0 or more optionally - -- indented blocks with first line indented. - local function indented_blocks(bl) - return Cs( bl - * (blankline^1 * indent * -blankline * bl)^0 - * (blankline^1 + eof) ) - end - local bulletchar = C(plus + asterisk + dash) - - local bullet = ( Cg(bulletchar, "bulletchar") * #spacing * (tab + space^-3) - + space * Cg(bulletchar, "bulletchar") * #spacing * (tab + space^-2) - + space * space * Cg(bulletchar, "bulletchar") * #spacing * (tab + space^-1) - + space * space * space * Cg(bulletchar, "bulletchar") * #spacing - ) - - if options.hashEnumerators then - dig = digit + hash - else - dig = digit - end - - local enumerator = C(dig^3 * period) * #spacing - + C(dig^2 * period) * #spacing * (tab + space^1) - + C(dig * period) * #spacing * (tab + space^-2) - + space * C(dig^2 * period) * #spacing - + space * C(dig * period) * #spacing * (tab + space^-1) - + space * space * C(dig^1 * period) * #spacing - local openticks = Cg(backtick^1, "ticks") - - local function captures_equal_length(s,i,a,b) - return #a == #b and i - end - - local closeticks = space^-1 * - Cmt(C(backtick^1) * Cb("ticks"), captures_equal_length) - - local intickschar = (any - S(" \n\r`")) - + (newline * -blankline) - + (space - closeticks) - + (backtick^1 - closeticks) - - local inticks = openticks * space^-1 * C(intickschar^0) * closeticks - local function captures_geq_length(s,i,a,b) - return #a >= #b and i - end - - local infostring = (linechar - (backtick + space^1 * (newline + eof)))^0 - - local fenceindent - local function fencehead(char) - return C(nonindentspace) / function(s) fenceindent = #s end - * Cg(char^3, "fencelength") - * optionalspace * C(infostring) * optionalspace - * (newline + eof) - end - - local function fencetail(char) - return nonindentspace - * Cmt(C(char^3) * Cb("fencelength"), - captures_geq_length) - * optionalspace * (newline + eof) - + eof - end - - local function fencedline(char) - return C(line - fencetail(char)) - / function(s) - return s:gsub("^" .. string.rep(" ?", - fenceindent), "") - end - end - local leader = space^-3 - - -- in balanced brackets, parentheses, quotes: - local bracketed = P{ lbracket - * ((anyescaped - (lbracket + rbracket - + blankline^2)) + V(1))^0 - * rbracket } - - local inparens = P{ lparent - * ((anyescaped - (lparent + rparent - + blankline^2)) + V(1))^0 - * rparent } - - local squoted = P{ squote * alphanumeric - * ((anyescaped - (squote + blankline^2)) - + V(1))^0 - * squote } - - local dquoted = P{ dquote * alphanumeric - * ((anyescaped - (dquote + blankline^2)) - + V(1))^0 - * dquote } - - -- bracketed 'tag' for markdown links, allowing nested brackets: - local tag = lbracket - * Cs((alphanumeric^1 - + bracketed - + inticks - + (anyescaped - (rbracket + blankline^2)))^0) - * rbracket - - -- url for markdown links, allowing balanced parentheses: - local url = less * Cs((anyescaped-more)^0) * more - + Cs((inparens + (anyescaped-spacing-rparent))^1) - - -- quoted text possibly with nested quotes: - local title_s = squote * Cs(((anyescaped-squote) + squoted)^0) * - squote - - local title_d = dquote * Cs(((anyescaped-dquote) + dquoted)^0) * - dquote - - local title_p = lparent - * Cs((inparens + (anyescaped-rparent))^0) - * rparent - - local title = title_d + title_s + title_p - - local optionaltitle = spnl * title * spacechar^0 - + Cc("") - local citation_name = Cs(dash^-1) * at - * Cs(alphanumeric - * (alphanumeric + internal_punctuation - - comma - semicolon)^0) - - local citation_body_prenote - = Cs((alphanumeric^1 - + bracketed - + inticks - + (anyescaped - - (rbracket + blankline^2)) - - (spnl * dash^-1 * at))^0) - - local citation_body_postnote - = Cs((alphanumeric^1 - + bracketed - + inticks - + (anyescaped - - (rbracket + semicolon + blankline^2)) - - (spnl * rbracket))^0) - - local citation_body_chunk - = citation_body_prenote - * spnl * citation_name - * (comma * spnl)^-1 - * citation_body_postnote - - local citation_body = citation_body_chunk - * (semicolon * spnl * citation_body_chunk)^0 - - local citation_headless_body_postnote - = Cs((alphanumeric^1 - + bracketed - + inticks - + (anyescaped - - (rbracket + at + semicolon + blankline^2)) - - (spnl * rbracket))^0) - - local citation_headless_body - = citation_headless_body_postnote - * (sp * semicolon * spnl * citation_body_chunk)^0 - local rawnotes = {} - - local function strip_first_char(s) - return s:sub(2) - end - - -- like indirect_link - local function lookup_note(ref) - return function() - local found = rawnotes[normalize_tag(ref)] - if found then - return writer.note(parse_blocks_toplevel(found)) - else - return {"[", parse_inlines("^" .. ref), "]"} - end - end - end - - local function register_note(ref,rawnote) - rawnotes[normalize_tag(ref)] = rawnote - return "" - end - - local RawNoteRef = #(lbracket * circumflex) * tag / strip_first_char - - local NoteRef = RawNoteRef / lookup_note - - local NoteBlock - - if options.footnotes then - NoteBlock = leader * RawNoteRef * colon * spnl * - indented_blocks(chunk) / register_note - else - NoteBlock = fail - end - -- List of references defined in the document - local references - - -- add a reference to the list - local function register_link(tag,url,title) - references[normalize_tag(tag)] = { url = url, title = title } - return "" - end - - -- parse a reference definition: [foo]: /bar "title" - local define_reference_parser = - leader * tag * colon * spacechar^0 * url * optionaltitle * blankline^1 - - -- lookup link reference and return either - -- the link or nil and fallback text. - local function lookup_reference(label,sps,tag) - local tagpart - if not tag then - tag = label - tagpart = "" - elseif tag == "" then - tag = label - tagpart = "[]" - else - tagpart = {"[", parse_inlines(tag), "]"} - end - if sps then - tagpart = {sps, tagpart} - end - local r = references[normalize_tag(tag)] - if r then - return r - else - return nil, {"[", parse_inlines(label), "]", tagpart} - end - end - - -- lookup link reference and return a link, if the reference is found, - -- or a bracketed label otherwise. - local function indirect_link(label,sps,tag) - return function() - local r,fallback = lookup_reference(label,sps,tag) - if r then - return writer.link(parse_inlines_no_link(label), r.url, r.title) - else - return fallback - end - end - end - - -- lookup image reference and return an image, if the reference is found, - -- or a bracketed label otherwise. - local function indirect_image(label,sps,tag) - return function() - local r,fallback = lookup_reference(label,sps,tag) - if r then - return writer.image(writer.string(label), r.url, r.title) - else - return {"!", fallback} - end - end - end - local bqstart = more - local headerstart = hash - + (line * (equal^1 + dash^1) * optionalspace * newline) - local fencestart = fencehead(backtick) + fencehead(tilde) - - if options.blankBeforeBlockquote then - bqstart = fail - end - - if options.blankBeforeHeading then - headerstart = fail - end - - if not options.fencedCode or options.blankBeforeCodeFence then - fencestart = fail - end - local Inline = V("Inline") - - local Str = normalchar^1 / writer.string - - local Symbol = (specialchar - tightblocksep) / writer.string - local Ellipsis = P("...") / writer.ellipsis - - local Smart = Ellipsis - local Code = inticks / writer.code - local Endline = newline * -( -- newline, but not before... - blankline -- paragraph break - + tightblocksep -- nested list - + eof -- end of document - + bqstart - + headerstart - + fencestart - ) * spacechar^0 / writer.space - - local Space = spacechar^2 * Endline / writer.linebreak - + spacechar^1 * Endline^-1 * eof / "" - + spacechar^1 * Endline^-1 * optionalspace / writer.space - - local NonbreakingEndline - = newline * -( -- newline, but not before... - blankline -- paragraph break - + tightblocksep -- nested list - + eof -- end of document - + bqstart - + headerstart - + fencestart - ) * spacechar^0 / writer.nbsp - - local NonbreakingSpace - = spacechar^2 * Endline / writer.linebreak - + spacechar^1 * Endline^-1 * eof / "" - + spacechar^1 * Endline^-1 * optionalspace / writer.nbsp - - -- parse many p between starter and ender - local function between(p, starter, ender) - local ender2 = B(nonspacechar) * ender - return (starter * #nonspacechar * Ct(p * (p - ender2)^0) * ender2) - end - local Strong = ( between(Inline, doubleasterisks, doubleasterisks) - + between(Inline, doubleunderscores, doubleunderscores) - ) / writer.strong - - local Emph = ( between(Inline, asterisk, asterisk) - + between(Inline, underscore, underscore) - ) / writer.emphasis - local urlchar = anyescaped - newline - more - - local AutoLinkUrl = less - * C(alphanumeric^1 * P("://") * urlchar^1) - * more - / function(url) - return writer.link(writer.string(url), url) - end - - local AutoLinkEmail = less - * C((alphanumeric + S("-._+"))^1 * P("@") * urlchar^1) - * more - / function(email) - return writer.link(writer.string(email), - "mailto:"..email) - end - - local DirectLink = (tag / parse_inlines_no_link) -- no links inside links - * spnl - * lparent - * (url + Cc("")) -- link can be empty [foo]() - * optionaltitle - * rparent - / writer.link - - local IndirectLink = tag * (C(spnl) * tag)^-1 / indirect_link - - -- parse a link or image (direct or indirect) - local Link = DirectLink + IndirectLink - local DirectImage = exclamation - * (tag / parse_inlines) - * spnl - * lparent - * (url + Cc("")) -- link can be empty [foo]() - * optionaltitle - * rparent - / writer.image - - local IndirectImage = exclamation * tag * (C(spnl) * tag)^-1 / - indirect_image - - local Image = DirectImage + IndirectImage - -- avoid parsing long strings of * or _ as emph/strong - local UlOrStarLine = asterisk^4 + underscore^4 / writer.string - - local EscapedChar = S("\\") * C(escapable) / writer.string - local function citations(text_cites, raw_cites) - local function normalize(str) - if str == "" then - str = nil - else - str = (options.citationNbsps and parse_inlines_nbsp or - parse_inlines)(str) - end - return str - end - - local cites = {} - for i = 1,#raw_cites,4 do - cites[#cites+1] = { - prenote = normalize(raw_cites[i]), - suppress_author = raw_cites[i+1] == "-", - name = writer.string(raw_cites[i+2]), - postnote = normalize(raw_cites[i+3]), - } - end - return writer.citations(text_cites, cites) - end - - local TextCitations = Ct(Cc("") - * citation_name - * ((spnl - * lbracket - * citation_headless_body - * rbracket) + Cc(""))) / - function(raw_cites) - return citations(true, raw_cites) - end - - local ParenthesizedCitations - = Ct(lbracket - * citation_body - * rbracket) / - function(raw_cites) - return citations(false, raw_cites) - end - - local Citations = TextCitations + ParenthesizedCitations - local Block = V("Block") - - local Verbatim = Cs( (blanklines - * ((indentedline - blankline))^1)^1 - ) / expandtabs / writer.verbatim - - local TildeFencedCode - = fencehead(tilde) - * Cs(fencedline(tilde)^0) - * fencetail(tilde) - - local BacktickFencedCode - = fencehead(backtick) - * Cs(fencedline(backtick)^0) - * fencetail(backtick) - - local FencedCode = (TildeFencedCode + BacktickFencedCode) - / function(infostring, code) - return writer.fencedCode( - writer.string(infostring), - expandtabs(code)) - end - -- strip off leading > and indents, and run through blocks - local Blockquote = Cs(( - ((leader * more * space^-1)/"" * linechar^0 * newline)^1 - * (-blankline * linechar^1 * newline)^0 - * (blankline^0 / "") - )^1) / parse_blocks_toplevel / writer.blockquote - - local function lineof(c) - return (leader * (P(c) * optionalspace)^3 * (newline * blankline^1 - + newline^-1 * eof)) - end - local HorizontalRule = ( lineof(asterisk) - + lineof(dash) - + lineof(underscore) - ) / writer.hrule - local starter = bullet + enumerator - - -- we use \001 as a separator between a tight list item and a - -- nested list under it. - local NestedList = Cs((optionallyindentedline - starter)^1) - / function(a) return "\001"..a end - - local ListBlockLine = optionallyindentedline - - blankline - (indent^-1 * starter) - - local ListBlock = line * ListBlockLine^0 - - local ListContinuationBlock = blanklines * (indent / "") * ListBlock - - local function TightListItem(starter) - return -HorizontalRule - * (Cs(starter / "" * ListBlock * NestedList^-1) / - parse_blocks) - * -(blanklines * indent) - end - - local function LooseListItem(starter) - return -HorizontalRule - * Cs( starter / "" * ListBlock * Cc("\n") - * (NestedList + ListContinuationBlock^0) - * (blanklines / "\n\n") - ) / parse_blocks - end - - local BulletList = ( Ct(TightListItem(bullet)^1) - * Cc(true) * skipblanklines * -bullet - + Ct(LooseListItem(bullet)^1) - * Cc(false) * skipblanklines ) / - writer.bulletlist - - local function orderedlist(items,tight,startNumber) - if options.startNumber then - startNumber = tonumber(startNumber) or 1 -- fallback for '#' - else - startNumber = nil - end - return writer.orderedlist(items,tight,startNumber) - end - - local OrderedList = Cg(enumerator, "listtype") * - ( Ct(TightListItem(Cb("listtype")) * - TightListItem(enumerator)^0) - * Cc(true) * skipblanklines * -enumerator - + Ct(LooseListItem(Cb("listtype")) * - LooseListItem(enumerator)^0) - * Cc(false) * skipblanklines - ) * Cb("listtype") / orderedlist - - local defstartchar = S("~:") - local defstart = ( defstartchar * #spacing * (tab + space^-3) - + space * defstartchar * #spacing * (tab + space^-2) - + space * space * defstartchar * #spacing * - (tab + space^-1) - + space * space * space * defstartchar * #spacing - ) - - local dlchunk = Cs(line * (indentedline - blankline)^0) - - local function definition_list_item(term, defs, tight) - return { term = parse_inlines(term), definitions = defs } - end - - local DefinitionListItemLoose = C(line) * skipblanklines - * Ct((defstart * - indented_blocks(dlchunk) / - parse_blocks_toplevel)^1) - * Cc(false) - / definition_list_item - - local DefinitionListItemTight = C(line) - * Ct((defstart * dlchunk / - parse_blocks)^1) - * Cc(true) - / definition_list_item - - local DefinitionList = ( Ct(DefinitionListItemLoose^1) * Cc(false) - + Ct(DefinitionListItemTight^1) - * (skipblanklines * - -DefinitionListItemLoose * Cc(true)) - ) / writer.definitionlist - local Reference = define_reference_parser / register_link - local Blank = blankline / "" - + NoteBlock - + Reference - + (tightblocksep / "\n") - local Paragraph = nonindentspace * Ct(Inline^1) * newline - * ( blankline^1 - + #hash - + #(leader * more * space^-1) - ) - / writer.paragraph - - local ToplevelParagraph - = nonindentspace * Ct(Inline^1) * (newline - * ( blankline^1 - + #hash - + #(leader * more * space^-1) - + eof - ) - + eof ) - / writer.paragraph - - local Plain = nonindentspace * Ct(Inline^1) / writer.plain - -- parse Atx heading start and return level - local HeadingStart = #hash * C(hash^-6) * -hash / length - - -- parse setext header ending and return level - local HeadingLevel = equal^1 * Cc(1) + dash^1 * Cc(2) - - local function strip_atx_end(s) - return s:gsub("[#%s]*\n$","") - end - - -- parse atx header - local AtxHeading = Cg(HeadingStart,"level") - * optionalspace - * (C(line) / strip_atx_end / parse_inlines) - * Cb("level") - / writer.heading - - -- parse setext header - local SetextHeading = #(line * S("=-")) - * Ct(line / parse_inlines) - * HeadingLevel - * optionalspace * newline - / writer.heading - - local Heading = AtxHeading + SetextHeading - syntax = - { "Blocks", - - Blocks = Blank^0 * - Block^-1 * - (Blank^0 / function() - return writer.interblocksep - end * Block)^0 * - Blank^0 * - eof, - - Blank = Blank, - - Block = V("Blockquote") - + V("Verbatim") - + V("FencedCode") - + V("HorizontalRule") - + V("BulletList") - + V("OrderedList") - + V("Heading") - + V("DefinitionList") - + V("Paragraph") - + V("Plain"), - - Blockquote = Blockquote, - Verbatim = Verbatim, - FencedCode = FencedCode, - HorizontalRule = HorizontalRule, - BulletList = BulletList, - OrderedList = OrderedList, - Heading = Heading, - DefinitionList = DefinitionList, - DisplayHtml = DisplayHtml, - Paragraph = Paragraph, - Plain = Plain, - - Inline = V("Str") - + V("Space") - + V("Endline") - + V("UlOrStarLine") - + V("Strong") - + V("Emph") - + V("NoteRef") - + V("Citations") - + V("Link") - + V("Image") - + V("Code") - + V("AutoLinkUrl") - + V("AutoLinkEmail") - + V("EscapedChar") - + V("Smart") - + V("Symbol"), - - Str = Str, - Space = Space, - Endline = Endline, - UlOrStarLine = UlOrStarLine, - Strong = Strong, - Emph = Emph, - NoteRef = NoteRef, - Citations = Citations, - Link = Link, - Image = Image, - Code = Code, - AutoLinkUrl = AutoLinkUrl, - AutoLinkEmail = AutoLinkEmail, - InlineHtml = InlineHtml, - HtmlEntity = HtmlEntity, - EscapedChar = EscapedChar, - Smart = Smart, - Symbol = Symbol, - } - - if not options.definitionLists then - syntax.DefinitionList = fail - end - - if not options.fencedCode then - syntax.FencedCode = fail - end - - if not options.citations then - syntax.Citations = fail - end - - if not options.footnotes then - syntax.NoteRef = fail - end - - if not options.smartEllipses then - syntax.Smart = fail - end - - local blocks_toplevel_t = util.table_copy(syntax) - blocks_toplevel_t.Paragraph = ToplevelParagraph - blocks_toplevel = Ct(blocks_toplevel_t) - - blocks = Ct(syntax) - - local inlines_t = util.table_copy(syntax) - inlines_t[1] = "Inlines" - inlines_t.Inlines = Inline^0 * (spacing^0 * eof / "") - inlines = Ct(inlines_t) - - local inlines_no_link_t = util.table_copy(inlines_t) - inlines_no_link_t.Link = fail - inlines_no_link = Ct(inlines_no_link_t) - - local inlines_nbsp_t = util.table_copy(inlines_t) - inlines_nbsp_t.Endline = NonbreakingEndline - inlines_nbsp_t.Space = NonbreakingSpace - inlines_nbsp = Ct(inlines_nbsp_t) - function self.convert(input) - references = {} - local opt_string = {} - for k,_ in pairs(defaultOptions) do - local v = options[k] - if k ~= "cacheDir" then - opt_string[#opt_string+1] = k .. "=" .. tostring(v) - end - end - table.sort(opt_string) - local salt = table.concat(opt_string, ",") .. "," .. metadata.version - local name = util.cache(options.cacheDir, input, salt, function(input) - return util.rope_to_string(parse_blocks_toplevel(input)) .. writer.eof - end, ".md" .. writer.suffix) - return writer.pack(name) - end - return self -end -function M.new(options) - local writer = M.writer.new(options) - local reader = M.reader.new(writer, options) - return reader.convert -end - -return M diff --git a/markdown.sty b/markdown.sty deleted file mode 100644 index ecaa444..0000000 --- a/markdown.sty +++ /dev/null @@ -1,518 +0,0 @@ -%% -%% This is file `markdown.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% markdown.dtx (with options: `latex') -%% -%% Copyright (C) 2016 Vít Novotný -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either version 1.3 -%% of this license or (at your option) any later version. -%% The latest version of this license is in -%% -%% http://www.latex-project.org/lppl.txt -%% -%% and version 1.3 or later is part of all distributions of LaTeX -%% version 2005/12/01 or later. -%% -%% This work has the LPPL maintenance status `maintained'. -%% The Current Maintainer of this work is Vít Novotný. -%% -%% Send bug reports, requests for additions and questions -%% either to the GitHub issue tracker at -%% -%% https://github.com/Witiko/markdown/issues -%% -%% or to the e-mail address <witiko@mail.muni.cz>. -%% -%% MODIFICATION ADVICE: -%% -%% If you want to customize this file, it is best to make a copy of -%% the source file(s) from which it was produced. Use a different -%% name for your copy(ies) and modify the copy(ies); this will ensure -%% that your modifications do not get overwritten when you install a -%% new release of the standard system. You should also ensure that -%% your modified source file does not generate any modified file with -%% the same name as a standard file. -%% -%% You will also need to produce your own, suitably named, .ins file to -%% control the generation of files from your source file; this file -%% should contain your own preambles for the files it generates, not -%% those in the standard .ins files. -%% -%% The names of the source files used are shown above. -%% -\NeedsTeXFormat{LaTeX2e}% -\newenvironment{markdown}\relax\relax -\newenvironment{markdown*}[1]\relax\relax -\newcommand\markdownSetup[1]{% - \setkeys{markdownOptions}{#1}}% -\RequirePackage{keyval} -\define@key{markdownOptions}{helperScriptFileName}{% - \def\markdownOptionHelperScriptFileName{#1}}% -\define@key{markdownOptions}{inputTempFileName}{% - \def\markdownOptionInputTempFileName{#1}}% -\define@key{markdownOptions}{outputTempFileName}{% - \def\markdownOptionOutputTempFileName{#1}}% -\define@key{markdownOptions}{blankBeforeBlockquote}[true]{% - \def\markdownOptionBlankBeforeBlockquote{#1}}% -\define@key{markdownOptions}{blankBeforeCodeFence}[true]{% - \def\markdownOptionBlankBeforeCodeFence{#1}}% -\define@key{markdownOptions}{blankBeforeHeading}[true]{% - \def\markdownOptionBlankBeforeHeading{#1}}% -\define@key{markdownOptions}{citations}[true]{% - \def\markdownOptionCitations{#1}}% -\define@key{markdownOptions}{citationNbsps}[true]{% - \def\markdownOptionCitationNbsps{#1}}% -\define@key{markdownOptions}{cacheDir}{% - \def\markdownOptionCacheDir{#1}}% -\define@key{markdownOptions}{definitionLists}[true]{% - \def\markdownOptionDefinitionLists{#1}}% -\define@key{markdownOptions}{footnotes}[true]{% - \def\markdownOptionFootnotes{#1}}% -\define@key{markdownOptions}{fencedCode}[true]{% - \def\markdownOptionFencedCode{#1}}% -\define@key{markdownOptions}{hashEnumerators}[true]{% - \def\markdownOptionHashEnumerators{#1}}% -\define@key{markdownOptions}{hybrid}[true]{% - \def\markdownOptionHybrid{#1}}% -\define@key{markdownOptions}{preserveTabs}[true]{% - \def\markdownOptionPreserveTabs{#1}}% -\define@key{markdownOptions}{smartEllipses}[true]{% - \def\markdownOptionSmartEllipses{#1}}% -\define@key{markdownOptions}{startNumber}[true]{% - \def\markdownOptionStartNumber{#1}}% -\define@key{markdownOptions}{tightLists}[true]{% - \def\markdownOptionTightLists{#1}}% -\define@key{markdownRenderers}{interblockSeparator}{% - \renewcommand\markdownRendererInterblockSeparator{#1}}% -\define@key{markdownRenderers}{lineBreak}{% - \renewcommand\markdownRendererLineBreak{#1}}% -\define@key{markdownRenderers}{ellipsis}{% - \renewcommand\markdownRendererEllipsis{#1}}% -\define@key{markdownRenderers}{nbsp}{% - \renewcommand\markdownRendererNbsp{#1}}% -\define@key{markdownRenderers}{leftBrace}{% - \renewcommand\markdownRendererLeftBrace{#1}}% -\define@key{markdownRenderers}{rightBrace}{% - \renewcommand\markdownRendererRightBrace{#1}}% -\define@key{markdownRenderers}{dollarSign}{% - \renewcommand\markdownRendererDollarSign{#1}}% -\define@key{markdownRenderers}{percentSign}{% - \renewcommand\markdownRendererPercentSign{#1}}% -\define@key{markdownRenderers}{ampersand}{% - \renewcommand\markdownRendererAmpersand{#1}}% -\define@key{markdownRenderers}{underscore}{% - \renewcommand\markdownRendererUnderscore{#1}}% -\define@key{markdownRenderers}{hash}{% - \renewcommand\markdownRendererHash{#1}}% -\define@key{markdownRenderers}{circumflex}{% - \renewcommand\markdownRendererCircumflex{#1}}% -\define@key{markdownRenderers}{backslash}{% - \renewcommand\markdownRendererBackslash{#1}}% -\define@key{markdownRenderers}{tilde}{% - \renewcommand\markdownRendererTilde{#1}}% -\define@key{markdownRenderers}{pipe}{% - \renewcommand\markdownRendererPipe{#1}}% -\define@key{markdownRenderers}{codeSpan}{% - \renewcommand\markdownRendererCodeSpan[1]{#1}}% -\define@key{markdownRenderers}{link}{% - \renewcommand\markdownRendererLink[4]{#1}}% -\define@key{markdownRenderers}{image}{% - \renewcommand\markdownRendererImage[4]{#1}}% -\define@key{markdownRenderers}{ulBegin}{% - \renewcommand\markdownRendererUlBegin{#1}}% -\define@key{markdownRenderers}{ulBeginTight}{% - \renewcommand\markdownRendererUlBeginTight{#1}}% -\define@key{markdownRenderers}{ulItem}{% - \renewcommand\markdownRendererUlItem{#1}}% -\define@key{markdownRenderers}{ulItemEnd}{% - \renewcommand\markdownRendererUlItemEnd{#1}}% -\define@key{markdownRenderers}{ulEnd}{% - \renewcommand\markdownRendererUlEnd{#1}}% -\define@key{markdownRenderers}{ulEndTight}{% - \renewcommand\markdownRendererUlEndTight{#1}}% -\define@key{markdownRenderers}{olBegin}{% - \renewcommand\markdownRendererOlBegin{#1}}% -\define@key{markdownRenderers}{olBeginTight}{% - \renewcommand\markdownRendererOlBeginTight{#1}}% -\define@key{markdownRenderers}{olItem}{% - \renewcommand\markdownRendererOlItem{#1}}% -\define@key{markdownRenderers}{olItemWithNumber}{% - \renewcommand\markdownRendererOlItemWithNumber[1]{#1}}% -\define@key{markdownRenderers}{olItemEnd}{% - \renewcommand\markdownRendererOlItemEnd{#1}}% -\define@key{markdownRenderers}{olEnd}{% - \renewcommand\markdownRendererOlEnd{#1}}% -\define@key{markdownRenderers}{olEndTight}{% - \renewcommand\markdownRendererOlEndTight{#1}}% -\define@key{markdownRenderers}{dlBegin}{% - \renewcommand\markdownRendererDlBegin{#1}}% -\define@key{markdownRenderers}{dlBeginTight}{% - \renewcommand\markdownRendererDlBeginTight{#1}}% -\define@key{markdownRenderers}{dlItem}{% - \renewcommand\markdownRendererDlItem[1]{#1}}% -\define@key{markdownRenderers}{dlItemEnd}{% - \renewcommand\markdownRendererDlItemEnd{#1}}% -\define@key{markdownRenderers}{dlDefinitionBegin}{% - \renewcommand\markdownRendererDlDefinitionBegin{#1}}% -\define@key{markdownRenderers}{dlDefinitionEnd}{% - \renewcommand\markdownRendererDlDefinitionEnd{#1}}% -\define@key{markdownRenderers}{dlEnd}{% - \renewcommand\markdownRendererDlEnd{#1}}% -\define@key{markdownRenderers}{dlEndTight}{% - \renewcommand\markdownRendererDlEndTight{#1}}% -\define@key{markdownRenderers}{emphasis}{% - \renewcommand\markdownRendererEmphasis[1]{#1}}% -\define@key{markdownRenderers}{strongEmphasis}{% - \renewcommand\markdownRendererStrongEmphasis[1]{#1}}% -\define@key{markdownRenderers}{blockQuoteBegin}{% - \renewcommand\markdownRendererBlockQuoteBegin{#1}}% -\define@key{markdownRenderers}{blockQuoteEnd}{% - \renewcommand\markdownRendererBlockQuoteEnd{#1}}% -\define@key{markdownRenderers}{inputVerbatim}{% - \renewcommand\markdownRendererInputVerbatim[1]{#1}}% -\define@key{markdownRenderers}{inputFencedCode}{% - \renewcommand\markdownRendererInputFencedCode[2]{#1}}% -\define@key{markdownRenderers}{headingOne}{% - \renewcommand\markdownRendererHeadingOne[1]{#1}}% -\define@key{markdownRenderers}{headingTwo}{% - \renewcommand\markdownRendererHeadingTwo[1]{#1}}% -\define@key{markdownRenderers}{headingThree}{% - \renewcommand\markdownRendererHeadingThree[1]{#1}}% -\define@key{markdownRenderers}{headingFour}{% - \renewcommand\markdownRendererHeadingFour[1]{#1}}% -\define@key{markdownRenderers}{headingFive}{% - \renewcommand\markdownRendererHeadingFive[1]{#1}}% -\define@key{markdownRenderers}{headingSix}{% - \renewcommand\markdownRendererHeadingSix[1]{#1}}% -\define@key{markdownRenderers}{horizontalRule}{% - \renewcommand\markdownRendererHorizontalRule{#1}}% -\define@key{markdownRenderers}{footnote}{% - \renewcommand\markdownRendererFootnote[1]{#1}}% -\define@key{markdownRenderers}{cite}{% - \renewcommand\markdownRendererCite[1]{#1}}% -\define@key{markdownRenderers}{textCite}{% - \renewcommand\markdownRendererTextCite[1]{#1}}% -\define@key{markdownRendererPrototypes}{interblockSeparator}{% - \renewcommand\markdownRendererInterblockSeparatorPrototype{#1}}% -\define@key{markdownRendererPrototypes}{lineBreak}{% - \renewcommand\markdownRendererLineBreakPrototype{#1}}% -\define@key{markdownRendererPrototypes}{ellipsis}{% - \renewcommand\markdownRendererEllipsisPrototype{#1}}% -\define@key{markdownRendererPrototypes}{nbsp}{% - \renewcommand\markdownRendererNbspPrototype{#1}}% -\define@key{markdownRendererPrototypes}{leftBrace}{% - \renewcommand\markdownRendererLeftBracePrototype{#1}}% -\define@key{markdownRendererPrototypes}{rightBrace}{% - \renewcommand\markdownRendererRightBracePrototype{#1}}% -\define@key{markdownRendererPrototypes}{dollarSign}{% - \renewcommand\markdownRendererDollarSignPrototype{#1}}% -\define@key{markdownRendererPrototypes}{percentSign}{% - \renewcommand\markdownRendererPercentSignPrototype{#1}}% -\define@key{markdownRendererPrototypes}{ampersand}{% - \renewcommand\markdownRendererAmpersandPrototype{#1}}% -\define@key{markdownRendererPrototypes}{underscore}{% - \renewcommand\markdownRendererUnderscorePrototype{#1}}% -\define@key{markdownRendererPrototypes}{hash}{% - \renewcommand\markdownRendererHashPrototype{#1}}% -\define@key{markdownRendererPrototypes}{circumflex}{% - \renewcommand\markdownRendererCircumflexPrototype{#1}}% -\define@key{markdownRendererPrototypes}{backslash}{% - \renewcommand\markdownRendererBackslashPrototype{#1}}% -\define@key{markdownRendererPrototypes}{tilde}{% - \renewcommand\markdownRendererTildePrototype{#1}}% -\define@key{markdownRendererPrototypes}{pipe}{% - \renewcommand\markdownRendererPipePrototype{#1}}% -\define@key{markdownRendererPrototypes}{codeSpan}{% - \renewcommand\markdownRendererCodeSpanPrototype[1]{#1}}% -\define@key{markdownRendererPrototypes}{link}{% - \renewcommand\markdownRendererLinkPrototype[4]{#1}}% -\define@key{markdownRendererPrototypes}{image}{% - \renewcommand\markdownRendererImagePrototype[4]{#1}}% -\define@key{markdownRendererPrototypes}{ulBegin}{% - \renewcommand\markdownRendererUlBeginPrototype{#1}}% -\define@key{markdownRendererPrototypes}{ulBeginTight}{% - \renewcommand\markdownRendererUlBeginTightPrototype{#1}}% -\define@key{markdownRendererPrototypes}{ulItem}{% - \renewcommand\markdownRendererUlItemPrototype{#1}}% -\define@key{markdownRendererPrototypes}{ulItemEnd}{% - \renewcommand\markdownRendererUlItemEndPrototype{#1}}% -\define@key{markdownRendererPrototypes}{ulEnd}{% - \renewcommand\markdownRendererUlEndPrototype{#1}}% -\define@key{markdownRendererPrototypes}{ulEndTight}{% - \renewcommand\markdownRendererUlEndTightPrototype{#1}}% -\define@key{markdownRendererPrototypes}{olBegin}{% - \renewcommand\markdownRendererOlBeginPrototype{#1}}% -\define@key{markdownRendererPrototypes}{olBeginTight}{% - \renewcommand\markdownRendererOlBeginTightPrototype{#1}}% -\define@key{markdownRendererPrototypes}{olItem}{% - \renewcommand\markdownRendererOlItemPrototype{#1}}% -\define@key{markdownRendererPrototypes}{olItemWithNumber}{% - \renewcommand\markdownRendererOlItemWithNumberPrototype[1]{#1}}% -\define@key{markdownRendererPrototypes}{olItemEnd}{% - \renewcommand\markdownRendererOlItemEndPrototype{#1}}% -\define@key{markdownRendererPrototypes}{olEnd}{% - \renewcommand\markdownRendererOlEndPrototype{#1}}% -\define@key{markdownRendererPrototypes}{olEndTight}{% - \renewcommand\markdownRendererOlEndTightPrototype{#1}}% -\define@key{markdownRendererPrototypes}{dlBegin}{% - \renewcommand\markdownRendererDlBeginPrototype{#1}}% -\define@key{markdownRendererPrototypes}{dlBeginTight}{% - \renewcommand\markdownRendererDlBeginTightPrototype{#1}}% -\define@key{markdownRendererPrototypes}{dlItem}{% - \renewcommand\markdownRendererDlItemPrototype[1]{#1}}% -\define@key{markdownRendererPrototypes}{dlItemEnd}{% - \renewcommand\markdownRendererDlItemEndPrototype{#1}}% -\define@key{markdownRendererPrototypes}{dlDefinitionBegin}{% - \renewcommand\markdownRendererDlDefinitionBeginPrototype{#1}}% -\define@key{markdownRendererPrototypes}{dlDefinitionEnd}{% - \renewcommand\markdownRendererDlDefinitionEndPrototype{#1}}% -\define@key{markdownRendererPrototypes}{dlEnd}{% - \renewcommand\markdownRendererDlEndPrototype{#1}}% -\define@key{markdownRendererPrototypes}{dlEndTight}{% - \renewcommand\markdownRendererDlEndTightPrototype{#1}}% -\define@key{markdownRendererPrototypes}{emphasis}{% - \renewcommand\markdownRendererEmphasisPrototype[1]{#1}}% -\define@key{markdownRendererPrototypes}{strongEmphasis}{% - \renewcommand\markdownRendererStrongEmphasisPrototype[1]{#1}}% -\define@key{markdownRendererPrototypes}{blockQuoteBegin}{% - \renewcommand\markdownRendererBlockQuoteBeginPrototype{#1}}% -\define@key{markdownRendererPrototypes}{blockQuoteEnd}{% - \renewcommand\markdownRendererBlockQuoteEndPrototype{#1}}% -\define@key{markdownRendererPrototypes}{inputVerbatim}{% - \renewcommand\markdownRendererInputVerbatimPrototype[1]{#1}}% -\define@key{markdownRendererPrototypes}{inputFencedCode}{% - \renewcommand\markdownRendererInputFencedCodePrototype[2]{#1}}% -\define@key{markdownRendererPrototypes}{headingOne}{% - \renewcommand\markdownRendererHeadingOnePrototype[1]{#1}}% -\define@key{markdownRendererPrototypes}{headingTwo}{% - \renewcommand\markdownRendererHeadingTwoPrototype[1]{#1}}% -\define@key{markdownRendererPrototypes}{headingThree}{% - \renewcommand\markdownRendererHeadingThreePrototype[1]{#1}}% -\define@key{markdownRendererPrototypes}{headingFour}{% - \renewcommand\markdownRendererHeadingFourPrototype[1]{#1}}% -\define@key{markdownRendererPrototypes}{headingFive}{% - \renewcommand\markdownRendererHeadingFivePrototype[1]{#1}}% -\define@key{markdownRendererPrototypes}{headingSix}{% - \renewcommand\markdownRendererHeadingSixPrototype[1]{#1}}% -\define@key{markdownRendererPrototypes}{horizontalRule}{% - \renewcommand\markdownRendererHorizontalRulePrototype{#1}}% -\define@key{markdownRendererPrototypes}{footnote}{% - \renewcommand\markdownRendererFootnotePrototype[1]{#1}}% -\define@key{markdownRendererPrototypes}{cite}{% - \renewcommand\markdownRendererCitePrototype[1]{#1}}% -\define@key{markdownRendererPrototypes}{textCite}{% - \renewcommand\markdownRendererTextCitePrototype[1]{#1}}% -\input markdown -\def\markdownVersionSpace{ }% -\ProvidesPackage{markdown}[\markdownLastModified\markdownVersionSpace v% - \markdownVersion\markdownVersionSpace markdown renderer]% -\renewcommand\markdownInfo[1]{\PackageInfo{markdown}{#1}}% -\renewcommand\markdownWarning[1]{\PackageWarning{markdown}{#1}}% -\renewcommand\markdownError[2]{\PackageError{markdown}{#1}{#2.}}% -\let\markdownInputPlainTeX\markdownInput -\renewcommand\markdownInput[2][]{% - \begingroup - \markdownSetup{#1}% - \markdownInputPlainTeX{#2}% - \endgroup}% -\renewenvironment{markdown}{% - \markdownReadAndConvert@markdown{}}\relax -\renewenvironment{markdown*}[1]{% - \markdownSetup{#1}% - \markdownReadAndConvert@markdown*}\relax -\begingroup - \catcode`\|=0\catcode`\<=1\catcode`\>=2% - \catcode`\\=12|catcode`|{=12|catcode`|}=12% - |gdef|markdownReadAndConvert@markdown#1<% - |markdownReadAndConvert<\end{markdown#1}>% - <|end<markdown#1>>>% -|endgroup -\DeclareOption*{% - \expandafter\markdownSetup\expandafter{\CurrentOption}}% -\ProcessOptions\relax -\define@key{markdownOptions}{renderers}{% - \setkeys{markdownRenderers}{#1}% - \def\KV@prefix{KV@markdownOptions@}}% -\define@key{markdownOptions}{rendererPrototypes}{% - \setkeys{markdownRendererPrototypes}{#1}% - \def\KV@prefix{KV@markdownOptions@}}% -\RequirePackage{url} -\RequirePackage{graphicx} -\RequirePackage{ifthen} -\ifx\markdownOptionTightLists\undefined - \@ifclassloaded{beamer}{}{ - \RequirePackage{paralist}} -\else - \ifthenelse{\equal{\markdownOptionTightLists}{false}}{}{ - \RequirePackage{paralist}} -\fi -\@ifpackageloaded{paralist}{ - \markdownSetup{rendererPrototypes={ - ulBeginTight = {\begin{compactitem}}, - ulEndTight = {\end{compactitem}}, - olBeginTight = {\begin{compactenum}}, - olEndTight = {\end{compactenum}}, - dlBeginTight = {\begin{compactdesc}}, - dlEndTight = {\end{compactdesc}}}} -}{ - \markdownSetup{rendererPrototypes={ - ulBeginTight = {\markdownRendererUlBegin}, - ulEndTight = {\markdownRendererUlEnd}, - olBeginTight = {\markdownRendererOlBegin}, - olEndTight = {\markdownRendererOlEnd}, - dlBeginTight = {\markdownRendererDlBegin}, - dlEndTight = {\markdownRendererDlEnd}}}} -\RequirePackage{fancyvrb} -\markdownSetup{rendererPrototypes={ - lineBreak = {\\}, - leftBrace = {\textbraceleft}, - rightBrace = {\textbraceright}, - dollarSign = {\textdollar}, - underscore = {\textunderscore}, - circumflex = {\textasciicircum}, - backslash = {\textbackslash}, - tilde = {\textasciitilde}, - pipe = {\textbar}, - codeSpan = {\texttt{#1}}, - link = {#1\footnote{\ifx\empty#4\empty\else#4: - \fi\texttt<\url{#3}\texttt>}}, - image = {\begin{figure} - \begin{center}% - \includegraphics{#3}% - \end{center}% - \ifx\empty#4\empty\else - \caption{#4}% - \fi - \label{fig:#1}% - \end{figure}}, - ulBegin = {\begin{itemize}}, - ulItem = {\item}, - ulEnd = {\end{itemize}}, - olBegin = {\begin{enumerate}}, - olItem = {\item}, - olItemWithNumber = {\item[#1.]}, - olEnd = {\end{enumerate}}, - dlBegin = {\begin{description}}, - dlItem = {\item[#1]}, - dlEnd = {\end{description}}, - emphasis = {\emph{#1}}, - strongEmphasis = {% - \ifx\alert\undefined - \textbf{\emph{#1}}% - \else % Beamer support - \alert{\emph{#1}}% - \fi}, - blockQuoteBegin = {\begin{quotation}}, - blockQuoteEnd = {\end{quotation}}, - inputVerbatim = {\VerbatimInput{#1}}, - inputFencedCode = {% - \ifx\relax#2\relax - \VerbatimInput{#1}% - \else - \ifx\minted@jobname\undefined - \ifx\lst@version\undefined - \markdownRendererInputFencedCode{#1}{}% - \else - \lstinputlisting[language=#2]{#1}% - \fi - \else - \inputminted{#2}{#1}% - \fi - \fi}, - horizontalRule = {\noindent\rule[0.5ex]{\linewidth}{1pt}}, - footnote = {\footnote{#1}}}} - -\ifx\chapter\undefined - \markdownSetup{rendererPrototypes = { - headingOne = {\section{#1}}, - headingTwo = {\subsection{#1}}, - headingThree = {\subsubsection{#1}}, - headingFour = {\paragraph{#1}}, - headingFive = {\subparagraph{#1}}}} -\else - \markdownSetup{rendererPrototypes = { - headingOne = {\chapter{#1}}, - headingTwo = {\section{#1}}, - headingThree = {\subsection{#1}}, - headingFour = {\subsubsection{#1}}, - headingFive = {\paragraph{#1}}, - headingSix = {\subparagraph{#1}}}} -\fi -\newcount\markdownLaTeXCitationsCounter - -\def\markdownLaTeXBasicCitations#1#2#3#4{% - \advance\markdownLaTeXCitationsCounter by 1\relax - \ifx\relax#2\relax\else#2~\fi\cite[#3]{#4}% - \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax - \expandafter\@gobble - \fi\markdownLaTeXBasicCitations} -\let\markdownLaTeXBasicTextCitations\markdownLaTeXBasicCitations - -\def\markdownLaTeXBibLaTeXCitations#1#2#3#4#5{% - \advance\markdownLaTeXCitationsCounter by 1\relax - \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax - \autocites#1[#3][#4]{#5}% - \expandafter\@gobbletwo - \fi\markdownLaTeXBibLaTeXCitations{#1[#3][#4]{#5}}} -\def\markdownLaTeXBibLaTeXTextCitations#1#2#3#4#5{% - \advance\markdownLaTeXCitationsCounter by 1\relax - \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax - \textcites#1[#3][#4]{#5}% - \expandafter\@gobbletwo - \fi\markdownLaTeXBibLaTeXTextCitations{#1[#3][#4]{#5}}} - -\markdownSetup{rendererPrototypes = { - cite = {% - \markdownLaTeXCitationsCounter=1% - \def\markdownLaTeXCitationsTotal{#1}% - \ifx\autocites\undefined - \expandafter - \markdownLaTeXBasicCitations - \else - \expandafter\expandafter\expandafter - \markdownLaTeXBibLaTeXCitations - \expandafter{\expandafter}% - \fi}, - textCite = {% - \markdownLaTeXCitationsCounter=1% - \def\markdownLaTeXCitationsTotal{#1}% - \ifx\textcites\undefined - \expandafter - \markdownLaTeXBasicTextCitations - \else - \expandafter\expandafter\expandafter - \markdownLaTeXBibLaTeXTextCitations - \expandafter{\expandafter}% - \fi}}} -\let\markdownLuaRegisterIBCallbackPrevious - \markdownLuaRegisterIBCallback -\let\markdownLuaUnregisterIBCallbackPrevious - \markdownLuaUnregisterIBCallback -\renewcommand\markdownLuaRegisterIBCallback[1]{% - if luatexbase and luatexbase.add_to_callback then - luatexbase.add_to_callback("process_input_buffer", #1, % - "The markdown input processor") - else - \markdownLuaRegisterIBCallbackPrevious{#1} - end} -\renewcommand\markdownLuaUnregisterIBCallback{% - if luatexbase and luatexbase.add_to_callback then - luatexbase.remove_from_callback("process_input_buffer",% - "The markdown input processor") - else - \markdownLuaUnregisterIBCallbackPrevious; - end} -\newcommand\markdownMakeOther{% - \count0=128\relax - \loop - \catcode\count0=11\relax - \advance\count0 by 1\relax - \ifnum\count0<256\repeat}% -\endinput -%% -%% End of file `markdown.sty'. diff --git a/markdown.tex b/markdown.tex deleted file mode 100644 index ae48119..0000000 --- a/markdown.tex +++ /dev/null @@ -1,519 +0,0 @@ -%% -%% This is file `markdown.tex', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% markdown.dtx (with options: `tex') -%% -%% Copyright (C) 2016 Vít Novotný -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either version 1.3 -%% of this license or (at your option) any later version. -%% The latest version of this license is in -%% -%% http://www.latex-project.org/lppl.txt -%% -%% and version 1.3 or later is part of all distributions of LaTeX -%% version 2005/12/01 or later. -%% -%% This work has the LPPL maintenance status `maintained'. -%% The Current Maintainer of this work is Vít Novotný. -%% -%% Send bug reports, requests for additions and questions -%% either to the GitHub issue tracker at -%% -%% https://github.com/Witiko/markdown/issues -%% -%% or to the e-mail address <witiko@mail.muni.cz>. -%% -%% MODIFICATION ADVICE: -%% -%% If you want to customize this file, it is best to make a copy of -%% the source file(s) from which it was produced. Use a different -%% name for your copy(ies) and modify the copy(ies); this will ensure -%% that your modifications do not get overwritten when you install a -%% new release of the standard system. You should also ensure that -%% your modified source file does not generate any modified file with -%% the same name as a standard file. -%% -%% You will also need to produce your own, suitably named, .ins file to -%% control the generation of files from your source file; this file -%% should contain your own preambles for the files it generates, not -%% those in the standard .ins files. -%% -%% The names of the source files used are shown above. -%% -\def\markdownLastModified{2016/09/15}% -\def\markdownVersion{2.1.3}% -\let\markdownBegin\relax -\let\markdownEnd\relax -\let\markdownInput\relax -\def\markdownOptionHelperScriptFileName{\jobname.markdown.lua}% -\def\markdownOptionInputTempFileName{\jobname.markdown.in}% -\def\markdownOptionOutputTempFileName{\jobname.markdown.out}% -\def\markdownOptionCacheDir{./_markdown_\jobname}% -\let\markdownOptionBlankBeforeBlockquote\undefined -\let\markdownOptionBlankBeforeCodeFence\undefined -\let\markdownOptionBlankBeforeHeading\undefined -\let\markdownOptionCitations\undefined -\let\markdownOptionCitationNbsps\undefined -\let\markdownOptionDefinitionLists\undefined -\let\markdownOptionFootnotes\undefined -\let\markdownOptionFencedCode\undefined -\let\markdownOptionHashEnumerators\undefined -\let\markdownOptionHybrid\undefined -\let\markdownOptionPreserveTabs\undefined -\let\markdownOptionSmartEllipses\undefined -\let\markdownOptionStartNumber\undefined -\let\markdownOptionTightLists\undefined -\def\markdownRendererInterblockSeparator{% - \markdownRendererInterblockSeparatorPrototype}% -\def\markdownRendererLineBreak{% - \markdownRendererLineBreakPrototype}% -\def\markdownRendererEllipsis{% - \markdownRendererEllipsisPrototype}% -\def\markdownRendererNbsp{% - \markdownRendererNbspPrototype}% -\def\markdownRendererLeftBrace{% - \markdownRendererLeftBracePrototype}% -\def\markdownRendererRightBrace{% - \markdownRendererRightBracePrototype}% -\def\markdownRendererDollarSign{% - \markdownRendererDollarSignPrototype}% -\def\markdownRendererPercentSign{% - \markdownRendererPercentSignPrototype}% -\def\markdownRendererAmpersand{% - \markdownRendererAmpersandPrototype}% -\def\markdownRendererUnderscore{% - \markdownRendererUnderscorePrototype}% -\def\markdownRendererHash{% - \markdownRendererHashPrototype}% -\def\markdownRendererCircumflex{% - \markdownRendererCircumflexPrototype}% -\def\markdownRendererBackslash{% - \markdownRendererBackslashPrototype}% -\def\markdownRendererTilde{% - \markdownRendererTildePrototype}% -\def\markdownRendererPipe{% - \markdownRendererPipePrototype}% -\def\markdownRendererCodeSpan{% - \markdownRendererCodeSpanPrototype}% -\def\markdownRendererLink{% - \markdownRendererLinkPrototype}% -\def\markdownRendererImage{% - \markdownRendererImagePrototype}% -\def\markdownRendererUlBegin{% - \markdownRendererUlBeginPrototype}% -\def\markdownRendererUlBeginTight{% - \markdownRendererUlBeginTightPrototype}% -\def\markdownRendererUlItem{% - \markdownRendererUlItemPrototype}% -\def\markdownRendererUlItemEnd{% - \markdownRendererUlItemEndPrototype}% -\def\markdownRendererUlEnd{% - \markdownRendererUlEndPrototype}% -\def\markdownRendererUlEndTight{% - \markdownRendererUlEndTightPrototype}% -\def\markdownRendererOlBegin{% - \markdownRendererOlBeginPrototype}% -\def\markdownRendererOlBeginTight{% - \markdownRendererOlBeginTightPrototype}% -\def\markdownRendererOlItem{% - \markdownRendererOlItemPrototype}% -\def\markdownRendererOlItemEnd{% - \markdownRendererOlItemEndPrototype}% -\def\markdownRendererOlItemWithNumber{% - \markdownRendererOlItemWithNumberPrototype}% -\def\markdownRendererOlEnd{% - \markdownRendererOlEndPrototype}% -\def\markdownRendererOlEndTight{% - \markdownRendererOlEndTightPrototype}% -\def\markdownRendererDlBegin{% - \markdownRendererDlBeginPrototype}% -\def\markdownRendererDlBeginTight{% - \markdownRendererDlBeginTightPrototype}% -\def\markdownRendererDlItem{% - \markdownRendererDlItemPrototype}% -\def\markdownRendererDlItemEnd{% - \markdownRendererDlItemEndPrototype}% -\def\markdownRendererDlDefinitionBegin{% - \markdownRendererDlDefinitionBeginPrototype}% -\def\markdownRendererDlDefinitionEnd{% - \markdownRendererDlDefinitionEndPrototype}% -\def\markdownRendererDlEnd{% - \markdownRendererDlEndPrototype}% -\def\markdownRendererDlEndTight{% - \markdownRendererDlEndTightPrototype}% -\def\markdownRendererEmphasis{% - \markdownRendererEmphasisPrototype}% -\def\markdownRendererStrongEmphasis{% - \markdownRendererStrongEmphasisPrototype}% -\def\markdownRendererBlockQuoteBegin{% - \markdownRendererBlockQuoteBeginPrototype}% -\def\markdownRendererBlockQuoteEnd{% - \markdownRendererBlockQuoteEndPrototype}% -\def\markdownRendererInputVerbatim{% - \markdownRendererInputVerbatimPrototype}% -\def\markdownRendererInputFencedCode{% - \markdownRendererInputFencedCodePrototype}% -\def\markdownRendererHeadingOne{% - \markdownRendererHeadingOnePrototype}% -\def\markdownRendererHeadingTwo{% - \markdownRendererHeadingTwoPrototype}% -\def\markdownRendererHeadingThree{% - \markdownRendererHeadingThreePrototype}% -\def\markdownRendererHeadingFour{% - \markdownRendererHeadingFourPrototype}% -\def\markdownRendererHeadingFive{% - \markdownRendererHeadingFivePrototype}% -\def\markdownRendererHeadingSix{% - \markdownRendererHeadingSixPrototype}% -\def\markdownRendererHorizontalRule{% - \markdownRendererHorizontalRulePrototype}% -\def\markdownRendererFootnote{% - \markdownRendererFootnotePrototype}% -\def\markdownRendererCite{% - \markdownRendererCitePrototype}% -\def\markdownRendererTextCite{% - \markdownRendererTextCitePrototype}% -\def\markdownRendererInterblockSeparatorPrototype{}% -\def\markdownRendererLineBreakPrototype{}% -\def\markdownRendererEllipsisPrototype{}% -\def\markdownRendererNbspPrototype{}% -\def\markdownRendererLeftBracePrototype{}% -\def\markdownRendererRightBracePrototype{}% -\def\markdownRendererDollarSignPrototype{}% -\def\markdownRendererPercentSignPrototype{}% -\def\markdownRendererAmpersandPrototype{}% -\def\markdownRendererUnderscorePrototype{}% -\def\markdownRendererHashPrototype{}% -\def\markdownRendererCircumflexPrototype{}% -\def\markdownRendererBackslashPrototype{}% -\def\markdownRendererTildePrototype{}% -\def\markdownRendererPipePrototype{}% -\def\markdownRendererCodeSpanPrototype#1{}% -\def\markdownRendererLinkPrototype#1#2#3#4{}% -\def\markdownRendererImagePrototype#1#2#3#4{}% -\def\markdownRendererUlBeginPrototype{}% -\def\markdownRendererUlBeginTightPrototype{}% -\def\markdownRendererUlItemPrototype{}% -\def\markdownRendererUlItemEndPrototype{}% -\def\markdownRendererUlEndPrototype{}% -\def\markdownRendererUlEndTightPrototype{}% -\def\markdownRendererOlBeginPrototype{}% -\def\markdownRendererOlBeginTightPrototype{}% -\def\markdownRendererOlItemPrototype{}% -\def\markdownRendererOlItemWithNumberPrototype#1{}% -\def\markdownRendererOlItemEndPrototype{}% -\def\markdownRendererOlEndPrototype{}% -\def\markdownRendererOlEndTightPrototype{}% -\def\markdownRendererDlBeginPrototype{}% -\def\markdownRendererDlBeginTightPrototype{}% -\def\markdownRendererDlItemPrototype#1{}% -\def\markdownRendererDlItemEndPrototype{}% -\def\markdownRendererDlDefinitionBeginPrototype{}% -\def\markdownRendererDlDefinitionEndPrototype{}% -\def\markdownRendererDlEndPrototype{}% -\def\markdownRendererDlEndTightPrototype{}% -\def\markdownRendererEmphasisPrototype#1{}% -\def\markdownRendererStrongEmphasisPrototype#1{}% -\def\markdownRendererBlockQuoteBeginPrototype{}% -\def\markdownRendererBlockQuoteEndPrototype{}% -\def\markdownRendererInputVerbatimPrototype#1{}% -\def\markdownRendererInputFencedCodePrototype#1#2{}% -\def\markdownRendererHeadingOnePrototype#1{}% -\def\markdownRendererHeadingTwoPrototype#1{}% -\def\markdownRendererHeadingThreePrototype#1{}% -\def\markdownRendererHeadingFourPrototype#1{}% -\def\markdownRendererHeadingFivePrototype#1{}% -\def\markdownRendererHeadingSixPrototype#1{}% -\def\markdownRendererHorizontalRulePrototype{}% -\def\markdownRendererFootnotePrototype#1{}% -\def\markdownRendererCitePrototype#1{}% -\def\markdownRendererTextCitePrototype#1{}% -\def\markdownInfo#1{}% -\def\markdownWarning#1{}% -\def\markdownError#1{}% -\def\markdownLuaRegisterIBCallback#1{% - local old_callback = callback.find("process_input_buffer") - callback.register("process_input_buffer", #1)}% -\def\markdownLuaUnregisterIBCallback{% - callback.register("process_input_buffer", old_callback)}% -\let\markdownMakeOther\relax -\let\markdownReadAndConvert\relax -\begingroup - \catcode`\|=0\catcode`\\=12% - |gdef|markdownBegin{% - |markdownReadAndConvert{\markdownEnd}% - {|markdownEnd}}% -|endgroup -\ifx\markdownMode\undefined - \ifx\directlua\undefined - \def\markdownMode{0}% - \else - \def\markdownMode{2}% - \fi -\fi -\def\markdownInfo#1{% - \message{(l.\the\inputlineno) markdown.tex info: #1.}}% -\def\markdownWarning#1{% - \message{(l.\the\inputlineno) markdown.tex warning: #1}}% -\def\markdownError#1#2{% - \errhelp{#2.}% - \errmessage{(l.\the\inputlineno) markdown.tex error: #1}}% -\def\markdownRendererInterblockSeparatorPrototype{\par}% -\def\markdownRendererLineBreakPrototype{\hfil\break}% -\let\markdownRendererEllipsisPrototype\dots -\def\markdownRendererNbspPrototype{~}% -\def\markdownRendererLeftBracePrototype{\char`{}% -\def\markdownRendererRightBracePrototype{\char`}}% -\def\markdownRendererDollarSignPrototype{\char`$}% -\def\markdownRendererPercentSignPrototype{\char`\%}% -\def\markdownRendererAmpersandPrototype{\char`&}% -\def\markdownRendererUnderscorePrototype{\char`_}% -\def\markdownRendererHashPrototype{\char`\#}% -\def\markdownRendererCircumflexPrototype{\char`^}% -\def\markdownRendererBackslashPrototype{\char`\\}% -\def\markdownRendererTildePrototype{\char`~}% -\def\markdownRendererPipePrototype{|}% -\def\markdownRendererCodeSpanPrototype#1{{\tt#1}}% -\def\markdownRendererLinkPrototype#1#2#3#4{#2}% -\def\markdownRendererImagePrototype#1#2#3#4{#2}% -\def\markdownRendererUlBeginPrototype{}% -\def\markdownRendererUlBeginTightPrototype{}% -\def\markdownRendererUlItemPrototype{}% -\def\markdownRendererUlItemEndPrototype{}% -\def\markdownRendererUlEndPrototype{}% -\def\markdownRendererUlEndTightPrototype{}% -\def\markdownRendererOlBeginPrototype{}% -\def\markdownRendererOlBeginTightPrototype{}% -\def\markdownRendererOlItemPrototype{}% -\def\markdownRendererOlItemWithNumberPrototype#1{}% -\def\markdownRendererOlItemEndPrototype{}% -\def\markdownRendererOlEndPrototype{}% -\def\markdownRendererOlEndTightPrototype{}% -\def\markdownRendererDlBeginPrototype{}% -\def\markdownRendererDlBeginTightPrototype{}% -\def\markdownRendererDlItemPrototype#1{#1}% -\def\markdownRendererDlItemEndPrototype{}% -\def\markdownRendererDlDefinitionBeginPrototype{}% -\def\markdownRendererDlDefinitionEndPrototype{\par}% -\def\markdownRendererDlEndPrototype{}% -\def\markdownRendererDlEndTightPrototype{}% -\def\markdownRendererEmphasisPrototype#1{{\it#1}}% -\def\markdownRendererStrongEmphasisPrototype#1{{\it#1}}% -\def\markdownRendererBlockQuoteBeginPrototype{\par\begingroup\it}% -\def\markdownRendererBlockQuoteEndPrototype{\endgroup\par}% -\def\markdownRendererInputVerbatimPrototype#1{% - \par{\tt\input"#1"\relax}\par}% -\def\markdownRendererInputFencedCodePrototype#1#2{% - \markdownRendererInputVerbatimPrototype{#1}}% -\def\markdownRendererHeadingOnePrototype#1{#1}% -\def\markdownRendererHeadingTwoPrototype#1{#1}% -\def\markdownRendererHeadingThreePrototype#1{#1}% -\def\markdownRendererHeadingFourPrototype#1{#1}% -\def\markdownRendererHeadingFivePrototype#1{#1}% -\def\markdownRendererHeadingSixPrototype#1{#1}% -\def\markdownRendererHorizontalRulePrototype{}% -\def\markdownRendererFootnotePrototype#1{#1}% -\def\markdownRendererCitePrototype#1{}% -\def\markdownRendererTextCitePrototype#1{}% -\def\markdownLuaOptions{{% -\ifx\markdownOptionBlankBeforeBlockquote\undefined\else - blankBeforeBlockquote = \markdownOptionBlankBeforeBlockquote, -\fi -\ifx\markdownOptionBlankBeforeCodeFence\undefined\else - blankBeforeCodeFence = \markdownOptionBlankBeforeCodeFence, -\fi -\ifx\markdownOptionBlankBeforeHeading\undefined\else - blankBeforeHeading = \markdownOptionBlankBeforeHeading, -\fi -\ifx\markdownOptionCacheDir\undefined\else - cacheDir = "\markdownOptionCacheDir", -\fi -\ifx\markdownOptionCitations\undefined\else - citations = \markdownOptionCitations, -\fi -\ifx\markdownOptionCitationNbsps\undefined\else - citationNbsps = \markdownOptionCitationNbsps, -\fi -\ifx\markdownOptionDefinitionLists\undefined\else - definitionLists = \markdownOptionDefinitionLists, -\fi -\ifx\markdownOptionFootnotes\undefined\else - footnotes = \markdownOptionFootnotes, -\fi -\ifx\markdownOptionFencedCode\undefined\else - fencedCode = \markdownOptionFencedCode, -\fi -\ifx\markdownOptionHashEnumerators\undefined\else - hashEnumerators = \markdownOptionHashEnumerators, -\fi -\ifx\markdownOptionHybrid\undefined\else - hybrid = \markdownOptionHybrid, -\fi -\ifx\markdownOptionPreserveTabs\undefined\else - preserveTabs = \markdownOptionPreserveTabs, -\fi -\ifx\markdownOptionSmartEllipses\undefined\else - smartEllipses = \markdownOptionSmartEllipses, -\fi -\ifx\markdownOptionStartNumber\undefined\else - startNumber = \markdownOptionStartNumber, -\fi -\ifx\markdownOptionTightLists\undefined\else - tightLists = \markdownOptionTightLists, -\fi} -}% -\def\markdownPrepare{% -local lfs = require("lfs") -local cacheDir = "\markdownOptionCacheDir" -if lfs.isdir(cacheDir) == true then else - assert(lfs.mkdir(cacheDir)) -end -local md = require("markdown") -local convert = md.new(\markdownLuaOptions) -}% - -\ifnum\markdownMode<2\relax -\ifnum\markdownMode=0\relax - \markdownInfo{Using mode 0: Shell escape via write18}% -\else - \markdownInfo{Using mode 1: Shell escape via os.execute}% -\fi -\csname newwrite\endcsname\markdownLuaExecuteFileStream -\ifx\pdfshellescape\undefined - \ifx\shellescape\undefined - \ifnum\markdownMode=0\relax - \def\markdownExecuteShellEscape{1}% - \else - \def\markdownExecuteShellEscape{% - \directlua{tex.sprint(status.shell_escape or "1")}}% - \fi - \else - \let\markdownExecuteShellEscape\shellescape - \fi -\else - \let\markdownExecuteShellEscape\pdfshellescape -\fi -\ifnum\markdownMode=0\relax - \def\markdownExecuteDirect#1{\immediate\write18{#1}}% -\else - \def\markdownExecuteDirect#1{% - \directlua{os.execute("\luaescapestring{#1}")}}% -\fi -\def\markdownExecute#1{% - \ifnum\markdownExecuteShellEscape=1\relax - \markdownExecuteDirect{#1}% - \else - \markdownError{I can not access the shell}{Either run the TeX - compiler with the --shell-escape or the --enable-write18 flag, - or set shell_escape=t in the texmf.cnf file}% - \fi}% -\def\markdownLuaExecute#1{% - \immediate\openout\markdownLuaExecuteFileStream=% - \markdownOptionHelperScriptFileName - \markdownInfo{Writing a helper Lua script to the file - "\markdownOptionHelperScriptFileName"}% - \immediate\write\markdownLuaExecuteFileStream{% - local kpse = require('kpse') - kpse.set_program_name('luatex') #1}% - \immediate\closeout\markdownLuaExecuteFileStream - \markdownInfo{Executing a helper Lua script from the file - "\markdownOptionHelperScriptFileName" and storing the result in the - file "\markdownOptionOutputTempFileName"}% - \markdownExecute{texlua "\markdownOptionHelperScriptFileName" > - "\markdownOptionOutputTempFileName"}% - \input\markdownOptionOutputTempFileName\relax}% -\begingroup - \catcode`\^^I=12% - \gdef\markdownReadAndConvertTab{^^I}% -\endgroup -\begingroup - \catcode`\^^M=13% - \catcode`\^^I=13% - \catcode`|=0% - \catcode`\\=12% - |gdef|markdownReadAndConvert#1#2{% - |begingroup% - |immediate|openout|markdownLuaExecuteFileStream% - |markdownOptionInputTempFileName% - |markdownInfo{Buffering markdown input into the temporary % - input file "|markdownOptionInputTempFileName" and scanning % - for the closing token sequence "#1"}% - |def|do##1{|catcode`##1=12}|dospecials% - |catcode`| =12% - |markdownMakeOther% - |def|markdownReadAndConvertProcessLine##1#1##2#1##3|relax{% - |ifx|relax##3|relax% - |immediate|write|markdownLuaExecuteFileStream{##1}% - |else% - |def^^M{% - |markdownInfo{The ending token sequence was found}% - |immediate|closeout|markdownLuaExecuteFileStream% - |endgroup% - |markdownInput|markdownOptionInputTempFileName% - #2}% - |fi% - ^^M}% - |catcode`|^^I=13% - |def^^I{|markdownReadAndConvertTab}% - |catcode`|^^M=13% - |def^^M##1^^M{% - |def^^M####1^^M{% - |markdownReadAndConvertProcessLine####1#1#1|relax}% - ^^M}% - ^^M}% -|endgroup -\else -\markdownInfo{Using mode 2: Direct Lua access}% -\def\markdownLuaExecute#1{\directlua{local print = tex.print #1}}% -\begingroup - \catcode`\_=12% - \catcode`\$=12% - \catcode`\^=12% - \catcode`\/=6% - \catcode`\#=12% - \catcode`\@=14% - \catcode`\%=12% - \catcode`|=0@ - \catcode`\\=12@ - |gdef|markdownReadAndConvert/1/2{@ - |def|markdownReadAndConvertAfter{/2}@ - |markdownInfo{Buffering markdown input and scanning for the - closing token sequence "/1"}@ - |directlua{@ - |markdownPrepare - local buffer = {} - local ending_sequence = "^.-" .. ([[/1]]):gsub( - "([%(%)%.%%%+%-%*%?%[%]%^%$])", "%%%1") - |markdownLuaRegisterIBCallback{function(line) - if line:match(ending_sequence) then - |markdownLuaUnregisterIBCallback; - local input = table.concat(buffer, "\n") .. "\n" - local output = convert(input) - return [[\markdownInfo{The ending token sequence was found}]] .. - output .. [[\markdownReadAndConvertAfter]] - else - buffer[#buffer+1] = line - return [[\]] .. (#buffer == 1 and "fi" or "relax") - end - end}}@ - |iffalse}@ - |endgroup -\fi -\begingroup - \catcode`|=0% - \catcode`\\=12% - |gdef|markdownInput#1{% - |markdownInfo{Including markdown document "#1"}% - |markdownLuaExecute{% - |markdownPrepare - local input = assert(io.open("#1","r")):read("*a") - print(convert(input:gsub("\r\n?", "\n")))}}% -|endgroup -\endinput -%% -%% End of file `markdown.tex'. @@ -1,7 +1,10 @@ #!/bin/bash +POSTERFILE=$1 +mdblocks=$(grep "\\input{./markdown_blocks/" $POSTERFILE|sed 's/\\input{.\/markdown_blocks\///g'|sed 's/}/.md/g' ) + cd markdown_blocks -for i in *.md ; do +for i in $mdblocks ; do echo converting $i to $(basename "${i/.md}").tex pandoc --highlight-style=kate --listings $i -t beamer -f markdown+implicit_figures+header_attributes+table_captions+simple_tables+multiline_tables+pipe_tables+grid_tables+simple_tables --bibliography=../references.bib |sed '/\(begin\|end\){frame}/d' > $(basename "${i/.md}").tex #sleep 1 diff --git a/postertemplate.tex b/postertemplate.tex index 67a9110..bd89313 100644 --- a/postertemplate.tex +++ b/postertemplate.tex @@ -43,30 +43,26 @@ \input{./markdown_blocks/maths} \end{block} - \begin{block}{Lists} - \input{./markdown_blocks/lists} - \end{block} + \begin{alertblock}{Highlighted Box} + \input{./markdown_blocks/exampletext} + \end{alertblock} \begin{block}{Code} \input{./markdown_blocks/code} \end{block} + \begin{exampleblock}{Lists} + \input{./markdown_blocks/lists} + \end{exampleblock} + \begin{block}{References} \small\bibliography{references} \end{block} - \begin{alertblock}{Highlighted Box} - \input{./markdown_blocks/exampletext} - \end{alertblock} - \end{textblock} - \begin{textblock}{80}(1,88) - - \begin{exampleblock}{} - \input{./markdown_blocks/exampletext} - \end{exampleblock} - + \begin{textblock}{82.1}(1,88) + \input{./markdown_blocks/exampletext} \end{textblock} \end{frame} |