6.14.7.10. Headings

Start python section to interscript/weavers/latex.py[11 /19 ] Next Prev First Last
   279: #line 301 "latex_weaver.ipk"
   280:   def head(self,level, text, **kwds):
   281:     atext=kwds.get('short_text','')
   282:     anchor=kwds.get('key','')
   283:     cmds = {
   284:       1:'\\part',
   285:       2:'\\chapter',
   286:       3:'\\section',
   287:       4:'\\subsection',
   288:       5:'\\subsubsection',
   289:       6:'\\paragraph',
   290:       7:'\\subparagraph'}
   291:     lev = level+self.heading_level_offset
   292:     if lev>7:lev=7
   293:     cmd = cmds[lev]
   294:     if anchor == '': anchor = atext
   295:     if anchor == '':
   296:       anchor = 'h'+str(self.acount)
   297:       self.acount = self.acount + 1
   298: 
   299:     if atext:
   300:       self._writeline(cmd+'['+atext+']{'+text+'}\\label{'+anchor+'}')
   301:     else:
   302:       self._writeline(cmd+'{'+text+'}\\label{'+anchor+'}')
   303: 
End python section to interscript/weavers/latex.py[11]