Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guidance to linter #69

Open
tdegeus opened this issue Mar 15, 2023 · 1 comment
Open

Add guidance to linter #69

tdegeus opened this issue Mar 15, 2023 · 1 comment

Comments

@tdegeus
Copy link
Owner

tdegeus commented Mar 15, 2023

For math environments there are no options and arguments. This could hold for custom commands environments as well. A way to guide the implementation could be to provide

Command-line guidance:

--args="{tabular}[1]{3}"  # environment with one option and three arguments
--args="\TG"  # command without any options or arguments
--args="\foo{2}"  # command with two arguments (and no options)

Or instead or in addition

--newcommand={\foo}[3][...]{...}  # command with one option and two arguments -- LaTeX syntax
--newenvironment{env}[3][...]{...}{...}  # environment with one option and two arguments -- LaTeX syntax

see below

In addition those commands present in the preamble could be read. And the user could add

% \texindent\newcommand{\foo}[3][...]{...}
% \texindent\newenvironment{env}[3][...]{...}{...}

for a command respectively an environment with one option and two arguments.
Note that ... is ignored.

@tdegeus tdegeus changed the title Add guidance Add guidance to linter Mar 15, 2023
@tdegeus
Copy link
Owner Author

tdegeus commented Mar 20, 2023

Implementation:

class TexEnvironment:

    def __init__(self, name: str, nopts: int = None, nargs: int = None):
        self.name = name
        self.nopts = nopts
        self.nargs = nnargs

    def text_to_placeholders(...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant