]> granicus.if.org Git - multimarkdown/commitdiff
ADDED: Improved citation support in LaTeX
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 13 Feb 2017 05:30:34 +0000 (00:30 -0500)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 13 Feb 2017 05:30:34 +0000 (00:30 -0500)
37 files changed:
src/html.c
src/latex.c
src/latex.h
src/writer.c
src/writer.h
tests/MMD6Tests/Citations.html
tests/MMD6Tests/Citations.htmlc
tests/MMD6Tests/Citations.tex [new file with mode: 0644]
tests/MMD6Tests/Citations.text
tests/MMD6Tests/Dutch.html
tests/MMD6Tests/Dutch.htmlc
tests/MMD6Tests/Dutch.tex [new file with mode: 0644]
tests/MMD6Tests/Dutch.text
tests/MMD6Tests/English.html
tests/MMD6Tests/English.htmlc
tests/MMD6Tests/English.tex [new file with mode: 0644]
tests/MMD6Tests/English.text
tests/MMD6Tests/French.html
tests/MMD6Tests/French.htmlc
tests/MMD6Tests/French.tex [new file with mode: 0644]
tests/MMD6Tests/French.text
tests/MMD6Tests/German Guillemets.html
tests/MMD6Tests/German Guillemets.htmlc
tests/MMD6Tests/German Guillemets.tex [new file with mode: 0644]
tests/MMD6Tests/German Guillemets.text
tests/MMD6Tests/German.html
tests/MMD6Tests/German.htmlc
tests/MMD6Tests/German.tex [new file with mode: 0644]
tests/MMD6Tests/German.text
tests/MMD6Tests/Integrated.html
tests/MMD6Tests/Integrated.htmlc
tests/MMD6Tests/Integrated.tex
tests/MMD6Tests/Integrated.text
tests/MMD6Tests/Swedish.html
tests/MMD6Tests/Swedish.htmlc
tests/MMD6Tests/Swedish.tex [new file with mode: 0644]
tests/MMD6Tests/Swedish.text

