code: def emit_pdf(outputs, options):
  
      '''Runs the PDF conversion command to generate the PDF.'''
  
      cmd = options.pdf_cmd
      cmd = cmd.replace('%o', options.pdfname)
      if len(outputs) > 2:
          cmd_print = cmd.replace('%i', ' '.join(outputs[:2] + ['...']))
      else:
          cmd_print = cmd.replace('%i', ' '.join(outputs))
      cmd = cmd.replace('%i', ' '.join(outputs))
  
      if not options.quiet:
          print('running PDF command "{}"...'.format(cmd_print))
  
      try:
          result = subprocess.call(shlex.split(cmd))
      except OSError:
          result = -1
  
      if result == 0:
          if not options.quiet:
              print('  wrote', options.pdfname)
      else:
          sys.stderr.write('warning: PDF command failed\n'f emit_pdf(outputs, options):
  
      '''Runs the PDF conversion command to generate the PDF.'''
  
      cmd = options.pdf_cmd
      cmd = cmd.replace('%o', options.pdfname)
      if len(outputs) > 2:
          cmd_print = cmd.replace('%i', ' '.join(outputs[:2] + ['...']))
      else:
          cmd_print = cmd.replace('%i', ' '.join(outputs))
      cmd = cmd.replace('%i', ' '.join(outputs))
  
      if not options.quiet:
          print('running PDF command "{}"...'.format(cmd_print))
  
      try:
          result = subprocess.call(shlex.split(cmd))
      except OSError:
          result = -1
  
      if result == 0:
          if not options.quiet:
              print('  wrote', options.pdfname)
      else:
          sys.stderr.write('warning: PDF command failed\n')
docs: Runs the PDF conversion command to generate the PDF.