user1027169
user1027169

Reputation: 2887

How to change format of a function call but keep the input the same

How can I change in my document all instances of \cite{something} to [@something]?

Upvotes: 0

Views: 61

Answers (2)

Kent
Kent

Reputation: 195289

I would do it with :

:%s#\v\\cite\{([^}]+)\}#[@\1]#g

note that the last 'g' flag will be important if you have more than one \cite{something} in same line.

Since you want to replace ALL instances, I would do it with 'g'.

Upvotes: 2

CSᵠ
CSᵠ

Reputation: 10169

do a Find by this RegExp: \\cite\{([^\}]+)\}
and Replace by: [@\1]

Upvotes: 0

Related Questions