code: def _bibFormatter(s, maxLength):
      
      if isinstance(s, list):
          s = ' and '.join((str(v) for v in s))
      elif not isinstance(s, str):
          s = str(s)
      if len(s) > maxLength:
          s = s.replace('"', '')
          s = [s[i * maxLength: (i + 1) * maxLength] for i in range(len(s) // maxLength )]
          s = '"{}"'.format('" # "'.join(s))
      elif '"' not in s:
          s = '"{}"'.format(s)
      else:
          s = s.replace('{', '\\{').replace('}', '\\}')
          s = '{{{}}}'.format(s)
      return s
docs: Formats a string, list or number to make it good for a bib file by:
          * if too long splits up the string correctly
          * tries to use the best quoting characters
          * expands lists into ' and ' seperated values, as per spec for authors field
      Note, this does not escape characters. LaTeX may have issues with the output
      Max length splitting derived from https://www.cs.arizona.edu/~collberg/Teaching/07.231/BibTeX/bibtex.html