parameters: (self)
docstring: Create :py:class:`waflib.Tools.tex.tex` objects, and dvips/dvipdf/pdf2ps tasks if necessary (outs='ps', etc).
docstring_summary: Create :py:class:`waflib.Tools.tex.tex` objects, and dvips/dvipdf/pdf2ps tasks if necessary (outs='ps', etc).
docstring_tokens: Create : py : class : waflib . Tools . tex . tex objects and dvips / dvipdf / pdf2ps tasks if necessary ( outs = ps etc ) .
function: def apply_tex(self):
  	"""
  	Create :py:class:`waflib.Tools.tex.tex` objects, and dvips/dvipdf/pdf2ps tasks if necessary (outs='ps', etc).
  	"""
  	if not getattr(self, 'type', None) in ['latex', 'pdflatex', 'xelatex']:
  		self.type = 'pdflatex'
  
  	tree = self.bld
  	outs = Utils.to_list(getattr(self, 'outs', []))
  
  	# prompt for incomplete files (else the batchmode is used)
  	self.env['PROMPT_LATEX'] = getattr(self, 'prompt', 1)
  
  	deps_lst = []
  
  	if getattr(self, 'deps', None):
  		deps = self.to_list(self.deps)
  		for filename in deps:
  			n = self.path.find_resource(filename)
  			if not n:
  				self.bld.fatal('Could not find %r for %r' % (filename, self))
  			if not n in deps_lst:
  				deps_lst.append(n)
  
  	for node in self.to_nodes(self.source):
  
  		if self.type == 'latex':
  			task = self.create_task('latex', node, node.change_ext('.dvi'))
  		elif self.type == 'pdflatex':
  			task = self.create_task('pdflatex', node, node.change_ext('.pdf'))
  		elif self.type == 'xelatex':
  			task = self.create_task('xelatex', node, node.change_ext('.pdf'))
  
  		task.env = self.env
  
  		# add the manual dependencies
  		if deps_lst:
  			try:
  				lst = tree.node_deps[task.uid()]
  				for n in deps_lst:
  					if not n in lst:
  						lst.append(n)
  			except KeyError:
  				tree.node_deps[task.uid()] = deps_lst
  
  		v = dict(os.environ)
  		p = node.parent.abspath() + os.pathsep + self.path.abspath() + os.pathsep + self.path.get_bld().abspath() + os.pathsep + v.get('TEXINPUTS', '') + os.pathsep
  		v['TEXINPUTS'] = p
  
  		if self.type == 'latex':
  			if 'ps' in outs:
  				tsk = self.create_task('dvips', task.outputs, node.change_ext('.ps'))
  				tsk.env.env = dict(v)
  			if 'pdf' in outs:
  				tsk = self.create_task('dvipdf', task.outputs, node.change_ext('.pdf'))
  				tsk.env.env = dict(v)
  		elif self.type == 'pdflatex':
  			if 'ps' in outs:
  				self.create_task('pdf2ps', task.outputs, node.change_ext('.ps'))
  	self.source = []
function_tokens: def apply_tex ( self ) : if not getattr ( self , 'type' , None ) in [ 'latex' , 'pdflatex' , 'xelatex' ] : self . type = 'pdflatex' tree = self . bld outs = Utils . to_list ( getattr ( self , 'outs' , [ ] ) ) # prompt for incomplete files (else the batchmode is used) self . env [ 'PROMPT_LATEX' ] = getattr ( self , 'prompt' , 1 ) deps_lst = [ ] if getattr ( self , 'deps' , None ) : deps = self . to_list ( self . deps ) for filename in deps : n = self . path . find_resource ( filename ) if not n : self . bld . fatal ( 'Could not find %r for %r' % ( filename , self ) ) if not n in deps_lst : deps_lst . append ( n ) for node in self . to_nodes ( self . source ) : if self . type == 'latex' : task = self . create_task ( 'latex' , node , node . change_ext ( '.dvi' ) ) elif self . type == 'pdflatex' : task = self . create_task ( 'pdflatex' , node , node . change_ext ( '.pdf' ) ) elif self . type == 'xelatex' : task = self . create_task ( 'xelatex' , node , node . change_ext ( '.pdf' ) ) task . env = self . env # add the manual dependencies if deps_lst : try : lst = tree . node_deps [ task . uid ( ) ] for n in deps_lst : if not n in lst : lst . append ( n ) except KeyError : tree . node_deps [ task . uid ( ) ] = deps_lst v = dict ( os . environ ) p = node . parent . abspath ( ) + os . pathsep + self . path . abspath ( ) + os . pathsep + self . path . get_bld ( ) . abspath ( ) + os . pathsep + v . get ( 'TEXINPUTS' , '' ) + os . pathsep v [ 'TEXINPUTS' ] = p if self . type == 'latex' : if 'ps' in outs : tsk = self . create_task ( 'dvips' , task . outputs , node . change_ext ( '.ps' ) ) tsk . env . env = dict ( v ) if 'pdf' in outs : tsk = self . create_task ( 'dvipdf' , task . outputs , node . change_ext ( '.pdf' ) ) tsk . env . env = dict ( v ) elif self . type == 'pdflatex' : if 'ps' in outs : self . create_task ( 'pdf2ps' , task . outputs , node . change_ext ( '.ps' ) ) self . source = [ ]