]> granicus.if.org Git - multimarkdown/commitdiff
ADDED: Support 'latexconfig' metadata
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 18 Feb 2017 18:23:44 +0000 (13:23 -0500)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 18 Feb 2017 18:23:44 +0000 (13:23 -0500)
src/html.c
src/latex.c

index f0262edf1306566b096d5f049b4495c708106b4a..b7838e778ccc8f5ee2c52ed12f1936b05fbcf1df 100644 (file)
@@ -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) {
index ac8d28db4d5766e18e596a4e85fa55046ddfc1fd..0b157dc3bed578913609e34fdbecaaecaad22b54 100644 (file)
@@ -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}");