Skip to content

Area snapshot (left-> right), MathPix pricing, phrasing edits #34

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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 16 additions & 2 deletions docs/sma/plugin-pdf-common.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
### PDF Summary

> **Import:** <kbd> Ctrl + Alt + I </kbd> to import PDF.
>
> **Open PDF:** Select the <dfn aria-label="Element in SuperMemo which contains the data of an imported PDF.">**PDF element**</dfn> SMA created for you. Unselect to close.
>
> **Extract:** <kbd> Alt + X</kbd> to extract.
>
> **Images:** Hold <kbd> Right click </kbd> and drag mouse to **area snapshot** images.
>
> **Multi-content:** Hold <kbd>CTRL</kbd> to choose multiple elements (e.g. text + images).
>
> See also: [Sub-PDFs](#pdf-sub-pdf), [LateX](plugin-latex.md), [Dictionary](plugin-Dictionary.md), [PDF deletion](#pdf-Deletion)

Comment on lines +1 to +14
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For experienced users who just want to glance at wiki

### PDF: Video tutorial

<div class="youtube-container">
Expand Down Expand Up @@ -44,7 +58,7 @@
There are **two modes** for extracting images:

1. **Image selection (A)**: <kbd>Left click</kbd> on the image. An overlay will be displayed to indicate your selection. <kbd>Alt</kbd> + <kbd>X</kbd> to extract.
2. **Area snapshot (B)**: Hold <kbd>Left click</kbd> or <kbd>Right click</kbd>, then drag your mouse **(B)**. <kbd>Alt</kbd> + <kbd>X</kbd> to extract.
2. **Area snapshot (B)**: Hold <kbd>Right click</kbd>, then drag your mouse **(B)**. <kbd>Alt</kbd> + <kbd>X</kbd> to extract.

![Image selection](content/images/plugin-pdf/pdf-image-selections.png '@z2v="content/videos/plugin-pdf/pdf-extract-image-click-and-drag"')

Expand All @@ -56,6 +70,6 @@ SMA allows you to **select as many objects** to extract as you desire. To start

<!-- TODO -->
> [!NOTE]
> SMA will automatically try to fit your content to make the best use of the space in SuperMemo. You can create new [layouts](#) to change the default arrangement.
> SMA will automatically try to fit your content to make the best use of the space in SuperMemo. *You can create new **layouts** to change the default arrangement. (work in progress)*

![](content/images/plugin-pdf/pdf-extract-multiple-AB.png '@z2v="content/videos/plugin-pdf/pdf-extract-multiple"')
5 changes: 3 additions & 2 deletions docs/sma/plugin-pdf-glossary.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- **PDF element**: [Element in SuperMemo](content/images/plugin-pdf/pdf-element.png ':ignore'), which contains the data relating to an imported PDF.
- **PDF window**: [The window](content/images/plugin-pdf/pdf-window.png ':ignore') that displays the actual PDF, and where extracts can be created.
- **Sub-PDFs**: PDF elements which contain only a [part of your original PDF](content/images/plugin-pdf/pdf-subpdf-out-of-extract.png ':ignore').
- **Area snapshot**: Image selection mode which [captures a region](content/videos/plugin-pdf/pdf-image-drag-result) of your PDF into an image. Hold left or right click, then drag an area with your mouse.
- **Multi-selection**: Selection that contains more than one object (text, image, area snapshot, OCR). Types of objects can be mixed and matched. To start a multi-selection, **hold** the <kbd>Ctrl</kbd> key, and select your content.
- **Area snapshot**: Image selection mode which [captures a region](content/videos/plugin-pdf/pdf-image-drag-result) of your PDF into an image. Hold right click, then drag an area with your mouse.
- **Multi-selection**: Selection that contains more than one object (text, image, area snapshot, OCR). Types of objects can be mixed and matched. To start a multi-selection, **hold** the <kbd>Ctrl</kbd> key, and select your content.

60 changes: 38 additions & 22 deletions docs/sma/plugin-pdf.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### PDF: Force selection

When you have PDF made of images only, or when you find it hard to select the image (interference with text) you can use force selection by holding <kbd>Right click</kbd>. This will ignore text selection.
When you have PDF made of images only, or when you find it hard to select the image (because text is in the way) you can use force selection by holding <kbd>Right click</kbd>. This will ignore text selection.

You can use <dfn aria-label="Selection mode that ignores text or image under the cursor. Hold Right click and drag to use.">force selection</dfn> with OCR as shown in the video clip below. (See [built-in OCR](#pdf-built-in-ocr))

Expand All @@ -16,27 +16,42 @@ You can use <dfn aria-label="Selection mode that ignores text or image under the

### PDF: Built-in OCR

The PDF plugin implements an optional **OCR**, working with both **text** and **scientific formulas** (math, chemestry, ...). Make sure that you also configure the [LaTeX plugin](plugin-LaTeX).
The PDF plugin implements an optional **OCR** functionality, which reads out text from images as well as converts scientific formulas (math, chemistry, ...) into Latex. For the latter, please make sure that the separate [LaTeX plugin](plugin-LaTeX) is correctly configured.

#### Setup

Behind the scene, SMA uses [MathPix](https://www.mathpix.com/) to recognize images. [Register](https://dashboard.mathpix.com/) an account to unlock the OCR feature. At the day of writing this guide, pricing is free up to 1000 requests.
Behind the scene, SMA uses [MathPix](https://www.mathpix.com/) to recognize images. [Register](https://dashboard.mathpix.com/) an account to unlock the OCR feature. As of **24.2.2020**, pricing is free up to 1000 requests (1 request = 1 OCR on image/formula).

Once you are registered, copy your **MathPix App Name** and **Key** and paste them in the [PDF plugin settings](#).
!> **Example**: You want to OCR math book which holds 2000 pieces of formulas. First 1000 formulas you OCR are free, the other 1000 formulas will cost a total of $4. However, if you OCR the first 1000 formulas in January and second 1000 in February, it will cost you nothing.

<div class="pure-g">
<div class="pure-u-1-3" style="padding-right: 30px;">
<img src="content/images/plugin-pdf/pdf-mathpix-pricing.png" />
<img src="content/images/plugin-pdf/pdf-mathpix-usage.png" />
</div>
<div class="pure-u-2-3">
<img src="content/images/plugin-pdf/pdf-mathpix-pricing.png"width="220" height="240" />
</div>
</div>

*You can find amount of requests you made each month in https://dashboard.mathpix.com*





Once you are registered, copy your **MathPix App Name** and **Key** and paste them in the [PDF plugin settings](#).

Comment on lines -23 to +43
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor improvements + example of payment system to those worried of using credit card etc.

<div class="pure-u-2-3">
<img src="content/images/plugin-pdf/pdf-mathpix-settings.png" />
</div>

</div>

#### Using the OCR

1. In the **PDF window**, press the <kbd>Alt</kbd> key, then capture an <dfn aria-label="Image selection mode which captures a region of your PDF into an image. Hold left or right click, then drag an area with your mouse.">[area snapshot](#extract-images)</dfn>.
2. If your image was success recognized, a window titled *TeX editor* will display your result.
#### How to use OCR

1. In the **PDF window**, press the <kbd>Alt</kbd> key, then capture an <dfn aria-label="Image selection mode which captures a region of your PDF into an image. Hold right click, then drag an area with your mouse.">[area snapshot](#extract-images)</dfn>.
2. If your image was successfully recognized, a *TeX editor* window pops up, in which you can preview your result and make changes before you extract it into SM.

![TeX editor](content/images/plugin-pdf/pdf-ocr-TeX-editor.png '@z2v="content/videos/plugin-pdf/pdf-ocr-wholeline"')

Expand Down Expand Up @@ -105,7 +120,7 @@ There are two layers of settings available:
- **Global PDF settings**: To access these settings, either
- <kbd>Right click</kbd> the ![](content/images/icons/robot-16.png) icon in your Window tray bar, and click on the <kbd>PDF</kbd> menu item
- Press <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>O</kbd> and click on the cog ![](content/images/icons/cog.png) icon next to the PDF plugin

- **Per-PDF settings**: In the <dfn aria-label="The window that displays the actual PDF, and where extracts can be created.">PDF window</dfn>, press <kbd>Ctrl</kbd> + <kbd>O</kbd> to bring up [settings dialog ![](content/images/plugin-pdf/pdf-per-pdf-settings.png)](content/images/plugin-pdf/pdf-per-pdf-settings.png ':ignore @tooltip-preview').

> [!NOTE]
Expand All @@ -128,15 +143,12 @@ HotKeys
- SM extract (Alt+X)
- Mark text as ignored (Ctrl+Shift+I)
- Show selected text in Dictionary (Ctrl+D)
- Go To Page (Ctrl+G)
- SM Learn (Ctrl+L)
- Learn And Reschedule (Ctrl+Shift+L)
- SM Reschedule (Ctrl+J)
- SM LaterToday (Ctrl+Shift+J)
- SM Done (Ctrl+Shift+Enter)
- SM Delete (Ctrl+Shift+Del)
- SM Previous (Alt+Left)
- SM Next (Alt+Right)
- SM Parent (Ctrl+Alt+Up)
- SM Child (Ctrl+Alt+Down)
- SM Prev Sibling (Ctrl+Alt+Left)
Expand All @@ -152,20 +164,28 @@ HotKeys
```
Non-hotkeys
- OCR (Alt+Click)
- Image area selection (Hold left click)
- Force image area selection (Hold right click)
- Image area selection (Hold right click)
- Zoom (Ctrl+Wheel)
- Extend text selection (Shift+Click, Shift+Left/Right)
- Deselect (Escape)
- PDF navigation (Up/Down/Left/Right/Pg. Down/Pg. Up/Home/End)
- Select word (Double click)
- Select paragraph (Triple click)
- Select page text (Quadra click)
- Select page (double click on empty space in page)
- Extend page selection (Shift+Click page)
- Add to selection (Hold ctrl)
- Select image (Click image)
```
```
Hotkeys not working currently:
- Go To Page (Ctrl+G)
- SM Previous (Alt+Left)
- SM Next (Alt+Right)
- Deselect (Escape)
- Select paragraph (Triple click)
- Select page text (Quadra click)
```



> [!NOTE]
> When you extract text from the PDF file, the windows error sound may play. You can [disable it by switching off system sounds](#faq).

Expand All @@ -175,10 +195,6 @@ Non-hotkeys

## FAQ

**Q: Concept verification error: hook is not a child of root!**

A: Change currently activated concept as the one with hook in it for the PDFs.

**Q: PDFs stop working after repair of SM collection**

A: This is because when you do repair, SM restarts itself, while SMA doesn't. So the solution is to restart SMA manually.
Expand All @@ -197,4 +213,4 @@ A: Use <kbd>Ctrl</kbd> + <kbd>G</kbd>.

**Q:How do I disable the Windows Sound from playing when I extract from a PDF?**

A: In order to stop the sound from playing, you can right click the volume icon on the taskbar, then open the volume mixer and set system sounds to zero.
A: In order to stop the sound from playing, you can right click the volume icon on the taskbar, then open the volume mixer and set system sounds to zero.