0

I'm working on a colaborative project where we're trying to align around terminology.

We have a list of 'banned phrases' that some authors use coloquially, but that we want to make sure we don't use in the text. ctrl-F searching for these words and phrases has helped us catch inadvertant uses so far, but I'd like to automate this process.

We're using overleaf, so don't have convenient access to scripting tools outslide of latex, where this would obviously be pretty easy.

Is there a latex package or simple script I could use to have latex find and throw errors when certain words or phrases are included in the final output?

  • 2
    Welcome to tex.sx. This is more an edit or external search function than a (La)TeX one. TeX has no concept of the meanings of words; even hyphenation is accomplished through pattern matching rather than syntactic parsing. A command-line script based on something like grep would, I believe, be your best bet. Thus this question isn't really appropriate for this forum. – barbara beeton Nov 17 '22 at 20:54
  • 1
    that would be script in your editor latex has no access to the words in the text – David Carlisle Nov 17 '22 at 21:02
  • you tagged overleaf so you could probably get latexmk to run a script searching the source, assuming you are using overleaf – David Carlisle Nov 17 '22 at 21:03
  • I'd imagine Lua could be used to process the lines/streams before they're set and do something... But that will require compilation using a different engine. – Werner Nov 17 '22 at 21:44
  • It is enough highlight the politically incorrect words in the text, like here? – Fran Nov 18 '22 at 10:16
  • @barbarabeeton and others, obviously this would be acheivable using other tools, but I'm asking spesifically if there's a way to do this within latex. I am using overleaf so I don't have convenient access to other scripting tools. – MattMcEwen Nov 19 '22 at 21:32
  • @Fran that's a good sugestion: I made a little working example based on the lua scripts in the linked answer. Sadly, it turns out LuaLaTex isn't compatible with the document class I'm using, so i'm back to square one there. I'll probably write it up as an answer anyways, thanks! – MattMcEwen Nov 19 '22 at 21:34

0 Answers0