taraskuzyo / latexpkges Goto Github PK
View Code? Open in Web Editor NEWThis project forked from bazzilic/latexpkges
A LaTeX package cleanup utility.
License: MIT License
This project forked from bazzilic/latexpkges
A LaTeX package cleanup utility.
License: MIT License
By any chance, could you provide a prepackaged Windows executable for easy download?
Would make this tool way more accessible while also saving users the need to install Python2.
Thanks for taking over this package! Would you consider submitting this to PyPI so it is easier to install?
I'm trying to run this script on a Debian machine with Python 2.7.13 and always end up with the following:
Building the project.... Done!
Initial build fails! Finishing now...
Any ideas how to solve this issue?
I suggest to remove the wordy output and use something like this:
[package] : used (build fails)
[package] : not used
[package] : used (checksum mismatch: [hash])
I am experiencing some weird behavior please consider the files below:
test.tex:
\documentclass{book}
\usepackage{lipsum}% useless package here
\usepackage{amsmath} % needed
\input{/tmp/input.tex}
\begin{document}
\begin{align}
a = b + c
\label{eq}
\end{align}
\cref{eq}
\eqref{eq}
\end{document}
input.tex
% BLA BLA BLA
\usepackage{tikz} % should be useless here as well
\usepackage{cleveref}% needed
When running LaTeXpkges.py --latex lualatex /tmp/test.tex --input /tmp/input.tex
it says:
Building the project.. Done!
Calculating the original checksum for test.pdf...
MD5 for the original output file is e774282e0696e6775781967f764a5aff
4 were found.
Testing if lipsum can be removed... Yep.
Testing if amsmath can be removed... Nope. Build fails.
Testing if tikz can be removed... Nope. Build fails.
Testing if cleveref can be removed... Nope. Build fails.It looks like it's safe to remove these packages:
lipsum
To me that's weird because manually removing tikz
does not result in an build error.
Edit:
Unforunately, that seems to be related to my changes. If I have all the stuff in one document, like
\documentclass{book}
\usepackage{lipsum}% useless package here
\usepackage{amsmath} % needed
% BLA BLA BLA
\usepackage{tikz} % should be useless here as well
\usepackage{cleveref}% needed
\begin{document}
\begin{align}
a = b + c
\label{eq}
\end{align}
\cref{eq}
\eqref{eq}
\end{document}
it says for LaTeXpkges.py --latex lualatex /tmp/test.tex
Building the project.. Done!
Calculating the original checksum for test.pdf...
MD5 for the original output file is e774282e0696e6775781967f764a5aff
4 were found.
Testing if lipsum can be removed... Yep.
Testing if amsmath can be removed... Nope. Build fails.
Testing if tikz can be removed... Nope. Checksum mismatch: b6a4bf87ca6cbb42bc7a89dddb71bfdc
Testing if cleveref can be removed... Nope. Build fails.It looks like it's safe to remove these packages:
lipsum
Which is still weird, but at least it doesn't report a crash.
Hello, I am considering to modify the script to do the same thing with macros (delete from the file macros that have not been used). I believe the same approach should work, as long as you change the regular expression to identify macros instead of packages and then you should always end up in the "Build failed" case. Do you know if there is already something like that available around?
If installing on Unix, there is no need for py2exe
so this shouldn't be a hard requirement.
$ pip install git+https://github.com/TarasKuzyo/LaTeXpkges.git
Collecting git+https://github.com/TarasKuzyo/LaTeXpkges.git
Cloning https://github.com/TarasKuzyo/LaTeXpkges.git to /tmp/pip-req-build-4ekiv_l3
Running command git clone -q https://github.com/TarasKuzyo/LaTeXpkges.git /tmp/pip-req-build-4ekiv_l3
ERROR: Command errored out with exit status 1:
command: /home/mhoffman/venv/python3/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-4ekiv_l3/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-4ekiv_l3/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-4ekiv_l3/pip-egg-info
cwd: /tmp/pip-req-build-4ekiv_l3/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-req-build-4ekiv_l3/setup.py", line 2, in <module>
import py2exe
ImportError: No module named 'py2exe'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Would it be possible to have an option to run multiple tests in parallel?
I have the problem that the package detects (and thus only evaluates) packages that have been included in the main document. But I have a couple of packages I load in a separate file to keep the main document cleaner. They seem to be disregarded.
Edit: Maybe an easier workaround is to let the user specify the additional files that should be parsed for \usepackage
commands?
When one uses multicol
package and a multicols
environment, this program still says the document does not need the multicol
package.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.