/usr/share/pyshared/plasTeX/Packages/book.py is in python-plastex 0.9.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | import os, glob
from plasTeX import Command, Environment, TheCounter
def ProcessOptions(options, document):
context = document.context
# Lists
context.newcounter('enumi')
context.newcounter('enumii', resetby='enumi')
context.newcounter('enumiii', resetby='enumii')
context.newcounter('enumiv', resetby='enumiii')
# Sections
context.newcounter('part', resetby='volume',
format='$part')
context.newcounter('chapter', resetby='part',
format='$chapter')
context.newcounter('section', resetby='chapter',
format='${thechapter}.${section}')
context.newcounter('subsection', resetby='section',
format='${thesection}.${subsection}')
context.newcounter('subsubsection', resetby='subsection',
format='${thesubsection}.${subsubsection}')
context.newcounter('paragraph', resetby='subsubsection',
format='${thesubsubsection}.${paragraph}')
context.newcounter('subparagraph', resetby='paragraph',
format='${theparagraph}.${subparagraph}')
context.newcounter('subsubparagraph', resetby='subparagraph',
format='${thesubparagraph}.${subsubparagraph}')
context.newcounter('equation', resetby='chapter',
format='${thechapter}.${equation}')
context.newcounter('secnumdepth')
context.newcounter('tocdepth')
context.newcounter('page')
# Floats
context.newcounter('figure', resetby='chapter',
format='${thechapter}.${figure}')
context.newcounter('table', resetby='chapter',
format='${thechapter}.${table}')
context.newcounter('topnumber')
context.newcounter('bottomnumber')
context.newcounter('totalnumber')
context.newcounter('dbltopnumber')
context.loadLanguage('american', document)
language = False
languages = document.context.languages.keys()
for key, value in options.items():
if key == 'language':
language = True
context.loadLanguage(value, document)
elif key in languages:
language = True
context.loadLanguage(key, document)
class frontmatter(Command):
pass
class mainmatter(Command):
pass
class backmatter(Command):
pass
class appendix(Command):
class thechapter(TheCounter):
format = '${chapter.Alph}'
def invoke(self, tex):
self.ownerDocument.context.counters['chapter'].setcounter(0)
self.ownerDocument.context['thechapter'] = type(self).thechapter
|