
내 참고문헌에 기술 보고서의 보고서 번호를 텔레타이프 글꼴로 포함하고 싶습니다. 이러한 보고서 번호는 일반적으로 와 같이 하이픈으로 연결된 여러 문자와 숫자 블록으로 구성됩니다 INSTITUTE-YEAR-MM-NUMBER
. 보고서 번호의 하이픈 뒤에 줄바꿈을 사용해도 괜찮습니다.
지금까지 별 생각 없이 사용해왔는데 \nolinkurl
, 좋은 결과를 보여주고 있습니다. 이제 나머지 블록과 공백으로 구분된 한 블록이 있는 보고서 번호를 포함해야 합니다. 이 공간은 에 의해 억제됩니다 \nolinkurl
.이 질문에는동일한 문제에 대해 허용되는 답변은 \texttt
대신 사용하는 것입니다. 그러나 에서는 \texttt
자동 줄 바꿈이 작동하지 않습니다.
최소한의 예:
\documentclass[12pt]{article}
\PassOptionsToPackage{hyphens}{url}
\usepackage[breaklinks]{hyperref}
\usepackage{showframe}
\newcommand{\thereport}{REPORT-19-12-001 SPECIAL}
\begin{document}
This is a long line and at the end of the line there should be \texttt{\thereport} referenced.
This is a long line and at the end of the line there should be \nolinkurl{\thereport} referenced.
\end{document}
자동 줄 바꿈 기능이 있는 텔레타이프 글꼴에 하이픈과 공백이 포함된 보고서 번호를 어떻게 얻을 수 있나요?
답변1
\path
내용을 확장하려면 , 를 수정하여 사용하세요 .
\documentclass[12pt]{article}
\PassOptionsToPackage{hyphens,obeyspaces}{url}
\usepackage{hyperref}
\usepackage{showframe}
\newcommand{\epath}[1]{\expandafter\path\expandafter{#1}}
\newcommand{\thereport}{REPORT-19-12-001 SPECIAL}
\begin{document}
This is a long line and at the end of the line there should be
\epath{\thereport} referenced.
\end{document}
답변2
하이픈 패키지를 사용할 수 있습니다.
\documentclass[12pt]{article}
\PassOptionsToPackage{hyphens}{url}
\usepackage[breaklinks]{hyperref}
\usepackage{showframe}
\newcommand{\thereport}{REPORT-19-12-001 SPECIAL}
\usepackage[htt]{hyphenat}
\begin{document}
This is a long line and at the end of the line there should be \texttt{\thereport} referenced.
This is a long line and at the end of the line there should be \nolinkurl{\thereport} referenced.
\end{document}
또는 \ttfamily \hyphenchar\font=45
(서문에서) 하이픈 문자를 재설정할 수 있습니다.