reformatting relative links and lists of theories