def get_tex_path_variable_miktex(variable, env=None):
 print('Reading path for {0}...'.format(variable))
 if (env is None):
  env = os.environ
 try:
  command = ['findtexmf', '-alias=latex']
  command.append((('-show-path={' + variable) + '}').format(TEXINPUTS='tex', BIBINPUTS='bib', BSTINPUTS='bst'))
  t = SubprocessTimeoutThread(30, command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=False, env=env)
  t.start()
  stdout = t.stdout
  if (stdout is None):
   return None
  output = u'\n'.join(re.split('\\r?\\n', stdout.decode('utf-8').strip()))
  return os.pathsep.join([os.path.normpath(p) for p in output.split(os.pathsep)])
 except:
  return None

def get_tex_path_variable_miktex ( variable , env = None ) : print ( 'Reading path for {0}...' . format ( variable ) ) if ( env is None ) : env = os . environ try : command = [ 'findtexmf' , '-alias=latex' ] command . append ( ( ( '-show-path={' + variable ) + '}' ) . format ( TEXINPUTS = 'tex' , BIBINPUTS = 'bib' , BSTINPUTS = 'bst' ) ) t = SubprocessTimeoutThread ( 30 , command , stdout = subprocess . PIPE , stderr = subprocess . STDOUT , shell = False , env = env ) t . start ( ) stdout = t . stdout if ( stdout is None ) : return None output = u'\n' . join ( re . split ( '\\r?\\n' , stdout . decode ( 'utf-8' ) . strip ( ) ) ) return os . pathsep . join ( [ os . path . normpath ( p ) for p in output . split ( os . pathsep ) ] ) except : return None
uses findtexmf to find the values of a given tex path variable .