You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+49-1
Original file line number
Diff line number
Diff line change
@@ -81,14 +81,16 @@ and see the block like this in the output
81
81
82
82
## Customization
83
83
84
-
The extension defaults to running `xelatex` on the server.
84
+
The extension defaults to running the `xelatex` engine on the server.
85
85
This command may be customized (e.g., to use `pdflatex` instead) by customizing
86
86
your `jupyter_notebook_config.py` file:
87
87
88
88
```python
89
89
c.LatexConfig.latex_command ='pdflatex'
90
90
```
91
91
92
+
The above configuration will compile a LaTeX document using the common predefined flags and options such as `-interaction``-halt-on-error`, `-file-line-error`, `-synctex`. For more control over the command sequence, check the Manual Command Arguments configuration.
93
+
92
94
The extension defaults to running `bibtex` for generating a bibliography
93
95
if a `.bib` file is found. You can also configure the bibliography command
94
96
by setting
@@ -97,13 +99,59 @@ by setting
97
99
c.LatexConfig.bib_command ='<custom_bib_command>'
98
100
```
99
101
102
+
_New in 4.2.0_: `BibTeX` compilation is skipped if the following conditions are present:
103
+
104
+
-`c.LatexConfig.disable_bibtex` is explicitly set to `True` in the `jupyter_notebook_config.py` file
105
+
- There are no .bib files found in the folder
106
+
100
107
To render references (`\ref{...}`), such as equation or chapter numbers, you would
101
108
need to compile in multiple passes by setting
102
109
103
110
```python
104
111
c.LatexConfig.run_times =2
105
112
```
106
113
114
+
_New in 4.2.0_: Manual Compile Command
115
+
For more advanced customizations, a complete command sequence can be specified using the `manual_cmd_args` configuration in the `jupyter_notebook_config.py` file. This allows to define the exact command and use options the extension will finally execute:
116
+
117
+
```python
118
+
c.LatexConfig.manual_cmd_args = [
119
+
'lualatex', # Specify the LaTeX engine (e.g., lualatex, pdflatex)
120
+
'-interaction=nonstopmode', # Continue compilation without stopping for errors
121
+
'-halt-on-error', # Stop compilation at the first error
122
+
'-file-line-error', # Print file and line number for errors
123
+
'-shell-escape', # Enable shell escape
124
+
'-synctex=1', # Enable SyncTeX for editor synchronization
125
+
'{filename}.tex'# Placeholder for the input file name
126
+
]
127
+
```
128
+
129
+
The only supported placeholder in the manual compile command is `{filename}`. It will be replaced by the name of the LaTeX file during compilation.
130
+
131
+
Additional tags and options can also be added to edit configuration values.
132
+
133
+
_New in 4.2.0_: Tectonic Engine Support
134
+
The extension now also supports the Tectonic engine for compiling LaTeX files. To use Tectonic as the default LaTeX engine cutomize the `jupyter_notebook_config.py file`:
135
+
136
+
```python
137
+
c.LatexConfig.latex_command ='tectonic'
138
+
```
139
+
140
+
The default command sequence for Tectonic generates the output file in `pdf` format and uses the available `SyncTeX` flag.
141
+
142
+
For [advanced control](https://tectonic-typesetting.github.io/book/latest/v2cli/compile.html) over [Tectonic](https://github.com/tectonic-typesetting/tectonic), specify options in the manual_cmd_args setting:
143
+
144
+
```python
145
+
c.LatexConfig.manual_cmd_args = [
146
+
'tectonic',
147
+
'--outfmt=pdf', # Output format as PDF
148
+
'--synctex=1', # Enable SyncTeX for editor synchronization
149
+
'--outdir', # The directory in which to place output files
150
+
'--keep-logs', # Keep the log files generated during processing
151
+
'{filename}.tex'# Input .tex file
152
+
]
153
+
```
154
+
107
155
### Security and customizing shell escapes
108
156
109
157
LaTeX files have the ability to run arbitrary code by triggering external
0 commit comments