This package is a helper tool for writing documents and papers using Markup Language (ML) such as LaTeX, HTML, or Markdown.
- Image insertion support
- This can convert .pptx/.ppt files created by PowerPoint or LibreOffice into image files such as .eps, .pdf, .png and so on.
- Cropping
- This can remove outline white space in the above conversion.
- Monitoring specific folders and copy if inside files are changed
- This can copy files such as .bib file exported from document manager to target folder by detecting their change or export and so on.
- Grayscale
- This can convert to gray scale image.
Please install the following software before using this package.
- LibreOffice
Format:convert4ml src_path dst_dir to_fmt is_crop
Format:mlhelper.watch
Install requirements
- LibreOffice
- Windows10 or above:
winget install LibreOffice
- MacOS:
brew install --cask libreoffice
- Linux:
sudo apt-get install libreoffice
- Manual install...
- Windows10 or above:
- this package:
pip install -U git+https://github.com/HirotsuguMINOWA/ml_writing_helper.git
- Make a rule file for support.
- Save this code to ,for example,
start_watcher.py
- Save this code to ,for example,
python [below code]
from ml_writing_helper import Monitor from pathlib import Path manu_path = Path(__file__).resolve().parent # manuscript_path as hiro_watcher o=Monitor() # Conversion .pptx in fig_src dir TO fig_gen dir. o.set_monitor( src_dir=manu_path.joinpath("fig_src") ,dst_dir=manu_path.joinpath("fig_gen") ,to_fmt=".eps" # .png, .pdf and so on. ) # Copy document manager(mendeley/zotero...) exported .bib is copied to manu_path o.set_monitor( src_dir="/usr/<username>/Documents/BibTexExported" ,dst_dir=manu_path ,to_fmt=".bib" ) o.start_monitors()
- Install this package.
python start_watcher.py
- Setup
- Install PlugIn "CodeRunner(
formulahendry.code-runner
)" to VSC.
- Install PlugIn "CodeRunner(
- Settings
- Setup path of python interpreter @
.vscode/settings.json
.vscode/settings.json
{ "code-runner.executorMap": { "python": "/Users/YOUR_USER_ID/pyenv/ml_writing_helper/bin/python", } }
- Setup path of python interpreter @
- Run a rule file
start_watcher.py
- 'Cmd(Ctrl)+Opt(Alt)+N' to run
start_watcher.py
- Or autorun if combines with
philfontaine.autolaunch
?
- 'Cmd(Ctrl)+Opt(Alt)+N' to run
- Reason: displays at proper size
- In pdf,
\linewidth
does not fit in the width (multiple columns) correctly, probably because the size of pdf is not correctly obtained.- Compared to png, it is easier to use eps or .xbb, because the bounding box is not necessary to specify the size.
- In IEICE templates, the above size acquisition failure may be the reason why the image is normally output as an image and buried in the text.
- Invisible frame in the target image
- If you use format
pdf
, change to.png
.- Current version fails to crop pdf files.
- MacOS: LibreOfficeVanilla is not verified?
- This edition was removed the conversion function.
- is the image quality down when you open that .pttx in LibreOffice?
- even if the image quality is not reduced on PowerPoint, the image quality may be reduced when opened in LibreOffice, which could be solved by reworking the document.
- a PowerPoint file can be converted to PNG in PowerPoint and then converted to eps in this script.
- MacOS: LibreOffice application verification not finished?
- after installing from Homebrew, if you use LibreOffice without completing the application validation, the image quality will be low.