LoginSignup
9
11

More than 5 years have passed since last update.

言語学論文用のLaTeXメモ

Posted at

gb4e

例文番号を振ったりするやつ。似たようなものは他にもあるが、これが一番しっくりくるのでこれを使っている。

\documentclass[uplatex,12pt]{jsarticle}
\usepackage{gb4e}
\begin{document}

\ea 吾輩は猫である。
\ex
    \ea にゃあにゃあ
    \ex にゃあ
    \z
\z

\end{document}

Kobito.MPRRD1.png

gb4eは上付き文字 ^ と下付き文字 _ を数式モードの外でも有効にする機能があるが、この機能は他のパッケージと衝突しがちで使いにくい。\noautomath で無効にする方が無難。

\usepackage{gb4e}
\noautomath

また、gb4eを使うと数式モードの中で\mathrm がエラーを吐くようになる。とりあえず次のようにすると、この問題を回避できる。

\let\mrm\mathrm
\usepackage{gb4e}
\let\mathrm\mrm

forest

句構造木を書くのに便利。dvipdfmxを読み込まないとちゃんと表示されないっぽい。細かい設定ができるようだが、句構造木を書く場合は linguistics という設定を読み込んでしまうのが手っ取り早い。

\documentclass[uplatex,dvipdfmx,12pt]{jsarticle}

\usepackage{forest}
\useforestlibrary{linguistics}
\forestapplylibrarydefaults{linguistics}

\begin{document}

\begin{forest}
    [S [NP [吾輩は, roof] ] [VP [猫である, roof] ] ]
\end{forest}

\end{document}

Kobito.MHS4An.png

tikz-dependency

係り受け図を描くのに便利。

\documentclass[uplatex,dvipdfmx,12pt]{jsarticle}
\usepackage{tikz-dependency}
\begin{document}

\begin{dependency}
    \begin{deptext}
        吾輩は \& 猫 \& である \\
    \end{deptext}
    \depedge{2}{1}{nsubj}
    \depedge{2}{3}{cop}
\end{dependency}

\begin{dependency}[arc edge, hide label]
    \begin{deptext}
        吾輩は \& 猫で \& ある \\
    \end{deptext}
    \depedge{1}{2}{D}
    \depedge{2}{3}{D}
\end{dependency}

\end{document}

Kobito.mQpsbU.png

ebproof

証明図を描くのに便利。bussproofs というのもあるらしい。

\documentclass[uplatex,dvipdfmx,12pt]{jsarticle}
\usepackage{ebproof}
\begin{document}

\begin{prooftree}
\Hypo{A\to B}
\Hypo{A}
\Infer2{B}
\end{prooftree}

\end{document}

Kobito.1ERhrR.png

9
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
11