LaTeX/Overleaf에서 `\it`과 `\bf` 사용을 피해야 하는 이유: 텍스트를 굵게/기울임꼴로 만드는 올바른 방법

현재 이 페이지는 한국어로 제공되지 않으므로 영어로 표시됩니다. 이 페이지의 번역을 도와주실래요? 이 페이지 번역하기

In the world of LaTeX, one of the most popular typesetting systems, there are several commands that have become outdated over the years. Two such commands are \\it and \\bf. While you might find these commands in older documents, there are compelling reasons to avoid them in modern LaTeX documents.

BibTeX 항목을 관리할 간단한 솔루션이 필요하신가요? CiteDrive를 탐색해보세요!

  • 웹 기반 현대적인 참고 문헌 관리
  • 동료 연구자들과 협업하고 공유하기
  • Overleaf와의 통합
  • BibTeX/BibLaTeX에 대한 포괄적인 지원
  • 브라우저에서 직접 문서와 웹사이트 저장
  • 수천만 개의 참조가 있는 데이터베이스에서 새로운 기사 검색
CiteDrive 사용해보기

1. They Overwrite Each Other

One of the primary reasons to avoid using \\it and \\bf is that they don’t nest as one might expect. This means that if you attempt to set text in both italic and bold by using both commands, only the last command specified will be applied.

Example:

\\it\bf My Text

This won’t display the text in both italic and bold as one might expect. Instead, only the bold command will be applied because \\bf overwrites the \\it command.

2. Modern Alternatives are Available

Fortunately, there are modern alternatives that don’t have this issue. The commands \textit{} and \textbf{} can be combined seamlessly to achieve the desired effect.

Example:

\textit{\textbf{My Text}}

This will display the text in both italic and bold, just as expected.