TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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".

share|improve this question
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
up vote 4 down vote accepted

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.

share|improve this answer
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.