2,3c2,4 < # txt2tags - generic text conversion tool < # http://txt2tags.sf.net --- > # > # t2t - patched txt2tags generic text conversion tool > # http://pst.libre.lu/toolz/t2t 5a7 > # Copyright 2005, 2006 Pascal Steichen 148,149c150,155 < TARGETS = ['html', 'xhtml', 'sgml', 'tex', 'lout', 'man', 'mgp', < 'moin', 'pm6' , 'txt'] --- > > # pst: added ltb to TARGETS and TARGET_NAMES > # ltb which stands for latex-beamer ;) > TARGETS = ['html', 'xhtml', 'sgml', 'tex', 'ltb', 'lout', 'man', 'mgp', > 'moin', 'pm6' , 'txt'] > #pst: added handout flag 153c159 < 'quiet' :0 } --- > 'quiet' :0 , 'handout' :0 } 172a179 > 'ltb' : _('LaTeX-Beamer document'), 209a217 > #pst: added handout flag 219a228 > _(" --handout (only ltb format) create handouts of slideshowi (default OFF)"), 429a439 > \usepackage{beamerarticle} 444a455,468 > 'ltb': \ > r"""\documentclass{beamer} > \usepackage{amsfonts,graphicx} > \usepackage[%(ENCODING)s]{inputenc} %% char encoding > \frenchspacing %% no aditional spaces after periods > \usetheme{%(STYLE)s} %% user defind style > > \title{%(HEADER1)s} > \author{%(HEADER2)s} > \date{%(HEADER3)s} > \begin{document} > \frame{\titlepage} > """, > 711a736,755 > > # pst: ltb inherits all not found below from tex ;) > 'ltb': { > 'title1Open' : '\n\\section*{\a}\n\\begin{frame}\n\\frametitle{\a}', > 'title1Close' : '\\end{frame}', > 'title2Open' : '\n\\subsection*{\a}\n\\begin{frame}\n\\frametitle{\\strut}\n\\framesubtitle{\a}', > 'title2Close' : '\\end{frame}', > 'numtitle1Open' : '\n\\section{\a}\n\\begin{frame}\n\\frametitle{\a}', > 'numtitle1Close' : '\\end{frame}', > 'numtitle2Open' : '\n\\subsection{\a}\n\\begin{frame}\n\\frametitle{\\strut}\n\\framesubtitle{\a}', > 'numtitle2Close' : '\\end{frame}', > 'listOpen' : '\\begin{itemize}[<+->]', > 'numlistOpen' : '\\begin{enumerate}[<+->]', > 'deflistOpen' : '\\begin{description}[<+->]', > # verbatim and quotations aren't handle very well > # so using blockquote instead > 'blockVerbOpen' : '\\begin{quotation}[<+->]\n\\texttt{', > 'blockVerbClose' : '}\n\\end{quotation}', > 'TOC' : '\\frame{\\tableofcontents}' > }, 950a995,999 > > # pst: do the tex -> ltb inheritance > ltb = alltags['tex'].copy() > ltb.update(alltags['ltb']) > alltags['ltb'] = ltb.copy() 1001a1051,1052 > # pst: new rules needed for the ltb target > 'titleblocksnodepth', # title section blocks do not use depth feature 1098a1150,1156 > # pst: ltb inherits all except the following from tex ;) > 'ltb': { > 'titleblocks':1, > 'titleblocksnodepth':1, > 'listmaxdepth':3, > 'verbblocknotescaped':0 > }, 1156a1215,1217 > elif config['target'] == 'ltb': > myrules = rules_bank['tex'].copy() # inheritance > myrules.update(rules_bank['ltb']) # get ltb specific 2238a2300 > if rules['titleblocksnodepth']: curr = last 2297a2360,2372 > > # pst: new func for ltb level specifics > def close_last(self): > "Closes last opened title (ltb specific)" > ret = [] > ret.extend(self.tag_hold) > tag = TAGS.get('title%dClose'%self.level) > if tag: ret.append(tag) > #tag = TAGS.get('blockTitle%dClose'%self.level) > #if tag: ret.append(tag) > return ret > > 2611c2686,2687 < if TARGET == 'tex': --- > # pst: added ltb > if TARGET == 'tex' or TARGET == 'ltb': 3195a3272,3274 > #pst: compose handouts if needed > template = doHandout(config) > 3206,3207c3285,3287 < if target != 'tex' or \ < (target == 'tex' and re.search(r'\\\w+{', contents)): --- > # pst: added ltb > if (target != 'tex' or target != 'ltb') or \ > ((target == 'tex' or target == 'ltb') and re.search(r'\\\w+{', contents)): 3277a3358,3372 > #pst: new function to create handouts of ltb slideshow > def doHandout(config): > target = config['target'] > if not HEADER_TEMPLATE.has_key(target): > Error("doHandout: Unknow target '%s'"%target) > template = HEADER_TEMPLATE[target] > > # change documentclass to use handout option > if (target == 'ltb'): > Debug('template before: %s'%template) > template = template.replace('\\documentclass{beamer}','\\documentclass[handout]{beamer}') > Debug('template after: %s'%template) > > return string.split(template, '\n') > 3294a3390,3391 > # pst: added ltb > if target == 'ltb': typename = 'LaTeX2e with latex-beamer class' 3328c3425 < elif target == 'tex': --- > elif target == 'tex'or target == 'ltb': 3346c3443,3444 < elif target == 'tex' : --- > # pst: added ltb > elif target == 'tex' or target == 'ltb': 3427c3525,3526 < if target == 'tex': --- > # pst: added ltb > if target == 'tex' or target == 'ltb': 3563a3663,3677 > }, > 'ltb': { > # pst: idem for ltb than for tex > 'us-ascii' : 'ascii', > 'windows-1250': 'cp1250', > 'windows-1252': 'cp1252', > 'ibm850' : 'cp850', > 'ibm852' : 'cp852', > 'iso-8859-1' : 'latin1', > 'iso-8859-2' : 'latin2', > 'iso-8859-3' : 'latin3', > 'iso-8859-4' : 'latin4', > 'iso-8859-5' : 'latin5', > 'iso-8859-9' : 'latin9', > 'koi8-r' : 'koi8-r' 3710c3824,3825 < if TARGET == 'tex': --- > # pst: added ltb > if TARGET == 'tex' or TARGET == 'ltb': 4222a4338 > # pst: use ltb specific title closing ;) 4224c4340,4343 < ret.extend(TITLE.close_all()) --- > if TARGET == 'ltb': > ret.extend(TITLE.close_last()) > else: > ret.extend(TITLE.close_all())