\(\TeX\) 환경에서 (Lewisian) Counterfactual operators 입력을 위한 팁

기본적으로, \(\TeX\) 환경 및 동일한 문법을 지원하는 환경(예컨대, MathJax)에는 루이스 스타일의 반사실 연산자(\(\counterfactual\) 및 \(\countermight\))를 입력하기 위한 별도의 타입세팅이 되어 있지 않다. 이에 해외 포럼을 찾아 보니, 다음과 같이 \newcommand를 이용해 \(\counterfactual\)과 \(\countermight\)를 정의하는 방법이 소개되어 있었다.

$$\newcommand{\counterfactual}
{\Box\kern-1.5pt\raise1pt\hbox{$\mathord{\rightarrow}$}}
\newcommand{\countermight}
{\mathord{\Diamond}\kern-1.5pt\raise0.5pt\hbox{$\mathord{\rightarrow}$}}$$

사이트 헤더에 이 코드를 넣으면 사이트 전역에서 \counterfactual과 \countermight를 통해 \(\counterfactual\)과 \(\countermight\)를 사용할 수 있게 된다. 다만 문제는 이 코드를 그대로 헤더에 넣을 경우 사이트 로드 과정에서 사이트 상단에 해당 로고가 노출된다는 점인데, 이는 다음과 같이 display를 이용해 해결할 수 있다:

<div id="texcommand" style="display:none">
$$\newcommand{\counterfactual}
{\Box\kern-1.5pt\raise1pt\hbox{$\mathord{\rightarrow}$}}
\newcommand{\countermight}
{\mathord{\Diamond}\kern-1.5pt\raise0.5pt\hbox{$\mathord{\rightarrow}$}}$$
</div>
댓글 보기