docs: def get_tex_location(new_tex_name, current_tex_name, recurred=False):
      """
      Takes the name of a TeX file and attempts to match it to an actual file
      in the tarball.
  
      :param: new_tex_name (string): the name of the TeX file to find
      :param: current_tex_name (string): the location of the TeX file where we
          found the reference
  
      :return: tex_location (string): the location of the other TeX file on
          disk or None if it is not found
      """
  
      tex_location = None
  
      current_dir = os.path.split(current_tex_name)[0]
  
      some_kind_of_tag = '\\\\\\w+ '
  
      new_tex_name = new_tex_name.strip()
      if new_tex_name.startswith('input'):
          new_tex_name = new_tex_name[len('input'):]
      if re.match(some_kind_of_tag, new_tex_name):
          new_tex_name = new_tex_name[len(new_tex_name.split(' ')[0]) + 1:]
      if new_tex_name.startswith('./'):
          new_tex_name = new_tex_name[2:]
      if len(new_tex_name) == 0:
          return None
      new_tex_name = new_tex_name.strip()
  
      new_tex_file = os.path.split(new_tex_name)[-1]
      new_tex_folder = os.path.split(new_tex_name)[0]
      if new_tex_folder == new_tex_file:
          new_tex_folder = ''
  
      # could be in the current directory
      for any_file in os.listdir(current_dir):
          if any_file == new_tex_file:
              return os.path.join(current_dir, new_tex_file)
  
      # could be in a subfolder of the current directory
      if os.path.isdir(os.path.join(current_dir, new_tex_folder)):
          for any_file in os.listdir(os.path.join(current_dir, new_tex_folder)):
              if any_file == new_tex_file:
                  return os.path.join(os.path.join(current_dir, new_tex_folder),
                                      new_tex_file)
  
      # could be in a subfolder of a higher directory
      one_dir_up = os.path.join(os.path.split(current_dir)[0], new_tex_folder)
      if os.path.isdir(one_dir_up):
          for any_file in os.listdir(one_dir_up):
              if any_file == new_tex_file:
                  return os.path.join(one_dir_up, new_tex_file)
  
      two_dirs_up = os.path.join(os.path.split(os.path.split(current_dir)[0])[0],
                                 new_tex_folder)
      if os.path.isdir(two_dirs_up):
          for any_file in os.listdir(two_dirs_up):
              if any_file == new_tex_file:
                  return os.path.join(two_dirs_up, new_tex_file)
  
      if tex_location is None and not recurred:
          return get_tex_location(new_tex_name + '.tex', current_tex_name,
                                  recurred=True)
  
      return tex_location