From: Fletcher T. Penney Date: Sat, 18 Feb 2017 18:23:44 +0000 (-0500) Subject: ADDED: Support 'latexconfig' metadata X-Git-Tag: 0.4.0-b^2~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c5c098c0c17b190753226765053a6b7d71c314da;p=multimarkdown ADDED: Support 'latexconfig' metadata --- diff --git a/src/html.c b/src/html.c index f0262ed..b7838e7 100644 --- a/src/html.c +++ b/src/html.c @@ -1442,6 +1442,7 @@ void mmd_start_complete_html(DString * out, const char * source, scratch_pad * s } else if (strcmp(m->key, "htmlheaderlevel") == 0) { } else if (strcmp(m->key, "lang") == 0) { } else if (strcmp(m->key, "latexbegin") == 0) { + } else if (strcmp(m->key, "latexconfig") == 0) { } else if (strcmp(m->key, "latexfooter") == 0) { } else if (strcmp(m->key, "latexheaderlevel") == 0) { } else if (strcmp(m->key, "latexinput") == 0) { diff --git a/src/latex.c b/src/latex.c index ac8d28d..0b157dc 100644 --- a/src/latex.c +++ b/src/latex.c @@ -1552,6 +1552,12 @@ void mmd_start_complete_latex(DString * out, const char * source, scratch_pad * m = extract_meta_from_stack(scratch, "latexleader"); if (m) { printf("\\input{%s}\n", m->value); + } else { + m = extract_meta_from_stack(scratch, "latexconfig"); + + if (m) { + printf("\\input{mmd6-%s-leader}\n", m->value); + } } for (m = scratch->meta_hash; m != NULL; m = m->hh.next) { @@ -1563,6 +1569,7 @@ void mmd_start_complete_latex(DString * out, const char * source, scratch_pad * } else if (strcmp(m->key, "htmlheaderlevel") == 0) { } else if (strcmp(m->key, "lang") == 0) { } else if (strcmp(m->key, "latexbegin") == 0) { + } else if (strcmp(m->key, "latexconfig") == 0) { } else if (strcmp(m->key, "latexheader") == 0) { print(m->value); print_char('\n'); @@ -1611,6 +1618,12 @@ void mmd_start_complete_latex(DString * out, const char * source, scratch_pad * m = extract_meta_from_stack(scratch, "latexbegin"); if (m) { printf("\\input{%s}\n", m->value); + } else { + m = extract_meta_from_stack(scratch, "latexconfig"); + + if (m) { + printf("\\input{mmd6-%s-begin}\n", m->value); + } } scratch->padded = 1; @@ -1624,6 +1637,12 @@ void mmd_end_complete_latex(DString * out, const char * source, scratch_pad * sc if (m) { printf("\\input{%s}\n\n", m->value); + } else { + m = extract_meta_from_stack(scratch, "latexconfig"); + + if (m) { + printf("\\input{mmd6-%s-footer}\n", m->value); + } } print("\\end{document}");