Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 –  mangledorf 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. \"{}). –  mangledorf Aug 27 '12 at 22:31
add comment

1 Answer

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.) –  tohecz 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
add comment

Your Answer

 
discard

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.