Skip to content

Commit c1a1eeb

Browse files
committed
docs/src/howto/auctex-setup/index.md: use hard linewraps
1 parent 1816866 commit c1a1eeb

1 file changed

Lines changed: 49 additions & 19 deletions

File tree

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,41 @@
11
# How To: Use Tectonic with AucTeX
22

3-
This section is a guide aimed at [GNU Emacs](https://www.gnu.org/software/emacs/) users for setting up [AucTeX](https://www.gnu.org/software/auctex/) with Tectonic as the TeX/LaTeX distribution.
3+
This section is a guide aimed at [GNU
4+
Emacs](https://www.gnu.org/software/emacs/) users for setting up
5+
[AucTeX](https://www.gnu.org/software/auctex/) with Tectonic as the TeX/LaTeX
6+
distribution.
47

58
## Basic Prerequisites
69

7-
To follow this section you will need Tectonic and GNU Emacs installed on your system. Additionally, you will require the AucTeX emacs package to be installed before
8-
following along.
10+
To follow this section you will need Tectonic and GNU Emacs installed on your
11+
system. Additionally, you will require the AucTeX emacs package to be installed
12+
before following along.
913

10-
> Note: This section makes use of the V2 tectonic CLI, invoked using the `nextonic` command.
14+
> Note: This section makes use of the V2 tectonic CLI, invoked using the
15+
> `nextonic` command.
1116
1217
## Setup
1318

14-
All the code displayed in this section should go into your `init.el` file (or `config.el` if you are using [Doomemacs](https://github.com/doomemacs/)).
19+
All the code displayed in this section should go into your `init.el` file (or
20+
`config.el` if you are using [Doomemacs](https://github.com/doomemacs/)).
1521

1622
First, load the AucTeX package.
1723

1824
```lisp
1925
(require 'latex)
2026
```
2127

22-
You will need to set the default TeX engine AucTeX uses to figure out the build commands to use Tectonic instead of traditional TeX distributions. Therefore we have to modify the `TeX-engine-alist` varible.
28+
You will need to set the default TeX engine AucTeX uses to figure out the build
29+
commands to use Tectonic instead of traditional TeX distributions. Therefore we
30+
have to modify the `TeX-engine-alist` varible.
2331
* The first element of the list is the symbol that AucTeX recognizes.
2432
* The second element is a string with the name of the TeX distribution.
2533
* The third element is the shell command for compiling plain TeX documents.
26-
* The fourth element is the shell command for compiling LaTeX documents. Here we are assuming the user is using a Tectonic project (generated using `nextonic new <proj-name>`).
27-
* The last element is the shell command for compiling ConTeXt documents, left unconfigured for now.
34+
* The fourth element is the shell command for compiling LaTeX documents. Here we
35+
are assuming the user is using a Tectonic project (generated using `nextonic
36+
new <proj-name>`).
37+
* The last element is the shell command for compiling ConTeXt documents, left
38+
unconfigured for now.
2839

2940
```lisp
3041
(setq TeX-engine-alist '((default
@@ -34,15 +45,20 @@ You will need to set the default TeX engine AucTeX uses to figure out the build
3445
nil)))
3546
```
3647

37-
Next, modify the `LaTeX-command-style` so that AucTex doesn't add extra options to it that Tectonic does not recognize. We simply set it to the `%(latex)` expansion (from `TeX-expand-list-builtin`), removing any other extra options.
48+
Next, modify the `LaTeX-command-style` so that AucTex doesn't add extra options
49+
to it that Tectonic does not recognize. We simply set it to the `%(latex)`
50+
expansion (from `TeX-expand-list-builtin`), removing any other extra options.
3851

3952
```lisp
4053
(setq LaTeX-command-style '(("" "%(latex)")))
4154
```
4255

43-
We need to set the `TeX-check-TeX` variable to `nil` since AucTeX will try to find a traditional distibution like `TeXLive` or others, and will fail since Tectonic doesn't meet it's criteria.
56+
We need to set the `TeX-check-TeX` variable to `nil` since AucTeX will try to
57+
find a traditional distibution like `TeXLive` or others, and will fail since
58+
Tectonic doesn't meet it's criteria.
4459

45-
Additionally, we should also set `TeX-process-asynchronous` to `t`, so that running Tectonic in watch mode doesn't hang up Emacs.
60+
Additionally, we should also set `TeX-process-asynchronous` to `t`, so that
61+
running Tectonic in watch mode doesn't hang up Emacs.
4662

4763
We'll also just ensure that the `TeX-engine` is set to `default`.
4864

@@ -52,7 +68,9 @@ We'll also just ensure that the `TeX-engine` is set to `default`.
5268
TeX-engine 'default)
5369
```
5470

55-
Finally, modify the `TeX-command-list` to use the appropriate commands, and not pass in extra metadata and options to Tectonic which cause it to error out. This needs to be done in place.
71+
Finally, modify the `TeX-command-list` to use the appropriate commands, and not
72+
pass in extra metadata and options to Tectonic which cause it to error out. This
73+
needs to be done in place.
5674

5775
```lisp
5876
(let ((tex-list (assoc "TeX" TeX-command-list))
@@ -61,24 +79,33 @@ Finally, modify the `TeX-command-list` to use the appropriate commands, and not
6179
(cadr latex-list) "%l"))
6280
```
6381

64-
And that is all! You should now be able to
82+
And that is all! You should now be able to
6583
1. Compile plain TeX files.
6684
2. Build Tectonic LaTeX projects in watch mode.
6785

6886
## Additional Configuration and Usage Suggestions
6987

7088
### Compile LaTeX outside a Tectonic project
7189

72-
To do this, you can simply invoke `M-x TeX-command-master`, and the select the `Other` option, passing in the compile command `nextonic compile -f latex <name of file>`.
73-
> **Caution**: Compiling a document with multiple LaTeX files in this manner isn't extensively tested, as using a Tectonic project is the better way in that case. Any bug reports are welcome.
90+
To do this, you can simply invoke `M-x TeX-command-master`, and the select the
91+
`Other` option, passing in the compile command `nextonic compile -f latex <name
92+
of file>`.
93+
94+
> **Caution**: Compiling a document with multiple LaTeX files in this manner
95+
> isn't extensively tested, as using a Tectonic project is the better way in
96+
> that case. Any bug reports are welcome.
7497
7598
### Live PDF Preview in Tectonic projects
7699

77-
AucTeX expects the output PDF after compiling to be in the same directory as the input file. So it will error out when that is not the case, since Tectonic places the output in a build directory.
100+
AucTeX expects the output PDF after compiling to be in the same directory as the
101+
input file. So it will error out when that is not the case, since Tectonic
102+
places the output in a build directory.
78103

79-
This behavior can be controlled by using the `TeX-output-dir` variable on a per porject basis.
104+
This behavior can be controlled by using the `TeX-output-dir` variable on a per
105+
porject basis.
80106

81-
This configuration assumes you are using `project.el`, although porting this code to `projectile.el` should be trivial.
107+
This configuration assumes you are using `project.el`, although porting this
108+
code to `projectile.el` should be trivial.
82109

83110
```lisp
84111
(add-hook 'after-change-major-mode-hook
@@ -89,4 +116,7 @@ This configuration assumes you are using `project.el`, although porting this cod
89116
(setq-local TeX-output-dir (expand-file-name "build/index" proot))))))
90117
```
91118

92-
We are basically looking for `Tectonic.toml` file in the project root, and if it exists, setting the `TeX-output-dir` to the appropriate path to the build directory. You may replace the `"build/index"` path to wherever your PDF file is placed after it is generated by Tectonic.
119+
We are basically looking for `Tectonic.toml` file in the project root, and if it
120+
exists, setting the `TeX-output-dir` to the appropriate path to the build
121+
directory. You may replace the `"build/index"` path to wherever your PDF file is
122+
placed after it is generated by Tectonic.

0 commit comments

Comments
 (0)