]> granicus.if.org Git - multimarkdown/commitdiff
ADDED: Add back support for BibTeX bibliography entries (address #56)
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Tue, 2 May 2017 12:51:33 +0000 (08:51 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Tue, 2 May 2017 12:51:33 +0000 (08:51 -0400)
Sources/libMultiMarkdown/html.c
Sources/libMultiMarkdown/latex.c
Sources/libMultiMarkdown/odf.c
Sources/libMultiMarkdown/writer.c
Sources/libMultiMarkdown/writer.h
tests/MMD6Tests/BibTeX.fodt [new file with mode: 0644]
tests/MMD6Tests/BibTeX.html [new file with mode: 0644]
tests/MMD6Tests/BibTeX.htmlc [new file with mode: 0644]
tests/MMD6Tests/BibTeX.tex [new file with mode: 0644]
tests/MMD6Tests/BibTeX.text [new file with mode: 0644]
tests/MMD6Tests/bibtex.bib [new file with mode: 0644]

index c967d54dc41073142ad07d055a5db7a6722dba29..f252d37ac8aca11e0f03dbd15f67ea001b0264a4 100644 (file)
@@ -1759,6 +1759,7 @@ void mmd_start_complete_html(DString * out, const char * source, scratch_pad * s
 
        for (m = scratch->meta_hash; m != NULL; m = m->hh.next) {
                if (strcmp(m->key, "baseheaderlevel") == 0) {
+               } else if (strcmp(m->key, "bibliostyle") == 0) {
                } else if (strcmp(m->key, "bibtex") == 0) {
                } else if (strcmp(m->key, "css") == 0) {
                        print_const("\t<link type=\"text/css\" rel=\"stylesheet\" href=\"");
index d223df6b9034fca75a42aa2af3a3955ba9e9de84..38b14ce06e51b1139fccda7caba1a3297974a575 100644 (file)
@@ -1131,17 +1131,24 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat
                                citation_from_bracket(source, scratch, t, &temp_short);
 
                                if (temp_short == -1) {
-                                       // This instance is not properly formed
-                                       print_const("[#");
-                                       mmd_export_token_tree_latex(out, source, t->child->next, scratch);
-                                       print_const("]");
+                                       // Ensure we aren't using BibTeX
+                                       if (!scratch->bibtex_file) {
+                                               // This instance is not properly formed
+                                               print_const("[#");
+                                               mmd_export_token_tree_latex(out, source, t->child->next, scratch);
+                                               print_const("]");
 
-                                       free(temp_char);
-                                       break;
+                                               free(temp_char);
+                                               break;
+                                       }
                                }
 
                                // Get instance of the note used
-                               temp_note = stack_peek_index(scratch->used_citations, temp_short - 1);
+                               if (temp_short == -1) {
+                                       temp_note = NULL;
+                               } else {
+                                       temp_note = stack_peek_index(scratch->used_citations, temp_short - 1);                                  
+                               }
 
                                if (temp_bool) {
                                        // This is a regular citation
@@ -1150,6 +1157,7 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat
                                        temp_char2 = clean_inside_pair(source, t, false);
                                        if (temp_char2[strlen(temp_char2) - 1] == ';') {
                                                temp_bool = true;               // citet
+                                               temp_char2[strlen(temp_char2) - 1] = '\0';
                                        } else {
                                                temp_bool = false;              // citep
                                        }
@@ -1180,11 +1188,22 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat
                                                }
                                        }
 
-                                       printf("{%s}", temp_note->label_text);
+                                       if (temp_note) {
+                                               printf("{%s}", temp_note->label_text);
+                                       } else {
+                                               printf("{%s}", &temp_char2[1]);
+                                       }
+
                                        free(temp_char2);
                                } else {
                                        // This is a "nocite"
-                                       printf("~\\nocite{%s}", temp_note->label_text);
+                                       if (temp_note) {
+                                               printf("~\\nocite{%s}", temp_note->label_text);
+                                       } else {
+                                               temp_char2 = clean_inside_pair(source, t, false);
+                                               printf("~\\nocite{%s}", &temp_char2[1]);
+                                               free(temp_char2);
+                                       }
                                }
 
                                if (temp_token != t) {
@@ -1849,7 +1868,6 @@ void mmd_start_complete_latex(DString * out, const char * source, scratch_pad *
 
        for (m = scratch->meta_hash; m != NULL; m = m->hh.next) {
                if (strcmp(m->key, "baseheaderlevel") == 0) {
-               } else if (strcmp(m->key, "bibtex") == 0) {
                } else if (strcmp(m->key, "css") == 0) {
                } else if (strcmp(m->key, "htmlfooter") == 0) {
                } else if (strcmp(m->key, "htmlheader") == 0) {
index 132efd0b8eb19d5106edeecfba53fe413b79e899..7eaf5e8b7cbfc1370cf37ef29e963d9b350941b0 100644 (file)
@@ -1914,6 +1914,7 @@ void mmd_start_complete_odf(DString * out, const char * source, scratch_pad * sc
 
        for (m = scratch->meta_hash; m != NULL; m = m->hh.next) {
                if (strcmp(m->key, "baseheaderlevel") == 0) {
+               } else if (strcmp(m->key, "bibliostyle") == 0) {
                } else if (strcmp(m->key, "bibtex") == 0) {
                } else if (strcmp(m->key, "css") == 0) {
                } else if (strcmp(m->key, "htmlfooter") == 0) {
index f7c1253cc469190522eb4355b738045a82f36060..89475174b069cb01e2012fa712b67ade28ceaf1d 100644 (file)
@@ -161,6 +161,7 @@ scratch_pad * scratch_pad_new(mmd_engine * e, short format) {
                p->used_citations = stack_new(0);
                p->inline_citations_to_free = stack_new(0);
                p->citation_being_printed = 0;
+               p->bibtex_file = NULL;
 
                p->citation_hash = NULL;
 
@@ -276,6 +277,7 @@ void scratch_pad_free(scratch_pad * scratch) {
        }
        stack_free(scratch->inline_citations_to_free);
 
+       free(scratch->bibtex_file);
 
        // Free glossary hash
        HASH_ITER(hh, scratch->glossary_hash, f, f_tmp) {
@@ -1562,6 +1564,11 @@ void process_metadata_stack(mmd_engine * e, scratch_pad * scratch) {
                        }
 
                        free(temp_char);
+               } else if (strcmp(m->key, "bibtex") == 0) {
+                       scratch->bibtex_file = strdup(m->value);
+                       // Trigger complete document unless explicitly denied
+                       if (!(scratch->extensions & EXT_SNIPPET))
+                               scratch->extensions |= EXT_COMPLETE;
                } else {
                        // Any other key triggers complete document
                        if (!(scratch->extensions & EXT_SNIPPET))
@@ -2074,9 +2081,16 @@ void citation_from_bracket(const char * source, scratch_pad * scratch, token * t
 
        if (citation_id == -1) {
                // No match, this is an inline citation -- create a new one
+
                t->child->type = TEXT_EMPTY;
                t->child->mate->type = TEXT_EMPTY;
 
+               // *UNLESS* we are using BibTeX, in which case we leave them alone
+               if (scratch->bibtex_file) {
+                       *num = -1;
+                       return;
+               }
+
                // Create citation
                footnote * temp = footnote_new(source, t, t->child, true);
 
index 86e80468efa389eb0221b66870f01abbe1ad0673..cc4ce29a740159460a7e7d3761a76b2824a75f7a 100644 (file)
@@ -94,6 +94,7 @@ typedef struct {
        stack *                         inline_citations_to_free;
        struct fn_holder *      citation_hash;
        short                           citation_being_printed;
+       char *                          bibtex_file;
 
        stack *                         used_glossaries;
        stack *                         inline_glossaries_to_free;
diff --git a/tests/MMD6Tests/BibTeX.fodt b/tests/MMD6Tests/BibTeX.fodt
new file mode 100644 (file)
index 0000000..f9991d7
--- /dev/null
@@ -0,0 +1,294 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
+     xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
+     xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+     xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+     xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+     xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
+     xmlns:xlink="http://www.w3.org/1999/xlink"
+     xmlns:dc="http://purl.org/dc/elements/1.1/"
+     xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
+     xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
+     xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
+     xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+     xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+     xmlns:math="http://www.w3.org/1998/Math/MathML"
+     xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
+     xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
+     xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
+     xmlns:ooo="http://openoffice.org/2004/office"
+     xmlns:ooow="http://openoffice.org/2004/writer"
+     xmlns:oooc="http://openoffice.org/2004/calc"
+     xmlns:dom="http://www.w3.org/2001/xml-events"
+     xmlns:xforms="http://www.w3.org/2002/xforms"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+     xmlns:rpt="http://openoffice.org/2005/report"
+     xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"
+     xmlns:xhtml="http://www.w3.org/1999/xhtml"
+     xmlns:grddl="http://www.w3.org/2003/g/data-view#"
+     xmlns:tableooo="http://openoffice.org/2009/table"
+     xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"
+     xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
+     xmlns:css3t="http://www.w3.org/TR/css3-text/"
+     office:version="1.2"
+     grddl:transformation="http://docs.oasis-open.org/office/1.2/xslt/odf2rdf.xsl"
+     office:mimetype="application/vnd.oasis.opendocument.text">
+<office:font-face-decls>
+   <style:font-face style:name="Courier New" svg:font-family="'Courier New'"
+                    style:font-adornments="Regular"
+                    style:font-family-generic="modern"
+                    style:font-pitch="fixed"/>
+</office:font-face-decls>
+<office:styles>
+<style:style style:name="Standard" style:family="paragraph" style:class="text">
+      <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.15in"     fo:text-align="justify" style:justify-single-word="false"/>
+   </style:style>
+<style:style style:name="Preformatted_20_Text" style:display-name="Preformatted Text"
+             style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="html">
+   <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" fo:text-align="start"
+                               style:justify-single-word="false"/>
+   <style:text-properties style:font-name="Courier New" fo:font-size="11pt"
+                          style:font-name-asian="Courier New"
+                          style:font-size-asian="11pt"
+                          style:font-name-complex="Courier New"
+                          style:font-size-complex="11pt"/>
+</style:style>
+<style:style style:name="Source_20_Text" style:display-name="Source Text"
+             style:family="text">
+   <style:text-properties style:font-name="Courier New" style:font-name-asian="Courier New"
+                          style:font-name-complex="Courier New"
+                          fo:font-size="11pt"/>
+</style:style>
+<style:style style:name="List" style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="list">
+   <style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+   <style:text-properties style:font-size-asian="12pt"/>
+</style:style>
+<style:style style:name="Quotations" style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="html">
+   <style:paragraph-properties fo:margin-left="0.3937in" fo:margin-right="0.3937in" fo:margin-top="0in"
+                               fo:margin-bottom="0.1965in"
+                               fo:text-align="justify"                               style:justify-single-word="false"                               fo:text-indent="0in"
+                               style:auto-text-indent="false"/>
+</style:style>
+<style:style style:name="Table_20_Heading" style:display-name="Table Heading"
+             style:family="paragraph"
+             style:parent-style-name="Table_20_Contents"
+             style:class="extra">
+   <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"
+                               text:number-lines="false"
+                               text:line-number="0"/>
+   <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold"
+                          style:font-weight-complex="bold"/>
+</style:style>
+<style:style style:name="Horizontal_20_Line" style:display-name="Horizontal Line"
+             style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="html">
+   <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.1965in"
+                               style:border-line-width-bottom="0.0008in 0.0138in 0.0008in"
+                               fo:padding="0in"
+                               fo:border-left="none"
+                               fo:border-right="none"
+                               fo:border-top="none"
+                               fo:border-bottom="0.0154in double #808080"
+                               text:number-lines="false"
+                               text:line-number="0"
+                               style:join-border="false"/>
+   <style:text-properties fo:font-size="6pt" style:font-size-asian="6pt" style:font-size-complex="6pt"/>
+</style:style>
+<style:style style:name="Footnote_20_anchor" style:display-name="Footnote anchor"              style:family="text">    <style:text-properties style:text-position="super 58%"/> </style:style>
+<style:style style:name="TOC_Item" style:family="paragraph" style:parent-style-name="Standard">
+ <style:paragraph-properties>
+  <style:tab-stops>
+   <style:tab-stop style:position="6.7283in" style:type="right" style:leader-style="dotted" style:leader-text="."/>
+  </style:tab-stops>
+ </style:paragraph-properties>
+</style:style>
+  <text:notes-configuration text:note-class="footnote" text:default-style-name="Footnote" text:citation-style-name="Footnote_20_Symbol" text:citation-body-style-name="Footnote_20_anchor" text:master-page-name="Footnote" style:num-format="a" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="page"/>
+  <text:notes-configuration text:note-class="endnote" text:default-style-name="Endnote" text:citation-style-name="Endnote_20_Symbol" text:citation-body-style-name="Endnote_20_anchor" text:master-page-name="Endnote" style:num-format="1" text:start-value="0"/>
+</office:styles>
+<office:automatic-styles>   <style:style style:name="MMD-Italic" style:family="text">
+      <style:text-properties fo:font-style="italic" style:font-style-asian="italic"
+                             style:font-style-complex="italic"/>
+   </style:style>
+   <style:style style:name="MMD-Bold" style:family="text">
+      <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold"
+                             style:font-weight-complex="bold"/>
+   </style:style>
+   <style:style style:name="MMD-Superscript" style:family="text">
+      <style:text-properties style:text-position="super 58%"/>
+   </style:style>
+   <style:style style:name="MMD-Subscript" style:family="text">
+      <style:text-properties style:text-position="sub 58%"/>
+   </style:style>
+   <style:style style:name="Strike" style:family="text">
+      <style:text-properties style:text-line-through-style="solid" />
+   </style:style>
+   <style:style style:name="Underline" style:family="text">
+      <style:text-properties style:text-underline-style="solid" style:text-underline-color="font-color"/>
+   </style:style>
+   <style:style style:name="Highlight" style:family="text">
+      <style:text-properties fo:background-color="#FFFF00" />
+   </style:style>
+   <style:style style:name="Comment" style:family="text">
+      <style:text-properties fo:color="#0000BB" />
+   </style:style>
+<style:style style:name="MMD-Table" style:family="paragraph" style:parent-style-name="Standard">
+   <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.05in"/>
+</style:style>
+<style:style style:name="MMD-Table-Center" style:family="paragraph" style:parent-style-name="MMD-Table">
+   <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
+</style:style>
+<style:style style:name="MMD-Table-Right" style:family="paragraph" style:parent-style-name="MMD-Table">
+   <style:paragraph-properties fo:text-align="right" style:justify-single-word="false"/>
+</style:style>
+<style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard"
+             style:list-style-name="L2">
+<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+</style:style>
+<style:style style:name="fr1" style:family="graphic" style:parent-style-name="Frame">
+   <style:graphic-properties style:print-content="true" style:vertical-pos="top"
+                             style:vertical-rel="baseline"
+                             fo:padding="0in"
+                             fo:border="none"
+                             style:shadow="none"/>
+</style:style>
+<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"
+             style:list-style-name="L1"/>
+<text:list-style style:name="L1">
+       <text:list-level-style-bullet text:level="1" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="•">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.5in" fo:text-indent="-0.25in" fo:margin-left="0.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-bullet>
+       <text:list-level-style-bullet text:level="2" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="◦">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.75in" fo:text-indent="-0.25in" fo:margin-left="0.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-bullet>
+       <text:list-level-style-bullet text:level="3" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="▪">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1in" fo:text-indent="-0.25in" fo:margin-left="1in"/>
+               </style:list-level-properties>
+       </text:list-level-style-bullet>
+       <text:list-level-style-number text:level="4" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.25in" fo:text-indent="-0.25in" fo:margin-left="1.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="5" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.5in" fo:text-indent="-0.25in" fo:margin-left="1.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="6" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.75in" fo:text-indent="-0.25in" fo:margin-left="1.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="7" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2in" fo:text-indent="-0.25in" fo:margin-left="2in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="8" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.25in" fo:text-indent="-0.25in" fo:margin-left="2.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="9" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.5in" fo:text-indent="-0.25in" fo:margin-left="2.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="10" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.75in" fo:text-indent="-0.25in" fo:margin-left="2.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+</text:list-style>
+<text:list-style style:name="L2">
+       <text:list-level-style-number text:level="1" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.5in" fo:text-indent="-0.25in" fo:margin-left="0.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="2" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.75in" fo:text-indent="-0.25in" fo:margin-left="0.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="3" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1in" fo:text-indent="-0.25in" fo:margin-left="1in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="4" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.25in" fo:text-indent="-0.25in" fo:margin-left="1.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="5" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.5in" fo:text-indent="-0.25in" fo:margin-left="1.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="6" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.75in" fo:text-indent="-0.25in" fo:margin-left="1.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="7" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2in" fo:text-indent="-0.25in" fo:margin-left="2in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="8" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.25in" fo:text-indent="-0.25in" fo:margin-left="2.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="9" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.5in" fo:text-indent="-0.25in" fo:margin-left="2.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="10" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.75in" fo:text-indent="-0.25in" fo:margin-left="2.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+</text:list-style>
+</office:automatic-styles>
+ <office:master-styles>
+  <style:master-page style:name="Endnote" >
+    <style:header><text:h text:outline-level="2">Bibliography</text:h></style:header></style:master-page>
+  <style:master-page style:name="Footnote" style:page-layout-name="pm2"/>
+ </office:master-styles>
+<office:meta>
+       <dc:title>Bibliography</dc:title>
+</office:meta>
+<office:body>
+<office:text>
+<text:p text:style-name="Standard">[#Knuth:1968]</text:p>
+
+<text:p text:style-name="Standard">[#Knuth:1968;]</text:p>
+
+<text:p text:style-name="Standard">[#Knuth:1981]</text:p>
+
+<text:p text:style-name="Standard">[#Knuth:1981;]</text:p>
+
+<text:p text:style-name="Standard">[#Knuth:1968,Knuth:1981]</text:p>
+
+<text:p text:style-name="Standard">5</text:p>
+
+<text:p text:style-name="Standard">[#Knuth:1968,Knuth:1981;]</text:p>
+</office:text>
+</office:body>
+</office:document>
diff --git a/tests/MMD6Tests/BibTeX.html b/tests/MMD6Tests/BibTeX.html
new file mode 100644 (file)
index 0000000..982d8fa
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<head>
+       <meta charset="utf-8"/>
+       <title>Bibliography</title>
+</head>
+<body>
+
+<p>[#Knuth:1968]</p>
+
+<p>[#Knuth:1968;]</p>
+
+<p>[#Knuth:1981]</p>
+
+<p>[#Knuth:1981;]</p>
+
+<p>[#Knuth:1968,Knuth:1981]</p>
+
+<p>5</p>
+
+<p>[#Knuth:1968,Knuth:1981;]</p>
+
+</body>
+</html>
+
diff --git a/tests/MMD6Tests/BibTeX.htmlc b/tests/MMD6Tests/BibTeX.htmlc
new file mode 100644 (file)
index 0000000..644a2c5
--- /dev/null
@@ -0,0 +1,18 @@
+<p>Title:      Bibliography
+latex config:  article
+bibtex:        bibtex
+biblio style: apalike</p>
+
+<p>[#Knuth:1968]</p>
+
+<p>[#Knuth:1968;]</p>
+
+<p>[#Knuth:1981]</p>
+
+<p>[#Knuth:1981;]</p>
+
+<p>[#Knuth:1968,Knuth:1981]</p>
+
+<p>5</p>
+
+<p>[#Knuth:1968,Knuth:1981;]</p>
diff --git a/tests/MMD6Tests/BibTeX.tex b/tests/MMD6Tests/BibTeX.tex
new file mode 100644 (file)
index 0000000..27c4d42
--- /dev/null
@@ -0,0 +1,22 @@
+\input{mmd6-article-leader}
+\def\mytitle{Bibliography}
+\def\bibliocommand{\bibliography{bibtex}}
+\def\bibliostyle{apalike}
+\input{mmd6-article-begin}
+
+~\citep{Knuth:1968}
+
+\citet{Knuth:1968}
+
+~\citep{Knuth:1981}
+
+\citet{Knuth:1981}
+
+~\citep{Knuth:1968,Knuth:1981}
+
+5
+
+\citet{Knuth:1968,Knuth:1981}
+
+\input{mmd6-article-footer}
+\end{document}
diff --git a/tests/MMD6Tests/BibTeX.text b/tests/MMD6Tests/BibTeX.text
new file mode 100644 (file)
index 0000000..0c08fc7
--- /dev/null
@@ -0,0 +1,19 @@
+Title: Bibliography
+latex config:  article
+bibtex:        bibtex
+biblio style: apalike
+
+
+[#Knuth:1968]
+
+[#Knuth:1968;]
+
+[#Knuth:1981]
+
+[#Knuth:1981;]
+
+[#Knuth:1968,Knuth:1981]
+
+5
+
+[#Knuth:1968,Knuth:1981;]
diff --git a/tests/MMD6Tests/bibtex.bib b/tests/MMD6Tests/bibtex.bib
new file mode 100644 (file)
index 0000000..f66435f
--- /dev/null
@@ -0,0 +1,119 @@
+%% This BibTeX bibliography file was created using BibDesk.
+%% http://bibdesk.sourceforge.net/
+
+
+%% Created for Fletcher T. Penney at 2011-01-22 19:03:16 -0500 
+
+
+%% Saved with string encoding Unicode (UTF-8) 
+
+
+
+@book{Knuth:1981,
+       Address = {Reading, Mass.},
+       Annote = {LDR    00912cam  2200253   4500
+001    3613158
+005    19990107112758.5
+008    740603m19731981maua     b    001 0 eng  
+035    $9(DLC)   73001830
+906    $a7$bcbc$corignew$d2$eocip$f19$gy-gencatlg
+010    $a   73001830 
+020    $a0201038099 (v. 1)
+040    $aDLC$cDLC$dDLC
+050 00 $aQA76.6$b.K64
+082 00 $a001.6/42
+100 1  $aKnuth, Donald Ervin,$d1938-
+245 14 $aThe art of computer programming /$cDonald E. Knuth.
+260    $aReading, Mass. :$bAddison-Wesley Pub. Co.,$cc1973-c1981.
+300    $a2 v. :$bill. ;$c25 cm.
+440  0 $aAddison-Wesley series in computer science and information processing
+504    $aIncludes bibliographical references and indexes.
+505 0  $av. 1. Fundamental algorithms -- v. 2. Seminumerical algorithms.
+650  0 $aComputer programming.
+991    $bc-GenColl$hQA76.6$i.K64$tCopy 1$wBOOKS
+},
+       Author = {Knuth, Donald Ervin},
+       Call-Number = {QA76.6},
+       Date-Added = {2011-01-22 19:03:04 -0500},
+       Date-Modified = {2011-01-22 19:03:04 -0500},
+       Dewey-Call-Number = {001.6/42},
+       Genre = {Computer programming},
+       Isbn = {0201038099 (v. 1)},
+       Library-Id = {73001830},
+       Publisher = {Addison-Wesley Pub. Co.},
+       Title = {The art of computer programming},
+       Year = {1981}}
+
+@book{Knuth:1968,
+       Address = {Reading, Mass.},
+       Annote = {LDR    00894cam  22002411  4500
+001    3590275
+005    19990107112747.0
+008    740605m19689999maua     b    001 0 eng  
+035    $9(DLC)   67026020
+906    $a7$bcbc$corignew$du$eocip$f19$gy-gencatlg
+010    $a   67026020 
+040    $aDLC$cDLC$dDLC
+050 00 $aQA76.5$b.K57
+082 00 $a651.8
+100 1  $aKnuth, Donald Ervin,$d1938-
+245 14 $aThe art of computer programming$c[by] Donald E. Knuth.
+260    $aReading, Mass.,$bAddison-Wesley Pub. Co.$c1968-
+300    $a v.$billus.$c25 cm.
+490 0  $aAddison-Wesley series in computer science and information processing
+504    $aIncludes bibliographical references and index.
+505 1  $av. 1. Fundamental algorithms.--v. 2. Semi-numerical algorithms.--v. 3. Sorting and searching.
+650  0 $aComputer programming.
+991    $bc-GenColl$hQA76.5$i.K57$tCopy 1$wBOOKS
+},
+       Author = {Knuth, Donald Ervin},
+       Call-Number = {QA76.5},
+       Date-Added = {2011-01-22 18:55:04 -0500},
+       Date-Modified = {2011-01-22 18:57:09 -0500},
+       Dewey-Call-Number = {651.8},
+       Genre = {Computer programming},
+       Library-Id = {67026020},
+       Publisher = {Addison-Wesley Pub. Co},
+       Series = {Addison-Wesley series in computer science and information processing},
+       Title = {The art of computer programming},
+       Year = {1968}}
+
+@book{Knuth:1986,
+       Address = {Reading, Mass.},
+       Annote = {LDR    01003cam  2200289 a 4500
+001    971492
+005    19930513170818.4
+008    851209s1986    maua          001 0 eng  
+035    $9(DLC)   85030845
+906    $a7$bcbc$corignew$d1$eocip$f19$gy-gencatlg
+010    $a   85030845 
+020    $a0201134470 :$c$32.95
+020    $a0201134489 (pbk)
+040    $aDLC$cDLC$dDLC
+050 00 $aZ253.4.T47$bK58 1986
+082 00 $a686.2/2544$219
+100 1  $aKnuth, Donald Ervin,$d1938-
+245 14 $aThe TeXbook /$cDonald E. Knuth ; illustrations by Duane Bibby.
+260    $aReading, Mass. :$bAddison-Wesley,$cc1986.
+300    $aix, 483 p. :$bill. ;$c24 cm.
+490 1  $aComputers & typesetting ;$vA
+500    $aIncludes index.
+630 00 $aTeX (Computer file)
+650  0 $aComputerized typesetting.
+650  0 $aMathematics printing$xComputer programs.
+800 1  $aKnuth, Donald Ervin,$d1938-$tComputers & typesetting ;$vA.
+991    $bc-GenColl$hZ253.4.T47$iK58 1986$p00000665666$tCopy 1$wBOOKS
+},
+       Author = {Knuth, Donald Ervin},
+       Call-Number = {Z253.4.T47},
+       Date-Added = {2011-01-22 18:54:36 -0500},
+       Date-Modified = {2011-01-22 18:57:09 -0500},
+       Dewey-Call-Number = {686.2/2544},
+       Genre = {Computerized typesetting},
+       Isbn = {0201134470},
+       Library-Id = {85030845},
+       Publisher = {Addison-Wesley},
+       Series = {Computers & typesetting},
+       Title = {The TeXbook},
+       Volume = {A},
+       Year = {1986}}