Skip to content
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

UX improvements #192

Open
wants to merge 65 commits into
base: ux-improvements
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
84b2264
instantiation
quintfain Jan 20, 2022
569caf8
Test push
Cbarr-hub Jan 21, 2022
0f1dd92
Add LaTeX Menu
JadenMcElvey Jan 24, 2022
c2439e3
Added Toolbar Button to .TEX files
Cbarr-hub Feb 9, 2022
31e3fc4
Updated ReadMe for release notes 0.1.0
Cbarr-hub Feb 11, 2022
46359c5
Update README.md
Cbarr-hub Feb 11, 2022
d373ae0
Update README.md
Cbarr-hub Feb 11, 2022
0ff3118
Fixed merge conflict in README
Cbarr-hub Feb 11, 2022
22b9d4c
Added Preview Button functionality
Cbarr-hub Feb 11, 2022
aac4c36
Added sub and super buttons with functionality
Cbarr-hub Feb 13, 2022
2d85d8a
Fraction Button
quintfain Feb 14, 2022
2acb243
Correct golden ratio symbol
JadenMcElvey Feb 14, 2022
e36d24d
Merge branch 'development' of https://github.com/Cbarr-hub/jupyterlab…
JadenMcElvey Feb 14, 2022
416749f
Add table creation to LaTeX menu
JadenMcElvey Feb 14, 2022
e348211
Working fraction button
quint-fain Feb 16, 2022
9c7947b
Fixed comma delimiter for splitting fraction button inputs
Cbarr-hub Feb 16, 2022
deb241b
Updated Release notes 0.2.0
Cbarr-hub Feb 18, 2022
3a06cfb
Added drop down feature to ErrorPanel
ZX-80 Feb 19, 2022
2ee47cb
Added feature to filter errors for interesting output
ZX-80 Feb 19, 2022
e22f3ff
Merge branch 'equationbuttons' into development
Cbarr-hub Mar 4, 2022
5f40e3f
Fixed duplicate import for merge of EquationButtons into dev
Cbarr-hub Mar 4, 2022
ff6b83c
Merge branch 'SimplifiedErrors' into development
Cbarr-hub Mar 4, 2022
beda70d
Code for bullet point and numbered lists
quint-fain Mar 8, 2022
9b98df2
Added typeface toolbarButtons and functionallity
Cbarr-hub Mar 10, 2022
0c46c9e
Update README.md
ladyron Mar 11, 2022
5259ea4
Update README.md
ladyron Mar 14, 2022
56fd23c
Update .gitignore
ladyron Mar 17, 2022
aa5698d
Update .gitignore
ladyron Mar 17, 2022
908d797
Delete .DS_Store
ladyron Mar 17, 2022
d8b3ada
Merge branch 'typefaceModifiers' into development
Cbarr-hub Mar 30, 2022
e2f48b0
Fixed more merge errors
Cbarr-hub Mar 30, 2022
d11baaa
Added release notes for v0.4.0
ZX-80 Apr 1, 2022
e81bba9
Add Plot Button
JadenMcElvey Apr 2, 2022
3716399
Merge branch 'master' into development
ktaletsk Apr 13, 2022
a668976
Added table button to toolbar
Cbarr-hub Apr 15, 2022
98a8442
Moved changes from readme to docs/changelog
Cbarr-hub Apr 15, 2022
6ccbd33
Added icon svgs and implemented them on toolbar buttons
Cbarr-hub Apr 15, 2022
a9f48b7
Changed insert super and subscript logic
Cbarr-hub Apr 15, 2022
ea485e3
text alignment
darklordsep1 Apr 18, 2022
6abdeb7
text alignment example
darklordsep1 Apr 18, 2022
9e1f8c5
text alignment
darklordsep1 Apr 18, 2022
2c5324e
merge conflicts
darklordsep1 Apr 18, 2022
11b7f51
Add plot button
JadenMcElvey Apr 18, 2022
3b5b18a
Fix duplicate definitions of button behavior
Cbarr-hub Apr 20, 2022
ec4f9a2
Merged dev_revised into dev
Cbarr-hub Apr 20, 2022
ff446ee
Added icons to text alignment and cleaned up code
Cbarr-hub Apr 20, 2022
ee7f1e2
Add Plot Button
JadenMcElvey Apr 22, 2022
729b27c
Add Format Shortcuts
JadenMcElvey Apr 22, 2022
b226a1b
Adjusted formatting on readme
Cbarr-hub Apr 24, 2022
42d2237
Cleaned up checking if latex file and removed keybinds
Cbarr-hub Oct 27, 2022
e07f00f
merge upstream
ktaletsk May 28, 2023
b9b69a7
fix build issues
ktaletsk May 29, 2023
b0781be
remove package-lock
ktaletsk May 29, 2023
7b18ab8
remove yarn error log
ktaletsk May 29, 2023
423ec77
fix false diff
ktaletsk May 30, 2023
6d6d32c
fix false diff
ktaletsk May 30, 2023
e267056
fix false diff
ktaletsk May 30, 2023
c23cfe9
fix false diff
ktaletsk May 30, 2023
8536328
fix false diff
ktaletsk May 30, 2023
c002fb5
fix false diff
ktaletsk May 30, 2023
c65c738
fix false diff
ktaletsk May 30, 2023
c283356
fix false diff
ktaletsk May 30, 2023
200e3c4
fix false diff
ktaletsk May 30, 2023
68b6530
fix false diff
ktaletsk May 30, 2023
5c9a792
fix false diff
ktaletsk May 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ lib/
node_modules/
npm-debug.log
test/build/*
.DS_Store
workspace.code-workspace
.DS_Store
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,94 @@ c.LatexConfig.shell_escape = "allow"

## Changes

---

# JupyterLab LabTeX

JupyterLab LabTeX is a document generator extension for JupyterLab which allows users to edit and compile LaTeX documents in a more efficient and user-friendly way.

# Release Notes

---

## Version 0.4.0

### New Features

* Image Formatting GUI: This feature allows the user to format an image (size, placement, captions, etc.)

* Insert Images GUI: This feature (partially complete) allows the user to upload an image from their PC and insert it directly into the document

* Insert Plots GUI: This feature allows the user to insert graphs and plots in an intuitive manner

* Text Layout Customization GUI: This feature allows the user to format a paragraphs layout (alignment for example)

### Bug Fixes

N/A

### Known Issues

* While the insert images GUI works, it's having trouble getting the real path to an image, and is thus unable to insert an image.

* During autocomplete implementation, a bug was found with either Jupyterlab-LSP or TexLab. We are working with their respective maintainers to resolve the issue.

---

## Version 0.3.0

### New Features

- Bullet Point and Numbered List

- Autocomplete

- Typeface Modifier GUI

### Bug Fixes

N/A

### Known Issues

N/A

## Version 0.2.0

### New Features

- Equation Buttons

- Table Creation GUI

- Preview Button

- Filtered Error Messages

### Bug Fixes

N/A

### Known Issues

- Unicode characters for Symbol/Constant Menu do not display correctly

## Version 0.1.0

### New Features

- Symbol Menu

- Constant Menu

### Bug Fixes

- LaTeX Editor toolbar buttons are now only visible for .TEX files

### Known Issues

N/A

---

ktaletsk marked this conversation as resolved.
Show resolved Hide resolved
For information on the changes with different versions of the `jupyterlab-latex` library, see our [changelog](./docs/changelog.md)
88 changes: 86 additions & 2 deletions jupyterlab_latex/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class LatexBuildHandler(APIHandler):
def initialize(self, notebook_dir):
self.notebook_dir = notebook_dir


def build_tex_cmd_sequence(self, tex_base_name, run_bibtex=False):
"""Builds tuples that will be used to call LaTeX shell commands.

Expand Down Expand Up @@ -136,6 +135,91 @@ def bib_condition(self):
"""
return any([re.match(r'.*\.bib', x) for x in set(glob.glob("*"))])

def filter_output(self, latex_output):
"""Filters latex output for "interesting" messages

Parameters
----------
latex_output: string
This is the output of the executed latex command from,
run_command in run_latex.

returns:
A string representing the filtered output.

Notes
-----
- Based on the public domain perl script texfot v 1.43 written by
Karl Berry in 2014. It has no home page beyond the package on
CTAN: <https://ctan.org/pkg/texfot>.

"""
ignore = re.compile(r'''^(
LaTeX\ Warning:\ You\ have\ requested\ package
|LaTeX\ Font\ Warning:\ Some\ font\ shapes
|LaTeX\ Font\ Warning:\ Size\ substitutions
|Package\ auxhook\ Warning:\ Cannot\ patch
|Package\ caption\ Warning:\ Un(supported|known)\ document\ class
|Package\ fixltx2e\ Warning:\ fixltx2e\ is\ not\ required
|Package\ frenchb?\.ldf\ Warning:\ (Figures|The\ definition)
|Package\ layouts\ Warning:\ Layout\ scale
|\*\*\*\ Reloading\ Xunicode\ for\ encoding # spurious ***
|pdfTeX\ warning:.*inclusion:\ fou #nd PDF version ...
|pdfTeX\ warning:.*inclusion:\ mul #tiple pdfs with page group
|libpng\ warning:\ iCCP:\ Not\ recognizing
|!\ $
|This\ is
|No\ pages\ of\ output. # possibly not worth ignoring?
)''', re.VERBOSE)

next_line = re.compile(r'''^(
.*?:[0-9]+: # usual file:lineno: form
|! # usual ! form
|>\ [^<] # from \show..., but not "> <img.whatever"
|.*pdfTeX\ warning # pdftex complaints often cross lines
|LaTeX\ Font\ Warning:\ Font\ shape
|Package\ hyperref\ Warning:\ Token\ not\ allowed
|removed\ on\ input\ line # hyperref
|Runaway\ argument
)''', re.VERBOSE)

show = re.compile(r'''^(
Output\ written
|No\ pages\ of\ output
|\(.*end\ occurred\ inside\ a\ group
|(Und|Ov)erfull
|(LaTeX|Package|Class).*(Error|Warning)
|.*Citation.*undefined
|.*\ Error # as in \Url Error ->...
|Missing\ character: # good to show (need \tracinglostchars=1)
|\\endL.*problem # XeTeX?
|\*\*\*\s # *** from some packages or subprograms
|l\.[0-9]+ # line number marking
|all\ text\ was\ ignored\ after\ line
|.*Fatal\ error
|.*for\ symbol.*on\ input\ line
)''', re.VERBOSE)

print_next = False
filtered_output = []

for line in latex_output.split('\n'):
if print_next:
filtered_output.append(line)
print_next = False

elif ignore.match(line):
continue

elif next_line.match(line):
filtered_output.append(line)
print_next = True

elif show.match(line):
filtered_output.append(line)

return '\n'.join(filtered_output)


@gen.coroutine
def run_latex(self, command_sequence):
Expand Down Expand Up @@ -167,7 +251,7 @@ def run_latex(self, command_sequence):
self.set_status(500)
self.log.error((f'LaTeX command `{" ".join(cmd)}` '
f'errored with code: {code}'))
return output
return json.dumps({'fullMessage':output, 'errorOnlyMessage':self.filter_output(output)})

return "LaTeX compiled"

Expand Down