ebook icon indicating copy to clipboard operation
ebook copied to clipboard

Title page not parsing TeX

Open laboon opened this issue 5 years ago • 2 comments

Title page is showing raw TeX instead of formatting.

laboon avatar Mar 21 '19 13:03 laboon

Poked a bit at this and the -M parameters are escaped by pandoc. It seems the easiest way is to just write some custom tex for the title page.

GeeF avatar May 15 '19 09:05 GeeF

To expand on what @GeeF said, here's a snippet from the manual:

-M KEY[=VAL], --metadata=KEY[:VAL]

Set the metadata field KEY to the value VAL. [...] unlike --variable, --metadata affects the metadata of the underlying document (which is accessible from filters and may be printed in some output formats) and metadata values will be escaped when inserted into the template.

This can be resolved by setting an option that's not escaped, like --variable. Here's a diff that does the trick:

diff --git a/Makefile b/Makefile
index c2fb292..d20a2a9 100644
--- a/Makefile
+++ b/Makefile
@@ -19,9 +19,9 @@ pdf:	main.tex tex_files
 		-M classoption="twoside" \
 		-M classoption="letterpaper" \
 		-M geometry="margin=1.25in" \
-		-M title="\Huge{\textbf{${TITLE}}}" \
-		-M author="\LARGE{${AUTHOR}}" \
-		-M date="{\Large\textcopyright~\textbf{$(shell git log -1 --date=iso --format='%ai' | cut -c-10 )}}\\\\Compiled in PDF\LaTeX{}\endgraf\textit{${DEDICATION}}"
+		-V title="\Huge{\textbf{${TITLE}}}" \
+		-V author="\LARGE{${AUTHOR}}" \
+		-V date="{\Large\textcopyright~\textbf{$(shell git log -1 --date=iso --format='%ai' | cut -c-10 )}}\\\\Compiled in PDF\LaTeX{}\endgraf\textit{${DEDICATION}}"
 
 tex_files:	compiled_tex/ $(patsubst text/%.md,compiled_tex/%.tex,$(MD_FILES))
 compiled_tex/:

Ichimonji10 avatar Oct 01 '19 16:10 Ichimonji10