タイトルはそのうち決める

艦これのおぼえがきとか実験装置とかLaTexのメモとか。

メモ LaTex 作ったコマンドの後ろにスペースが入らない

\newcommandとかで作ったコマンドの後ろに半角スペースが入らない。

たとえば、

\newcommand{\KanC}{KanColle}

 

\KanC can be played on android OS.

KanColle can be played on android OS.

この出力は

f:id:kurosakiworks:20171213110614p:plain

となる。
コマンドの後ろに半角スペースが入らない。

 

xspace.styの利用

\usepackage{xspace} を書き足す。
あと、コマンドの後ろに\xspaceを追加

\usepackage{xspace}



\newcommand{\KanC}{KanColle\xspace}

 
\KanC can be played on android OS.
KanColle can be played on android OS.

出力は

f:id:kurosakiworks:20171213111606p:plain

こうなる。

\xspaceで空白を追加する利点は、後ろがコンマやピリオドのときは空白が入らないこと。