0

I'm using LaTeX with BibTeX to write my paper. The .bst file is written by someone else.

In the .bst file, he wrote a function to deal with the \url as follows:

FUNCTION {format.url} { 
  "\url{" swap$ * "}" * 
}

Now I want to change "\url" to "\href". For example,

\url{http://www.aaa.com} --> \href{http://www.aaa.com}{http://www.aaa.com}

The minimum working example can be downloaded from here

Thank you.

cgnieder
  • 66,645
loujing
  • 53
  • 1
    You can edit and create a modified .bst file (making the correction), or you could, in your document, reassign \url to behave as \href, assuming the argument lists were compatible. However, it would help if you edit your question to provide a minimum working example to show the actual problem. – Steven B. Segletes Aug 15 '17 at 09:53
  • The hyperref package provides the \href macro... and the \url macro... – Paul Gaborit Aug 15 '17 at 09:54
  • Thank you for your help. The minimum working example can be downloaded from https://raw.githubusercontent.com/jinglou/p2017-hcn-co-sod/master/Question.zip – loujing Aug 15 '17 at 10:15
  • 3
    Why exactly? As others mention, when hyperref is loaded, that is how \url work. – daleif Aug 15 '17 at 10:17

1 Answers1

1

I referenced this question set DOI link on Journal Name with bibtex/.bst and have solved this problem.

The code is

FUNCTION {format.url} {    
  "\href{" url * "}{" * swap$ * "}" * 
}
cgnieder
  • 66,645
loujing
  • 53