
아직 살아있는 사람을 언급할 때 나는 Jim Foo(1977--)에서와 같이 태어난 연도를 표시한 다음 괄호 안에 모두 대시를 표시합니다. 때때로 이로 인해 엔 대시와 오른쪽 괄호 사이에 줄 바꿈이 발생합니다. 푸(1977--)가 모두 같은 선상에 놓이도록 이를 막을 수 있는 방법은 없을까?
답변1
\mbox
Barbara가 이미 보여드린 것처럼 줄 바꿈을 방지하려면 a에 넣어야 합니다 .
\mbox
내용물이 상자에 들어 있는 것처럼 작동하며 깨지지 않습니다.
삶을 더 쉽게 만들고 싶다면 자신만의 명령을 만들 수 있습니다.
\documentclass[12pt]{article}
\newcommand{\alive}[2]{{#1} \mbox{({#2}--)}}
\begin{document}
\alive{Jim Foo}{1977}
\end{document}
답변2
\nobreakdash
에서 을 사용할 수 있습니다 amsmath
.
\documentclass{article}
\usepackage{amsmath}
\textwidth=2.9cm
\begin{document}
\noindent X\dotfill X
Jim Foo (1977\nobreakdash--)
\end{document}
답변3
전체 날짜 범위를 상자에 넣는 것 외에도 작성 요구 사항에 따라 다소 편리할 수 있는 다른 가능성이 있습니다.
\documentclass{article}
\textwidth=2.9cm
\begin{document}
\noindent X\dotfill X
Jim Foo (1977--)
Jim Foo \mbox{(1977--)}
Jim Foo (1977\mbox{--})
Jim Foo (1977\nobreakdashes--)
\exhyphenpenalty=10000 % global affecting - and --- as well as --
Jim Foo (1977--)
\end{document}