pkubowicz / opendetex

Improved version of Detex - tool for extracting plain text from TeX and LaTeX sources
Other
236 stars 34 forks source link

Increase the number of environments allowed in the -e flag #34

Open pauloney opened 8 years ago

pauloney commented 8 years ago

The -e flag to specify an environment list only allows 10 environments and gives an error when you try to place one more to the list:

$ detex -e "algorithm,align,array,bmatrix,displaymath,eqnarray,equation,floatfig,floating,longtable,picture" test.tex
detex: error: The environment list contains too many environments

since the command does not allow one to ADD to the existing list, the new list has to be large (the default list has 20 entries now and growing) making it almost impossible to run.

A nice addition would be to add another flag that would allow one to ADD one (or a few) environments to the existing list - to make the command line small and manageable.

pkubowicz commented 8 years ago

I really like the idea, thanks Paulo.

pauloney commented 5 years ago

Piotr,

Since you self-assigned this one, I am going to add a conversation that I had with Vadim on the issue, so you can chime in if you need:

Vadim: btw about -e - max number of environments limit could be easily changed to some big number, but the idea is to allow multiple -e to increase manageability, correct ?

Paulo Ney: The problem -- as I recollect -- and I could be wrong is: When you use -e to place one more on the list you have to list ALL previous environments. The command does NOT add to the list, it only replaces the list. So you always have to list all previous enviroments in the command, making the list enormous. The best would be to to leave the -e flag exactly as it is -- specially for compatibility with previous versions, and ...

Vadim: multiple "-e"s adding new values to the list would be much more convenient, correct ? add another flag that would allow one to "add" to the environment list -- as opposed to re-write the envoroment list.

Paulo Ney: Yes, correct ...

Vadim: ok thanks

pkubowicz commented 5 years ago

I haven't done any work related to this issue. Sorry for confusion. I'm short of time in March, so I will welcome any PR on this.

I completely agree with leaving "-e" flag as it is and adding a new flag to "append" new environments to the list.

pauloney commented 5 years ago

Vadim,

I think a nice plan here would be to change the number of environment allowed to something like a thousand, to allow people to write scripts with any number of environments they want. Then copy the entire framework of the "-e" flag to another "-a" flag, that we would use to "add" environments to the basic list, and modify if appropriately.

PN