-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add texlab for LaTeX #288
Add texlab for LaTeX #288
Changes from 28 commits
1b9c44f
f79f8f1
2858cb9
4bae338
6cf82a5
ee0be1d
f543d48
359893e
ba9ea90
5430fe4
fd0ac0e
efb46ed
c57e31a
68ffee7
d3fb610
1eaf308
650614c
5c74e42
fda5598
21ddb6c
2810db2
cb3586e
8b4cbc2
4db5ea7
2a68086
12c9d93
6395a1b
1ce8fc3
f44c918
650e472
fce491e
d420016
f2a7b1a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,12 +12,26 @@ Python | |
Capture Page Screenshot 02-python.png | ||
Clean Up After Working With File Python.ipynb | ||
|
||
Foregin Extractors | ||
Setup Notebook Python Foreign extractors.ipynb | ||
Foreign Extractors | ||
${file} = Set Variable Foreign extractors.ipynb | ||
# #288: this would need to be restored for latex | ||
# | ||
# Configure JupyterLab Plugin {"language_servers": {"texlab": {"serverSettings": {"latex.lint.onChange": true}}}} | ||
# | ||
Setup Notebook Python ${file} | ||
# if mypy and pyflakes will fight over `(N|n)ame 'valid'`, just hope for the best | ||
@{diagnostics} = Create List Failed to parse expression ame 'valid' Trailing whitespace is superfluous. | ||
@{diagnostics} = Create List | ||
... Failed to parse expression # bash | ||
... ame 'valid' # python | ||
... Trailing whitespace is superfluous. # r | ||
... `frob` is misspelt # markdown | ||
# | ||
# #288: once configured, diagnostics are coming back over the wire, but not displaying | ||
# | ||
# ... Command terminated with space # latex | ||
# | ||
FOR ${diagnostic} IN @{diagnostics} | ||
Wait Until Page Contains Element css:.cm-lsp-diagnostic[title*\="${diagnostic}"] timeout=35s | ||
Capture Page Screenshot 0x-${diagnostic}.png | ||
END | ||
Clean Up After Working With File Foreign Extractors.ipynb | ||
[Teardown] Clean Up After Working with File and Settings ${file} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this may well have been causing issues... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
\documentclass{article} | ||
|
||
\begin{document} | ||
\label{foo} | ||
\ref{foo} | ||
\foo This is an error. | ||
\end{document} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,7 @@ dependencies: | |
- r-irkernel | ||
- r-languageserver | ||
- rpy2 | ||
# for tex | ||
- tectonic | ||
- texlab | ||
- chktex |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -199,6 +199,48 @@ | |
"install them with [extra_node_roots](./Configuring.ipynb#extra_node_roots)." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Other Scientific Languages\n", | ||
"\n", | ||
"These servers have been mostly tested with file editor." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"hide_input": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"sci_langs = [\"texlab\"]\n", | ||
"lang_server_table(\n", | ||
" {key: spec for key, spec in mgr.language_servers.items() if key in sci_langs}\n", | ||
")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"#### Example: Getting a $\\LaTeX$ stack\n", | ||
"\n", | ||
"```bash\n", | ||
"conda install -y conda-forge tectonic texlab chktex\n", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this conda-only or is there a reasonable (maybe not single command I guess) alternative for let's say Ubuntu users? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. latex installation, care, and feeding, is one of my personal circles of support hell. for example, because i run a small root partition, i can't even use the "easy" route on my machine, unless i handpick all of the stuff it would need to work, because i would run out of disk space. with this, like nodejs, or anything else in the stack, providing inaccurate install docs is worse than nothing, so i think the best thing we can do is:
the only way i'd be interested in documenting or supporting n distros, would be if we had additional Dockerfiles we ran the full battery of tests against with the release tarballs... and that seems like an awful lot for this That being said, it looks like the docs aren't pick up the new spec: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. About the docs - R does not show up on the PR builds too, but it is ok on master; would it have to do with your changes, or is it a limitation of the PR builds? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, my personal standpoint is that having a Debian/Ubuntu install is usually good enough. Not only because it is a common one, but also because I can always google "how to install X ubuntu package equivalent on Y" and it more often works than it doesn't (unless speaking of exotic distros). This trick also works for Y=Mac (sometimes). But I think this is not holding this PR from being merged - let's just make sure we show links to official docs of the tools we require to make latex work! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess let's see how the docs build goes... I didn't have to do anything too fancy to the specs.
I suppose... but again, I've never tried to do one... it's definitely one of those things I Docker-and-forget in a build toolchahin. Indeed let's hope that the texlab docs link is sufficient. |
||
"```\n", | ||
"\n", | ||
"This will install:\n", | ||
"\n", | ||
"- `tectonic`, a cross-platform $\\LaTeX$ processing tool\n", | ||
" - note, it will download a large number of packages when first executed\n", | ||
"- `texlab`, a Language Server for `.tex` files that supports completion and\n", | ||
" refernce navigation\n", | ||
"- `chktex`, a `.tex` style checker" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,7 +112,7 @@ export let foreign_code_extractors: IForeignCodeExtractorsRegistry = { | |
pattern: '^%%(latex)( .*?)?\n([^]*)', | ||
extract_to_foreign: '$3', | ||
is_standalone: false, | ||
file_extension: 'latex' | ||
file_extension: 'tex' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. after making this change, the diagnostics do come over the wire, but they aren't showing up in the notebook... @krassowski thoughts? |
||
}), | ||
new RegExpForeignCodeExtractor({ | ||
language: 'markdown', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be updated :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mentioned below, but if not configured with
onChange
oronSave
, they never show.Perhaps, as a separate issue, we may add a
suggestedConfiguration
which gets toasted/shown in the status bar when you start a particular server for the first time.Also: watching the websocket logs:
texlab
's noisy! WhenonChange
is set, you get back diagnostics even for documents never opened during the lifespan of that server. Maybe it's caching stuff someplace, but hopefully not a showstopper. I'm taking a look on binder, and it's probably fine, but still surprising.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems ok on binder, even with a number of files open.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean the wording could be more "needs configuration to work" rather "don't work but works if configured"