index 2c836a22f2ccbef02f547dd42fa5c5d174a33b76..fd5fd9ef1eb7942ad6ee2402c127b9e79b843a46 100644 (file)
@@ -1047,15 +1047,10 @@ void mmd_export_token_html(DString * out, const char * source, token * t, size_t
                                citation_from_bracket(source, scratch, t, &temp_short);
 
                                if (temp_bool) {
-                                       if (temp_short < scratch->used_citations->size) {
-                                               // Re-using previous citation
-                                               printf("<a href=\"#cn:%d\" title=\"%s\" class=\"citation\">[%s%s%d]</a>",
-                                                               temp_short, LC("see citation"), temp_char, temp_char2, temp_short);
-                                       } else {
-                                               // This is a new citation
-                                               printf("<a href=\"#cn:%d\" id=\"cnref:%d\" title=\"%s\" class=\"citation\">[%s%s%d]</a>",
-                                                               temp_short, temp_short, LC("see citation"), temp_char, temp_char2, temp_short);
-                                       }
+                    // This is a new citation
+                    temp_short = scratch->used_citations->size;
+                    printf("<a href=\"#cn:%d\" id=\"cnref:%d\" title=\"%s\" class=\"citation\">[%s%s%d]</a>",
+                            temp_short, temp_short, LC("see citation"), temp_char, temp_char2, temp_short);
                                }
 
                                if (t->prev && (t->prev->type == PAIR_BRACKET)) {
index c5abdeb222ffa68a3a8c0675674a4213e99c74ed..c73a4197f325b6784701f98415da9b5952b1bf98 100644 (file)
@@ -810,51 +810,60 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat
                        break;
                case PAIR_BRACKET_CITATION:
                        parse_citation:
-                       temp_bool = true;
-
-                       if (t->type == PAIR_BRACKET) {
-                               // This is a locator for subsequent citation
-                               temp_char = text_inside_pair(source, t);
-                               temp_char2 = label_from_string(temp_char);
-
-                               if (strcmp(temp_char2, "notcited") == 0) {
-                                       free(temp_char2);
-                                       free(temp_char);
-                                       temp_char = strdup("");
-                                       temp_bool = false;
-                               }
-
-                               if (temp_char[0] == '\0')
-                                       temp_char2 = strdup("");
-                               else
-                                       temp_char2 = strdup(", ");
-
-
-                               // Process the actual citation
-                               t = t->next;
-                       } else {
-                               temp_char = strdup("");
-                               temp_char2 = strdup("");
-                       }
-
-                       if (scratch->extensions & EXT_NOTES) {
+                       temp_bool = true;   // Track whether this is a 'not cited'
+            temp_token = t;     // Remember whether we need to skip ahead
+            
+            if (scratch->extensions & EXT_NOTES) {
+                if (t->type == PAIR_BRACKET) {
+                    // This is a locator for subsequent citation (e.g. `[foo][#bar]`
+                    temp_char = text_inside_pair(source, t);
+                    temp_char2 = label_from_string(temp_char);
+
+                    if (strcmp(temp_char2, "notcited") == 0) {
+                        free(temp_char);
+                        temp_char = strdup("");
+                        temp_bool = false;
+                    }
+
+                    free(temp_char2);
+
+                    // Process the actual citation
+                    t = t->next;
+                } else {
+                    // This is just a citation (e.g. `[#foo]`)
+                    temp_char = strdup("");
+                }
+
+                // See if we're a citep or cite
+                temp_char2 = clean_inside_pair(source, t, false);
+                
                                citation_from_bracket(source, scratch, t, &temp_short);
 
-                               if (temp_bool) {
-                                       if (temp_short < scratch->used_citations->size) {
-                                               // Re-using previous citation
-                                               printf("\\citation{reuse");
+                               temp_note = stack_peek_index(scratch->used_citations, temp_short - 1);
 
-                                               printf("}");
+                               if (temp_bool) {
+                                       // This is not a "not cited"
+                                       if (temp_char[0] == '\0') {
+                        if (temp_char2[strlen(temp_char2) - 1] == ';') {
+                            print("\\citet");
+                        } else {
+                            print("~\\citep");
+                        }
                                        } else {
-                                               // This is a new citation
-                                               printf("\\citation{");
-
-                                               printf("}");
+                        if (temp_char2[strlen(temp_char2) - 1] == ';') {
+                            printf("\\citet[%s]", temp_char);
+                        } else {
+                            printf("~\\citep[%s]", temp_char);
+                        }
                                        }
+
+                                       printf("{%s}", temp_note->label_text);
+                               } else {
+                                       // This is a "nocite"
+                                       printf("~\\nocite{%s}",temp_note->label_text);
                                }
 
-                               if (t->prev && (t->prev->type == PAIR_BRACKET)) {
+                               if (temp_token != t) {
                                        // Skip citation on next pass
                                        scratch->skip_token = 1;
                                }
@@ -1241,3 +1250,37 @@ void mmd_end_complete_latex(DString * out, const char * source, scratch_pad * sc
 
 }
 
+void mmd_export_citation_list_latex(DString * out, const char * source, scratch_pad * scratch) {
+       if (scratch->used_citations->size > 0) {
+               footnote * note;
+               token * content;
+
+               pad(out, 2, scratch);
+               print("\\begin{thebibliography}{0}");
+               scratch->padded = 0;
+
+               for (int i = 0; i < scratch->used_citations->size; ++i)
+               {
+                       // Export footnote
+                       pad(out, 2, scratch);
+
+                       note = stack_peek_index(scratch->used_citations, i);
+                       content = note->content;
+
+                       printf("\\bibitem{%s}\n", note->label_text);
+                       scratch->padded = 6;
+
+                       scratch->footnote_para_counter = 0;
+
+                       content = note->content;
+                       scratch->citation_being_printed = i + 1;
+
+                       mmd_export_token_tree_latex(out, source, content, scratch);
+               }
+
+               pad(out, 1, scratch);
+               print("\\end{thebibliography}");
+               scratch->padded = 0;
+               scratch->citation_being_printed = 0;
+       }
+}
index 0734a15b6735f4590a4f6ae5580a9db16e4500fd..c755882d28d18a48240172f2196b3b5dfb3b7fc0 100644 (file)
@@ -77,5 +77,7 @@ void mmd_export_footnote_list_latex(DString * out, const char * source, scratch_
 void mmd_start_complete_latex(DString * out, const char * source, scratch_pad * scratch);
 void mmd_end_complete_latex(DString * out, const char * source, scratch_pad * scratch);
 
+void mmd_export_citation_list_latex(DString * out, const char * source, scratch_pad * scratch);
+
 
 #endif
index 095d01b05c35d501132411c62acc233d1c41a920..0a801ddc4dd85491600040ab3015c246cbe51315 100644 (file)
@@ -1310,6 +1310,7 @@ void mmd_export_token_tree(DString * out, mmd_engine * e, short format) {
                                mmd_start_complete_latex(out, e->dstr->str, scratch);
 
                        mmd_export_token_tree_latex(out, e->dstr->str, e->root, scratch);
+                       mmd_export_citation_list_latex(out, e->dstr->str, scratch);
 
                        if (scratch->extensions & EXT_COMPLETE)
                                mmd_end_complete_latex(out, e->dstr->str, scratch);
@@ -1532,12 +1533,12 @@ void citation_from_bracket(const char * source, scratch_pad * scratch, token * t
        free(text);
 
        if (citation_id == -1) {
-               // No match, this is an inline footnote -- create a new one
+               // No match, this is an inline citation -- create a new one
                t->child->type = TEXT_EMPTY;
                t->child->mate->type = TEXT_EMPTY;
 
-               // Create footnote
-               footnote * temp = footnote_new(source, NULL, t->child);
+               // Create citation
+               footnote * temp = footnote_new(source, t, t->child);
 
                // Store as used
                stack_push(scratch->used_citations, temp);
index b20b1f3a241202b5682c8d6f7c53d4939cee9bc6..852fa3ceea84c7f47efe1df3b9d10efe1a264a93 100644 (file)
@@ -176,6 +176,7 @@ link * explicit_link(scratch_pad * scratch, token * label, token * url, const ch
 link * extract_link_from_stack(scratch_pad * scratch, const char * target);
 
 char * text_inside_pair(const char * source, token * pair);
+char * clean_inside_pair(const char * source, token * t, bool lowercase);
 
 void link_free(link * l);
 void footnote_free(footnote * f);
index 2de9e9702e1fd0350de38e7f899023bff1ebb3da..283988d1885d03e5e3ca455fb471372cc29c1911 100644 (file)
@@ -1,8 +1,30 @@
+<h1 id="citep">citep </h1>
+
 <p><a href="#cn:1" id="cnref:1" title="see citation" class="citation">[1]</a></p>
 
-<p><a href="#cn:1" id="cnref:1" title="see citation" class="citation">[p. 123, 1]</a></p>
+<p><a href="#cn:1" title="see citation" class="citation">[1]</a>[]</p>
 
-<p><a href="#cn:1" id="cnref:1" title="see citation" class="citation">[1]</a></p>
+<p><a href="#cn:1" title="see citation" class="citation">[p. 123, 1]</a></p>
+
+<p><a href="#cn:1" title="see citation" class="citation">[1]</a></p>
+
+<p><a href="#cn:1" title="see citation" class="citation">[foo\]\[bar, 1]</a></p>
+
+<p><a href="#cn:1" title="see citation" class="citation">[1]</a><a href="#cn:2" id="cnref:2" title="see citation" class="citation">[2]</a></p>
+
+<h1 id="citet">citet </h1>
+
+<p><a href="#cn:1" title="see citation" class="citation">[1]</a></p>
+
+<p><a href="#cn:1" title="see citation" class="citation">[1]</a>[]</p>
+
+<p><a href="#cn:1" title="see citation" class="citation">[p. 123, 1]</a></p>
+
+<p><a href="#cn:1" title="see citation" class="citation">[1]</a></p>
+
+<p><a href="#cn:1" title="see citation" class="citation">[foo\]\[bar, 1]</a></p>
+
+<p><a href="#cn:1" title="see citation" class="citation">[1]</a><a href="#cn:2" title="see citation" class="citation">[2]</a></p>
 
 <p></p>
 
index 47e66486fe058e58c98980627eeb19bdad4224c3..307887aadb80e1f9c3ba293500015ad18d6a4c02 100644 (file)
@@ -1,9 +1,31 @@
+<h1>citep </h1>
+
 <p>[#foo1]</p>
 
+<p>[#foo1][]</p>
+
 <p>[p. 123][#foo1]</p>
 
 <p>[][#foo1]</p>
 
+<p>[foo][bar][#foo1]</p>
+
+<p>[#foo1][#foo2]</p>
+
+<h1>citet </h1>
+
+<p>[#foo1;]</p>
+
+<p>[#foo1;][]</p>
+
+<p>[p. 123][#foo1;]</p>
+
+<p>[][#foo1;]</p>
+
+<p>[foo][bar][#foo1;]</p>
+
+<p>[#foo1;][#foo2;]</p>
+
 <p>[Not Cited][#foo2]</p>
 
 <p>[#foo1]: John Doe. <em>A Totally Fake Book</em>. Vanity Press, 2006.</p>
diff --git a/tests/MMD6Tests/Citations.tex b/tests/MMD6Tests/Citations.tex
new file mode 100644 (file)
index 0000000..d00c334
--- /dev/null
@@ -0,0 +1,41 @@
+\part{citep }
+\label{citep}
+
+~\citep{foo1}
+
+~\citep{foo1}
+
+~\citep[p. 123]{foo1}
+
+~\citep{foo1}
+
+~\citep[foo][bar]{foo1}
+
+~\citep{foo1}~\citep{foo2}
+
+\part{citet }
+\label{citet}
+
+\citet{foo1}
+
+\citet{foo1}
+
+\citet[p. 123]{foo1}
+
+\citet{foo1}
+
+\citet[foo][bar]{foo1}
+
+\citet{foo1}\citet{foo2}
+
+~\nocite{foo2}
+
+\begin{thebibliography}{0}
+
+\bibitem{foo1}
+John Doe. \emph{A Totally Fake Book}. Vanity Press, 2006.
+
+\bibitem{foo2}
+John Doe. \emph{A Totally Fake Book}. Vanity Press, 2006.
+
+\end{thebibliography}
index bd486666dd8b7afef329f1047ec95f3c916e0da8..a44c164cae60c8e48cd7607e052e9b3f34b70ee0 100644 (file)
@@ -1,9 +1,33 @@
+# citep #
+
 [#foo1]
 
+[#foo1][]
+
 [p. 123][#foo1]
 
 [][#foo1]
 
+[foo\]\[bar][#foo1]
+
+[#foo1][#foo2]
+
+
+# citet #
+
+[#foo1;]
+
+[#foo1;][]
+
+[p. 123][#foo1;]
+
+[][#foo1;]
+
+[foo\]\[bar][#foo1;]
+
+[#foo1;][#foo2;]
+
+
 [Not Cited][#foo2]
 
 [#foo1]: John Doe. *A Totally Fake Book*.  Vanity Press, 2006.
index ccb0e226d27a9bb0dbfdf8bcf8c9b11809c8521d..a406776630307fb63dbd4e2af52662d5c4b507d3 100644 (file)
@@ -32,7 +32,7 @@
 <ol>
 
 <li id="cn:1">
-<p>bar <a href="#cnref:1" title="return to body" class="reversecitation">&#160;&#8617;</a></p>
+<p>foo <a href="#cnref:1" title="return to body" class="reversecitation">&#160;&#8617;</a></p>
 </li>
 
 </ol>
index 20decdcac6f8040c89436441389a3fa6e9194bcd..1f1f7465262ef04ee39a6e46243309a7ffb812fc 100644 (file)
@@ -16,4 +16,4 @@
 
 <p>[^foo]</p>
 
-<p>[#bar]</p>
+<p><a href="foo">#bar</a></p>
diff --git a/tests/MMD6Tests/Dutch.tex b/tests/MMD6Tests/Dutch.tex
new file mode 100644 (file)
index 0000000..4b1a6d6
--- /dev/null
@@ -0,0 +1,23 @@
+`foo'
+
+„foo''
+
+foo's
+
+foo --- bar
+
+foo -- bar
+
+5
+
+foo{\ldots}
+
+\footnote{foo}
+
+~\citep{bar}
+
+\begin{thebibliography}{0}
+
+\bibitem{bar}
+foo
+\end{thebibliography}
index 8f136995907118fa5a8dd89ea7c5b7c4e4ecbe23..7fb8fb3e2ae6a1d60b492e03ea1bc18721a788bb 100644 (file)
@@ -17,3 +17,5 @@ foo...
 [^foo]
 
 [#bar]
+
+[#bar]: foo
index 5af934779bab1c22487918156a7198100e99abf1..54f637df4bfdea458a97d17ea1a32a181631c75a 100644 (file)
@@ -32,7 +32,7 @@
 <ol>
 
 <li id="cn:1">
-<p>bar <a href="#cnref:1" title="return to body" class="reversecitation">&#160;&#8617;</a></p>
+<p>foo <a href="#cnref:1" title="return to body" class="reversecitation">&#160;&#8617;</a></p>
 </li>
 
 </ol>
index f5c2b7db111b3ca517643dd6af88cf7fd95610ea..91ac1038c2ff4f8a373541524ef900b70246e134 100644 (file)
@@ -16,4 +16,4 @@
 
 <p>[^foo]</p>
 
-<p>[#bar]</p>
+<p><a href="foo">#bar</a></p>
diff --git a/tests/MMD6Tests/English.tex b/tests/MMD6Tests/English.tex
new file mode 100644 (file)
index 0000000..6d34bd5
--- /dev/null
@@ -0,0 +1,23 @@
+`foo'
+
+``foo''
+
+foo's
+
+foo --- bar
+
+foo -- bar
+
+5
+
+foo{\ldots}
+
+\footnote{foo}
+
+~\citep{bar}
+
+\begin{thebibliography}{0}
+
+\bibitem{bar}
+foo
+\end{thebibliography}
index 9172ef16e7bcfcd9f2aff766e9e3605e297cda93..28eeb2ac5f49462eaa02775c3e2b0e571810fc30 100644 (file)
@@ -17,3 +17,5 @@ foo...
 [^foo]
 
 [#bar]
+
+[#bar]: foo
index b27c02c5fa483f6ab49dfd09af1e25da31788404..d5c1f8982883c29adf507c51724abcbb9ab7709c 100644 (file)
@@ -32,7 +32,7 @@
 <ol>
 
 <li id="cn:1">
-<p>bar <a href="#cnref:1" title="return to body" class="reversecitation">&#160;&#8617;</a></p>
+<p>foo <a href="#cnref:1" title="return to body" class="reversecitation">&#160;&#8617;</a></p>
 </li>
 
 </ol>
index 4314734d71e3a80e13110b5c47dadd87779e4238..2db85c0086880ff720b80d880c99d9873e6cd2eb 100644 (file)
@@ -16,4 +16,4 @@
 
 <p>[^foo]</p>
 
-<p>[#bar]</p>
+<p><a href="foo">#bar</a></p>
diff --git a/tests/MMD6Tests/French.tex b/tests/MMD6Tests/French.tex
new file mode 100644 (file)
index 0000000..7e09b97
--- /dev/null
@@ -0,0 +1,23 @@
+'foo'
+
+«foo»
+
+foo's
+
+foo --- bar
+
+foo -- bar
+
+5
+
+foo{\ldots}
+
+\footnote{foo}
+
+~\citep{bar}
+
+\begin{thebibliography}{0}
+
+\bibitem{bar}
+foo
+\end{thebibliography}
index c496fbc3ecfddb996056e6998a796a982395196f..9a770b9d644bfd9fb49d25f36295f06c2bcffff0 100644 (file)
@@ -17,3 +17,5 @@ foo...
 [^foo]
 
 [#bar]
+
+[#bar]: foo
index e9965fd4885e7d699ffdff6e9bca884989e82aa8..dc3f79b580a1de413429e6a8f93445efe2942123 100644 (file)
 
 <p>foo&#8230;</p>
 
-<p><a href="#fn:1" id="fnref:1" title="siehe Fußnote" class="footnote">[1]</a></p>
+<p><a href="#fn:1" id="fnref:1" title="see footnote" class="footnote">[1]</a></p>
 
-<p><a href="#cn:1" id="cnref:1" title="siehe Zitat" class="citation">[1]</a></p>
+<p><a href="#cn:1" id="cnref:1" title="see citation" class="citation">[1]</a></p>
 
 <div class="footnotes">
 <hr />
 <ol>
 
 <li id="fn:1">
-<p>foo <a href="#fnref:1" title="zum Haupttext" class="reversefootnote">&#160;&#8617;</a></p>
+<p>foo <a href="#fnref:1" title="return to body" class="reversefootnote">&#160;&#8617;</a></p>
 </li>
 
 </ol>
@@ -32,7 +32,7 @@
 <ol>
 
 <li id="cn:1">
-<p>bar <a href="#cnref:1" title="zum Haupttext" class="reversecitation">&#160;&#8617;</a></p>
+<p>foo <a href="#cnref:1" title="return to body" class="reversecitation">&#160;&#8617;</a></p>
 </li>
 
 </ol>
index c62c0af1aac0fba603098c1faf52e2bcbcec373b..ad86d1d8223a2202cb2c507a7fcfb9ccf6a89de0 100644 (file)
@@ -17,4 +17,4 @@ quotes language:      germanguillemets</p>
 
 <p>[^foo]</p>
 
-<p>[#bar]</p>
+<p><a href="foo">#bar</a></p>
diff --git a/tests/MMD6Tests/German Guillemets.tex b/tests/MMD6Tests/German Guillemets.tex
new file mode 100644 (file)
index 0000000..fa88f64
--- /dev/null
@@ -0,0 +1,23 @@
+›foo‹
+
+»foo«
+
+foo's
+
+foo --- bar
+
+foo -- bar
+
+5
+
+foo{\ldots}
+
+\footnote{foo}
+
+~\citep{bar}
+
+\begin{thebibliography}{0}
+
+\bibitem{bar}
+foo
+\end{thebibliography}
index fada37f475149e9f88ceb6bdeb12338a11394d24..22ef9a4c7a3f5ec7bf0bb72efe55710c3e35ff8b 100644 (file)
@@ -18,3 +18,5 @@ foo...
 [^foo]
 
 [#bar]
+
+[#bar]: foo
index 26c893a689061b5d84f35ccf31138e6ab891758b..8031dc21f0b1f8c6dc2ed2e22de2fecd83a4b159 100644 (file)
 
 <p>foo&#8230;</p>
 
-<p><a href="#fn:1" id="fnref:1" title="siehe Fußnote" class="footnote">[1]</a></p>
+<p><a href="#fn:1" id="fnref:1" title="see footnote" class="footnote">[1]</a></p>
 
-<p><a href="#cn:1" id="cnref:1" title="siehe Zitat" class="citation">[1]</a></p>
+<p><a href="#cn:1" id="cnref:1" title="see citation" class="citation">[1]</a></p>
 
 <div class="footnotes">
 <hr />
 <ol>
 
 <li id="fn:1">
-<p>foo <a href="#fnref:1" title="zum Haupttext" class="reversefootnote">&#160;&#8617;</a></p>
+<p>foo <a href="#fnref:1" title="return to body" class="reversefootnote">&#160;&#8617;</a></p>
 </li>
 
 </ol>
@@ -32,7 +32,7 @@
 <ol>
 
 <li id="cn:1">
-<p>bar <a href="#cnref:1" title="zum Haupttext" class="reversecitation">&#160;&#8617;</a></p>
+<p>foo <a href="#cnref:1" title="return to body" class="reversecitation">&#160;&#8617;</a></p>
 </li>
 
 </ol>
index b13d0eee450b38086b44406e4d0797ced85c543e..a5c44b42ac3cc7ee4a8d83b19c656b84e458ed8b 100644 (file)
@@ -16,4 +16,4 @@
 
 <p>[^foo]</p>
 
-<p>[#bar]</p>
+<p><a href="foo">#bar</a></p>
diff --git a/tests/MMD6Tests/German.tex b/tests/MMD6Tests/German.tex
new file mode 100644 (file)
index 0000000..970d3d3
--- /dev/null
@@ -0,0 +1,23 @@
+‚foo`
+
+„foo``
+
+foo's
+
+foo --- bar
+
+foo -- bar
+
+5
+
+foo{\ldots}
+
+\footnote{foo}
+
+~\citep{bar}
+
+\begin{thebibliography}{0}
+
+\bibitem{bar}
+foo
+\end{thebibliography}
index c26c033fc1ad7c7f27e28090b3f58970860a346d..649acdf4879985e7715436c0454d4f74efe7afd0 100644 (file)
@@ -17,3 +17,5 @@ foo...
 [^foo]
 
 [#bar]
+
+[#bar]: foo
index 70814cef161123e648fd4a21f84c242076ef0bce..00387d04ff2f8404f4fd0b99c988de4562ed613b 100644 (file)
@@ -46,6 +46,8 @@ code
 
 <p>Cite.<a href="#cn:1" id="cnref:1" title="see citation" class="citation">[1]</a></p>
 
+<p>Cite.<a href="#cn:2" id="cnref:2" title="see citation" class="citation">[2]</a></p>
+
 <h1 id="linksandimages">Links and Images </h1>
 
 <p><a href="http://foo.net/">link</a> and <a href="http://bar.net" title="title" class="custom">link</a></p>
@@ -128,5 +130,10 @@ code
 <p>Inline Citation <a href="#cnref:1" title="return to body" class="reversecitation">&#160;&#8617;</a></p>
 </li>
 
+<li id="cn:2">
+<p>bar
+ <a href="#cnref:2" title="return to body" class="reversecitation">&#160;&#8617;</a></p>
+</li>
+
 </ol>
 </div>
index 0bb4899d515e33b792a23d64823441b34574a0ac..eef9f93d09fc6fa0a8282b8c589e78ad7f923be5 100644 (file)
@@ -47,6 +47,8 @@ code
 
 <p>Cite.[#Inline Citation]</p>
 
+<p>Cite.<a href="bar">#foo</a></p>
+
 <h1>Links and Images </h1>
 
 <p><a href="http://foo.net/">link</a> and [link]</p>
index 26e7074d13c0dc1275984200180a4b83d4fa7da7..d8dc10852c303c34fda4fabc37f42d77c56304bf 100644 (file)
@@ -54,12 +54,14 @@ Foo.\footnote{This is an inline footnote}
 
 Bar.\footnote{And a reference footnote.}
 
-Cite.\citesyntax TBD
+Cite.~\citep{inlinecitation}
+
+Cite.~\citep{foo}
 
 \part{Links and Images }
 \label{linksandimages}
 
-\href{http://foo.net/}{link}\footnote{\href{http://foo.net/}{http:/\slash foo.net\slash }} and \href{http://bar.net}{link}\footnote{\href{http://bar.net}{http:/\slash bar.net}}
+\href{http://foo.net/}{link}\footnote{\href{http://foo.net/}{http:\slash \slash foo.net\slash }} and \href{http://bar.net}{link}\footnote{\href{http://bar.net}{http:\slash \slash bar.net}}
 
 \begin{figure}[htbp]
 \centering
@@ -123,3 +125,13 @@ baz bat*
 \label{horizontalrules}
 
 \begin{center}\rule{3in}{0.4pt}\end{center}
+
+\begin{thebibliography}{0}
+
+\bibitem{inlinecitation}
+Inline Citation
+
+\bibitem{foo}
+bar
+
+\end{thebibliography}
index 6f90471de1b0374bc4f8574e2d6112cb6f8d56e4..3bdbb29fd54179dceda88fceb492dfc12d49d0ba 100644 (file)
@@ -47,6 +47,10 @@ Bar.[^foot]
 
 Cite.[#Inline Citation]
 
+Cite.[#foo]
+
+[#foo]: bar
+
 
 # Links and Images #
 
index 4f4cf7459635455ee10d5f05bca0ea178fa15602..c82f3b49291978a5117a46f6b6d440a2290d7dbd 100644 (file)
@@ -32,7 +32,7 @@
 <ol>
 
 <li id="cn:1">
-<p>bar <a href="#cnref:1" title="return to body" class="reversecitation">&#160;&#8617;</a></p>
+<p>foo <a href="#cnref:1" title="return to body" class="reversecitation">&#160;&#8617;</a></p>
 </li>
 
 </ol>
index 014446c4fb084a9496e3ab1b8c1c87d48e9d02f3..bcf32207c89dd84643275bbc0176fb49e8f53250 100644 (file)
@@ -16,4 +16,4 @@
 
 <p>[^foo]</p>
 
-<p>[#bar]</p>
+<p><a href="foo">#bar</a></p>
\ No newline at end of file
diff --git a/tests/MMD6Tests/Swedish.tex b/tests/MMD6Tests/Swedish.tex
new file mode 100644 (file)
index 0000000..e081b02
--- /dev/null
@@ -0,0 +1,23 @@
+'foo'
+
+''foo''
+
+foo's
+
+foo --- bar
+
+foo -- bar
+
+5
+
+foo{\ldots}
+
+\footnote{foo}
+
+~\citep{bar}
+
+\begin{thebibliography}{0}
+
+\bibitem{bar}
+foo
+\end{thebibliography}
index bd11d077f8f3706333cf9abd9ef6e51dd0d91171..d5a789e2cce30e55d05e9e5c8bea4a9510a2f424 100644 (file)
@@ -17,3 +17,5 @@ foo...
 [^foo]
 
 [#bar]
+
+[#bar]: foo