!!!TeXでいこう! {{outline}} ---- !!インストール ! TeX Live 2023 *Installing TeX Live over the Internet https://texwiki.texjp.org/?TeX%20Live%2FWindows *==TeXインストーラ3== https://www.ms.u-tokyo.ac.jp/~abenori/soft/abtexinst.html **インストール先 C:\w32tex\ **TeX Works をスタートメニューにピン止めする C:\w32tex\bin64\texworks.exe !TeX Worksの使い方 https://texwiki.texjp.org/?TeXworks%2F%E4%BD%BF%E3%81%84%E6%96%B9 +texファイルを開いて編集 +左上の緑の三角をクリックしたら、コンパイルして、PDFで出力される。 ++画面下部に処理過程が出るので、エラーがあったら、そこを修正する。 !W32TeXの使い方 *コマンドラインからコマンドを打って使う *platex file.tex **これで、file.dvi ファイルが出力される。 *dvipdfmx file.dvi **これで、file.pdf というPDFファイルが出力される。 !TeX WiKi https://texwiki.texjp.org/?Microsoft%20Windows !CloudLaTeX https://cloudlatex.io/ https://nkgtt.hatenablog.jp/entry/2020/12/24/000000 https://zenn.dev/arks/articles/3697b25d03f8a8 !Overleaf *もともとはopen source https://github.com/overleaf/overleaf *有料版 https://ja.overleaf.com/ *Overleafで科研費LaTeX https://www.artsci.kyushu-u.ac.jp/~okamoto/misc-latex.html *Overleafを使った日本語論文の作成 https://qiita.com/fujino-fpu/items/d92d185da730e25743cb !TeXstudio https://www.texstudio.org/ !!Beamerでプレゼン https://dreamer-uma.com/latex-beamer/ !!KakenhiLaTeX http://osksn2.hep.sci.osaka-u.ac.jp/~taku/kakenhiLaTeX/ *\input{ファイル名} で、同じディレクトリー内に別に作ってある「ファイル名.tex」をそこに読み込む。 **別途そのファイルを編集するか **コメントアウト(%)して直接書き込む !科研費LaTeX https://texwiki.texjp.org/?%E7%A7%91%E7%A0%94%E8%B2%BBLaTeX *これを使うためだけにでもLaTeX使うことをお勧め。 !!Using LaTeX in Linguistics https://www.linguisticsociety.org/content/using-latex-linguistics !Gallery — Linguistics https://ja.overleaf.com/gallery/tagged/linguistics !LATEX and Linguistics https://conf.ling.cornell.edu/miawiegand/Latex_Slides.pdf !!Template !APA7 https://www.overleaf.com/project/65158f5eb78b00018fa500f8 !!Rとの連携 !GLMMの結果の表をLaTeXに入れるために .tex に変換するには、 https://github.com/gorkang/html2latex * インストール {{pre # remotes::install_github("gorkang/html2latex") library("html2latex") }} * フリーのオフィスソフトの LibreOfficeを事前にインストールしておくこと。 ** .html ファイルを、LibreOfficeをつかってLiberOfficeの .odt ファイルに変換してから、 ** .odt ファイルを .tex ファイルに変換するので。 + sjPlotパッケージに含まれるtab_model()を使って、まずは、.htmlファイルにする + そのあと、html2pdf() を使って、.tex ファイルにする。 * <<注意点:>> ディレクトリー名(フォルダー名)内に、空白スペースがないように !!コマンドメモ !文字のスタイル *スタイルとコンテンツを分けるという発想がもとにある *強調する部分は \emph{}で囲む **日本語はゴチックで表示され **英語はイタリックで表示される。 ***日本語の文章中で、英語だけイタリックになるのは変なので、調整が必要 ****\emph{}の中で\emph{}を入れ子にすると、キャンセルされる !文字の色 {\color{red}赤くしたい文字列} !コメントアウト % * 連続した複数行は、選んでおいて、Ctrl+/ !行間 {{pre \smallskip 少しだけ空行を入れる \medskip  中くらい空行を入れる \bigskip 一行くらい空行を入れる }} !記号 * チルダ $\sim$ !エスケープが必要な記号 {{pre \# \$ \% \& \_ \{ \} }} !箇条書き {{pre \begin{itemize} \item 項目 \item 項目 \item 項目 \end{itemize} }} * 項目の見出しを指定したい場合は \item[見出し]として、見出しの部分に記号などを入れる。(例: \item[(d)] ) {{pre \begin{enumerate} \item 項目 \item 項目 \item 項目 \end{enumerate} }} {{pre \begin{description} \item[見出し項目]\mbox{}\\ 内容 \item[見出し項目]\mbox{}\\ 内容 \item[見出し項目]\mbox{}\\ 内容 \end{description} }} !箇条書きの項目間のスペースを狭める {{pre \setlength{\parskip}{0cm} \setlength{\itemsep}{0cm} }} *これを \begin{enumerate}の下に記入 !図の挿入 {{pre \begin{figure} \includegraphics{ファイル名} \caption{キャプション} \label{fig:ラベル名} \end{figure} }} *これで、本文中で \ref{fig:ラベル名} で番号で表示されるようになる。 Figure \ref{fig:ラベル名} shows .... *センタリング \centering *スケール \includegraphics[scale=0.60]{図.png} !脚注 {{pre \footnote{テキスト} }} *本文中の注を付けたいか所に直接挿入 *番号は自動でつく *{テキスト}部分が注の内容。 !そのまま出力 verbatim {{pre \begin{verbatim} \end{verbatim} }} * varbatimの後ろにアスタリスクを付けると、半角スペースも記号で表示 !文献 *本文中 {{pre \cite{文献の記号} }} *文献の記号は、Bibtexのデータ内につけた記号 *丸カッコ内に文献を入れる場合、pをつける {{pre \citep{文献の記号} }} *後ろのReferences {{pre \bibliography{文献ファイル名} %拡張子なし \bibliographystyle{plain} %出力スタイル アルファベット順 }} ---- !!論文スタイル !TeX Wiki 学会スタイル等 https://texwiki.texjp.org/?%E5%AD%A6%E4%BC%9A%E3%82%B9%E3%82%BF%E3%82%A4%E3%83%AB%E7%AD%89 *PLOS https://journals.plos.org/plosone/s/latex *Template and Sample for Authoring APA7 Manuscripts **Overleafで配布されているテンプレート ***Overleafにログインするるとダウンロードできる。 https://ja.overleaf.com/latex/templates/template-and-sample-for-authoring-apa7-manuscripts/pvhtwcrvcmsp * ELSEVIER LaTeX instruction https://www.elsevier.com/authors/policies-and-guidelines/latex-instructions !!オンライン便利ツール !表の作成 *https://doratex.github.io/misc-files/excel2tabular/ *https://www.tablesgenerator.com/latex_tables **CSVでつくったものを **File > Paste table dataで貼り付ける !!References !TeXとLaTeX https://blog.wtsnjp.com/2016/12/19/tex-and-latex/ !LaTeX入門 https://medemanabu.net/latex/ !Learn Latex in 5 minutes https://youtu.be/Y-kXtWdjtmw !文系人間のためのやさしいLaTeX入門 http://ideas.paunix.org/latex/index.htm !The LaTeX for Linguists https://www1.essex.ac.uk/linguistics/external/clmt/latex4ling/ !BibTeX.org http://www.bibtex.org/ !LaTeX Wikibooks https://en.wikibooks.org/wiki/LaTeX !packages with support for linguistics https://www.ctan.org/topic/linguistic !!LaTeXバージョンの問題 !LaTeX2がこれまで使われていたが、expl3というTeXマクロを使った新しいバージョンが使われだしてきた *https://zenn.dev/k16/articles/e7690b036e534c !さまざまなLaTeX *LuaLaTeXへ移行すべきという意見 https://www.metaphysica.info/uplatex-to-lualatex/ *pLaTeX *upLaTeX (unicode対応版) *pdfLaTeX *LuaLaTeX **Luaというプログラミング言語でLaTeXを拡張 **TrueType/OpenTypeを使用 **https://texwiki.texjp.org/?LuaTeX-ja **https://ja.osdn.net/projects/luatex-ja/wiki/LuaTeX-ja%E3%81%AE%E4%BD%BF%E3%81%84%E6%96%B9 *XeLaTeX **OSのフォントを使用 **https://tug.org/xetex/ !!Tips !Overleafのソースコードをローカルで使う * Overleafの左上のメニュのあたりから、ダウンロード ソース を選んでダウンロード *以下のエラーが出たら以下のように修正 ** pdfoutputのエラーはコメントアウト ** pdfファイルの読み込みのエラーは ,dvipdfmx を追加する {{pre \documentclass[nonatbib,dvipdfmx]{elsarticle} %\documentclass[nonatbib]{elsarticle} %\pdfoutput=1 }} *Dvipdfmx https://tug.org/dvipdfmx/doc/dvipdfmx/dvipdfmx.pdf