Skip to content

Commit

Permalink
fix: footnote numbering
Browse files Browse the repository at this point in the history
I would love to know how I might make it automatic.
  • Loading branch information
nobiot committed Feb 6, 2021
1 parent 872f79c commit 587e87b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions 115.How-to-enable-insert-image-from-clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ I will also talk about how you can adjust the size of the image displayed in-lin

### Functions

Here is my Windows solution in the source code exhibit below. It does not do drag & drop, unfortunately. I have taken the original solution **somewhere** from Stack Exchange or somewhere else [^3]. I have had it long time, and lost the link to the original since (apologies for not taking enough care about attributions; I have become better since then). I have revisited and cleaned it in the new year with my renewed knowledge in Elisp coding.
Here is my Windows solution in the source code exhibit below. It does not do drag & drop, unfortunately. I have taken the original solution **somewhere** from Stack Exchange or somewhere else [^1]. I have had it long time, and lost the link to the original since (apologies for not taking enough care about attributions; I have become better since then). I have revisited and cleaned it in the new year with my renewed knowledge in Elisp coding.

[^3]: As GitHub user [nerdvarma](https://github.com/nerdvarma) points out for me, [this article](https://www.sastibe.de/2018/11/take-screenshots-straight-into-org-files-in-emacs-on-win10/) looks like the one I referred to originally a few years ago.
[^1]: As GitHub user [nerdvarma](https://github.com/nerdvarma) points out for me, [this article](https://www.sastibe.de/2018/11/take-screenshots-straight-into-org-files-in-emacs-on-win10/) looks like the one I referred to originally a few years ago.

Please try not to be overwhelmed by the amount of lines. In the end, it is rather simple. It consists of the following parts:

Expand Down Expand Up @@ -118,12 +118,13 @@ You can change some bits and pieces easily to customize this solution. Here is a

I can't do it, but if you know how to do it, probably you could do all sorts of good things with it (e.g. you can save the image in a different format [^2]).

One thing: In the main function, `powershell` appears twice in a row. It is not redundant. I have no idea why, but it needs to be there twice [^1]. I tried to make it do with only one, but the image was not correctly stored. I would appreciate it if someone with more knowledge can enlighten me with the way PowerShell works.

[^1]: I suspect it is related to the fact that the default shell in Windows is set to `cmd` rahter than PowerShell with variable `w32-system-shells`; that is, the `shell-command` in Emacs launches `cmd`, and then within it our command string tells it to launch `powershell`. However, this still does not explain why it needs the second `powershell` command, because wihtin PowerShell, or even in `cmd`, you don't need to do it. I will leave it as it is for now. It works with the current default PowerShell version 5.1 that comes with Windows 10. The script itself works wtih PowerShell 7 that I have separately installed, so it should be fine for a long term.
One thing: In the main function, `powershell` appears twice in a row. It is not redundant. I have no idea why, but it needs to be there twice [^3]. I tried to make it do with only one, but the image was not correctly stored. I would appreciate it if someone with more knowledge can enlighten me with the way PowerShell works.

[^2 ]: I have also confirmed that `[System.Drawing.Imaging.ImageFormat]::Png` is not really needed. Without it, PowerShell still saves the image as PNG **no matter what extension you gives to the method**. You can, nevertheless, tell it to save the image file in a different format. For example, `[System.Drawing.Imaging.ImageFormat]::Tiff` or `[System.Drawing.Imaging.ImageFormat]::Bmp`. Refer to [Microsoft's documentation](https://docs.microsoft.com/en-us/dotnet/api/system.drawing.imaging.imageformat) for other accepted formats.

[^3]: I suspect it is related to the fact that the default shell in Windows is set to `cmd` rahter than PowerShell with variable `w32-system-shells`; that is, the `shell-command` in Emacs launches `cmd`, and then within it our command string tells it to launch `powershell`. However, this still does not explain why it needs the second `powershell` command, because wihtin PowerShell, or even in `cmd`, you don't need to do it. I will leave it as it is for now. It works with the current default PowerShell version 5.1 that comes with Windows 10. The script itself works wtih PowerShell 7 that I have separately installed, so it should be fine for a long term.


5. **Add prompt to let you choose the image directory**

See the new section below. I have added the code that I use as of 2021-02-06.
Expand Down

0 comments on commit 587e87b

Please sign in to comment.