Giter VIP home page Giter VIP logo

pydetex's Introduction

PyDetex

@ppizarror

License MIT

Python 3.7+

PyPi package

FOSSA Status

Documentation Status

Codecov

Open issues

PyPi downloads

Total downloads

Buy me a Ko-fi

Source repo on GitHub, and run it on Repl.it

Introduction

PyDetex is a Python application that transforms LaTeX code to plain text. It has multiple language support (15+), detects repeated words, offers a dictionary (synonyms, antonyms, definitions), and many things more to come!

Comprehensive documentation for the latest version (if you plan to use the API) is available at https://pydetex.readthedocs.io

Install Instructions

PyDetex can be installed via pip, for both MacOS, Windows & Linux. Simply run:

$> python3 pip install pydetex -U

Also, there're compiled binaries for Windows (x64) and macOS available through GitHub releases.

Launch the GUI, or use the library

Simply run this command anywhere to execute the application.

$> python3 -m pydetex.gui

(Simple Pipeline) Tadada... !!! A simple GUI to process your LaTex, and paste into Google Docs, an email, or Grammarly \(^o^)/

(Simple Pipeline) Tadada... !!! A simple GUI to process your LaTex, and paste into Google Docs, an email, or Grammarly \(^o^)/

(Strict Pipeline) The strict pipeline removes all commands, or replaces by some known tags.

(Strict Pipeline) The strict pipeline removes all commands, or replaces by some known tags.

Multiple options to configure: Check repeated words, highlight undetected code, or use different pipelines.

Multiple options to configure: Check repeated words, highlight undetected code, or use different pipelines.

You can also import the library, and use the parsers (methods that take latex code and perform a single task) or the pipelines (combination of parsers). For more information, please visit the documentation.

import pydetex.pipelines as pip
text = "This is a \\textbf{LaTex} code..."
out = pip.simple(text)

TO-DOs

Currently, many things must be improved:

  • Add synthax checking for several languages, like language-check.
  • Custom support for environments, such as table.

Author

Pablo Pizarro R. | 2021 - 2024

pydetex's People

Contributors

lgtm-migrator avatar ppizarror avatar vskobov avatar xionghuichen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pydetex's Issues

flatlatex workaround to keep spaces

Hi,

I am the dev of flatlatex. I do not understand when exactly you use flatlatex (but I am happy to see my module is useful), but I found one thing which can be a misuse. In _utils_tex.py line 785 you replace spaces by a special substring, and you do the reverse after conversion line 790. I think this because you want to preserve spaces.

In fact, this is a very bad idea, because, for example in LaTeX, this \frac a2 is pefectly valid, and give normaly ᵃ⁄₂, and this works fine with flatlatex. But if you replace space, the parsing get you a incorrect solution.

I had the same problem, and sometime I want to keep space. Therefore I had some unpushed code for that, I commit the code and I pushed it and I added a option keep_space in flatlatex v0.14 (but I set the default to False to preserve backward compat) (I pushed the doc in docstring in v0.15).

support \MakeUppercase

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

"I am \MakeUppercase{Happy}" is translated to "I am".

Describe the solution you'd like
A clear and concise description of what you want to happen.
The problem is similar to #28. Maybe we should design a default strategy to decide what to keep and what to remove.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

add \MakeUppercase to the whitelist is the simplest solution.

Setup with pipx

Is your feature request related to a problem? Please describe.

This is a standalone tool, so I would like to install it in a separate virtual environment. This is cumbersome.

Describe the solution you'd like

pipx is the standard tool for this use case. This will not require any additional work on your side but to specify the entry_points in setup.py, see here. Then, users can simply run pipx run pydetex, and pipx will download, install, and run pydetex 🎉

Additional context

Thanks a lot for developing this package, very useful!

Support acronym package

Is your feature request related to a problem? Please describe.
This is a feature request to support the acronym package. Acronyms typeset as \ac{XYZ} are removed, changing the context and grammar of the text.

Describe the solution you'd like
A clear and concise description of what you want to happen.
Replace \ac{} with plain text within the brackets.

support \citeauthor

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

\citeauthor will be removed after the PyDetex process and make a sentence lack subject.
e.g.,

On the other hand, \citeauthor{article} do something. -> On the other hand, do something.

Describe the solution you'd like
I think a solution is replacing \citeauthor{} with a placeholder.

e.g.,

On the other hand, \citeauthor{article} do something. -> On the other hand, [authors] do something.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.