bibtex: 다른 문자의 URL 및 DOI 줄바꿈

bibtex: 다른 문자의 URL 및 DOI 줄바꿈

내 참조에서 나는 아래의 세 번째 참조와 같이 줄이 부족한 것을 피하기 위해 DOI가 슬래시 '/' 문자(또는 모든 문자의 최후의 수단으로)를 중단하도록 허용하고 싶습니다. URL은 이미 슬래시로 구분되어 있고 DOI는 이미 대시로 구분되어 있습니다.

문제가 있는 항목이 있는 이미지

\documentclass{article}

\usepackage[left=1.5in,right=1.5in]{geometry}

\usepackage{natbib}
\usepackage[colorlinks,breaklinks,urlcolor=blue]{hyperref}
\usepackage{doi}
\urlstyle{rm}
\bibliographystyle{sp}

\begin{document}
\nocite{Endriss:09} \nocite{Evans:80} \nocite{Szabolcsi:10}
\bibliography{references}
\end{document}

다음은 일부 .bib 항목입니다.

@article{Evans:80, Author={Gareth Evans}, Journal={Linguistic Inquiry}, Number={2},
    Pages={337--362}, Title={Pronouns}, Url={http://www.jstor.org/stable/4178164},
    Volume={11}, Year={1980}}

@book{Szabolcsi:10, Author={Anna Szabolcsi}, Doi={10.1017/CBO9780511781681},
    Publisher={Cambridge University Press}, Title={Quantification}, Year={2010}}

참고문헌 스타일 파일은 다음에서 zip 파일(실제로 사용된 클래스 파일도 포함)의 일부로 다운로드할 수 있습니다.LATEX 2ε를 사용하는 S&P 작성자를 위한 지침 | 폰 핀텔 | 의미론과 화용론.

답변1

내가 보기에 "doi:"도 로마 글꼴로 표시하려면 패키지를 의 자체 기능 으로 선언된 doi자체 명령으로 바꿔야 합니다 . 클래스 파일에 이미 정의되어 있다는 것은 중요하지 않습니다 . 그렇지 않으면 package 를 사용할 수도 있습니다 . 여기에서 내 답변도 비교해 보세요.\doiurlsp.clsuri하이퍼링크된 DOI를 생성하시겠습니까?.

\documentclass{sp} % based on "article"

\usepackage[left=1.5in,right=1.5in]{geometry}

\usepackage{filecontents}
% will produce a BIB file with the same name like your main tex file
\begin{filecontents*}{\jobname.bib}
@article{Evans:80,
  Author={Gareth Evans},
  Journal={Linguistic Inquiry},
  Number={2},
  Pages={337--362},
  Title={Pronouns},
  Url={http://www.jstor.org/stable/4178164},
  Volume={11}, Year={1980}
}
@book{Szabolcsi:10,
  Author={Anna Szabolcsi},
  Doi={10.1017/CBO9780511781681},
  Publisher={Cambridge University Press},
  Title={Quantification},
  Year={2010}
}
\end{filecontents*}

\usepackage{natbib} % actually not needed: already defined in the class "sp"
\bibliographystyle{sp} % actually not needed: already defined in the class "sp"


% already loaded with the class "sp", throws out an error, if separately loaded:
% \usepackage[colorlinks,breaklinks,urlcolor=blue]{hyperref} % loads "url"
%
\urlstyle{rm} % actually not needed: already defined in the class "sp"
% see the documentation of "url" for the next command
% "doi:" is not part of the link:
\DeclareUrlCommand\doi{\def\UrlLeft##1\UrlRight{doi:\href{http://dx.doi.org/##1}{##1}}\urlstyle{rm}}
% "doi:" is part of the link:
% \DeclareUrlCommand\doi{\def\UrlLeft##1\UrlRight{\href{http://dx.doi.org/##1}{doi:##1}}\urlstyle{rm}}

\begin{document}
\nocite{Evans:80} \nocite{Szabolcsi:10}
\bibliography{\jobname}
\end{document}

관련 정보