役に立つLaTeXメモ

# document で beamer のような box を使いたい

https://texmedicine.hatenadiary.jp/entry/2015/12/17/000339

https://tex.stackexchange.com/questions/172475/how-can-i-define-a-custom-tcolorbox-environment-with-color-as-a-parameter






# フォントのあれこれ
https://tug.org/FontCatalogue/mathfonts.html

https://www.reddit.com/r/LaTeX/comments/v29jf9/what_font_and_font_size_do_you_prefer/

https://www.reddit.com/r/typography/comments/2ifj1u/instead_of_writing_my_thesis_i_created_an/



## 好きなフォント
Serif
- \usepackage{mathpazo} : 基本はこれ
- \usepackage{XCharter}\usepackage[notext]{stix2}
- \usepackage{libertinus,libertinust1math}
- \usepackage{boisik} : ブサイク過ぎて逆に捗る

Sans Serif
- \usepackage{helvet} : Helvetica
- \usepackage[default]{lato} : Lato
- \usepackage[defaultsans,scaled=.85]{droidsans}
- \usepackage[scaled=0.95]{newtxsf} : math font
- \usepackage{helvet}\usepackage[default]{lato} : 効果はわからないけど2つを同時に使うのを最も愛用している





# Githubとの連携
https://qiita.com/tonta/items/ecf056bc67429df98fed







# コンパイルの速度を上げたい
https://tex.stackexchange.com/questions/409232/is-it-possible-to-use-gpu-acceleration-on-compiling-large-latex-documents

https://tex.stackexchange.com/questions/103565/tips-for-choosing-hardware-for-best-latex-compile-performance

>[I]t is only one thing that really makes a difference: Single-Threaded CPU power!

>[T]he result roughly is: compilation times scale nearly linear with the CPU clock. It's the fasted Core i7 that makes the run; memory and disk plays only a minor role (given that you provide modest quality and size of both). 

>To sum up: For a "LaTeX machine" it is the processor and in particularly it's single-core throughput one should look for. However, the latter is not always easy to figure out, as basically all processors nowadays are multi-core and benchmarked and advertised with their multi-core throughput. A good starting point is [the PassMark CPU Benchmarks site](https://www.cpubenchmark.net/singleThread.html), which provides a frequently updated report on "Single Thread Performance" for all current IA32e/AMD64 CPUs. 


# \emph or \textit

https://tex.stackexchange.com/questions/1980/emph-or-textit

>If you want to emphasize a word or some text, use \emph. Don't just make the text italic or bold.

>If you want to get italic text, use \textit. \emph might have a different effect, a package like ulem might change it to underlining for instance.

# alignの無駄なスペースが大きすぎる
https://tex.stackexchange.com/questions/125662/too-much-white-space-when-using-the-align-environment

https://tex.stackexchange.com/questions/47400/remove-vertical-space-around-align

2つ目の記事の以下のコマンドを利用するようになった、\begin{document}の前に
```
\usepackage{etoolbox}
\newcommand{\zerodisplayskips}{%
  \setlength{\abovedisplayskip}{0pt}%
  \setlength{\belowdisplayskip}{0pt}%
  \setlength{\abovedisplayshortskip}{0pt}%
  \setlength{\belowdisplayshortskip}{0pt}}
\appto{\normalsize}{\zerodisplayskips}
\appto{\small}{\zerodisplayskips}
\appto{\footnotesize}{\zerodisplayskips}
```



# \headheight is too small (12.0pt): Make it at least 14.49998pt.

以下のコマンドを入れてエラーメッセージ消去
```
\setlength{\headheight}{14.49998pt}
```



# ファイルの1部だけをインプットしたい
https://stackoverflow.com/questions/56218371/import-specific-section-from-another-tex-file

```
%<*tag> と %</tag> で囲む (最初と最後、*と/が異なる) ことに注意
```

# VS Codeの色をカスタムしたい
```
https://gist.github.com/Yarakashi-Kikohshi/948720cb69d0baafe71e62ec6cb2cb54

https://github.com/dsrkafuu/vscode-theme-aofuji
```

# blockの空白
https://tex.stackexchange.com/questions/28251/too-much-space-at-the-top-of-a-beamer-block-when-using-multilined-math-environme

https://latex-beamer.com/faq/block-width/

```
\addtobeamertemplate{block begin}{
  \vspace{0pt}}{ % space before block
  \vspace{-3pt}} % space of above block body
```


# 特定の文字列に色を付けたり太字にしたい (VS Code)
https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-highlight
```
    "highlight.decorations": { "rangeBehavior": 3 },
    "highlight.regexFlags": "gi",
    "highlight.regexes": {
        "(frame)": [
            {
                "color": "",
                "fontWeight": "bold",
                "fontStyle": "",
            }
        ],
        "(block)": [
            {
                "color": "",
                "fontWeight": "",
                "fontStyle": "italic",
            }
        ],
    },
    "highlight.maxMatches": 250,
```

# 複数行のスライド
https://tex.stackexchange.com/questions/26929/two-column-beamer-toc-with-control-over-the-breaking-point


# item で行間を整わせたい
https://sleepy-yoshi.hatenablog.com/entry/20080115/p2



# formatしたい
https://qiita.com/Yarakashi_Kikohshi/items/1a275f2046b002e398b3#-format-%E3%81%A8-lint

[How to use latexindent](https://gist.github.com/Yarakashi-Kikohshi/8c39707f83ba73b3bce73c54638ac594)

https://zenn.dev/ganariya/articles/vscode-latex-indent