Improve multi-language support

This commit is contained in:
Nero 2022-07-02 20:55:45 +00:00
parent 121ebca9ae
commit 6c831dc78f
3 changed files with 27 additions and 9 deletions

8
md2tex
View file

@ -5,6 +5,7 @@ BEGIN {
tag("documentclass[a4paper]{article}")
# tag("special{papersize=210mm,297mm}")
tag("usepackage[margin=1in]{geometry}")
tag("usepackage[utf8]{inputenc}")
tag("setlength{\\parskip}{\\baselineskip}%")
tag("setlength{\\parindent}{0pt}%")
tag("usepackage{listings}")
@ -82,9 +83,12 @@ function inline(text) {
}
}
/^## / {
/^##* / {
d=length($1)
t="section"
for (i=3; i<=d; i++) t="sub"t
gsub(/^#* /, "", $0)
tag("section{" $0 "}")
tag(t"{" $0 "}")
next
}