# .bst function to strip LaTeX command from string

Is there a preexisting .bst command to stip all LaTeX commands from a string?

For example, if the string on the top of the stack is "Hello \textsc{ladies}" I'd like to replace it with just "Hello ladies".

-
Are you after a BibTeX style with no added formatting, or one to remove formatting that's already in the input. The latter seems pretty complex, as things like accents will go wrong. – Joseph Wright Aug 12 '12 at 19:08
Remove existing formatting – Alec Jacobson Aug 22 '12 at 20:06
That sounds very tricky indeed. BibTeX cannot expand TeX macros, so you are left having to search through letter by letter for \foo. You thus have to either make some assumptions about formatting commands or about accents, etc. I suspect this will not be robust however it's done. What we certainly need is a bit more context: for example, do you have a list of formatting that may appear? – Joseph Wright Aug 22 '12 at 20:18
Well, yeah in general I want to remove any markup like \textsc{} or accents (e.g. \"{}). – Alec Jacobson Aug 27 '12 at 22:31

bst is the file extension used by the compiler bibtex. BibTeX doesn't have this functionality. To modify the input file you can write a small script (perl, shell etc.) providing this functionality.
Sorry but this answer is not a good answer, not in a current state. The second part about \def is confusing: where should one put it? (I don't think I'm unexperienced LaTeX user, but I would have hard time using that advice.) – yo' Aug 12 '12 at 20:16
@tohecz: I know. My aim was the reducing of the unanswered list. However there is no way with bibtex ;-). I switch the answer to a cw one. Please feel free to edit them. – Marco Daniel Aug 13 '12 at 15:47