LaTeX on IntelliJ
2019/01/08
結論
File > Settings > Editor > Inspections > LaTeX で Unsupported Unicode characterのチェックを外す
SFC大学院のフォーマットに準拠したLaTeXテンプレートが存在するので、これを使っている コンパイルはmakeするだけでいい
@ymrl@kurokobo両氏に感謝
ところが日本語とか、non-ASCII character を使うと怒られてしまう
https://gyazo.com/217771087deaefc5b04b14840c7712af
issueによれば、IntelliJのinspection設定で対処してくれとのことだった
File > Settings > Editor > Inspections > TeXiFy で設定しろと書いてある
自分の環境ではFile > Settings > Editor > Inspections > LaTeXしか無かった
こちらのチェックを外せば設定完了
https://gyazo.com/b1022dda39883fd407ece61b2b314170
こういうのをいろいろ作った
https://gyazo.com/63a83a2444cc66fefd03b7bc8f19b25a
https://gyazo.com/3f15cab0006107209b97a434d3b02a65
設定ファイルはこちら
お使いのIntelliJ系IDEにインポートすると↑のtemplatesを使えます
code:LaTeX.xml
<templateSet group="LaTeX">
<template name="img" value="\begin{figure}H \centering \includegraphicswidth=$WIDTH$cm{images/$IMG_FILE_NAME$} \caption{$CAPTION$} \label{$LABEL$} \end{figure} $END$" description="Inserts image" toReformat="false" toShortenFQNames="true"> <variable name="WIDTH" expression=""15"" defaultValue="" alwaysStopAt="true" />
<variable name="IMG_FILE_NAME" expression=""gyazo.png"" defaultValue="gyazo.png" alwaysStopAt="true" />
<variable name="CAPTION" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="LABEL" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="LATEX" value="true" />
</context>
</template>
<template name="refimg" value="図\ref{$LABEL_TITLE$}$END$" description="Inserts 図\ref{}" toReformat="false" toShortenFQNames="true">
<variable name="LABEL_TITLE" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="LATEX" value="true" />
</context>
</template>
<template name="br" value="\\" description="Inserts line break" toReformat="false" toShortenFQNames="true">
<context>
<option name="LATEX" value="true" />
</context>
</template>
<template name="refcode" value="ソースコード\ref{$LABEL_TITLE$}$END$" description="Inserts ソースコード\ref{}" toReformat="false" toShortenFQNames="true">
<variable name="LABEL_TITLE" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="LATEX" value="true" />
</context>
</template>
<template name="code" value="\begin{lstlisting}caption=$CAPTION$, label=$LABEL$ $CODE$ \end{lstlisting} $END$" description="Inserts source code" toReformat="false" toShortenFQNames="true"> <variable name="CAPTION" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="LABEL" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="CODE" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="LATEX" value="true" />
</context>
</template>
<template name="fn" value="\footnote{\textsf{$TEXT$}}$END$" description="Inserts footnote" toReformat="false" toShortenFQNames="true">
<variable name="TEXT" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="LATEX" value="true" />
</context>
</template>
</templateSet>