database_tools中生成讲义里讲义只有一个section时不加标题
This commit is contained in:
parent
e455bf9a07
commit
10f44bb422
|
|
@ -1273,7 +1273,8 @@ def GenerateSingleLessonNote(id,notesdict,metadict,templatepath,outputfilepath,c
|
||||||
paragraphs = [p for p in rawoutput.split("\\section") if not p.strip() == ""]
|
paragraphs = [p for p in rawoutput.split("\\section") if not p.strip() == ""]
|
||||||
for item in paragraphs:
|
for item in paragraphs:
|
||||||
sectionkey, content = re.findall(r"\{([\S]*)\}\n([\S\s]*)$",item)[0]
|
sectionkey, content = re.findall(r"\{([\S]*)\}\n([\S\s]*)$",item)[0]
|
||||||
output += "\\section{" + structure[sectionkey]["name"] + "}\n\n"
|
if not len(paragraphs) == 1:
|
||||||
|
output += "\\section{" + structure[sectionkey]["name"] + "}\n\n"
|
||||||
if not structure[sectionkey]["spaceflag"] or answered:
|
if not structure[sectionkey]["spaceflag"] or answered:
|
||||||
content = re.sub(r"\\vspace[\*]?\{[\S]*\}","\n",content)
|
content = re.sub(r"\\vspace[\*]?\{[\S]*\}","\n",content)
|
||||||
output += content + "\n\n"
|
output += content + "\n\n"
|
||||||
|
|
|
||||||
Reference in New Issue