Skip to content

Commit

Permalink
Add screenshot capture and about window functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
ProfFan committed Feb 15, 2024
1 parent ceb8a39 commit cc8fcd9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Click on it and select "Capture" to capture a screenshot of the equation. The ap

![](./images/screenshot.png)

Double click on the LaTeX code and right click to copy.

# Build

```bash
Expand Down
17 changes: 16 additions & 1 deletion standalone_app/Snap2LaTeX.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@

# Create the icon
from os import path
path_to_icon = path.abspath(path.join(path.dirname(__file__), 'icon.png'))

path_to_icon = path.abspath(path.join(path.dirname(__file__), "icon.png"))
icon = QIcon(path_to_icon)

# Create the tray
Expand Down Expand Up @@ -101,6 +102,20 @@ def capture():
action.triggered.connect(capture)
menu.addAction(action)

# Add About option to the menu
def about_window():
dialog = QMessageBox()
dialog.setText(
"""Snap2LaTeX ©2024 Fan Jiang
Snap2LaTeX is a tool that converts a picture of a mathematical equation into a LaTeX code. Model by @NormXU: https://github.com/NormXU/nougat-latex-ocr.
"""
)
dialog.exec()

about = QAction("About")
about.triggered.connect(about_window)
menu.addAction(about)

# Add a Quit option to the menu.
quit = QAction("Quit")
quit.triggered.connect(app.quit)
Expand Down

0 comments on commit cc8fcd9

Please sign in to comment.