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

Implement macro replacement for \pochhammer{a}{n} #9

Open
poortho opened this issue May 11, 2016 · 12 comments
Open

Implement macro replacement for \pochhammer{a}{n} #9

poortho opened this issue May 11, 2016 · 12 comments

Comments

@poortho
Copy link

poortho commented May 11, 2016

From @HowardCohl on July 15, 2015 18:22

If you have some math in LaTeX such as

(a)_n this string should be replaced by \pochhammer{a}{n}.

Similarly

\left(a\right)_n 
\Biggl(a\Biggr)_n
(a)_{n}
(a)_{{n}}
(\mu)_\alpha

as well as

(\;a)_{\ n}

should also be replaced by \pochhammer{a}{n}

\left( and \Biggl( are all ways to represent parentheses.
; and \ are space delimiters and should be ignored.

Copied from original issue: DRMF/texvcjs#10

@poortho
Copy link
Author

poortho commented May 11, 2016

From @physikerwelt on July 15, 2015 22:24

👍 Yes. But please make that an optional feature that can be switched on or off via config
It should perform replacements based on the AST

@poortho
Copy link
Author

poortho commented May 11, 2016

From @HowardCohl on July 17, 2015 16:8

Ha. An optional parameter for the main feature the program is specifically designed to perform. Isn't that like "print -print x", saying we should print x but only if the -print option is specified. :)

What's an AST?

@poortho
Copy link
Author

poortho commented May 11, 2016

From @physikerwelt on July 17, 2015 17:25

AST is abstract syntax tree.

parameter:To keep the program compatible to the wikimedia texvcjs program this would be nice to follow a modular design here. I would not pass the parameter as commandline argument but define that in a config file

@poortho
Copy link
Author

poortho commented May 11, 2016

From @physikerwelt on July 17, 2015 17:26

print -print reminds me to git clean

@poortho
Copy link
Author

poortho commented May 11, 2016

You said that

\Biggl(a)\Biggr)_n

should return \pochhammer{a}{n}, but there seems to be an extra right parenthesis there (both a ")" and "\Biggr)", is this intentional?

@poortho
Copy link
Author

poortho commented May 11, 2016

From @HowardCohl on July 22, 2015 13:34

You're right Claude. It should be \Biggl(a\Biggr)_n. I will correct the original comment.

But of course these are just examples of ways to insert parentheses. There are many more such as:

\big(...\big) \Big(...\Big) \bigg(...\bigg) \Bigg(...\Bigg)
\bigl(...\bigr) \Bigl(...\Bigr) \biggl(...\biggr) \Biggl(...\Biggr)
\left(...\right)
(...)

@poortho
Copy link
Author

poortho commented May 11, 2016

I have tried doing this but with limited success. I was able to make it perform the replacement if it was a single character as a and n but the parsing does not work if it is a LaTeX command or multiple characters due to the way that the program handles parentheses and underscores normally. I eventually got pretty frustrated and started working on issue #18, and will probably come back to it after I completely solve issues #15, #18, and #16.

@poortho
Copy link
Author

poortho commented May 11, 2016

Can the command inside the parenthesis be a string of more than one character? For example, could it be like this:

(abcd)_{\commandname}

@poortho
Copy link
Author

poortho commented May 11, 2016

Also, if the second argument was like this:

(a)_abcd

should I return \pochhammer{a}{abcd} or \pochhammer{a}{a}?

@poortho
Copy link
Author

poortho commented May 11, 2016

From @HowardCohl on September 18, 2015 21:32

Yes you could have (abcd)_{\commandname} for instance you could have (abcd)_{\alpha} or you could have (abcd)_\alpha. This works also.

If you have (a)_abcd then you should return \pochhammer{a}{a}bcd. Does this make sense?

@poortho
Copy link
Author

poortho commented May 11, 2016

From @HowardCohl on October 13, 2015 21:19

Once you finish this, it should be easy for you to implement \qPochhammer.

This will be, for instance,

(a;q)_n to be replaced with \qPochhammer{a}{q}{n}

It has to look for a semicolon to separate the a and the q.

@poortho
Copy link
Author

poortho commented May 11, 2016

From @physikerwelt on April 1, 2016 18:27

Github has new (simplified way of tracking the status)
You can create lists of the sub-issues that need to be resolved.

  • A
  • B ...

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

No branches or pull requests

1 participant