# Tex

## install texlive & tex2pdf

* install texlive `sudo apt-get install texlive`
* install tex2pdf <https://sourceforge.net/projects/tex2pdf.berlios/>

```bash
sudo mv tex2pdf /usr/bin
tex2pdf --configure
tex2pdf <filename>.tex
```

there may remind you that not found `subfloat.sty`

## install subfloat.sty

* download `subfloat.sty` <https://ctan.org/tex-archive/macros/latex/contrib/subfloat>
* unzip this .zip file

```bash
cd subfloat
./install.sh
```

```bash
$ kpsewhich -var-value=TEXMFHOME
/home/litreily/texmf
$ sudo mkdir -p ~/texmf/subfloat
$ cp subfloat.sty ~/texmf/subfloat/
$ sudo texhash
```

or

```bash
sudo cp subfloat.sty /usr/share/latex/subfloat/
# or
sudo cp subfloat.sty /usr/share/texlive/texmf-dist/tex/latex/subfloat/

sudo texhash
```

* check subfloat.sty

```bash
$ kpsewhich subfloat.sty
/usr/share/texmf/tex/latex/subfloat/subfloat.sty
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://litreily.gitbook.io/notes/gitbook/software/tex.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
