From: Fletcher T. Penney Date: Mon, 29 May 2017 22:03:42 +0000 (-0400) Subject: ADDED: Add support for 'latexauthor' and 'latextitle' metadata (Addresses #58) X-Git-Tag: 6.1.0^2~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d371c8530d8d4e7f9a1a95b123706a7a8dba9f1;p=multimarkdown ADDED: Add support for 'latexauthor' and 'latextitle' metadata (Addresses #58) --- diff --git a/Sources/libMultiMarkdown/latex.c b/Sources/libMultiMarkdown/latex.c index 93d4d94..b1d7557 100644 --- a/Sources/libMultiMarkdown/latex.c +++ b/Sources/libMultiMarkdown/latex.c @@ -1890,16 +1890,22 @@ void mmd_start_complete_latex(DString * out, const char * source, scratch_pad * } else if (strcmp(m->key, "mmdfooter") == 0) { } else if (strcmp(m->key, "mmdheader") == 0) { } else if (strcmp(m->key, "quoteslanguage") == 0) { - } else if ((strcmp(m->key, "title") == 0) || - (strcmp(m->key, "latextitle") == 0)) { + } else if (strcmp(m->key, "title") == 0) { print_const("\\def\\mytitle{"); mmd_print_string_latex(out, m->value); print_const("}\n"); - } else if ((strcmp(m->key, "author") == 0) || - (strcmp(m->key, "latexauthor") == 0)) { + } else if (strcmp(m->key, "latextitle") == 0) { + print_const("\\def\\latextitle{"); + print(m->value); + print_const("}\n"); + } else if (strcmp(m->key, "author") == 0) { print_const("\\def\\myauthor{"); mmd_print_string_latex(out, m->value); print_const("}\n"); + } else if (strcmp(m->key, "latexauthor") == 0) { + print_const("\\def\\latexauthor{"); + print(m->value); + print_const("}\n"); } else if (strcmp(m->key, "date") == 0) { print_const("\\def\\mydate{"); mmd_print_string_latex(out, m->value); diff --git a/texmf/tex/latex/mmd6/article/mmd6-article-begin.tex b/texmf/tex/latex/mmd6/article/mmd6-article-begin.tex index d82f55c..29f21e2 100644 --- a/texmf/tex/latex/mmd6/article/mmd6-article-begin.tex +++ b/texmf/tex/latex/mmd6/article/mmd6-article-begin.tex @@ -20,7 +20,7 @@ \VerbatimFootnotes -\title{\mytitle} +\title{\latextitle} \author{\myauthor} \ifx\mydate\undefined diff --git a/texmf/tex/latex/mmd6/shared/mmd6-title.tex b/texmf/tex/latex/mmd6/shared/mmd6-title.tex index 7e67673..e108fed 100644 --- a/texmf/tex/latex/mmd6/shared/mmd6-title.tex +++ b/texmf/tex/latex/mmd6/shared/mmd6-title.tex @@ -35,4 +35,9 @@ \ifx\event\undefined \else \date[\mydate]{\today} -\fi \ No newline at end of file +\fi + +\ifx\latextitle\undefined + \def\latextitle{\mytitle} +\else +\fi