Skip to content

Commit 71ddd01

Browse files
authored
Merge pull request #262 from sepehr541/patch-4
Update README.md for pygments lexer for Overleaf
2 parents 16bdaa1 + 2be4735 commit 71ddd01

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

syntax/pygments/README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,24 @@ pygmentize -f html -O full -o output.html /path/to/input.tla
2828
```
2929

3030
For syntax highlighting inside Latex docuemtns, we use [minted](https://ctan.org/pkg/minted?lang=en) package. For more
31-
information see the provided [example](latex/main.tex).
31+
information see the provided [example](latex/main.tex).
32+
33+
### Overleaf
34+
To use the MPCal and TLA+ lexers provided here on [Overleaf](overleaf.com):
35+
1. Upload the `mpcallexer/lexer.py` file to your Overleaf project's top-most level (i.e., root directory).
36+
2. Change your TeX Live version to 2022 or earlier, see (link)[https://www.overleaf.com/learn/latex/Code_Highlighting_with_minted#Custom_lexers].
37+
3. Use `\begin{minted}{lexer.py:TLAplusLexer -x}` to redirect highlighting to the custom lexer.
38+
- For TLA+: `{lexer.py:TLAPlusLexer -x}`
39+
- For MPCal: `{lexer.py:MPCalLexer -x}`
40+
41+
4. A minted environment can be defined to avoid repetition:
42+
- definition:
43+
```latex
44+
\newminted[tlaplus]{lexer.py:TLAplusLexer -x}{fontsize=\small, linenos}
45+
```
46+
- usage:
47+
```latex
48+
\begin{tlaplus}
49+
...
50+
\end{tlaplus}
51+
```

0 commit comments

Comments
 (0)