diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..2879bc7 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,11 @@ +[report] +omit = + */python?.?/* + */test/* + */site-packages/nose/* +exclude_lines = + if __name__ == .__main__.: + +[run] +include = + */src/*.py diff --git a/.gitignore b/.gitignore index c4436c3..5c0f18c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,253 +1,253 @@ -/data -Macro-Replacement/sources/ -KLSadd_insertion/chapterFilesIgnore - -### Python template -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -/KLSadd_insertion/hsc09.pdf -/KLSadd_insertion/hsc09.tex -/KLSadd_insertion/tempchap9.pdf -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -### JetBrains template -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio - -*.iml - -## Directory-based project format: -.idea/ -# if you remove the above rule, at least ignore the following: - -# User-specific stuff: -# .idea/workspace.xml -# .idea/tasks.xml -# .idea/dictionaries - -# Sensitive or high-churn files: -# .idea/dataSources.ids -# .idea/dataSources.xml -# .idea/sqlDataSources.xml -# .idea/dynamic.xml -# .idea/uiDesigner.xml - -# Gradle: -# .idea/gradle.xml -# .idea/libraries - -# Mongo Explorer plugin: -# .idea/mongoSettings.xml - -## File-based project format: -*.ipr -*.iws - -## Plugin-specific files: - -# IntelliJ -/out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties - -### TeX template -## Core latex/pdflatex auxiliary files: -*.aux -*.lof -*.log -*.lot -*.fls -*.out -*.toc - -## Intermediate documents: -*.dvi -*-converted-to.* -# these rules might exclude image files for figures etc. -# *.ps -# *.eps -# *.pdf - -## Bibliography auxiliary files (bibtex/biblatex/biber): -*.bbl -*.bcf -*.blg -*-blx.aux -*-blx.bib -*.brf -*.run.xml - -## Build tool auxiliary files: -*.fdb_latexmk -*.synctex -*.synctex.gz -*.synctex.gz(busy) -*.pdfsync - -## Auxiliary and intermediate files from other packages: - - -# algorithms -*.alg -*.loa - -# achemso -acs-*.bib - -# amsthm -*.thm - -# beamer -*.nav -*.snm -*.vrb - -#(e)ledmac/(e)ledpar -*.end -*.[1-9] -*.[1-9][0-9] -*.[1-9][0-9][0-9] -*.[1-9]R -*.[1-9][0-9]R -*.[1-9][0-9][0-9]R -*.eledsec[1-9] -*.eledsec[1-9]R -*.eledsec[1-9][0-9] -*.eledsec[1-9][0-9]R -*.eledsec[1-9][0-9][0-9] -*.eledsec[1-9][0-9][0-9]R - -# glossaries -*.acn -*.acr -*.glg -*.glo -*.gls - -# gnuplottex -*-gnuplottex-* - -# hyperref -*.brf - -# knitr -*-concordance.tex -*.tikz -*-tikzDictionary - -# listings -*.lol - -# makeidx -*.idx -*.ilg -*.ind -*.ist - -# minitoc -*.maf -*.mtc -*.mtc[0-9] -*.mtc[1-9][0-9] - -# minted -_minted* -*.pyg - -# morewrites -*.mw - -# mylatexformat -*.fmt - -# nomencl -*.nlo - -# sagetex -*.sagetex.sage -*.sagetex.py -*.sagetex.scmd - -# sympy -*.sout -*.sympy -sympy-plots-for-*.tex/ - -# TikZ & PGF -*.dpth -*.md5 -*.auxlock - -# todonotes -*.tdo - -# xindy -*.xdy - -# WinEdt -*.bak -*.sav - +/Azeem/src/BruceLabelLinks +/data +Macro-Replacement/sources/ +KLSadd_insertion/chapterFilesIgnore + +### Python template +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +/KLSadd_insertion/hsc09.pdf +/KLSadd_insertion/hsc09.tex +/KLSadd_insertion/tempchap9.pdf +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio + +*.iml + +## Directory-based project format: +.idea/ +# if you remove the above rule, at least ignore the following: + +# User-specific stuff: +# .idea/workspace.xml +# .idea/tasks.xml +# .idea/dictionaries + +# Sensitive or high-churn files: +# .idea/dataSources.ids +# .idea/dataSources.xml +# .idea/sqlDataSources.xml +# .idea/dynamic.xml +# .idea/uiDesigner.xml + +# Gradle: +# .idea/gradle.xml +# .idea/libraries + +# Mongo Explorer plugin: +# .idea/mongoSettings.xml + +## File-based project format: +*.ipr +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties + +### TeX template +## Core latex/pdflatex auxiliary files: +*.sty +*.cls +*.aux +*.lof +*.lot +*.fls +*.out +*.toc + +## Intermediate documents: +*.dvi +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.brf +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Auxiliary and intermediate files from other packages: + + +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.snm +*.vrb + +#(e)ledmac/(e)ledpar +*.end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls + +# gnuplottex +*-gnuplottex-* + +# hyperref +# knitr +*-concordance.tex +*.tikz +*-tikzDictionary + +# listings +*.lol + +# makeidx +*.idx +*.ilg +*.ind +*.ist + +# minitoc +*.maf +*.mtc +*.mtc[0-9] +*.mtc[1-9][0-9] + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# mylatexformat +*.fmt + +# nomencl +*.nlo + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# todonotes +*.tdo + +# xindy +*.xdy + +# WinEdt +*.bak +*.sav + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..bc15884 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: python +install: + - pip install coveralls +script: + + nosetests --with-coverage -v tex2Wiki DLMF_preprocessing maple2latex main_page eCF KLSadd_insertion + +after_success: + coveralls diff --git a/AlexDanoff/remove_excess.py b/AlexDanoff/remove_excess.py deleted file mode 100644 index c520105..0000000 --- a/AlexDanoff/remove_excess.py +++ /dev/null @@ -1,311 +0,0 @@ -"""This program begins with an unprocessed LaTeX file and removes parts that are unnecesssary for the DLMF.""" - -import re -import sys - -import parentheses -from utilities import (writeout, readin, get_line_lengths, - find_line) - -EQ_START = r'\begin{equation}' -EQ_END = r'\end{equation}' - -CASES_START = r'\begin{cases}' -CASES_END = r'\end{cases}' - -EQMIX_START = r'\begin{equationmix}' -EQMIX_END = r'\end{equationmix}' - -STD_REGEX = r'.*?###open_(\d+)###.*?###close_\1###' - -def main(): - - if len(sys.argv) != 3: - - fname = "ZE.tex" - dot_ind = fname.index(".") + 1 - ofname = fname[:dot_ind] + "1." + fname[dot_ind:] - - else: - - fname = sys.argv[1] - ofname = sys.argv[2] - - writeout(ofname, remove_excess(readin(fname))) - -def remove_group(name, content, skip_lines): - """Removes the group bounded by the group name and then curly braces.""" - - str_pat = name + STD_REGEX - pattern = re.compile(str_pat, re.DOTALL) - - return pattern.sub(r'', content) - -def remove_section(start, end, content): - """Removes the section or part bounded by start and end.""" - - str_pat = start + r'.*?(' + end + r')' - pattern = re.compile(str_pat, re.DOTALL) - - return pattern.sub(r'\1', content) - -def remove_begin_end(name, content): - """Removes a group bound by \\begin{name} and \\end{name}.""" - - str_pat = r'\\begin{' + name + r'}.*?\\end{' + name + r'}' - pattern = re.compile(str_pat, re.DOTALL) - - return pattern.sub(r'', content) - -def remove_excess(content): - """Removes the excess pieces from the given content and returns the updated version as a string.""" - - oldest = content - - updated = _get_preamble() - old = content - - #edit single lines - content = re.sub(r'\\bibliography{\.\./bib/DLMF}', r'\\bibliographystyle{plain}' + "\n" + r'\\bibliography{/home/hcohl/DRMF/DLMF/DLMF.bib}', content) - content = re.sub(r'\\author\[.*?\]{(.*?)}', r'\\author{\1}', content) - content = re.sub(r'{math}', r'{equation}', content) - - #modify labels, etc - content = re.sub(r'\\begin{equation}\[.*?\]+', r'\\begin{equation}', content, re.DOTALL) - - print(len(old) -len(content)) - old = content - - #remove from something to the start of the next section/part/etc - content = remove_section(r'\\section{Special Notation}', r'\\part', content) - content = remove_section(r'\\part{Computation}', r'\\bibliographystyle{plain}', content) - content = remove_section(r'\\part{References}', r'\\bibliographystyle{plain}', content) - content = remove_section(r'\\section{Graphics}', r'\\section', content) - content = remove_section(r'\\section{Graphics}', r'\\section', content) - content = remove_section(r'\\subsection{Graphics}', r'\\subsection', content) - content = remove_section(r'\\section{Integrals}', r'\\section', content) - content = remove_section(r'\\subsection{Integrals}', r'\\subsection', content) - content = remove_section(r'\\section{Physical Applications}', r'\\bibliographystyle{plain}', content) - - print(len(old) - len(content)) - old = content - - to_join = [] - - #takes out comment lines first - for line in content.split("\n"): - - #if line only consists of % replace with nothing, otherwise don't add back - if line.lstrip().startswith("%"): - if line.rstrip().endswith("%"): - line = "" - else: - continue - - to_join.append(line) - - content = "\n".join(to_join) - - skip_lines = set() - - #remove begin/end groups - content = remove_begin_end("figuregroup", content) - content = remove_begin_end("comment", content) - content = remove_begin_end("figure", content) - content = remove_begin_end("errata", content) - - content = parentheses.remove(content, curly=True) - - to_remove = [ - r'\\citet', - r'\\lxDeclare\[.*?\]', - r'\\note', - r'\\origref', - r'\\lxRefDeclaration', - r'\\MarkDefn.*?###open_(\d+)###.*?###close_\1###', - r'\\indexdefn', - r'\\MarkNotation.*?###open_(\d+)###.*?###close_\1###', - r'\\affiliation', - ] - - lengths = get_line_lengths(content) - - #go through each group and remove it - for name in to_remove: - - str_regex = name + STD_REGEX - pattern = re.compile(str_regex, re.DOTALL) - - #go through every match, finding start and end - for match in pattern.finditer(content): - - group = match.group() - - start = find_line(match.start(), lengths) - end = find_line(match.end(), lengths) - - #print("{0}: {1} - {2}".format(group, start, end)) - - skip_lines.update(range(start, end + 1)) - - #define items that cannot be at the beginning of any line or be contined in any line - illegal_starts = [r'\documentclass{DLMF}', r'\thischapter', r'\part{Notation}', r'\begin{equationgroup', r'\end{equationgroup', r'\begin{onecolumn', r'\end{onecolumn'] - illegal_elements = [r'TwoToOneRule', r'OneToTwoRule', r'\citet'] - - lines = content.split("\n") - - #various flags that will be useful when going through the lines - in_eq = False - in_eqmix = False - in_const = False - in_cases = False - - eqmix_label = "" - const_str = "" - - #remove trailing % and whitespace and add to updated - also remove lines that should be skipped - for lnum, line in enumerate(lines): - - lnum += 1 - - #don't add line back if it should be skipped - if lnum in skip_lines: - continue - - line = parentheses.insert(line, curly=True) - line_checks = [line.lstrip().startswith(start) for start in illegal_starts] + [element in line for element in illegal_elements] - - #skip current line if it starts with or contains an illegal element - if any(line_checks): - continue - - cleaned = line.rstrip().rstrip("%").rstrip() - - #line marks the start of an equationmix, set the flag and remove the line - if EQMIX_START in cleaned: - in_eqmix = True - eqmix_label = cleaned[cleaned.index(r'\label'):] - continue - - #line marks the end of an equationmix, set the flag and remove the line - if EQMIX_END in cleaned: - in_eqmix = False - eqmix_label = "" - continue - - #if this line marks the start of an equation, set the flag - if EQ_START in cleaned: - in_eq = True - cleaned = cleaned + eqmix_label - - #if this line marks the end of an equation, set the flag - if EQ_END in cleaned: - in_eq = False - - #comment out constraints and replace commas with double commas; we need to build the entire constraint string and then add it back together - if cleaned.lstrip().startswith(r"\constraint"): - in_const = True - - #starting a cases statement - if CASES_START in cleaned: - in_cases = True - - #ending a cases statement - if CASES_END in cleaned: - in_cases = False - - #remove commas, periods, colons, and semi-colons from the end of equations - if in_eq and not in_const: - to_strip = ":;," - - #don't take off trailing commas when in a cases block - if in_cases: - to_strip = to_strip[:-1] - - cleaned = cleaned.rstrip(to_strip) - - #we're still in a constraint, replace commas and comment out - if in_const: - - const_str += cleaned - - #we're done with the constraint, make substitutions - if cleaned.rstrip().rstrip(".,").endswith("}"): - - const_str = re.sub(r'\$[;,](\s*(?:\$|or))', r'$ &\1', const_str) - in_const = False - - #constraint ends with two }, put one on next line - if cleaned.rstrip().endswith("}}"): - const_str = const_str[:-1] + "\n}" - - const_lines = [] - split = const_str.split("\n") - - offset = 1 - - #account for the case when there are no newlines present - if len(split) == 1: - offset = 0 - - #split multiline constraints back into multiple lines - for const_line in split[offset:]: - - #if line is not just a bracket, comment it out - if const_line.strip() != "}": - const_line = "%" + const_line - - const_lines.append(const_line) - - updated.extend(const_lines) - const_str = "" - - const_str += "\n" - - continue - - updated.append(cleaned) - - content = '\n'.join(updated) - - #remove blank lines around begin and end equation - space_pat = re.compile(r'\\begin{equation}(.*?)$\s+$', re.MULTILINE) - content = space_pat.sub(r'\\begin{equation}\1', content) - - space_pat = re.compile(r'^\s*$\n\\end{equation}', re.MULTILINE) - content = space_pat.sub(r'\\end{equation}', content) - - #remove consecutive blank lines - content = re.sub(r'(\n){3,}', '\n\n', content) - - print("Final: {0}".format(len(oldest) - len(content))) - - return content - -#returns the preamble as a list of it's lines -def _get_preamble(): - - preamble = [] - - preamble.append('\\documentclass{article}') - preamble.append('\\usepackage{amsmath}') - preamble.append('\\usepackage{amsfonts}') - preamble.append('\\usepackage{breqn}') - preamble.append('\\usepackage{DLMFmath}') - preamble.append('\\usepackage{DRMFfcns}') - preamble.append('') - preamble.append('\\oddsidemargin -0.7cm') - preamble.append('\\textwidth 18.3cm') - preamble.append('\\textheight 26.0cm') - preamble.append('\\topmargin -2.0cm') - preamble.append('') - preamble.append('% \constraint{') - preamble.append('% \substitution{') - preamble.append('% \drmfnote{') - preamble.append('% \drmfname{') - preamble.append('') - - return preamble - -if __name__ == "__main__": - main() diff --git a/AlexDanoff/replace_special.py b/AlexDanoff/replace_special.py deleted file mode 100644 index 83e1a73..0000000 --- a/AlexDanoff/replace_special.py +++ /dev/null @@ -1,261 +0,0 @@ -"""Replace i, e, and \pi with \iunit, \expe, and \cpi respectively.""" - -import re -import sys - -#for compatibility with Python 3 -try: - from itertools import izip -except ImportError: - izip = zip - -import parentheses -from utilities import writeout -from utilities import readin - -EQ_START = r'\begin{equation}' -EQ_END = r'\end{equation}' - -IND_START = r'\index{' - -NAME = 0 -SEEN = 1 - -CASES_START = r'\begin{cases}' -CASES_END = r'\end{cases}' - -EQMIX_START = r'\begin{equationmix}' -EQMIX_END = r'\end{equationmix}' - -STD_REGEX = r'.*?###open_(\d+)###.*?###close_\1###' - -def main(): - - if len(sys.argv) != 3: - - fname = "ZE.2.tex" - ofname = "ZE.3.tex" - - else: - - fname = sys.argv[1] - ofname = sys.argv[2] - - writeout(ofname, remove_special(readin(fname))) - -def remove_special(content): - """Removes the excess pieces from the given content and returns the updated version as a string.""" - - lines = content.split("\n") - - #various flags that will help us keep track of what elements we are inside of currently - inside = { - "constraint": [r'\constraint{', False], - "substitution": [r'\substitution{', False], - "drmfnote": [r'\drmfnote{', False], - "drmfname": [r'\drmfname{', False], - "proof": [r'\proof{', False] - } - - should_replace = False - in_ind = False - in_eq = False - - pi_pat = re.compile(r'(\s*)\\pi(\s*\b|[aeiou])') - expe_pat = re.compile(r'\b([^\\]?\W*)\s*e\s*\^') - - spaces_pat = re.compile(r' {2,}') - paren_pat = re.compile(r'\(\s*(.*?)\s*\)') - - dollar_pat = re.compile(r'(? Reformat Code. Be warned, Reformat Code will *not* fix all issues. In addition, PyCharm will warn you about code that violates PEP-8 standards. + +Code in other languages should follow standard conventions for that language. + +## Unit Tests + +All important code meant for use should have unit tests written for them. In Python, this can be achieved through the built-in [```unittest```](https://docs.python.org/2.7/library/unittest.html) module. + +Ideally, unit tests should cover every single possibility, every input and outcome, every line of code. A more realistic goal is "90%" coverage. Coverage can be checked through Coveralls. The idea is that, by the time code gets to production, there should be no possibility of unexpected output, since all possible types of inputs should have been tested. + +Unit tests should be stored in a separate "test" folder. + +## Best Practices + +Please follow the instructions [here](http://chris.beams.io/posts/git-commit/) on how to write git commit messages. + +PyCharm can help resolve merge conflicts. To resolve conflicts in your project, navigate to VCS -> Git -> Resolve Conflicts. Merge conflicts can also be resolved manually, through the steps in [this guide](https://confluence.atlassian.com/bitbucket/resolve-merge-conflicts-704414003.html). + +Code should be stored in a "src" folder. + +All Python source files should have `__author__` and `__status__` set to the author's name and development status - either "Prototype", for the most basic, incomplete code, "Development", for code that is currently being worked on, and "Production" for code that is ready to be used without any changes. If there were multiple people working on the code, also set `__credits__` to a Python list of people who have worked on the code. + +All subprojects must have README.md files. A guide may be found [here](https://gist.github.com/PurpleBooth/109311bb0361f32d87a2). Note that some of these requirements may not make sense to put in your README.md. + +Make good use of .gitignore. Anything that has been generated by code in the repository (compiled code, test files, test output, etc.) should be in your .gitignore. The easiest way to do this is to move these files into a folder, and gitignore that folder. + diff --git a/AlexDanoff/README.md b/DLMF_preprocessing/README.md similarity index 55% rename from AlexDanoff/README.md rename to DLMF_preprocessing/README.md index fc8395b..95c6f59 100644 --- a/AlexDanoff/README.md +++ b/DLMF_preprocessing/README.md @@ -1,23 +1,11 @@ # DRMF-Seeding-Project -This project is meant to convert different designated source formats to MediaWiki WikiText. - -## MediaWiki Wikitext Generation - ## Alex Danoff Seeding Source Code +This code preprocesses code from the DLMF to get it ready to be run through tex2wiki. + To achieve the desired result, one should execute the progams in the following order (using the output of the previous program as input for the next one): 1. remove_excess.py 2. replace_special.py 3. prepare_annotations.py - -## KLS Seeding Project - -## DLMF Seeding Project - -## eCF Seeding Project - -## BMP Seeding Project - - diff --git a/DLMF_preprocessing/src/__init__.py b/DLMF_preprocessing/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/DLMF_preprocessing/src/conversion_ecf.py b/DLMF_preprocessing/src/conversion_ecf.py new file mode 100644 index 0000000..753a7a3 --- /dev/null +++ b/DLMF_preprocessing/src/conversion_ecf.py @@ -0,0 +1,605 @@ +__author__ = "Divya Gandla" +__status__ = "Development" + +import re + +# existing file named text.txt +existing_file = open('test1.txt', 'r').read() + +# output written to newText.txt +newFile = open('newIdentities.txt', 'w') + +listOfGVars = [ + "Alpha", + "Beta", + "Gamma", + "Delta", + "Epsilon", + "Zeta", + "Eta", + "Theta", + "Iota", + "Kappa", + "Lambda", + "Mu", + "Nu", + "Xi", + "Omicron", + "Pi", + "Rho", + "Sigma", + "Tau", + "Upsilon", + "Phi", + "Chi", + "Psi", + "Omega", + "alpha", + "beta", + "gamma", + "delta", + "epsilon", + "zeta", + "eta", + "theta", + "iota", + "kappa", + "lambda", + "mu", + "nu", + "Xi", + "Omicron", + "Pi", + "Rho", + "Sigma", + "tau", + "upsilon", + "phi", + "chi", + "psi", + "omega"] + + +def replaceGreekVars(s): + newFile = s + for gvar in listOfGVars: + # original ex: \[Delta] + oldGVar = "\[" + gvar + "]" + + # replacement ex: \delta + newGVar = chr(92) + gvar.lower() + newFile = (newFile.replace(oldGVar, newGVar)) + + # adds a space after the replacement of the greek letter if it's + # followed by A-Z or a-z + for i in range(len(newFile)): + if newFile[i:i + len(newGVar)] == newGVar: + if ord( + newFile[ + i + + len(newGVar): i + + len(newGVar) + + 1]) >= 65 and ord( + newFile[ + i + + len(newGVar): i + + len(newGVar) + + 1]) <= 90: + newFile = (newFile.replace(newGVar, newGVar + " ")) + elif ord(newFile[i + len(newGVar): i + len(newGVar) + 1]) >= 97 and ord( + newFile[i + len(newGVar): i + len(newGVar) + 1]) <= 122: + newFile = newFile.replace(newGVar, newGVar + " ") + + # special case: replace "pi" with "\cpi" <-- circular pi + newFile = newFile.replace("Pi", "\cpi") + + return newFile + + +def findArgs(s, functionName): + newReplacings = [] + + # finds capture groups (includes brackets in arguments) + replacings = (re.findall(r'' + functionName + '(\[.*\])', s)) + for i in replacings: + recurse = i.find(functionName) + # if the function name is found in the replacing, regex is used to find the inner function's arguments + # regex's string is from the position of the function name till the end + replacings.extend(re.findall( + r'' + functionName + '(\[.*\])', i[recurse:])) + if recurse >= 0: + # if the function name is found in the replacing, regex is used to find the inner function's arguments + # regex's string is from the position of the last instance(of + # function name) plus the length(of function name) till the end + replacings.extend(re.findall( + r'' + functionName + '(\[.*\])', i[recurse + len(functionName):])) + + # gets rid of extra ] + for i in replacings: + countOpen = 0 + countClose = 0 + position = 0 + for char in i: + if char == '[': + countOpen = countOpen + 1 + elif char == ']': + countClose = countClose + 1 + # if the num open and close are same, the string is appended till + # that location + if countOpen == countClose: + newReplacings.append(i[0:position + 1]) + break + position = position + 1 + + return newReplacings + + +def replaceSqrt(s): + arguments = findArgs(s, "Sqrt") + for i in arguments: + s = s.replace("Sqrt" + i, "\\sqrt{" + i[1:-1] + "}") + return (s) + + +def replacePolygamma(s): + arguments = findArgs(s, "Polygamma") + for i in arguments: + commaLoc = i.find(',') + if i[1:2] != "0": + s = s.replace("Polygamma" + + i, "\\polygamma{" + + i[1:commaLoc] + + "}@{" + + i[commaLoc + 1:-1] + + "}") + elif i[1:2] == "0": + s = s.replace("Polygamma" + i, + "\\digamma@{" + i[3:-1] + "}") + return s + + +def removeInactive(s): + arguments = findArgs(s, "Inactive") + for i in arguments: + s = s.replace("Inactive" + i, i[1:-1]) + return s + + +def replaceCos(s): + arguments = findArgs(s, "Cos") + for i in arguments: + if len(i) == 3: + s = s.replace("Cos" + i, "\\cos@@{" + i[1:-1] + "}") + else: + s = s.replace("Cos" + i, "\\cos@{" + i[1:-1] + "}") + return s + + +def replaceSin(s): + arguments = findArgs(s, "Sin") + for i in arguments: + if len(i) == 3: + s = s.replace("Sin" + i, "\\sin@@{" + i[1:-1] + "}") + else: + s = s.replace("Sin" + i, "\\sin@{" + i[1:-1] + "}") + return s + + +def replaceTan(s): + arguments = findArgs(s, "Tan") + for i in arguments: + if len(i) == 3: + s = s.replace("Tan" + i, "\\tan@@{" + i[1:-1] + "}") + else: + s = s.replace("Tan" + i, "\\tan@{" + i[1:-1] + "}") + return s + + +def replaceCsc(s): + arguments = findArgs(s, "Csc") + for i in arguments: + if len(i) == 3: + s = s.replace("Csc" + i, "\\csc@@{" + i[1:-1] + "}") + else: + s = s.replace("Csc" + i, "\\csc@{" + i[1:-1] + "}") + return s + + +def replaceSec(s): + arguments = findArgs(s, "Sec") + for i in arguments: + if len(i) == 3: + s = s.replace("Sec" + i, "\\sec@@{" + i[1:-1] + "}") + else: + s = s.replace("Sec" + i, "\\sec@{" + i[1:-1] + "}") + return s + + +def replaceCot(s): + arguments = findArgs(s, "Cot") + for i in arguments: + if len(i) == 3: + s = s.replace("Cot" + i, "\\cot@@{" + i[1:-1] + "}") + else: + s = s.replace("Cot" + i, "\\cot@{" + i[1:-1] + "}") + return s + + +def replaceCosh(s): + arguments = findArgs(s, "Cosh") + for i in arguments: + if len(i) == 3: + s = s.replace("Cosh" + i, "\\cosh@@{" + i[1:-1] + "}") + else: + s = s.replace("Cosh" + i, "\\cosh@{" + i[1:-1] + "}") + return s + + +def replaceSinh(s): + arguments = findArgs(s, "Sinh") + for i in arguments: + if len(i) == 3: + s = s.replace("Sinh" + i, "\\sinh@@{" + i[1:-1] + "}") + else: + s = s.replace("Sinh" + i, "\\sinh@{" + i[1:-1] + "}") + return s + + +def replaceTanh(s): + arguments = findArgs(s, "Tanh") + for i in arguments: + if len(i) == 3: + s = s.replace("Tanh" + i, "\\tanh@@{" + i[1:-1] + "}") + else: + s = s.replace("Tanh" + i, "\\tanh@{" + i[1:-1] + "}") + return s + + +def replaceCsch(s): + arguments = findArgs(s, "Csch") + for i in arguments: + if len(i) == 3: + s = s.replace("Csch" + i, "\\csch@@{" + i[1:-1] + "}") + else: + s = s.replace("Csch" + i, "\\csch@{" + i[1:-1] + "}") + return s + + +def replaceSech(s): + arguments = findArgs(s, "Sech") + for i in arguments: + if len(i) == 3: + s = s.replace("Sech" + i, "\\sech@@{" + i[1:-1] + "}") + else: + s = s.replace("Sech" + i, "\\sech@{" + i[1:-1] + "}") + return s + + +def replaceCoth(s): + arguments = findArgs(s, "Coth") + for i in arguments: + if len(i) == 3: + s = s.replace("Coth" + i, "\\coth@@{" + i[1:-1] + "}") + else: + s = s.replace("Coth" + i, "\\coth@{" + i[1:-1] + "}") + return s + + +def replaceArcCos(s): + arguments = findArgs(s, "ArcCos") + for i in arguments: + if len(i) == 3: + s = s.replace("ArcCos" + i, "\\acos@@{" + i[1:-1] + "}") + else: + s = s.replace("ArcCos" + i, "\\acos@{" + i[1:-1] + "}") + return s + + +def replaceArcSin(s): + arguments = findArgs(s, "ArcSin") + for i in arguments: + if len(i) == 3: + s = s.replace("ArcSin" + i, "\\asin@@{" + i[1:-1] + "}") + else: + s = s.replace("ArcSin" + i, "\\asin@{" + i[1:-1] + "}") + return s + + +def replaceArcTan(s): + arguments = findArgs(s, "ArcTan") + for i in arguments: + if len(i) == 3: + s = s.replace("ArcTan" + i, "\\atan@@{" + i[1:-1] + "}") + else: + s = s.replace("ArcTan" + i, "\\atan@{" + i[1:-1] + "}") + return s + + +def replaceArcCsc(s): + arguments = findArgs(s, "ArcCsc") + for i in arguments: + if len(i) == 3: + s = s.replace("ArcCsc" + i, "\\acsc@@{" + i[1:-1] + "}") + else: + s = s.replace("ArcCsc" + i, "\\acsc@{" + i[1:-1] + "}") + return s + + +def replaceArcSec(s): + arguments = findArgs(s, "ArcSec") + for i in arguments: + if len(i) == 3: + s = s.replace("ArcSec" + i, "\\asec@@{" + i[1:-1] + "}") + else: + s = s.replace("ArcSec" + i, "\\asec@{" + i[1:-1] + "}") + return s + + +def replaceArcCot(s): + arguments = findArgs(s, "ArcCot") + for i in arguments: + if len(i) == 3: + s = s.replace("ArcCot" + i, "\\acot@@{" + i[1:-1] + "}") + else: + s = s.replace("ArcCot" + i, "\\acot@{" + i[1:-1] + "}") + return s + + +def replaceInfinity(s): + recurse = s.find("Infinity") + while recurse >= 0: + s = s.replace("Infinity", "\infty") + recurse = s.find("Infinity") + return s + + +def ContinuedFractionK(s): + arguments = findArgs(s, "ContinuedFractionK") + for i in arguments: + location = i.find(",{") + if location < 0: + location = i.find(", {") + var = i[1:location] + s = s.replace("ContinuedFractionK" + i, + "\ContinuedFractionK{k}{1}{\infty}@{" + var + "}") + return s + + +def replaceAbs(s): + arguments = findArgs(s, "Abs") + for i in arguments: + s = s.replace("Abs" + i, "\Abs@{" + i[1:len(i) - 1] + "}") + return s + + +def comparativeRelators(s): + s = s.replace("LessEqual", "\\leq") + s = s.replace("Less", "<") + return s + + +def element(s): + # http://texblog.org/2007/08/27/number-sets-prime-natural-integer-rational-real-and-complex-in-latex/ + arguments = findArgs(s, "Element") + for i in arguments: + location = i.rfind(", ") + if location < 0: + location = i.rfind(",") + + if location >= 0: + var = i[location + 1:len(i) - 1].strip() + z = i[1:location].strip() + + if (var == "Complexes"): + s = s.replace("Element" + i, z + " \in \Complex") + elif (var == "Wholes"): + s = s.replace("Element" + i, z + " \in \Whole") + elif (var == "Naturals"): + s = s.replace("Element" + i, z + " \in \\NatNumber") + elif (var == "Integers"): + s = s.replace("Element" + i, z + " \in \Integer") + elif (var == "Irrationals"): + s = s.replace("Element" + i, z + " \in \Irrational") + elif (var == "Reals"): + s = s.replace("Element" + i, z + " \in \Real") + elif (var == "Rational"): + s = s.replace("Element" + i, z + " \in \Rational") + elif (var == "Primes"): + s = s.replace("Element" + i, z + " \in \Prime") + return s + + +def markup(file): + newFile = "" + equations = findArgs(file, "ConditionalExpression") + constraints = [] + + # looks through each equation set including the conditional expression + for index in range(len(equations)): + equation = equations[index] + location = equation.find(", Element") + if location == -1: + location = equation.find(",Element") + # there are no constraints if Element[ ] is not found + if location == -1: + location = len(equation) + + newFile = newFile + "\\begin{equation} \n" + \ + equation[1:location] + "% \\constraints{\n" + + # find constraints + c = findArgs(equation, "Element") + for element in c: + location = element.rfind(", ") + if location < 0: + location = element.rfind(",") + if location >= 0: + var = element[location + 1:len(element) - 1].strip() + z = element[1:location].strip() + elif element.count("|") > 0: + for index in range(element.count("|") + 1): + # if it is the first constraints then it is from beginning + # to the first location of the |, the loc is increased each + # time to get through all of the constraints + if index == 0: + loc = element.find("|") + constraints.append(element[1:loc]) + elif index == element.count: + loc = element.find("|", loc + 1) + constraints.append(element[loc, element.find(",")]) + else: + constraints.append( + element[ + loc:element.find( + "|", loc + 1)]) + loc = element.find("|", loc + 1) + print(var) + + for index in range(len(constraints)): + print(constraints) + if (var == "Complexes"): + newFile = "% " + newFile + constraints + "\in \Complex" + elif (var == "Wholes"): + newFile = "% " + newFile + constraints + "\in \\NonNegInteger" + elif (var == "Naturals"): + newFile = "% " + newFile + constraints + "\in \\NatNumber" + elif (var == "Integers"): + newFile = "% " + newFile + constraints + "\in \Integer" + elif (var == "Irrationals"): + newFile = "% " + newFile + constraints + "\in \Irrationals" + elif (var == "Reals"): + newFile = "% " + newFile + constraints + "\in \Real" + elif (var == "Rational"): + newFile = "% " + newFile + constraints + "\in \Rational" + elif (var == "Primes"): + newFile = "% " + newFile + constraints + "\in \Prime" + return newFile + + +def equationSetUp(s): + newFile = "\\begin {equation}\n" + start = s.find("ConditionalExpression[") + len("ConditionalExpression[") + end = s.rfind(",") + end = s.rfind(",", 0, end) + newFile = newFile + s[start:end] + "\n" + constraints = [] + if (s.find("Element[")) > 0: + elements = s[s.find("Element[", end) + len("Element["): len(s) - 1] + newFile = newFile + "% \constraints{\n" + numCon = elements.count("|") + 1 + location = 0 + for index in range(numCon): + if index == 0: + if numCon == 1: + constraints.append(elements[0:elements.find(",")].strip()) + else: + location = elements.find("|") + constraints.append(elements[0:location].strip()) + elif index == numCon - 1: + constraints.append( + elements[ + location + + 1:elements.find( + ",", + location)].strip()) + else: + constraints.append( + elements[ + location + + 1:elements.find( + "|", + location + + 1)].strip()) + location = elements.find("|", location + 1) + var = elements[elements.rfind(",") + 1:len(elements) - 1].strip() + for index in range(len(constraints)): + if index == len(constraints) - 1: + if (var == "Complexes"): + newFile = newFile + "% " + \ + constraints[index] + " \in \Complex }\n" + elif (var == "Wholes"): + newFile = newFile + "% " + \ + constraints[index] + " \in \\NonNegInteger }\n" + elif (var == "Naturals"): + newFile = newFile + "% " + \ + constraints[index] + " \in \\NatNumber }\n" + elif (var == "Integers"): + newFile = newFile + "% " + \ + constraints[index] + " \in \Integer }\n" + elif (var == "Irrationals"): + newFile = newFile + "% " + \ + constraints[index] + " \in \Irrationals }\n" + elif (var == "Reals"): + newFile = newFile + "% " + \ + constraints[index] + " \in \Real }\n" + elif (var == "Rational"): + newFile = newFile + "% " + \ + constraints[index] + " \in \Rational }\n" + elif (var == "Primes"): + newFile = newFile + "% " + \ + constraints[index] + " \in \Prime }\n" + else: + if (var == "Complexes"): + newFile = newFile + "% " + \ + constraints[index] + " \in \Complex &\n" + elif (var == "Wholes"): + newFile = newFile + "% " + \ + constraints[index] + " \in \\NonNegInteger &\n" + elif (var == "Naturals"): + newFile = newFile + "% " + \ + constraints[index] + " \in \\NatNumber &\n" + elif (var == "Integers"): + newFile = newFile + "% " + \ + constraints[index] + " \in \Integer &\n" + elif (var == "Irrationals"): + newFile = newFile + "% " + \ + constraints[index] + " \in \Irrationals &\n" + elif (var == "Reals"): + newFile = newFile + "% " + \ + constraints[index] + " \in \Real &\n" + elif (var == "Rational"): + newFile = newFile + "% " + \ + constraints[index] + " \in \Rational &\n" + elif (var == "Primes"): + newFile = newFile + "% " + \ + constraints[index] + " \in \Prime &\n" + return (newFile + "\\end {equation} \n\n") + + +existing_file = removeInactive(existing_file) +existing_file = replaceGreekVars(existing_file) +existing_file = replaceSqrt(existing_file) +existing_file = replacePolygamma(existing_file) +existing_file = replaceCos(existing_file) +existing_file = replaceSin(existing_file) +existing_file = replaceTan(existing_file) +existing_file = replaceCsc(existing_file) +existing_file = replaceSec(existing_file) +existing_file = replaceCot(existing_file) +existing_file = replaceArcCos(existing_file) +existing_file = replaceArcSin(existing_file) +existing_file = replaceArcTan(existing_file) +existing_file = replaceArcCsc(existing_file) +existing_file = replaceArcSec(existing_file) +existing_file = replaceArcCot(existing_file) +existing_file = replaceCosh(existing_file) +existing_file = replaceSinh(existing_file) +existing_file = replaceTanh(existing_file) +existing_file = replaceCsch(existing_file) +existing_file = replaceSech(existing_file) +existing_file = replaceCoth(existing_file) +existing_file = replaceInfinity(existing_file) +existing_file = ContinuedFractionK(existing_file) +existing_file = replaceAbs(existing_file) +existing_file = comparativeRelators(existing_file) + +count = 0 +position = 0 +yorn = False +for index in range(len(existing_file)): + if existing_file[index: index + 2] == "(*": + count = index + position = existing_file.find("\n", index) + position = existing_file.find("\n", position + 1) + newFile.write(equationSetUp(existing_file[index: position]).replace("*", " ")) +newFile.close() diff --git a/DLMF_preprocessing/src/latex_constraint_modifier.py b/DLMF_preprocessing/src/latex_constraint_modifier.py new file mode 100644 index 0000000..f58c117 --- /dev/null +++ b/DLMF_preprocessing/src/latex_constraint_modifier.py @@ -0,0 +1,176 @@ + +__author__ = 'Kevin Chen' +__status__ = 'Development' + +import argparse + +CONVERSIONS = {'\\constraint': '{\\bf C}:~', + '\\substitution': '{\\bf S}:~', + '\\drmfnote': '{\\bf NOTE}:~', + '\\drmfname': '{\\bf NAME}:~', + '\\proof': '{\\bf PROOF}:~', + '\\mathematicatag': '{\\bf MtT}:~', + '\\mathematicareference': '{\\bf MtR}:~', + '\\mapletag': '{\\bf MpT}:~', + '\\category': '{\\bf CAT}:~'} +TT = ('\\mathematicatag', '\\mapletag') +TEXT = ('\\mathematicareference', '\\category') + + +def find_surrounding(line, function): + # (str, str) -> list + """ + Finds the indices of the beginning and end of a function; this is the main + function that powers the converter. + + :param line: line with functions that are going to be searched + :param function: the function you're trying to find the surrounding + brackets for + :returns: positions of opening and ending brackets + """ + positions = [0, 0] + positions[0] = line.find(function) + + # Finds the start and end of a function + count = 0 + for j in range(positions[0] + len(function), len(line) + 1): + + if line[j] in list('([{'): + count += 1 + if line[j] in list(')]}'): + count -= 1 + if count == 0: + positions[1] = j + 1 + break + + return positions + + +def combine_percent(lines): + # (list) -> list + """ + Combines terms with constraints (ones with percent signs) so that replacing + is easier. + + :param lines: list of all lines + :return: same list, but groups of constraint terms are combined + """ + index = 0 + while index < len(lines): + if len(lines[index]) >= 3 and lines[index][:3] == '% ' and \ + index > lines.index('\\begin{equation}'): + if len(lines[index + 1]) != '' and lines[index + 1][0] == '%': + add = lines.pop(index + 1) + lines[index] += '\n' + add.replace('%', ' ') + else: + lines[index], lines[index + 1] = lines[index + 1], lines[index] + index += 2 + else: + index += 1 + + return lines + + +def replace(line): + # (str) -> str + """ + Replaces constraints with viewable metadata. + + :param line: line to be converted + :returns: converted line + """ + for word in CONVERSIONS: + for _ in range(line.count(word)): + pos = find_surrounding(line, word) + if pos[0] != pos[1]: + arg = line[pos[0] + len(word) + 1:pos[1] - 1]\ + .replace('\n', '').replace(' &', ' &') + + # Splits lines if there are any "&". + if word in TT: + arg = ('}$ \\\\[0.2cm]\n ' + CONVERSIONS[word] + + '$\\tt{').join(arg.split('&')) + if word in TEXT: + arg = ('}$ \\\\[0.2cm]\n ' + CONVERSIONS[word] + + '$\\text{').join(arg.split('&')) + else: + arg = ('\\\\[0.2cm]\n ' + CONVERSIONS[word])\ + .join(arg.split('&')) + + if (max([line.find(item) for item in CONVERSIONS]) > pos[1] or + max([line.find(CONVERSIONS[item]) for + item in CONVERSIONS]) > pos[1]): + line = line[:pos[0]] + CONVERSIONS[word] + arg + \ + ' \\\\[0.2cm]' + line[pos[1]:] + else: + line = line[:pos[0]] + CONVERSIONS[word] + arg + \ + line[pos[1]:] + + return line + + +def dollarsign(line): + # (str) -> str + """ + Changes "$ $" to "${\\displaystyle }$". + + :param line: line to be converted + :returns: converted line + """ + count = [] + for index in range(len(line) - 1, 0, -1): + if line[index] == '$': + count.insert(0, index) + if len(count) == 2: + # This checks to see if there is already a "displaystyle", so it + # doesn't add a second useless one. + if line[count[0]:count[0] + 15] != '${\\displaystyle': + begin = count[0] + end = count[1] + line = line[:begin] + '${\\displaystyle ' + \ + line[begin + 1: end] + '}' + line[end:] + count = [] + + return line + + +def main(pathr, pathw): + # (str, str) -> None + """ + Main function that reads data and calls other functions to process data. + + :param pathr: directory of file to be read from + :param pathw: directory of file to be written to + :return: None + """ + with open(pathr, 'r') as b: + before = [c.replace(' %', '%') for c in b.read().split('\n')] + + before = combine_percent(before) + + with open(pathw, 'w') as after: + for line in before: + if len(line) >= 3 and line[:3] == '% ' and \ + before.index(line) > \ + before.index('\\begin{equation}'): + line = replace(line) + line = dollarsign(line) + line = '\\begin{flushright}\n' + line.replace('%', ' ') + \ + '\n\\end{flushright}' + + after.write(line + '\n') + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description='Receive .tex file with constraints and convert' + ' them viewable metadata.') + parser.add_argument('PATHR', type=str, + help='path of input .tex file, with the current' + ' directory as the starting point', ) + parser.add_argument('PATHW', type=str, + help='path of file to be outputted to, with the' + ' current directory as the starting point') + args = parser.parse_args() + + main(args.PATHR, args.PATHW) diff --git a/DLMF_preprocessing/src/math_function.py b/DLMF_preprocessing/src/math_function.py new file mode 100644 index 0000000..d362e77 --- /dev/null +++ b/DLMF_preprocessing/src/math_function.py @@ -0,0 +1,128 @@ +import math_mode +import re + + +def math_string(in_file): + # Takes input file or string and returns list of strings when in math mode + try: # test if file or string + math_str = open(in_file).read() + except: + math_str = in_file + output = [] + ranges = math_mode.find_math_ranges(math_str) + for i in ranges: + new = math_str[i[0]:i[1]] + output.append(new) + return output + + +def change_original(o_file, changed_math_string_list): + # Places changed string from math mode back into place in the original function + try: + o_string = open(o_file).read() + except: + o_string = o_file + math_ranges = math_mode.find_math_ranges(o_string) + num = 0 + edited = o_string + # print math_ranges + for i in math_ranges[::-1]: + edited = edited[:i[0]] + changed_math_string_list[::-1][num] + edited[i[1]:] + num += 1 + return edited + + +def formatting(file_str): + # Proper spacing for the indexes and gets rid of all non begin{eq end{eq text + commands = r'\\[a-zA-Z]+' + + updated = [] + ind_str = "" + in_ind = False + previous = "" + + ranges = math_mode.find_math_ranges(file_str) + + lines = file_str.split('\n') + in_eq = False + been_in_eq = False + + section = r'\\[a-zA-Z]*section' + + re.compile(commands) + re.compile(section) + past_last = 0 + + unnecessary = ['\\begin{align', '\\end{align', '\\index', '\\paragraph', '\\eqref'] + + for lnum, line in enumerate(lines): + + lnum += 1 + + not_added = not any([element in line for element in unnecessary]) + past_last += len(line) + 1 # + 1 to compensate for \n + + if '\\begin{equation}' in line: + # Make a blank line between equations + if '\\end{equation}' in updated[-1]: + updated.append('') + in_eq = True + been_in_eq = True + if '\\end{equation}' in line: + updated.append(line.lstrip()) + in_eq = False + continue + + if in_eq: + if line != '': + updated.append(line.lstrip()) + + else: + # not been in eq + if not been_in_eq: + # if text line != command + if re.match(commands, line.lstrip()): + if not_added: + updated.append(line) + elif line == '': + updated.append(line) + else: + # not in eq but already been in eq + if re.match(section, line.lstrip()) or line == '': + updated.append(line) + + if past_last >= ranges[-1][1]: + # In section after last eq + if re.match(commands, line.lstrip()) or line == '': + if not_added: + updated.append(line) + + # if this line is an index start storing it,or write it if we're done with the indexes + if '\\index{' in line: + in_ind = True + ind_str += line + "\n" + # if next line also index, continue storing + if '\\index{' in lines[lnum]: + continue + + if in_ind: + in_ind = False + + # add a preceding newline if one is not already present + if previous.strip() != '': + ind_str = "\n" + ind_str + + fullsplit = ind_str.split("\n") + updated.extend(fullsplit) + ind_str = "" + + previous = line + + wrote = "\n".join(updated) + + # remove consecutive blank lines and blank lines between \index groups + spaces_pat = re.compile(r'\n{2,}[ ]?\n+') + wrote = spaces_pat.sub('\n\n', wrote) + wrote = re.sub(r'\\index{(.*?)}\n{2,}(?=\\index{(.*?)})', r'\\index{\1}\n', wrote) + + return wrote diff --git a/DLMF_preprocessing/src/math_mode.py b/DLMF_preprocessing/src/math_mode.py new file mode 100644 index 0000000..10d280c --- /dev/null +++ b/DLMF_preprocessing/src/math_mode.py @@ -0,0 +1,188 @@ +__author__ = "Jagan Prem" +__status__ = "Production" + +# Dictionary containing math mode delimiters and their respective endpoints. +MATH_START = {"\\[": "\\]", + "\\(": "\\)", + "$$": "$$", + "$": "$", + "\\begin{equation}": "\\end{equation}", + "\\begin{equation*}": "\\end{equation*}", + "\\begin{align}": "\\end{align}", + "\\begin{align*}": "\\end{align*}", + "\\begin{multline}": "\\end{multline}", + "\\begin{multline*}": "\\end{multline*}"} + +# List of delimiters that exit math mode. +MATH_END = ["\\hbox{", + "\\mbox{", + "\\text{", + "\\label{"] + + +def find_first(string, delim, start=0): + # type: (str, str, int) -> int + """ + Finds the first occurrence of a delimiter within a string. + :param string: The string to search within. + :param delim: The delimiter to search for. + :param start: The starting index in the string. + :return: The index of the first occurrence. + """ + i = string.find(delim, start) + if delim in ["$", "\\[", "\\("]: + if i == -1: + return -1 + elif i != 0 and string[i - 1] == "\\": + return find_first(string, delim, i + len(delim)) + return i + + +def first_delim(string, enter=True): + # type: (str, bool) -> str + """ + Finds the first math or text mode delimiter within a string. + :param string: The string to search within. + :param enter: Whether to find a math mode or a text mode delimiter. + :return: The delimiter that first appears in the string. + """ + minm = ["\\hbox{", "\\]"][enter] + for delim in [MATH_END, MATH_START][enter]: + i = find_first(string, delim) + if i != -1 and i < find_first(string, minm) or minm not in string: + minm = delim + if minm == "$" and string.find("$$") == string.find("$"): + minm = "$$" + return minm + + +def does_exit(string): + # type: (str) -> bool + """ + Returns whether a string starts with a text mode delimiter. + :param string: The string to check. + :return: Whether the string starts with a text mode delimiter. + """ + return any(string.startswith(delim) for delim in MATH_END) + + +def does_enter(string): + # type: (str) -> bool + """ + Returns whether a string starts with a math mode delimiter. + :param string: The string to check. + :return: Whether the string starts with a math mode delimiter. + """ + return any(string.startswith(delim) for delim in MATH_START) + + +def skip_escaped(string, loop=True): + # type: (str) -> int + """ + Returns the distance to skip from escaped delimiters in the string. + :param string: The string to check. + :param loop: Whether to skip repeatedly or not. + :return: The distance to skip. + """ + if loop: + s = skip_escaped(string, False) + index = 0 + while s != 0: + string = string[s:] + index += s + s = skip_escaped(string, False) + return index + else: + for escape in ["\\$", "\\\\]", "\\\\)", "\\\\(", "\\\\[", "\\%"]: + if string.startswith(escape): + return len(escape) + return 0 + + +def parse_math(string, start, ranges): + # type: (str) -> str, int + """ + Finds the ranges of the current math mode segment. + :param string: The string to parse. + :param start: The starting index in the original string. + :param ranges: The ranges of all math mode segments. + :return i: The length of the math mode segment. + """ + delim = first_delim(string) + i = len(delim) + begin = start + i + commented = False + while i < len(string): + if not commented: + i += skip_escaped(string[i:]) + sub = string[i:] + if sub[0] == "%": + commented = True + else: + if does_exit(sub): + if begin != start + i: + ranges.append((begin, start + i)) + i += parse_non_math(sub, start + i, ranges) + begin = start + i + i -= 1 + if sub.startswith(MATH_START[delim]): + if begin != start + i: + ranges.append((begin, start + i)) + return i + len(MATH_START[delim]) - 1 + elif string[i] == "\n": + commented = False + i += 1 + raise SyntaxError("missing " + MATH_START[delim]) + + +def parse_non_math(string, start, ranges): + # type: (str) -> str, int + """ + Finds occurrences of math mode within a segment of text mode. + :param string: The string to parse. + :param start: The starting index in the original string. + :param ranges: The ranges of all math mode segments. + :return i: The length of the text mode segment. + """ + delim = first_delim(string, False) + if not string.startswith(delim): + delim = "" + level = 0 + i = len(delim) + commented = False + while i < len(string): + if not commented: + i += skip_escaped(string[i:]) + if i >= len(string): + break + sub = string[i:] + if sub[0] == "%": + commented = True + elif does_enter(sub): + i += parse_math(sub, start + i, ranges) + elif sub[0] == "{": + level += 1 + elif sub[0] == "}": + if level == 0 and delim != "": + i += 1 + return i + else: + level -= 1 + elif string[i] == "\n": + commented = False + i += 1 + if delim == "" and level == 0: + return i + raise SyntaxError("missing end bracket") + + +def find_math_ranges(string): + # type: (str) -> list + """ + Returns a list of tuples, each tuple denoting a range of math mode. + :param string: The string to search within. + :return: A list of tuples denoting math mode ranges. + """ + ranges = [] + parse_non_math(string, 0, ranges) + return ranges[:] diff --git a/DLMF_preprocessing/src/parentheses.py b/DLMF_preprocessing/src/parentheses.py new file mode 100644 index 0000000..1545ee4 --- /dev/null +++ b/DLMF_preprocessing/src/parentheses.py @@ -0,0 +1,74 @@ +__author__ = "Alex Danoff" +__status__ = "Development" + +"""Goes through input file, + numbers every opening and corresponding closing parenthesis and writes result to output file.""" + +import re + +_last_val = 0 + + +def remove(text, curly=False, cached=False): + """Goes through input and replaces any opening and closing parentheses with numbered markers.""" + + global _last_val + + counter = 0 + + # resume from previous count + if cached: + counter = _last_val + + updated = "" + + open_delimiter = "(" + close_delimiter = ")" + + # if client wants to replace curly braces, adjust accordingly + if curly: + open_delimiter = "{" + close_delimiter = "}" + + # go through input and replace parentheses with labels + for character in text: + + # found an opening parenthesis, replace it with its label + if character == open_delimiter: + character = "###open_{0}###".format(counter) + counter += 1 + + # found a closing parenthesis, replace it with its label + if character == close_delimiter: + counter -= 1 + + if counter < 0: + counter = 0 + + character = "###close_{0}###".format(counter) + + updated += character + + _last_val = counter # store our spot + + return updated + + +def insert(text, curly=False): + """Goes through input and replaces any numbered markers with opening and closing parentheses.""" + + o_rep = "(" + c_rep = ")" + + # adjust for curly braces + if curly: + o_rep = "{" + c_rep = "}" + + open_pattern = r'###open_\d###' + close_pattern = r'###close_\d###' + + text = re.sub(open_pattern, o_rep, text) + text = re.sub(close_pattern, c_rep, text) + + return text diff --git a/AlexDanoff/prepare_annotations.py b/DLMF_preprocessing/src/prepare_annotations.py similarity index 70% rename from AlexDanoff/prepare_annotations.py rename to DLMF_preprocessing/src/prepare_annotations.py index 818eede..e61d987 100644 --- a/AlexDanoff/prepare_annotations.py +++ b/DLMF_preprocessing/src/prepare_annotations.py @@ -14,12 +14,15 @@ *``proof`` """ +__author__ = "Alex Danoff" +__status__ = "Development" + import re import sys import parentheses from utilities import (readin, writeout, remove_inner_whitespace, - get_line_lengths, find_line) + get_line_lengths, find_line) FLUSH_START = r'\begin{flushright}' FLUSH_END = r'\end{flushright}' @@ -27,25 +30,30 @@ ANNOTATION_STR = r'\s*%\s*\\(?:constraint|substitution|drmf(?:note|name)|proof)' ANNOTATION_PAT = re.compile(ANNOTATION_STR, re.MULTILINE) -BRACE_PAT = re.compile(r'(?P' + ANNOTATION_STR + r')###open_(\d+)###(?![$ ])(?P.*?)(?![$ ])###close_\2###', re.DOTALL) +BRACE_PAT = re.compile( + r'(?P' + + ANNOTATION_STR + + r')###open_(\d+)###(?![$ ])(?P.*?)(?![$ ])###close_\2###', + re.DOTALL) MEASURE_PAT = re.compile(r'(\S)\\\\\[0.2cm\]') -def main(): - #get the names of the input and output files +def main(): + # get the names of the input and output files if len(sys.argv) != 3: - fname = "ZE.3.tex" - ofname = "ZE.4.tex" + fname = "../../data/ZE.2.tex" + ofname = "../../data/ZE.3.tex" else: fname = sys.argv[1] - ofname = sys.argv[2] + ofname = sys.argv[2] writeout(ofname, prepare_annotations(readin(fname))) + def prepare_annotations(content): """ Prepares annotations in `content` to be compatible with WikiText. @@ -55,13 +63,15 @@ def prepare_annotations(content): * special formatting * etc. """ - - docstart = content.find(r'\begin{document}') - eq_comment_pattern = re.compile(r'\\begin{equation}(?P\\label{(?P.*?)}.*?\n^[^%]*$)(?P\n^ *%[\w\s\\{}()<>[\]&=@%,.:;|\'~_^$/+-]*?\n)\\end{equation}', re.MULTILINE) + docstart = content.find(r'\begin{document}') - content = content[:docstart] + eq_comment_pattern.sub(replace_comments, content[docstart:]) + eq_comment_pattern = re.compile( + r'\\begin{equation}(?P\\label{(?P.*?)}.*?\n^[^%]*$)(?P\n^ *%[\w\s\\{}()<>[\]&=@%,.:;|\'~_^$/+-]*?\n)\\end{equation}', + re.MULTILINE) + content = content[:docstart] + \ + eq_comment_pattern.sub(replace_comments, content[docstart:]) special_annotations = { r'\\constraint': "C", @@ -71,9 +81,10 @@ def prepare_annotations(content): r'\\proof': "PROOF" } - #replace the annotations with their "code" + # replace the annotations with their "code" for annotation, code in special_annotations.iteritems(): - content = content[:docstart] + re.sub(annotation, r'{\\bf ' + code + '}:~', content[docstart:]) + content = content[ + :docstart] + re.sub(annotation, r'{\\bf ' + code + '}:~', content[docstart:]) content = content.replace("~{", "~") content = content.replace("~ ", "~") @@ -82,7 +93,9 @@ def prepare_annotations(content): return content -#moves annotations from inside equation blocks to the end of them and wraps them in a flushright block + +# moves annotations from inside equation blocks to the end of them and +# wraps them in a flushright block def replace_comments(match): """ Processes each equation block that contains comments. @@ -97,7 +110,7 @@ def replace_comments(match): \\RiemannZeta'@{s} = - \\sum_{n=2}^\\infty (\\ln@@{n}) n^{-s} % \\constraint{$\\realpart{s} > 1$} \\end{equation} - + becomes:: \\begin{equation}\\label{eq:ZE.EX.ZE5} @@ -110,7 +123,7 @@ def replace_comments(match): before = match.group("before") - #print("Equation label: {0}".format(match.group("eq_label"))) + # print("Equation label: {0}".format(match.group("eq_label"))) replacement = r'\begin{equation}' + before @@ -128,26 +141,29 @@ def replace_comments(match): comment = BRACE_PAT.sub(r'\g\g', comment) comment = parentheses.insert(comment, curly=True) - #make sure every line in the comment is actually a comment + # make sure every line in the comment is actually a comment for comment_line in comment.split("\n"): stripped = comment_line.lstrip() - #line isn't really a comment, add it back to the equation + # line isn't really a comment, add it back to the equation if not stripped.startswith("%"): replacement += comment_line + "\n" - - else: #otherwise, process it (take off % and add in \displaystyle) and add it to the comment + + # otherwise, process it (take off % and add in \displaystyle) and add + # it to the comment + else: num_annotations = len(ANNOTATION_PAT.findall(comment_line)) - #add measurement to the previous line if the current line is starting a new annotation + # add measurement to the previous line if the current line is + # starting a new annotation add_measure = num_annotations and annotations_left != total_annotations annotations_left -= num_annotations - + leading_whitespace = len(comment_line) - len(stripped) + 1 - comment_line = " " * leading_whitespace + stripped.lstrip("%") + comment_line = " " * leading_whitespace + stripped.lstrip("%") old_len = len(comment_line) @@ -158,22 +174,22 @@ def replace_comments(match): first_brack = comment_line.find("{") - #if we're going to go out of bounds, nothing to do on this line + # if we're going to go out of bounds, nothing to do on this line if first_brack + 1 < len(comment_line): after_first = comment_line[first_brack + 1] else: continue - + dollar_locs = _get_dollar_locs(comment_line) offset = 0 - #there's at least one $ in the line + # there's at least one $ in the line while dollar_locs: - - #the $ are balanced + + # the $ are balanced if len(dollar_locs) % 2 == 0: - + dollar_iter = iter(dollar_locs) start, end = (dollar_iter.next(), dollar_iter.next()) @@ -181,15 +197,17 @@ def replace_comments(match): previous = "" disp_string = '${' + r'\displaystyle ' - #only try to look behind the $ if it isn't the first character in the line + # only try to look behind the $ if it isn't the first + # character in the line if start != 0: - previous = comment_line[start-1] - - #we may need to add a space before displaystyle + previous = comment_line[start - 1] + + # we may need to add a space before displaystyle if previous == " ": disp_string = " " + disp_string - comment_line = comment_line[:start] + " " * extra_whitespace + disp_string + comment_line[start + 1:end] + '}' + comment_line[end:] + comment_line = comment_line[:start] + " " * extra_whitespace + \ + disp_string + comment_line[start + 1:end] + '}' + comment_line[end:] comment_line = comment_line.rstrip().rstrip("}") + " " dollar_locs = _get_dollar_locs(comment_line) @@ -197,9 +215,9 @@ def replace_comments(match): dollar_locs = dollar_locs[offset:] - #add the measurement at the end + # add the measurement at the end if add_measure: - last = updated[-1] + last = updated[-1] last += r'\\[0.2cm]' last = MEASURE_PAT.sub(r'\1 \\\\[0.2cm]', last) updated[-1] = last @@ -222,19 +240,19 @@ def replace_comments(match): replacement += r'\end{flushright}' - #print("") + # print("") return replacement -#returns a list of the locations of the $ in the given string -def _get_dollar_locs(words): +# returns a list of the locations of the $ in the given string +def _get_dollar_locs(words): locs = [] start = 0 next_loc = words.find("$", start) - #keep adding to the list as long as more $ remain + # keep adding to the list as long as more $ remain while next_loc != -1: locs.append(next_loc) start = next_loc + 1 @@ -242,6 +260,7 @@ def _get_dollar_locs(words): return locs -#call main function + +# call main function if __name__ == "__main__": main() diff --git a/DLMF_preprocessing/src/remove_excess.py b/DLMF_preprocessing/src/remove_excess.py new file mode 100644 index 0000000..f1e2d4d --- /dev/null +++ b/DLMF_preprocessing/src/remove_excess.py @@ -0,0 +1,432 @@ +"""This program begins with an unprocessed LaTeX file and removes parts that are unnecessary for the DLMF.""" + +import re +import sys + +import parentheses +from utilities import (writeout, readin, get_line_lengths, + find_line) + +EQ_START = r'\\begin{equation}' +EQ_END = r'\\end{equation}' + +CASES_START = r'\begin{cases}' +CASES_END = r'\end{cases}' + +EQMIX_START = r'\begin{equationmix}' +EQMIX_END = r'\end{equationmix}' + +STD_REGEX = r'.*?###open_(\d+)###.*?###close_0###' + + +def main(): + if len(sys.argv) != 3: + + fname = "../../data/ZE.tex" + dot_ind = fname.rfind(".") + 1 + ofname = fname[:dot_ind] + "1." + fname[dot_ind:] + + else: + + fname = sys.argv[1] + ofname = sys.argv[2] + + writeout(ofname, remove_excess(readin(fname))) + + +def remove_group(name, content): + """Removes the group bounded by the group name and then curly braces. + :param content: + :param name: + """ + + str_pat = name + STD_REGEX + pattern = re.compile(str_pat, re.DOTALL) + + return pattern.sub(r'', content) + + +def remove_section(start, end, content): + """Removes the section or part bounded by start and end. + :param start: + :param end: + :param content: + """ + + str_pat = start + r'.*?(' + end + r')' + pattern = re.compile(str_pat, re.DOTALL) + + return pattern.sub(r'\1', content) + + +def remove_begin_end(name, content): + """Removes a group bound by \\begin{name} and \\end{name}. + :param name: + :param content: + """ + + str_pat = r'\\begin{' + name + r'}.*?\\end{' + name + r'}' + pattern = re.compile(str_pat, re.DOTALL) + + return pattern.sub(r'', content) + + +def remove_macro(name, content): + pattern = re.compile(name + "{(.*?)}") + return pattern.sub(r'\1', content) + + +def remove_excess(content): + """Removes the excess pieces from the given content and returns the updated version as a string. + :param content: + """ + oldest = content + + start_eq = re.compile(EQ_START) + end_eq = re.compile(EQ_END) + + updated = _get_preamble() + old = content + content = remove_macro(r"\\lxID", content) + + # edit single lines + # removed unecessary information that caused an error with pdflatex + pattern = re.compile(r'\\acknowledgements{.*?}\n\n', re.DOTALL) + content = re.sub(pattern, r'', content) + content = re.sub(r'\\maketitle', r' ', content) + content = re.sub(r'\\bibliography{\.\./bib/DLMF}', + r'\\bibliographystyle{plain}' + "\n" + r'\\bibliography{/home/hcohl/DRMF/DLMF/DLMF.bib}', content) + content = re.sub(r'\\acknowledgements{.*?}', r' ', content) + content = re.sub(r'\{math}', r'{equation}', content) + content = re.sub(r'\\galleryitem{.*?}{.*?}', r' ', content) + content = re.sub(r'\\origref{.*?}{.*?}', r' ', content) + content = re.sub(r'\\onlyelectronic{.*?{.*?}.*?}', r' ', content) + content = re.sub(r'\\onlyelectronic{.*?}', r' ', content) + content = re.sub(r'\\printonly{.*?}', r' ', content) + pattern = re.compile(r'\\onlyprint{.*?}', re.DOTALL) + content = re.sub(pattern, r' ', content) + pattern = re.compile(r'\\origref\[.*?\]{.*?}', re.DOTALL) + content = re.sub(pattern, r'', content) + content = re.sub(r'\\begin\{electroniconly}', r' ', content) + content = re.sub(r'\\end\{electroniconly}', r' ', content) + content = re.sub(r'\\end\{printonly}', r' ', content) + content = re.sub(r'\\begin\{printonly}', r' ', content) + content = re.sub(r'\\DLMF\[.*?\]', r' ', content) + content = re.sub(r'\\author\[.*?\]{.*?}', r' ', content) + + # modify labels, etc + content = re.sub(r'\\begin\{equation\}\[.*?\]+', r'\\begin{equation}', content, re.DOTALL) + + print(len(old) - len(content)) + old = content + + content = remove_section(r'\\section{Special Notation}', r'\\part', content) + content = remove_section(r'\\part{Computation}', r'\\bibliographystyle{plain}', content) + content = remove_section(r'\\part{References}', r'\\bibliographystyle{plain}', content) + content = remove_section(r'\\section{Graphics}', r'\\section', content) + content = remove_section(r'\\section{Graphics}', r'\\section', content) + content = remove_section(r'\\subsection{Graphics}', r'\\subsection', content) + content = remove_section(r'\\section{Integrals}', r'\\section', content) + content = remove_section(r'\\subsection{Integrals}', r'\\subsection', content) + content = remove_section(r'\\section{Physical Applications}', r'\\bibliographystyle{plain}', content) + + print(len(old) - len(content)) + + to_join = [] + in_eq = False + + # takes out comment lines first + for line in content.split("\n"): + + if re.match(EQ_START, line.lstrip()): + in_eq = True + if re.match(EQ_END, line.lstrip()): + in_eq = False + + # if line only consists of % replace with nothing, otherwise don't add back + if line.lstrip().startswith("%"): + if line.rstrip().endswith("%"): + line = "" + else: + if not in_eq: + continue + + to_join.append(line) + + content = "\n".join(to_join) + + skip_lines = set() + + # remove begin/end groups + content = remove_begin_end("figuregroup", content) + content = remove_begin_end("comment", content) + content = remove_begin_end("figure", content) + content = remove_begin_end("errata", content) + content = remove_begin_end("table", content) + content = remove_begin_end("table", content) + + content = remove_begin_end("%", content) + + content = remove_begin_end("sidebar", content) + content = parentheses.remove(content, curly=True) + + to_remove = [ + r'\\citet', + r'\\lxDeclare\[.*?\]', + r'\\note', + r'\\origref', + r'\\lxRefDeclaration', + r'\\MarkDefn', + r'\\indexdefn', + r'\\MarkNotation', + r'\\affiliation.*?###open_(\d+)###.*?###close_0###', + ] + + lengths = get_line_lengths(content) + lines = content.split('\n') + + entering = re.compile(r'\\begin###open_\d###equation###close_\d###') + exiting = re.compile(r'\\end###open_\d###equation###close_\d###') + + # Find the lines on which equations start and end + eq_starts = [m.end() for m in entering.finditer(content)] + eq_ends = [m.start() for m in exiting.finditer(content)] + start_end_eq = [] + + for i in range(len(eq_starts)): + eq_starts[i] = find_line(eq_starts[i], lengths) + eq_ends[i] = find_line(eq_ends[i], lengths) + start_end_eq.append((eq_starts[i], eq_ends[i])) + + if len(eq_starts) != len(eq_ends): + print 'UNEVEN DISTRIBUTION OF \\begin{equation} and \\end{equation}' + sys.exit(-1) + + # go through each group and remove it + for name in to_remove: + + # for each improper name, put it in ###open### and ###closes### + str_regex = name # + STD_REGEX not really necessary to add STD_REGEX, edit if wrong -oksana + pattern = re.compile(str_regex, re.DOTALL) + + # go through every match, finding start and end + for match in pattern.finditer(content): + + # for each match of compiled improper name in file + + start = find_line(match.start(), lengths) + end = find_line(match.end(), lengths) + dont_skip = False + + # check that element isn't a comment within an equation + for eq in start_end_eq: + + if eq[0] <= start <= eq[1]: + if lines[start - 1].lstrip().startswith('%'): + dont_skip = True + + if lines[start - 1].count('$') % 2 != 0: + # don't skip if only 1 $ on that line so as to avoid causing wrong math_mode ranges + dont_skip = True + + if not dont_skip: + skip_lines.update(range(start, end + 1)) + + # define items that cannot be at the beginning of any line or be contined in any line + illegal_starts = [r'\documentclass{DLMF}', r'\thischapter', r'\part{Notation}', r'\begin{equationgroup', + r'\end{equationgroup', r'\begin{onecolumn', r'\end{onecolumn'] + illegal_elements = [r'TwoToOneRule', r'OneToTwoRule', r'\citet'] + + # various flags that will be useful when going through the lines, in_eq above for comment control + in_const = False + in_cases = False + + eqmix_label = "" + const_str = "" + + lengths = get_line_lengths(content) + + eq_starts = [m.end() for m in start_eq.finditer(content)] + eq_ends = [m.start() for m in end_eq.finditer(content)] + + start_end_eq = [] + + for i in range(len(eq_starts)): + eq_starts[i] = find_line(eq_starts[i], lengths) + eq_ends[i] = find_line(eq_ends[i], lengths) + start_end_eq.append((eq_starts[i], eq_ends[i])) + + eq_counter = None + in_eqmix = False + + # remove trailing % and whitespace and add to updated - also remove lines that should be skipped + for lnum, line in enumerate(lines): + + lnum += 1 + + # don't add line back if it should be skipped + if lnum in skip_lines: + continue + + if re.match(EQ_START, line.lstrip()): + in_eq = True + if re.match(EQ_END, line.lstrip()): + in_eq = False + + # replaces long ###open and close phrases with curly brackets + line = parentheses.insert(line, curly=True) + line_checks = [line.lstrip().startswith(start) for start in illegal_starts] + [element in line for element in + illegal_elements] + + # skip current line if it starts with or contains an illegal element + if any(line_checks): + # don't remove comments in equations + if in_eq: + if not line.lstrip().startswith('%'): + continue + + if not in_eq: + # don't remove if 1 $ in line (causes missing $ error) + if line.count('$') % 2 == 0: + continue + + # no more trailing % characters after cleaned + cleaned = line.rstrip().rstrip("%").rstrip() + + # line marks the start of an equationmix, set the flag and remove the line + if EQMIX_START in cleaned: + in_eqmix = True + eq_counter = 0 + if re.search('%', cleaned): + cleaned = cleaned[:cleaned.index('%')] + eqmix_label = cleaned[cleaned.index(r'\label'):-1] + ".SE" + continue + + # line marks the end of an equationmix, set the flag and remove the line + if EQMIX_END in cleaned: + in_eqmix = False + eq_counter = None + eqmix_label = "" + continue + + # if this line marks the start of an equation, set the flag + if re.match(EQ_START, cleaned.lstrip()): + if in_eqmix: + if '\\end{equation}' in cleaned: + # if in eqmix and \end{equation} in line, space the commands, label, and the actual equation + if isinstance(eq_counter, int): + eq_counter += 1 + cleaned = cleaned.lstrip()[:16] + eqmix_label + str(eq_counter) + '}\n' + \ + cleaned[18:cleaned.index('equation}')] + '\n\\end{equation}' + cleaned = re.sub(r'\n{2,}', '\n', cleaned) + else: + # just in eqmix, add the command and label only + eq_counter += 1 + cleaned = cleaned.lstrip()[:16] + eqmix_label + str(eq_counter) + '}' + else: + # just in eq, add command and label only: make sure no in line comments get added + if '\\label' not in cleaned: + cleaned = cleaned.lstrip() + eqmix_label + else: + cleaned = cleaned.lstrip()[:16] + cleaned[16: 17 + cleaned[16:].index('}')] + eqmix_label + in_eq = True + + # if this line marks the end of an equation, set the flag + if re.match(EQ_END, cleaned.lstrip()): + in_eq = False + + # comment out constraints and replace commas with double commas; we need to build the entire constraint + # string and then add it back together + if cleaned.lstrip().startswith(r"\constraint"): + in_const = True + + # starting a cases statement + if CASES_START in cleaned: + in_cases = True + + # ending a cases statement + if CASES_END in cleaned: + in_cases = False + + # remove commas, periods, colons, and semi-colons from the end of equations + if in_eq and not in_const: + to_strip = ":;," + + # don't take off trailing commas when in a cases block + if in_cases: + to_strip = to_strip[:-1] + + cleaned = cleaned.rstrip(to_strip) + + # we're still in a constraint, replace commas and comment out + if in_const: + + const_str += cleaned + + # we're done with the constraint, make substitutions + if cleaned.rstrip().rstrip(".,").endswith("}"): + + const_str = re.sub(r'\$[;,](\s*(?:\$|or))', r'$ &\1', const_str) + in_const = False + + # constraint ends with two }, put one on next line + if cleaned.rstrip().endswith("}}"): + const_str = const_str[:-1] + "\n}" + + const_lines = [] + split = const_str.split("\n") + + offset = 1 + + # account for the case when there are no newlines present + if len(split) == 1: + offset = 0 + + # split multiline constraints back into multiple lines + for const_line in split[offset:]: + + # if line is not just a bracket, comment it out + if const_line.strip() != "}": + const_line = "%" + const_line + + const_lines.append(const_line) + + updated.extend(const_lines) + const_str = "" + + const_str += "\n" + + continue + + updated.append(cleaned) + + content = '\n'.join(updated) + + # remove blank lines around begin and end equation + space_pat = re.compile(r'\\begin\{equation\}(.*?)$\s+$', re.MULTILINE) + content = space_pat.sub(r'\\begin{equation}\1', content) + + space_pat = re.compile(r'^\s*$\n\\end\{equation\}', re.MULTILINE) + content = space_pat.sub(r'\\end{equation}', content) + + # remove consecutive blank lines + content = re.sub(r'(\n){3,}', '\n\n', content) + + print("Final: {0}".format(len(oldest) - len(content))) + + return content + + +# returns the preamble as a list of it's lines +def _get_preamble(): + preamble = ['\\documentclass{article}', '\\usepackage{amsmath}', '\\usepackage{amsfonts}', + '\\usepackage{breqn}', + '\\usepackage{DLMFmath}', '\\usepackage{DRMFfcns}', '', '\\oddsidemargin -0.7cm', '\\textwidth 18.3cm', + '\\textheight 26.0cm', '\\topmargin -2.0cm', '', '% \constraint{', '% \substitution{', + '% \drmfnote{', '% \drmfname{', ''] + + return preamble + + +if __name__ == "__main__": + main() diff --git a/DLMF_preprocessing/src/replace_special.py b/DLMF_preprocessing/src/replace_special.py new file mode 100644 index 0000000..a13ffe9 --- /dev/null +++ b/DLMF_preprocessing/src/replace_special.py @@ -0,0 +1,242 @@ +"""Replace i, e, and \pi with \iunit, \expe, and \cpi respectively. Creates proper spacing for indexes and removes +unnecessary characters.""" + +import re +import sys + +# for compatibility with Python 3 +try: + from itertools import izip +except ImportError: + izip = zip + +import math_mode +import math_function +import parentheses +from utilities import writeout +from utilities import readin + + +EQ_START = r'\begin{equation}' +EQ_END = r'\end{equation}' + +IND_START = r'\index{' + +NAME = 0 +SEEN = 1 + +CASES_START = r'\begin{cases}' +CASES_END = r'\end{cases}' + +EQMIX_START = r'\begin{equationmix}' +EQMIX_END = r'\end{equationmix}' + +STD_REGEX = r'.*?###open_(\d+)###.*?###close_\1###' + + +def main(): + if len(sys.argv) != 3: + + fname = "../../data/ZE.1.tex" + ofname = "../../data/ZE.2.tex" + + else: + + fname = sys.argv[1] + ofname = sys.argv[2] + + # Below: index_str writes to output file, math_string takes output file as input, and change_original + # writes to the output based on the previous output file + + unchanged_math = math_function.math_string(fname) + math_string = remove_special(unchanged_math) + changed_math = math_function.change_original(fname,math_string) + formatted = math_function.formatting(changed_math) + + writeout(ofname, formatted) + + +def remove_special(content): + """Removes the excess pieces from the given content and returns the updated version as a string. + IN -> list + OUT -> string""" + if isinstance(content, str): + content = content.split('\n') + counter = 0 + + for function in content: + + lines = function.split('\n') + + # various flags that will help us keep track of what elements we are inside of currently + inside = { + "constraint": [r'\constraint{', False], + "substitution": [r'\substitution{', False], + "drmfnote": [r'\drmfnote{', False], + "drmfname": [r'\drmfname{', False], + "proof": [r'\proof{', False] + } + + in_eq = True + + pi_pat = re.compile(r'(\s*)\\pi(?![a-zA-Z])') + expe_pat = re.compile(r'\b([^\\]?\W*)\s*e\s*\^') + + spaces_pat = re.compile(r' {2,}') + paren_pat = re.compile(r'\(\s*(.*?)\s*\)') + + dollar_pat = re.compile(r'(? 1: + continue + + surrounding = "" + + # ensure "i" does not occur at the beginning of the string + if iloc != 0: + surrounding += words[iloc - 1] + + # ensure "i" does not occur at the end of the line + if iloc != len(words) - 1: + surrounding += words[iloc + 1] + + replacement = words[iloc] + + # at least one of the characters surrounding "i" is not alphabetic, we may need to replace + if not surrounding.isalpha(): + + # one (but not both) of the surrounding characters IS alphabetic, may need to replace + if any(s.isalpha() for s in surrounding): + + + if surrounding[1].isalpha(): # character after is alphabetic + + # make sure we're not starting a macro + if surrounding[0] != "\\": + replacement = r'\iunit ' + + else: + # neither of the characters surrounding the "i" are alphabetic, replace + replacement = r'\iunit' + + + # print("Surrounding: {0} - replacement made: {1}".format(surrounding, replacement != "i")) + if iloc != -1: + words = words[:iloc] + replacement + words[iloc + 1:] + iloc = words.find("i", iloc + len(replacement)) + else: + words = words[:iloc] + replacement + + return words + + +if __name__ == "__main__": + main() diff --git a/AlexDanoff/utilities.py b/DLMF_preprocessing/src/utilities.py similarity index 75% rename from AlexDanoff/utilities.py rename to DLMF_preprocessing/src/utilities.py index a0096ed..129ea56 100644 --- a/AlexDanoff/utilities.py +++ b/DLMF_preprocessing/src/utilities.py @@ -1,13 +1,14 @@ -""" -Provides utility/helper functions for use in other files. -""" +"""Provides utility/helper functions for use in other files.""" from __future__ import print_function +__author__ = "Alex Danoff" +__status__ = "Development" + import re import sys -#remap input function if necessary +# remap input function if necessary if int(sys.version[0]) >= 3: raw_input = input @@ -16,9 +17,8 @@ def debug(function): """ Decorator that starts pdb before calling the function. """ - + def inner(*args, **kwargs): - import pdb pdb.set_trace() @@ -26,6 +26,7 @@ def inner(*args, **kwargs): return inner + def get_input(prompt, valid=None, list=False, wait=True, preserve_case=False): """ Requests input from stdin until a valid response is given. @@ -42,7 +43,7 @@ def get_input(prompt, valid=None, list=False, wait=True, preserve_case=False): typed character as input (using getch). For example::: - + get_input("enter your name:") enter your name: monty @@ -61,7 +62,7 @@ def get_input(prompt, valid=None, list=False, wait=True, preserve_case=False): ] get_input("enter your eye color:", colors) - + enter your eye color: red That is not a valid response. Please try again. @@ -72,49 +73,48 @@ def get_input(prompt, valid=None, list=False, wait=True, preserve_case=False): input_function = raw_input - #add quit option and redefine raw_input if we're not waiting + # add quit option and redefine raw_input if we're not waiting if not wait: valid.add("q") - - #returns the result of using getch with a prompt - def _getch_input(prompt_str): + # returns the result of using getch with a prompt + def _getch_input(prompt_str): print(prompt_str, end="") to_return = _getch() print("") - + return to_return input_function = _getch_input - #add a space after the prompt for readability + # add a space after the prompt for readability if not prompt.endswith(" "): prompt = prompt + " " - response = input_function(prompt) - - #add spaces and commas to the valid characters for a list + response = input_function(prompt) + + # add spaces and commas to the valid characters for a list if list: valid.add(",") valid.add(" ") - #keep asking for input until a valid response is given - while (valid and - (any(char not in valid for char in response.lower()) or not list) - and (response.lower() not in valid or list) - or response.strip() == ""): - + # keep asking for input until a valid response is given + while (valid and + (any(char not in valid for char in response.lower()) or not list) + and (response.lower() not in valid or list) + or response.strip() == ""): print("That is not a valid response. Please try again.") - response = input_function(prompt) + response = input_function(prompt) to_return = response.lower() - - #give response as typed if preserve case specified + + # give response as typed if preserve case specified if preserve_case: to_return = response return to_return + def readin(filename): """ Returns the content of filename as a list of lines. @@ -122,21 +122,23 @@ def readin(filename): return open(filename, "r").read() + def writeout(filename, content, append=False): """ Writes content to file filename. """ - + mode = "w" - - #append to the file instead of overwriting + + # append to the file instead of overwriting if append: mode = "a" - #write content + # write content with open(filename, mode) as out: out.write(content) + def get_line_lengths(content): """ Returns a list of the total number of bytes before the end of each line in content. @@ -144,31 +146,32 @@ def get_line_lengths(content): lengths = [0] - total = 0 + total = 0 - #go through every line + # go through every line for i, line in enumerate(content.split("\n")): - length = len(line) - total += length + 1 #account for missing newlines + total += length + 1 # account for missing newlines lengths.append(total) return lengths + def unpack_list(first, second, *rest): """ Simulates Python 3's extended iterable unpacking. - + Usage: my_list = [1,2,3,4] - + unpack_list(*my_list) #returns (1, 2, (3, 4)) """ return first, second, rest + def get_last_line(fname): """ Returns the last line in file `fname`. @@ -177,28 +180,29 @@ def get_last_line(fname): all_lines = "" last_line = "" - #get last line + # get last line with open(fname, "r+") as file: all_lines = file.read().split("\n") - last_line = all_lines[-1] + last_line = all_lines[-1] del all_lines[-1] - #if the last line is a number, delete it + # if the last line is a number, delete it try: int(last_line) - #print("it's a number") - #write back all the lines except the last one + # print("it's a number") + # write back all the lines except the last one with open(fname, "w+") as file: for line in all_lines: - file.write(line + "\n") + file.write(line + "\n") except ValueError: - #print("it's not a number") + # print("it's not a number") pass return last_line + def remove_inner_whitespace(line): """ Removes any repeated spaces from inside `line` (after the first word character) and returns the new string. @@ -207,7 +211,7 @@ def remove_inner_whitespace(line): stripped = line.lstrip() leading_space = len(line) - len(stripped) - stripped = re.sub(r' {2,}', ' ', stripped) + stripped = re.sub(r' {2,}', ' ', stripped) return ' ' * leading_space + stripped @@ -216,44 +220,45 @@ def find_line(byte, line_lengths): """ Determines which line the character `byte` bytes from the start of the file occurs on using a binary search. """ - + return _find_line_helper(byte, line_lengths, 0, len(line_lengths) - 1) -#uses recursive binary-search-esque algorithm to find what line the given byte is on -def _find_line_helper(byte, line_lengths, start, end): +# uses recursive binary-search-esque algorithm to find what line the given +# byte is on +def _find_line_helper(byte, line_lengths, start, end): mid = (start + end) // 2 if line_lengths[mid] == byte: - return mid+1 + return mid + 1 next_start = start next_end = end - #target byte is less than mid + # target byte is less than mid if byte < line_lengths[mid]: left = mid - 1 - #target byte between left and mid + # target byte between left and mid if line_lengths[left] < byte: return mid next_end = left - #target byte is between mid and right + # target byte is between mid and right if line_lengths[mid] <= byte: right = mid + 1 - + if line_lengths[right] == byte: return right + 1 - #if we're out of bounds, it's on the last possible line + # if we're out of bounds, it's on the last possible line if right >= end: - return end + return end - #target byte between mid and right + # target byte between mid and right if byte < line_lengths[right]: return right @@ -261,28 +266,34 @@ def _find_line_helper(byte, line_lengths, start, end): return _find_line_helper(byte, line_lengths, next_start, next_end) + class _Getch: """ Gets a single character from standard input. Does not echo to the screen. - + From http://code.activestate.com/recipes/134892/ By Danny Yoo """ + def __init__(self): try: self.impl = _GetchWindows() except ImportError: self.impl = _GetchUnix() - def __call__(self): return self.impl() + def __call__(self): + return self.impl() class _GetchUnix: + def __init__(self): - import tty, sys + pass def __call__(self): - import sys, tty, termios + import sys + import tty + import termios fd = sys.stdin.fileno() old_settings = termios.tcgetattr(fd) try: @@ -293,12 +304,15 @@ def __call__(self): termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) return ch + class _GetchWindows: + def __init__(self): - import msvcrt + pass def __call__(self): import msvcrt return msvcrt.getch() + _getch = _Getch() diff --git a/DLMF_preprocessing/test/__init__.py b/DLMF_preprocessing/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/DLMF_preprocessing/test/data/correctout.tex b/DLMF_preprocessing/test/data/correctout.tex new file mode 100644 index 0000000..f6d7a9f --- /dev/null +++ b/DLMF_preprocessing/test/data/correctout.tex @@ -0,0 +1,81 @@ + +\documentclass{article} + +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{amssymb} +\usepackage{breqn} +\usepackage{DLMFmath} +\usepackage{DRMFfcns} +\usepackage[paperwidth=15in, paperheight=20in, margin=0.5in]{geometry} + +\begin{document} + + +% \constraint{ +% \substitution{ +% \drmfnote{ +% \drmfname{ +% \proof{ +% \mathematicatag{ +% \mathematicareference{ +% \mapletag +% \category + + +\begin{equation} + tests for each metadata (single) +\end{equation} +\begin{flushright} + {\bf C}:~text \\[0.2cm] + {\bf S}:~text \\[0.2cm] + {\bf NOTE}:~text \\[0.2cm] + {\bf NAME}:~text \\[0.2cm] + {\bf PROOF}:~text \\[0.2cm] + {\bf MtT}:~text \\[0.2cm] + {\bf MtR}:~text \\[0.2cm] + {\bf MpT}:~text \\[0.2cm] + {\bf CAT}:~text +\end{flushright} + +\begin{equation} + tests for each metadata (multiple) +\end{equation} +\begin{flushright} + {\bf C}:~a \\[0.2cm] + {\bf C}:~ b \\[0.2cm] + {\bf S}:~a \\[0.2cm] + {\bf S}:~ b \\[0.2cm] + {\bf NOTE}:~a \\[0.2cm] + {\bf NOTE}:~ b \\[0.2cm] + {\bf NAME}:~a \\[0.2cm] + {\bf NAME}:~ b \\[0.2cm] + {\bf PROOF}:~a \\[0.2cm] + {\bf PROOF}:~ b \\[0.2cm] + {\bf MtT}:~${\displaystyle \tt{a }}$ \\[0.2cm] + {\bf MtT}:~${\displaystyle \tt{ b}}$ \\[0.2cm] + {\bf MtR}:~${\displaystyle \text{a }}$ \\[0.2cm] + {\bf MtR}:~${\displaystyle \text{ b}}$ \\[0.2cm] + {\bf MpT}:~${\displaystyle \tt{a }}$ \\[0.2cm] + {\bf MpT}:~${\displaystyle \tt{ b}}$ \\[0.2cm] + {\bf CAT}:~${\displaystyle \text{a }}$ \\[0.2cm] + {\bf CAT}:~${\displaystyle \text{ b}}$ +\end{flushright} + +\begin{equation} + tests for percent combination +\end{equation} +\begin{flushright} + {\bf C}:~ a \\[0.2cm] + {\bf NOTE}:~this is a multiline note. +\end{flushright} + +\begin{equation} + tests for dollarsign conversion +\end{equation} +\begin{flushright} + {\bf C}:~${\displaystyle a}$ ${\displaystyle alreadyconverted}$ +\end{flushright} + + +\end{document} diff --git a/DLMF_preprocessing/test/data/in.tex b/DLMF_preprocessing/test/data/in.tex new file mode 100644 index 0000000..cdd1670 --- /dev/null +++ b/DLMF_preprocessing/test/data/in.tex @@ -0,0 +1,67 @@ + +\documentclass{article} + +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{amssymb} +\usepackage{breqn} +\usepackage{DLMFmath} +\usepackage{DRMFfcns} +\usepackage[paperwidth=15in, paperheight=20in, margin=0.5in]{geometry} + +\begin{document} + + +% \constraint{ +% \substitution{ +% \drmfnote{ +% \drmfname{ +% \proof{ +% \mathematicatag{ +% \mathematicareference{ +% \mapletag +% \category + + +\begin{equation} + tests for each metadata (single) +% \constraint{text} +% \substitution{text} +% \drmfnote{text} +% \drmfname{text} +% \proof{text} +% \mathematicatag{text} +% \mathematicareference{text} +% \mapletag{text} +% \category{text} +\end{equation} + +\begin{equation} + tests for each metadata (multiple) +% \constraint{a & b} +% \substitution{a & b} +% \drmfnote{a & b} +% \drmfname{a & b} +% \proof{a & b} +% \mathematicatag{$\tt{a & b}$} +% \mathematicareference{$\text{a & b}$} +% \mapletag{$\tt{a & b}$} +% \category{$\text{a & b}$} +\end{equation} + +\begin{equation} + tests for percent combination +% \constraint{ +% a} +% \drmfnote{this +% is a +% multiline note.} +\end{equation} + +\begin{equation} + tests for dollarsign conversion +% \constraint{$a$ ${\displaystyle alreadyconverted}$} +\end{equation} + + +\end{document} \ No newline at end of file diff --git a/DLMF_preprocessing/test/data/testout.tex b/DLMF_preprocessing/test/data/testout.tex new file mode 100644 index 0000000..f6d7a9f --- /dev/null +++ b/DLMF_preprocessing/test/data/testout.tex @@ -0,0 +1,81 @@ + +\documentclass{article} + +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{amssymb} +\usepackage{breqn} +\usepackage{DLMFmath} +\usepackage{DRMFfcns} +\usepackage[paperwidth=15in, paperheight=20in, margin=0.5in]{geometry} + +\begin{document} + + +% \constraint{ +% \substitution{ +% \drmfnote{ +% \drmfname{ +% \proof{ +% \mathematicatag{ +% \mathematicareference{ +% \mapletag +% \category + + +\begin{equation} + tests for each metadata (single) +\end{equation} +\begin{flushright} + {\bf C}:~text \\[0.2cm] + {\bf S}:~text \\[0.2cm] + {\bf NOTE}:~text \\[0.2cm] + {\bf NAME}:~text \\[0.2cm] + {\bf PROOF}:~text \\[0.2cm] + {\bf MtT}:~text \\[0.2cm] + {\bf MtR}:~text \\[0.2cm] + {\bf MpT}:~text \\[0.2cm] + {\bf CAT}:~text +\end{flushright} + +\begin{equation} + tests for each metadata (multiple) +\end{equation} +\begin{flushright} + {\bf C}:~a \\[0.2cm] + {\bf C}:~ b \\[0.2cm] + {\bf S}:~a \\[0.2cm] + {\bf S}:~ b \\[0.2cm] + {\bf NOTE}:~a \\[0.2cm] + {\bf NOTE}:~ b \\[0.2cm] + {\bf NAME}:~a \\[0.2cm] + {\bf NAME}:~ b \\[0.2cm] + {\bf PROOF}:~a \\[0.2cm] + {\bf PROOF}:~ b \\[0.2cm] + {\bf MtT}:~${\displaystyle \tt{a }}$ \\[0.2cm] + {\bf MtT}:~${\displaystyle \tt{ b}}$ \\[0.2cm] + {\bf MtR}:~${\displaystyle \text{a }}$ \\[0.2cm] + {\bf MtR}:~${\displaystyle \text{ b}}$ \\[0.2cm] + {\bf MpT}:~${\displaystyle \tt{a }}$ \\[0.2cm] + {\bf MpT}:~${\displaystyle \tt{ b}}$ \\[0.2cm] + {\bf CAT}:~${\displaystyle \text{a }}$ \\[0.2cm] + {\bf CAT}:~${\displaystyle \text{ b}}$ +\end{flushright} + +\begin{equation} + tests for percent combination +\end{equation} +\begin{flushright} + {\bf C}:~ a \\[0.2cm] + {\bf NOTE}:~this is a multiline note. +\end{flushright} + +\begin{equation} + tests for dollarsign conversion +\end{equation} +\begin{flushright} + {\bf C}:~${\displaystyle a}$ ${\displaystyle alreadyconverted}$ +\end{flushright} + + +\end{document} diff --git a/DLMF_preprocessing/test/test_latex_constraint_modifier.py b/DLMF_preprocessing/test/test_latex_constraint_modifier.py new file mode 100644 index 0000000..77ea343 --- /dev/null +++ b/DLMF_preprocessing/test/test_latex_constraint_modifier.py @@ -0,0 +1,24 @@ + +__author__ = 'Kevin Chen' +__status__ = 'Development' + +from unittest import TestCase +from latex_constraint_modifier import main + +import os + +PATHR = os.path.dirname(os.path.realpath(__file__)) + '/data/in.tex' +PATHW = os.path.dirname(os.path.realpath(__file__)) + '/data/testout.tex' +PATHC = os.path.dirname(os.path.realpath(__file__)) + '/data/correctout.tex' + + +class TestMain(TestCase): + + def test_generation(self): + main(PATHR, PATHW) + with open(PATHW, 'r') as r: + out = r.read() + with open(PATHC, 'r') as c: + correct = c.read() + + self.assertEqual(out, correct) diff --git a/DLMF_preprocessing/test/test_math_function.py b/DLMF_preprocessing/test/test_math_function.py new file mode 100644 index 0000000..9d724cf --- /dev/null +++ b/DLMF_preprocessing/test/test_math_function.py @@ -0,0 +1,53 @@ +import math_function +from unittest import TestCase + + +before = """ +\\paragraph{Arithmetic Progression} +\\index{arithmetic progression} + +\\begin{equation}\\label{eq:AL.ES.AR} + a + (a + d) + (a + 2d) + \\dots + (a + (n-1)d) + = na + \\tfrac{1}{2} n(n-1) d + = \\tfrac{1}{2} n (a + \\ell) +\\end{equation} + +where $\\ell$ = last term of the series = $a + (n-1)d$. + +\\paragraph{Geometric Progression} +\\index{geometric progression (or series)} +""" + +just_math = [""" + a + (a + d) + (a + 2d) + \\dots + (a + (n-1)d) + = na + \\tfrac{1}{2} n(n-1) d + = \\tfrac{1}{2} n (a + \\ell)\n""", "\\ell", "a + (n-1)d"] + +no_text = """ + +\\index{arithmetic progression} + +\\begin{equation}\\label{eq:AL.ES.AR} +a + (a + d) + (a + 2d) + \\dots + (a + (n-1)d) += na + \\tfrac{1}{2} n(n-1) d += \\tfrac{1}{2} n (a + \\ell) +\\end{equation} + +\\index{geometric progression (or series)} + +""" + + + +class TestMathString(TestCase): + def test_math_string(self): + math = math_function.math_string(before) + self.assertEqual(just_math, math) + + def test_change_original(self): + c_o = math_function.change_original(before, just_math) + self.assertEqual(before, c_o) + + def test_formatting(self): + formatted = math_function.formatting(before) + self.assertEqual(no_text, formatted) diff --git a/DLMF_preprocessing/test/test_math_mode.py b/DLMF_preprocessing/test/test_math_mode.py new file mode 100644 index 0000000..225605c --- /dev/null +++ b/DLMF_preprocessing/test/test_math_mode.py @@ -0,0 +1,116 @@ +import unittest +import math_mode + +DELIM_TESTS = [ + { + "args": ["$test$"], + "output": "$" + }, + { + "args": ["$$test$$"], + "output": "$$" + }, + { + "args": [" \\begin{equation}test\\end{equation} "], + "output": "\\begin{equation}" + }, + { + "args": ["\\hbox{}", False], + "output": "\\hbox{" + } +] + +MATH_TESTS = [ + { + "string": "$\\frac 1 2$ test", + "start": 0, + "output": 10 + }, + { + "string": "\\[2\\hbox{Test}\\\\]\\]", + "start": 22, + "output": 18 + }, + { + "string": "$%\n\\$\\%$", + "start": 12, + "output": 7 + }, + [ + (1, 10), + (24, 25), + (36, 39), + (13, 19) + ] +] + +NON_MATH_TESTS = [ + { + "string": "\\mbox{\\$Test\\(test\\\\)\\)} ", + "start": 14, + "output": 24 + }, + { + "string": "test{} \\\\(\\begin{align*}\\end{align*}\\\\[", + "start": 56, + "output": 39 + }, + { + "string": "\\begin{multline}\n\\left(2\\right)\n\\end{multline}\n%begin{equation}\n", + "start": 3, + "output": 64 + }, + [ + (28, 35), + (19, 35) + ] +] + +RANGE_TESTS = [ + { + "string": "test\\% \\begin{multline*}\ntest \\hbox{Test}\\end{multline*}", + "output": [ + (24, 30) + ] + }, + { + "string": "$2$ \\begin{align}Test\\end{align}", + "output": [ + (1, 2), + (17, 21) + ] + }, + { + "string": "test", + "output": [] + } +] + + +class Testmath_mode(unittest.TestCase): + + def test_first_delim(self): + for test in DELIM_TESTS: + self.assertEqual(math_mode.first_delim(*test["args"]), test["output"]) + + def test_parse_math(self): + ranges = [] + for test in MATH_TESTS[:-1]: + self.assertEqual(math_mode.parse_math(test["string"], test["start"], ranges), test["output"]) + self.assertEqual(ranges, MATH_TESTS[-1]) + self.assertRaises(SyntaxError, math_mode.parse_math, "\\begin{equation*}", 23, []) + + def test_parse_non_math(self): + ranges = [] + for test in NON_MATH_TESTS[:-1]: + self.assertEqual(math_mode.parse_non_math(test["string"], test["start"], ranges), test["output"]) + self.assertEqual(ranges, NON_MATH_TESTS[-1]) + self.assertRaises(SyntaxError, math_mode.parse_non_math, "\\text{", 9, [(1, 4)]) + + def test_find_math_ranges(self): + for test in RANGE_TESTS: + self.assertEqual(math_mode.find_math_ranges(test["string"]), test["output"]) + self.assertRaises(SyntaxError, math_mode.find_math_ranges, "{$$}$$") + +if __name__ == "__main__": + unittest.main() diff --git a/DLMF_preprocessing/test/test_parentheses.py b/DLMF_preprocessing/test/test_parentheses.py new file mode 100644 index 0000000..3a23322 --- /dev/null +++ b/DLMF_preprocessing/test/test_parentheses.py @@ -0,0 +1,52 @@ +__author__ = "Alex Danoff" +__status__ = "Development" + +from unittest import TestCase +from src.parentheses import insert, remove + +test_cases = [{ + 'normal': '\\sin(x)', + 'replaced': '\\sin###open_0###x###close_0###', +}, { + 'normal': '\\sin{x}', + 'replaced': '\\sin{x}', +}, + { + 'normal': '\\sin{x}', + 'replaced': '\\sin###open_0###x###close_0###', + 'curly': True + } +] + +round_trip_tests = [{ + 'normal': '\\sin(\\arcsin(x))', +}, { + 'normal': '\\sin{\\arcsin(x)}', +}, { + 'normal': '\\sin{\\arcsin(x)}', + 'curly': True +}, { + 'normal': '\\sin{\\arcsin{x}}', + 'curly': True +}, +] + + +class TestInsert(TestCase): + def test_insert(self): + for case in test_cases: + self.assertEqual(case['normal'], insert(case['replaced'], case.get('curly', False))) + + def test_remove(self): + for case in test_cases: + self.assertEqual(case['replaced'], remove(case['normal'], case.get('curly', False))) + + def test_round_trip(self): + for case in test_cases: + output = insert(remove(case['normal'], case.get('curly', False)), case.get('curly', False)) + self.assertEqual(case['normal'], output) + + def test_extended_round_trip(self): + for case in round_trip_tests: + output = insert(remove(case['normal'], case.get('curly', False)), case.get('curly', False)) + self.assertEqual(case['normal'], output) diff --git a/DLMF_preprocessing/test/test_remove_excess.py b/DLMF_preprocessing/test/test_remove_excess.py new file mode 100644 index 0000000..af640a9 --- /dev/null +++ b/DLMF_preprocessing/test/test_remove_excess.py @@ -0,0 +1,10 @@ +from unittest import TestCase +from src.remove_excess import remove_section + + +class TestRemoveExcess(TestCase): + def test_remove_section(self): + content = 'AA{Begin} This should be removed {End}DDBB' + result = remove_section(r'{Begin}', r'{End}', content) + self.assertEqual('AA{End}DDBB', result) + diff --git a/DLMF_preprocessing/test/test_replace_i.py b/DLMF_preprocessing/test/test_replace_i.py new file mode 100644 index 0000000..210f667 --- /dev/null +++ b/DLMF_preprocessing/test/test_replace_i.py @@ -0,0 +1,34 @@ +from unittest import TestCase +from replace_special import remove_special + +mismatched = """ +%\\frac{q(t)}{p'(t) (p(t) - p(a))^{(\lambda/\mu)-1}}$, using Cauchy's integral +%formula for the residue, and integrating by parts. See also + b_s + = \\frac{1}{\mu} + \Residue_{t=a}\left[\\frac{q(t)}{(p(t) - p(a))^{(\lambda+s)/\mu}}\\right] +% \constraint{$s = 0,1,2,\dots$.} +""" +matched = """ +%\\note{This follows from \eqref{eq:AL.xx}--\eqref{eq:AL.xx} by setting $f(t) = p(t), g(t) = +%\\frac{q(t)}{p'(t) (p(t) - p(a))^{(\lambda/\mu)-1}}$, using Cauchy's integral +%formula for the residue, and integrating by parts. See also +%\citet{Cicuta:1975:RFA}.} + b_s + = \\frac{1}{\mu} + \Residue_{t=a}\left[\\frac{q(t)}{(p(t) - p(a))^{(\lambda+s)/\mu}}\\right] +% \constraint{$s = 0,1,2,\dots$.} +""" + + +class TestReplaceSpecial(TestCase): + def test__replace_special(self): + tex = "z^a = \\underbrace{z \\cdot z \\cdots z}_{n \n \\text{ times}} = 1 / z^{-a}" + result = remove_special(tex) + self.assertEqual(tex.split('\n'), result) + def test_dollar_loc(self): + actual = remove_special(mismatched) + self.assertEqual(mismatched.split('\n'), actual) + def test_matching(self): + result = remove_special(matched) + self.assertEqual(matched.split('\n'), result) \ No newline at end of file diff --git a/KLSadd_insertion/README.md b/KLSadd_insertion/README.md new file mode 100644 index 0000000..02d624e --- /dev/null +++ b/KLSadd_insertion/README.md @@ -0,0 +1,125 @@ +##KLS Addendum Insertion Project + +This project uses Python and string manipulation to insert sections of the KLSadd.tex file into the appropriate DRMF chapter sections. updateChapters.py is the most recently updated and cleanest version, however it is not completed. Should be run with a simple call to +``` +Python updateChapters.py +``` +The program must have a tempchap9.tex and a tempchap14.tex as well as the KLSadd.tex file in the same directory! + +The linetest.py program is the original program file fully updated. It is much harder to read and should only be used as a reference to update updateChapters.py. + +NOTE: Both the updateChapters.py and linetest.py lack a .PDF version of their chapter 14 output. One must be generated to view results. + +NOTE: The KLSadd.tex file only deals with chapters 9 and 14, as stated in the document itself. + +NOTE: when you run updateChapters.py or linetest.py you need the KLSadd.tex file, tempchap9.tex, and tempchap14.tex in order to run the program. The program generates updated9.tex and updated14.tex files. + +**DO NOT REMOVE INPUT FILES FROM .GITIGNORE, THEY ARE NOT PUBLIC** + +This is a roadmap of updateChapters.py. It will help explain every piece of code and exactly how everything works in relation to each other. + + +_______________________________________________________________________________ + + +# First: The Files + + ## - KLSadd.tex: + This is the addendum we are working with. It has sections that correspond with sections in the chapter files, and it contains paragraphs that must be inserted into the chapter files. CAN BE FOUND ONINE IN .PDF FORM: https://staff.fnwi.uva.nl/t.h.koornwinder/art/informal/KLSadd.pdf + + ## - chap09.tex and chap14.tex: + These are chapter files. These are LaTeX documents that are chapters in a book. This is a book written by smart math people. But they did some things wrong, so another math person wants to fix them. That math person wrote an addendum file called KLSadd.tex and our job is to pull paragraphs out of KLSadd and insert them at the end of the relevant section in the chapter files. Every chapter is made up of sections and every section has subsections. + + ## - updateChapters.py: + This is the code currently being worked on and sorting chapters. This document will be going over the variables and methods in this program. This program should: take paragraphs from every section in KLSadd and insert them into the relevant chapter file and into the relevant section within that chapter. + + ## - linetest.py: + This is the original program. It did the job, and it did it well. However, I realized that it was very very unreadable. This program is the child I never wanted. This program does 100% work and its outputs can be used to check against updateChapters.py's output. + + ## - newtempchap09.tex and newtempchap14.tex: + These are output files of linetest.py and this is what a standard output looks like. They are no longer up to date for updateChapters as it sorts by subsection, but still serve as good reference + +# Next: the specifications + +Each section has subsections like "Hypergeometric Representation", sections in KLSadd with "Hypergeometric Representation" should be seorted there. + +Toward the end of every section in the chapter file, there is a subsection called "References". It basically just contains a bunch of references to sources and other papers. This is where unsorted materials go For example: +**These aren't real sections, just an example** + +In chap09.tex: +```latex +\section{Dogs}\index{Dog polynomials} +\subsection*{Hypergeometric dogs} +blah blah blah +\subsection*{References} +\cite{Dogs101} +``` + +In KLSadd.tex: + +```latex +\subsection*{9.15 Dogs} +\paragraph{Beagles} +The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetric +in $a,b,c,d$. +``` + +So in the chapter 9 file, section 15 "Dogs", We change the formatting with "\bf KLS Addendum: ". This changes the format so it looks prettier and stands out. So the heading in this example would be: + +```latex +\paragraph{\bf KLS Addendum: Beagles} +``` +--- + +# The variables: + +These are the variables in the beginning: + + ## -chapNums: + chapNums is a list, denoted by the [], that holds the chapter number (in this case it's either a 9 or a 14) that corresponds to where a section in KLSadd should go + + ## -paras: + Holds all of the text in the paragraphs of KLSadd.tex. This is the list that gets read when its time to insert paragraphs into the chapter file. Every element is a loooong string + + ## -mathPeople: T + This holds the *name* of every section in KLSadd. It stores names like Wilson, Racah, Dual Hahn, etc. In our example with the Dogs above, it would hold "Dogs". This is useful to finding where to insert the correct paragraph + + ## -newCommands: + This is a list that holds ints representing line numbers in KLSadd.tex that correspond to commands. There are a few special commands in the file that help turn LaTeX files into .PDF files and they need to be copied over into both chapter files + + ## -comms: + Holds the actual strings of the commands found from the line numbers stored in newCommands + +--- + +# The functions: + + ## -prepareForPDF(chap): + This method inserts some packages needed by LATEX files to be turned into .PDF files. It takes a list called chap which is a String containing the contents of the chapter fie. It returns the chap String edited with the special packages in place. + + ## -getCommands(kls): + Takes the KLSadd.tex as a string as a parameter and stores the special commands in the comms variable mentioned earlier + + ## -insertCommands(kls, chap, cms): + kls is KLSadd.tex, chap is a chapter file string, cms is a list of commands, it is the comms variable. This method returns the chap with the special commands inserted in place + + ## -findReferences(str): + Takes a string representation of a chapter file. Returns a list of the line numbers of the "References" subsections. This references variable is used as an index as to where the paragraphs in paras should be inserted + + ## -fixChapter(chap, references, p, kls): + Takes a chapter file string, a references list, the paras variable, and the KLSadd file string. This method basically just calls all of the methods above and adds all of the extra stuff like the commands and packages. + + + + +As a quick rundown: + +The chapters and KLSadd are turned into Strings and passed through the fixChapter methods. + +Then the strings are written into seperate updated chapter files. + +--- + +At this point in time updateChapters.py is functional (there are still a few areas that are ill formatted or inefficient). Currently, unit tests and additional functions are being added. + + diff --git a/KLSadd_insertion/data/KLSaddII.pdf b/KLSadd_insertion/data/KLSaddII.pdf new file mode 100644 index 0000000..c903e54 Binary files /dev/null and b/KLSadd_insertion/data/KLSaddII.pdf differ diff --git a/KLSadd_insertion/data/KLSaddII.tex b/KLSadd_insertion/data/KLSaddII.tex new file mode 100644 index 0000000..f9f3e63 --- /dev/null +++ b/KLSadd_insertion/data/KLSaddII.tex @@ -0,0 +1,2637 @@ +%until 185 +\documentclass[twoside,11pt]{article} +\usepackage[pdftex]{hyperref} +\hypersetup{ + colorlinks = true, + allcolors = {red}, +} +\usepackage{color} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{xparse} +\usepackage{cite} +\renewcommand\citeform[1]{K#1} +\setlength{\textwidth}{16cm} +\setlength{\textheight}{21cm} +\setlength{\topmargin}{0cm} +\setlength{\oddsidemargin}{0.2mm} +\setlength{\evensidemargin}{0.2mm} + +\newcommand\sa{\smallskipamount} +\newcommand\sLP{\\[\sa]} +\newcommand\sPP{\\[\sa]\indent} +\newcommand\ba{\bigskipamount} +\newcommand\bLP{\\[\ba]} +\newcommand\CC{\mathbb{C}} +\newcommand\RR{\mathbb{R}} +\newcommand\ZZ{\mathbb{Z}} +\newcommand\al\alpha +\newcommand\be\beta +\newcommand\ga\gamma +\newcommand\de\delta +\newcommand\tha\theta +\newcommand\la\lambda +\newcommand\om\omega +\newcommand\Ga{\Gamma} +\newcommand\half{\frac12} +\newcommand\thalf{\tfrac12} +\newcommand\iy\infty +\newcommand\wt{\widetilde} +\newcommand\const{{\rm const.}\,} +\newcommand\Zpos{\ZZ_{>0}} +\newcommand\Znonneg{\ZZ_{\ge0}} +\newcommand{\hyp}[5]{\,\mbox{}_{#1}F_{#2}\!\left( + \genfrac{}{}{0pt}{}{#3}{#4};#5\right)} +\newcommand{\qhyp}[5]{\,\mbox{}_{#1}\phi_{#2}\!\left( + \genfrac{}{}{0pt}{}{#3}{#4};#5\right)} +\newcommand\LHS{left-hand side} +\newcommand\RHS{right-hand side} +\renewcommand\Re{{\rm Re}\,} +\renewcommand\Im{{\rm Im}\,} + +\NewDocumentCommand\mycite{m g}{% + \IfNoValueTF{#2} + {[\hyperlink{#1}{#1}]} + {[\hyperlink{#1}{#1}, #2]}% +} +\newcommand\mybibitem[1]{\bibitem[#1]{#1}\hypertarget{#1}{}} + +%\NewDocumentCommand{\myciteKLS}{m g}{% +% \IfNoValueTF{#2} +% {\hyperlink{KLS#1}{[#1]}} +% {\hyperlink{KLS#1}{[#1, #2]}}% +%} +\NewDocumentCommand{\myciteKLS}{m g}{% + \IfNoValueTF{#2} + {[\hyperlink{KLS#1}{#1}]} + {[\hyperlink{KLS#1}{#1}, #2]}% +} +\newcommand\mybibitemKLS[1]{\bibitem[#1]{#1}\hypertarget{KLS#1}{}} + +\begin{document} + +\title{Additions to the formula lists in +``Hypergeometric orthogonal polynomials and their $q$-analogues'' +by Koekoek, Lesky and Swarttouw} +\author{Tom H. Koornwinder} +\date{June 19, 2015} +\maketitle +\begin{abstract} +This report gives a rather arbitrary choice of formulas for +($q$-)hypergeometric orthogonal polynomials which the author missed +while consulting Chapters 9 and 14 in the book +``Hypergeometric orthogonal polynomials and their $q$-analogues'' +by Koekoek, Lesky and Swarttouw. The systematics of these chapters will be followed +here, in particular for the numbering of subsections and of references. +\end{abstract} +% +\subsection*{Introduction} +\label{sec_intro} +This report contains some formulas about ($q$-)hypergeometric +orthogonal polynomials which I missed but wanted to use +while consulting Chapters 9 and 14 in the book \mycite{KLS}: +\sLP +R. Koekoek, P.~A. Lesky and R.~F. Swarttouw, +{\em Hypergeometric orthogonal polynomials and their $q$-analogues}, +Springer-Verlag, 2010. +\sLP +These chapters form together the (slightly extended) successor of the report +\sLP +R.~Koekoek and R.~F. Swarttouw, +{\em The Askey-scheme of hypergeometric orthogonal +polynomials and its $q$-analogue}, +Report 98-17, Faculty of Technical Mathematics and Informatics, +Delft University of Technology, 1998; +\url{http://aw.twi.tudelft.nl/~koekoek/askey/}. +\sPP +Certainly these chapters give complete lists of formulas of special type, for instance +orthogonality relations and three-term recurrence relations. But outside these narrow +categories there are many other +formulas for ($q$-)orthogonal polynomials which one wants to have available. +Often one can find the desired formula in one of the +\hyperref[sec_ref1]{standard references} listed at the end of this report. +Sometimes it is only available in a journal or a less common monograph. +Just for my own comfort, I have brought together some of these formulas. +This will possibly also be helpful for some other users. + +Usually, any type of formula I give for a special class of polynomials, will suggest +a similar formula for many other classes, but I have not aimed at completeness +by filling in a formula of such type at all places. The resulting choice of formulas is +rather arbitrary, just depending on the formulas which I happened to need or which raised my interest. +For each formula I give a suitable reference or I sketch a +proof. +It is my intention to gradually extend this collection of formulas. +% +\subsection*{Conventions} +\label{sec_conv} +The (x.y) and (x.y.z) type subsection numbers, the +(x.y.z) type formula numbers, and the [x] type citation numbers +refer to \mycite{KLS}. +The (x) type formula numbers refer to this manuscript and the [Kx] type citation numbers refer to citations which are not in \mycite{KLS}. +Some standard references like \mycite{DLMF} +are given by special acronyms. + +$N$ is always a positive integer. Always assume $n$ to be a nonnegative +integer or, if $N$ is present, to be in $\{0,1,\ldots,N\}$. +Throughout assume $00$ and $0\le\frac{4xy}{(1-x-y)^2}<1$. +% +\paragraph{$q$-Hypergeometric series of base $q^{-1}$} +By \mycite{GR}{Exercise 1.4(i)}: +\begin{equation} +\qhyp rs{a_1,\ldots,a_r}{b_1,\ldots b_s}{q^{-1},z} +=\qhyp{s+1}s{a_1^{-1},\ldots a_r^{-1},0,\ldots,0} +{b_1^{-1},\ldots,b_s^{-1}}{q,\frac{qa_1\ldots a_rz}{b_1\ldots b_s}} +\label{154} +\end{equation} +for $r\le s+1$, $a_1,\ldots,a_r,b_1,\ldots,b_s\ne0$. +In the non-terminating case, for $00$ and $(c,d)=(\overline a,\overline b)$ or $(\overline b,\overline a)$.\\ +Thus, under these assumptions, the continuous Hahn polynomial +$p_n(x;a,b,c,d)$ +is symmetric in $a,b$ and in $c,d$. +This follows from the orthogonality relation (9.4.2) +together with the value of its coefficient of $x^n$ given in (9.4.4b).\\ +As a consequence, it is sufficient to give generating function (9.4.11). Then the generating +function (9.4.12) will follow by symmetry in the parameters. +% +\paragraph{Uniqueness of orthogonality measure} +The coefficient of $p_{n-1}(x)$ in (9.4.4) behaves as $O(n^2)$ as $n\to\iy$. +Hence \eqref{93} holds, by which the orthogonality measure is unique. +% +\paragraph{Special cases} +In the following special case there is a reduction to +Meixner-Pollaczek: +\begin{equation} +p_n(x;a,a+\thalf,a,a+\thalf)= +\frac{(2a)_n (2a+\thalf)_n}{(4a)_n}\,P_n^{(2a)}(2x;\thalf\pi). +\end{equation} +See \myciteKLS{342}{(2.6)} (note that in \myciteKLS{342}{(2.3)} the +Meixner-Pollaczek polynonmials are defined different from (9.7.1), +without a constant factor in front). + +For $0\al>-1,\quad m,n<-\thalf(\al+\be+1),\\ +&\frac{h_n}{h_0}= +\frac{n+\al+\be+1}{2n+\al+\be+1}\, +\frac{(\al+1)_n(\be+1)_n}{(\al+\be+2)_n\,n!}\,,\quad +h_0=\frac{2^{\al+\be+1}\Ga(\al+1)\Ga(-\al-\be-1)}{\Ga(-\be)}\,. +\end{split} +\label{122} +\end{equation} + +% +\paragraph{Symmetry} +\begin{equation} +P_n^{(\al,\be)}(-x)=(-1)^n\,P_n^{(\be,\al)}(x). +\label{48} +\end{equation} +Use (9.8.2) and (9.8.5b) or see \mycite{DLMF}{Table 18.6.1}. +% +\paragraph{Special values} +\begin{equation} +P_n^{(\al,\be)}(1)=\frac{(\al+1)_n}{n!}\,,\quad +P_n^{(\al,\be)}(-1)=\frac{(-1)^n(\be+1)_n}{n!}\,,\quad +\frac{P_n^{(\al,\be)}(-1)}{P_n^{(\al,\be)}(1)}=\frac{(-1)^n(\be+1)_n}{(\al+1)_n}\,. +\label{50} +\end{equation} +Use (9.8.1) and \eqref{48} or see \mycite{DLMF}{Table 18.6.1}. +% +\paragraph{Generating functions} +Formula (9.8.15) was first obtained by Brafman \myciteKLS{109}. +% +\paragraph{Bilateral generating functions} +For $0\le r<1$ and $x,y\in[-1,1]$ we have in terms of $F_4$ (see~\eqref{62}): +\begin{align} +&\sum_{n=0}^\iy\frac{(\al+\be+1)_n\,n!}{(\al+1)_n(\be+1)_n}\,r^n\, +P_n^{(\al,\be)}(x)\,P_n^{(\al,\be)}(y) +=\frac1{(1+r)^{\al+\be+1}} +\nonumber\\ +&\qquad\quad\times F_4\Big(\thalf(\al+\be+1),\thalf(\al+\be+2);\al+1,\be+1; +\frac{r(1-x)(1-y)}{(1+r)^2},\frac{r(1+x)(1+y)}{(1+r)^2}\Big), +\label{58}\sLP +&\sum_{n=0}^\iy\frac{2n+\al+\be+1}{n+\al+\be+1} +\frac{(\al+\be+2)_n\,n!}{(\al+1)_n(\be+1)_n}\,r^n\, +P_n^{(\al,\be)}(x)\,P_n^{(\al,\be)}(y) +=\frac{1-r}{(1+r)^{\al+\be+2}}\nonumber\\ +&\qquad\quad\times F_4\Big(\thalf(\al+\be+2),\thalf(\al+\be+3);\al+1,\be+1; +\frac{r(1-x)(1-y)}{(1+r)^2},\frac{r(1+x)(1+y)}{(1+r)^2}\Big). +\label{59} +\end{align} +Formulas \eqref{58} and \eqref{59} were first +given by Bailey \myciteKLS{91}{(2.1), (2.3)}. +See Stanton \myciteKLS{485} for a shorter proof. +(However, in the second line of +\myciteKLS{485}{(1)} $z$ and $Z$ should be interchanged.)$\;$ +As observed in Bailey \myciteKLS{91}{p.10}, \eqref{59} follows +from \eqref{58} +by applying the operator $r^{-\half(\al+\be-1)}\,\frac d{dr}\circ r^{\half(\al+\be+1)}$ +to both sides of \eqref{58}. +In view of \eqref{60}, formula \eqref{59} is the Poisson kernel for Jacobi +polynomials. The \RHS\ of \eqref{59} makes clear that this kernel is positive. +See also the discussion in Askey \myciteKLS{46}{following (2.32)}. +% +\paragraph{Quadratic transformations} +\begin{align} +\frac{C_{2n}^{(\al+\half)}(x)}{C_{2n}^{(\al+\half)}(1)} +=\frac{P_{2n}^{(\al,\al)}(x)}{P_{2n}^{(\al,\al)}(1)} +&=\frac{P_n^{(\al,-\half)}(2x^2-1)}{P_n^{(\al,-\half)}(1)}\,, +\label{51}\\ +\frac{C_{2n+1}^{(\al+\half)}(x)}{C_{2n+1}^{(\al+\half)}(1)} +=\frac{P_{2n+1}^{(\al,\al)}(x)}{P_{2n+1}^{(\al,\al)}(1)} +&=\frac{x\,P_n^{(\al,\half)}(2x^2-1)}{P_n^{(\al,\half)}(1)}\,. +\label{52} +\end{align} +See p.221, Remarks, last two formulas together with \eqref{50} and \eqref{49}. +Or see \mycite{DLMF}{(18.7.13), (18.7.14)}. +% +\paragraph{Differentiation formulas} +Each differentiation formula is given in two equivalent forms. +\begin{equation} +\begin{split} +\frac d{dx}\left((1-x)^\al P_n^{(\al,\be)}(x)\right)&= +-(n+\al)\,(1-x)^{\al-1} P_n^{(\al-1,\be+1)}(x),\\ +\left((1-x)\frac d{dx}-\al\right)P_n^{(\al,\be)}(x)&= +-(n+\al)\,P_n^{(\al-1,\be+1)}(x). +\end{split} +\label{68} +\end{equation} +% +\begin{equation} +\begin{split} +\frac d{dx}\left((1+x)^\be P_n^{(\al,\be)}(x)\right)&= +(n+\be)\,(1+x)^{\be-1} P_n^{(\al+1,\be-1)}(x),\\ +\left((1+x)\frac d{dx}+\be\right)P_n^{(\al,\be)}(x)&= +(n+\be)\,P_n^{(\al+1,\be-1)}(x). +\end{split} +\label{69} +\end{equation} +Formulas \eqref{68} and \eqref{69} follow from +\mycite{DLMF}{(15.5.4), (15.5.6)} +together with (9.8.1). They also follow from each other by \eqref{48}. +% +\paragraph{Generalized Gegenbauer polynomials} +These are defined by +\begin{equation} +S_{2m}^{(\al,\be)}(x):=\const P_m^{(\al,\be)}(2x^2-1),\qquad +S_{2m+1}^{(\al,\be)}(x):=\const x\,P_m^{(\al,\be+1)}(2x^2-1) +\label{70} +\end{equation} +in the notation of \myciteKLS{146}{p.156} +(see also \cite{K27}), while \cite[Section 1.5.2]{K26} +has $C_n^{(\la,\mu)}(x)=\const\allowbreak\times S_n^{(\la-\half,\mu-\half)}(x)$. +For $\al,\be>-1$ we have the orthogonality relation +\begin{equation} +\int_{-1}^1 S_m^{(\al,\be)}(x)\,S_n^{(\al,\be)}(x)\,|x|^{2\be+1}(1-x^2)^\al\,dx +=0\qquad(m\ne n). +\label{71} +\end{equation} +For $\be=\al-1$ generalized Gegenbauer polynomials are limit cases of +continuous $q$-ultraspherical polynomials, see \eqref{176}. + +If we define the {\em Dunkl operator} $T_\mu$ by +\begin{equation} +(T_\mu f)(x):=f'(x)+\mu\,\frac{f(x)-f(-x)}x +\label{72} +\end{equation} +and if we choose the constants in \eqref{70} as +\begin{equation} +S_{2m}^{(\al,\be)}(x)=\frac{(\al+\be+1)_m}{(\be+1)_m}\, P_m^{(\al,\be)}(2x^2-1),\quad +S_{2m+1}^{(\al,\be)}(x)=\frac{(\al+\be+1)_{m+1}}{(\be+1)_{m+1}}\, +x\,P_m^{(\al,\be+1)}(2x^2-1) +\label{73} +\end{equation} +then (see \cite[(1.6)]{K5}) +\begin{equation} +T_{\be+\half}S_n^{(\al,\be)}=2(\al+\be+1)\,S_{n-1}^{(\al+1,\be)}. +\label{74} +\end{equation} +Formula \eqref{74} with \eqref{73} substituted gives rise to two +differentiation formulas involving Jacobi polynomials which are equivalent to +(9.8.7) and \eqref{69}. + +Composition of \eqref{74} with itself gives +\[ +T_{\be+\half}^2S_n^{(\al,\be)}=4(\al+\be+1)(\al+\be+2)\,S_{n-2}^{(\al+2,\be)}, +\] +which is equivalent to the composition of (9.8.7) and \eqref{69}: +\begin{equation} +\left(\frac{d^2}{dx^2}+\frac{2\be+1}x\,\frac d{dx}\right)P_n^{(\al,\be)}(2x^2-1) +=4(n+\al+\be+1)(n+\be)\,P_{n-1}^{(\al+2,\be)}(2x^2-1). +\label{75} +\end{equation} +Formula \eqref{75} was also given in \myciteKLS{322}{(2.4)}. +% +\subsection*{9.8.1 Gegenbauer / Ultraspherical} +\label{sec9.8.1} +% +\paragraph{Notation} +Here the Gegenbauer polynomial is denoted by $C_n^\la$ instead of $C_n^{(\la)}$. +% +\paragraph{Orthogonality relation} +Write the \RHS\ of (9.8.20) as $h_n\,\de_{m,n}$. Then +\begin{equation} +\frac{h_n}{h_0}= +\frac\la{\la+n}\,\frac{(2\la)_n}{n!}\,,\quad +h_0=\frac{\pi^\half\,\Ga(\la+\thalf)}{\Ga(\la+1)},\quad +\frac{h_n}{h_0\,(C_n^\la(1))^2}= +\frac\la{\la+n}\,\frac{n!}{(2\la)_n}\,. +\label{61} +\end{equation} +% +\paragraph{Hypergeometric representation} +Beside (9.8.19) we have also +\begin{equation} +C_n^\lambda(x)=\sum_{\ell=0}^{\lfloor n/2\rfloor}\frac{(-1)^{\ell}(\lambda)_{n-\ell}} +{\ell!\;(n-2\ell)!}\,(2x)^{n-2\ell} +=(2x)^{n}\,\frac{(\lambda)_{n}}{n!}\, +\hyp21{-\thalf n,-\thalf n+\thalf}{1-\la-n}{\frac1{x^2}}. +\label{57} +\end{equation} +See \mycite{DLMF}{(18.5.10)}. +% +\paragraph{Special value} +\begin{equation} +C_n^{\la}(1)=\frac{(2\la)_n}{n!}\,. +\label{49} +\end{equation} +Use (9.8.19) or see \mycite{DLMF}{Table 18.6.1}. +% +\paragraph{Expression in terms of Jacobi} +% +\begin{equation} +\frac{C_n^\la(x)}{C_n^\la(1)}= +\frac{P_n^{(\la-\half,\la-\half)}(x)}{P_n^{(\la-\half,\la-\half)}(1)}\,,\qquad +C_n^\la(x)=\frac{(2\la)_n}{(\la+\thalf)_n}\,P_n^{(\la-\half,\la-\half)}(x). +\label{65} +\end{equation} +% +\paragraph{Re: (9.8.21)} +By iteration of recurrence relation (9.8.21): +\begin{multline} +x^2 C_n^\la(x)= +\frac{(n+1)(n+2)}{4(n+\la)(n+\la+1)}\,C_{n+2}^\la(x)+ +\frac{n^2+2n\la+\la-1}{2(n+\la-1)(n+\la+1)}\,C_n^\la(x)\\ ++\frac{(n+2\la-1)(n+2\la-2)}{4(n+\la)(n+\la-1)}\,C_{n-2}^\la(x). +\label{6} +\end{multline} +% +\paragraph{Bilateral generating functions} +\begin{multline} +\sum_{n=0}^\iy\frac{n!}{(2\la)_n}\,r^n\,C_n^\la(x)\,C_n^\la(y) +=\frac1{(1-2rxy+r^2)^\la}\,\hyp21{\thalf\la,\thalf(\la+1)}{\la+\thalf} +{\frac{4r^2(1-x^2)(1-y^2)}{(1-2rxy+r^2)^2}}\\ +(r\in(-1,1),\;x,y\in[-1,1]). +\label{66} +\end{multline} +For the proof put $\be:=\al$ in \eqref{58}, then use \eqref{63} and \eqref{65}. +The Poisson kernel for Gegenbauer polynomials can be derived in a similar way +from \eqref{59}, or alternatively by applying the operator +$r^{-\la+1}\frac d{dr}\circ r^\la$ to both sides of \eqref{66}: +\begin{multline} +\sum_{n=0}^\iy\frac{\la+n}\la\,\frac{n!}{(2\la)_n}\,r^n\,C_n^\la(x)\,C_n^\la(y) +=\frac{1-r^2}{(1-2rxy+r^2)^{\la+1}}\\ +\times\hyp21{\thalf(\la+1),\thalf(\la+2)}{\la+\thalf} +{\frac{4r^2(1-x^2)(1-y^2)}{(1-2rxy+r^2)^2}}\qquad +(r\in(-1,1),\;x,y\in[-1,1]). +\label{67} +\end{multline} +Formula \eqref{67} was obtained by Gasper \& Rahman \myciteKLS{234}{(4.4)} +as a limit case of their formula for the Poisson kernel for continuous +$q$-ultraspherical polynomials. +% +\paragraph{Trigonometric expansions} +By \mycite{DLMF}{(18.5.11), (15.8.1)}: +\begin{align} +C_n^{\la}(\cos\tha) +&=\sum_{k=0}^n\frac{(\la)_k(\la)_{n-k}}{k!\,(n-k)!}\,e^{i(n-2k)\tha} +=e^{in\tha}\frac{(\la)_n}{n!}\, +\hyp21{-n,\la}{1-\la-n}{e^{-2i\tha}}\label{103}\\ +&=\frac{(\la)_n}{2^\la n!}\, +e^{-\half i\la\pi}e^{i(n+\la)\tha}\,(\sin\tha)^{-\la}\, +\hyp21{\la,1-\la}{1-\la-n}{\frac{i e^{-i\tha}}{2\sin\tha}}\label{104}\\ +&=\frac{(\la)_n}{n!}\,\sum_{k=0}^\iy\frac{(\la)_k(1-\la)_k}{(1-\la-n)_k k!}\, +\frac{\cos((n-k+\la)\tha+\thalf(k-\la)\pi)}{(2\sin\tha)^{k+\la}}\,.\label{105} +\end{align} +In \eqref{104} and \eqref{105} we require that +$\tfrac16\pi<\tha<\tfrac56\pi$. Then the convergence is absolute for $\la>\thalf$ +and conditional for $0<\la\le\thalf$. + +By \mycite{DLMF}{(14.13.1), (14.3.21), (15.8.1)]}: +\begin{align} +C_n^\la(\cos\tha)&=\frac{2\Ga(\la+\thalf)}{\pi^\half\Ga(\la+1)}\, +\frac{(2\la)_n}{(\la+1)_n}\,(\sin\tha)^{1-2\la}\, +\sum_{k=0}^\iy\frac{(1-\la)_k(n+1)_k}{(n+\la+1)_k k!}\, +\sin\big((2k+n+1)\tha\big) +\label{7}\\ +&=\frac{2\Ga(\la+\thalf)}{\pi^\half\Ga(\la+1)}\, +\frac{(2\la)_n}{(\la+1)_n}\,(\sin\tha)^{1-2\la}\, +\Im\!\!\left(e^{i(n+1)\tha}\,\hyp21{1-\la,n+1}{n+\la+1}{e^{2i\tha}}\right)\nonumber\\ +&=\frac{2^\la\Ga(\la+\thalf)}{\pi^\half\Ga(\la+1)}\, +\frac{(2\la)_n}{(\la+1)_n}\,(\sin\tha)^{-\la}\, +\Re\!\!\left(e^{-\thalf i\la\pi}e^{i(n+\la)\tha}\, +\hyp21{\la,1-\la}{1+\la+n}{\frac{e^{i\tha}}{2i\sin\tha}}\right)\nonumber\\ +&=\frac{2^{2\la}\Ga(\la+\thalf)}{\pi^\half\Ga(\la+1)}\,\frac{(2\la)_n}{(\la+1)_n}\, +\sum_{k=0}^\iy\frac{(\la)_k(1-\la)_k}{(1+\la+n)_k k!}\, +\frac{\cos((n+k+\la)\tha-\thalf(k+\la)\pi)}{(2\sin\tha)^{k+\la}}\,. +\label{106} +\end{align} +We require that $0<\tha<\pi$ in \eqref{7} and $\tfrac16\pi<\tha<\tfrac56\pi$ in +\eqref{106} The convergence is absolute for $\la>\thalf$ and conditional for +$0<\la\le\thalf$. +For $\la\in\Zpos$ the above series terminate after the term with +$k=\la-1$. +Formulas \eqref{7} and \eqref{106} are also given in +\mycite{Sz}{(4.9.22), (4.9.25)}. +% +\paragraph{Fourier transform} +\begin{equation} +\frac{\Ga(\la+1)}{\Ga(\la+\thalf)\,\Ga(\thalf)}\, +\int_{-1}^1 \frac{C_n^\la(y)}{C_n^\la(1)}\,(1-y^2)^{\la-\half}\, +e^{ixy}\,dy +=i^n\,2^\la\,\Ga(\la+1)\,x^{-\la}\,J_{\la+n}(x). +\label{8} +\end{equation} +See \mycite{DLMF}{(18.17.17) and (18.17.18)}. +% +\paragraph{Laplace transforms} +\begin{equation} +\frac2{n!\,\Ga(\la)}\, +\int_0^\iy H_n(tx)\,t^{n+2\la-1}\,e^{-t^2}\,dt=C_n^\la(x). +\label{56} +\end{equation} +See Nielsen \cite[p.48, (4) with p.47, (1) and p.28, (10)]{K4} (1918) +or Feldheim \cite[(28)]{K3} (1942). +\begin{equation} +\frac2{\Ga(\la+\thalf)}\,\int_0^1 \frac{C_n^\la(t)}{C_n^\la(1)}\, +(1-t^2)^{\la-\half}\,t^{-1}\,(x/t)^{n+2\la+1}\,e^{-x^2/t^2}\,dt +=2^{-n}\,H_n(x)\,e^{-x^2}\quad(\la>-\thalf). +\label{46} +\end{equation} +Use Askey \& Fitch \cite[(3.29)]{K2} for $\al=\pm\thalf$ together with +\eqref{48}, \eqref{51}, \eqref{52}, \eqref{54} and \eqref{55}. +\paragraph{Addition formula} (see \mycite{AAR}{(9.8.5$'$)]}) +\begin{multline} +R_n^{(\al,\al)}\big(xy+(1-x^2)^\half(1-y^2)^\half t\big) +=\sum_{k=0}^n \frac{(-1)^k(-n)_k\,(n+2\al+1)_k}{2^{2k}((\al+1)_k)^2}\\ +\times(1-x^2)^{k/2} R_{n-k}^{(\al+k,\al+k)}(x)\,(1-y^2)^{k/2} R_{n-k}^{(\al+k,\al+k)}(y)\, +\om_k^{(\al-\half,\al-\half)}\,R_k^{(\al-\half,\al-\half)}(t), +\label{108} +\end{multline} +where +\[ +R_n^{(\al,\be)}(x):=P_n^{(\al,\be)}(x)/P_n^{(\al,\be)}(1),\quad +\om_n^{(\al,\be)}:=\frac{\int_{-1}^1 (1-x)^\al(1+x)^\be\,dx} +{\int_{-1}^1 (R_n^{(\al,\be)}(x))^2\,(1-x)^\al(1+x)^\be\,dx}\,. +\] +% +\subsection*{9.8.2 Chebyshev} +\label{sec9.8.2} +In addition to the Chebyshev polynomials $T_n$ of the first kind (9.8.35) +and $U_n$ of the second kind (9.8.36), +\begin{align} +T_n(x)&:=\frac{P_n^{(-\half,-\half)}(x)}{P_n^{(-\half,-\half)}(1)} +=\cos(n\tha),\quad x=\cos\tha,\\ +U_n(x)&:=(n+1)\,\frac{P_n^{(\half,\half)}(x)}{P_n^{(\half,\half)}(1)} +=\frac{\sin((n+1)\tha)}{\sin\tha}\,,\quad x=\cos\tha, +\end{align} +we have Chebyshev polynomials $V_n$ {\em of the third kind} +and $W_n$ {\em of the fourth kind}, +\begin{align} +V_n(x)&:=\frac{P_n^{(-\half,\half)}(x)}{P_n^{(-\half,\half)}(1)} +=\frac{\cos((n+\thalf)\tha)}{\cos(\thalf\tha)}\,,\quad x=\cos\tha,\\ +W_n(x)&:=(2n+1)\,\frac{P_n^{(\half,-\half)}(x)}{P_n^{(\half,-\half)}(1)} +=\frac{\sin((n+\thalf)\tha)}{\sin(\thalf\tha)}\,,\quad x=\cos\tha, +\end{align} +see \cite[Section 1.2.3]{K20}. Then there is the symmetry +\begin{equation} +V_n(-x)=(-1)^n W_n(x). +\label{140} +\end{equation} + +The names of Chebyshev polynomials of the third and fourth kind +and the notation $V_n(x)$ are due to Gautschi \cite{K21}. +The notation $W_n(x)$ was first used by Mason \cite{K22}. +Names and notations for Chebyshev polynomials of the third and fourth +kind are interchanged in \mycite{AAR}{Remark 2.5.3} and +\mycite{DLMF}{Table 18.3.1}. +% +\subsection*{9.9 Pseudo Jacobi (or Routh-Romanovski)} +\label{sec9.9} +In this section in \mycite{KLS} the pseudo Jacobi polynomial $P_n(x;\nu,N)$ in (9.9.1) +is considered +for $N\in\ZZ_{\ge0}$ and $n=0,1,\ldots,n$. However, we can more generally take +$-\thalf\be>0\;\;{\rm or}\;\;\al<\be<0). +\] +Then $P_n$ can be expressed as a Meixner polynomial: +\[ +P_n(x)=(-k_2(\al\be)^{-1})_n\,\be^n\, +M_n\left(-\,\frac{x+k_2\al^{-1}}{\al-\be},-k_2(\al\be)^{-1},\be\al^{-1}\right). +\] + +In 1938 Gottlieb \cite[\S2]{K1} introduces polynomials $l_n$ ``of Laguerre type'' +which turn out to be special Meixner polynomials: +$l_n(x)=e^{-n\la} M_n(x;1,e^{-\la})$. +% +\paragraph{Uniqueness of orthogonality measure} +The coefficient of $p_{n-1}(x)$ in (9.10.4) behaves as $O(n^2)$ as $n\to\iy$. +Hence \eqref{93} holds, by which the orthogonality measure is unique. +% +\subsection*{9.11 Krawtchouk} +\label{sec9.11} +% +\paragraph{Special values} +By (9.11.1) and the binomial formula: +\begin{equation} +K_n(0;p,N)=1,\qquad +K_n(N;p,N)=(1-p^{-1})^n. +\label{9} +\end{equation} +The self-duality (p.240, Remarks, first formula) +\begin{equation} +K_n(x;p,N)=K_x(n;p,N)\qquad (n,x\in \{0,1,\ldots,N\}) +\label{147} +\end{equation} +combined with \eqref{9} yields: +\begin{equation} +K_N(x;p,N)=(1-p^{-1})^x\qquad(x\in\{0,1,\ldots,N\}). +\label{148} +\end{equation} +% +\paragraph{Symmetry} +By the orthogonality relation (9.11.2): +\begin{equation} +\frac{K_n(N-x;p,N)}{K_n(N;p,N)}=K_n(x;1-p,N). +\label{10} +\end{equation} +By \eqref{10} and \eqref{147} we have also +\begin{equation} +\frac{K_{N-n}(x;p,N)}{K_N(x;p,N)}=K_n(x;1-p,N) +\qquad(n,x\in\{0,1,\ldots,N\}), +\label{149} +\end{equation} +and, by \eqref{149}, \eqref{10} and \eqref{9}, +\begin{equation} +K_{N-n}(N-x;p,N)=\left(\frac p{p-1}\right)^{n+x-N}K_n(x;p,N) +\qquad(n,x\in\{0,1,\ldots,N\}). +\label{150} +\end{equation} +A particular case of \eqref{10} is: +\begin{equation} +K_n(N-x;\thalf,N)=(-1)^n K_n(x;\thalf,N). +\label{11} +\end{equation} +Hence +\begin{equation} +K_{2m+1}(N;\thalf,2N)=0. +\label{12} +\end{equation} +From (9.11.11): +\begin{equation} +K_{2m}(N;\thalf,2N)=\frac{(\thalf)_m}{(-N+\thalf)_m}\,. +\label{13} +\end{equation} +% +\paragraph{Quadratic transformations} +\begin{align} +K_{2m}(x+N;\thalf,2N)&=\frac{(\thalf)_m}{(-N+\thalf)_m}\, +R_m(x^2;-\thalf,-\thalf,N), +\label{31}\\ +K_{2m+1}(x+N;\thalf,2N)&=-\,\frac{(\tfrac32)_m}{N\,(-N+\thalf)_m}\, +x\,R_m(x^2-1;\thalf,\thalf,N-1), +\label{33}\\ +K_{2m}(x+N+1;\thalf,2N+1)&=\frac{(\tfrac12)_m}{(-N-\thalf)_m}\, +R_m(x(x+1);-\thalf,\thalf,N), +\label{32}\\ +K_{2m+1}(x+N+1;\thalf,2N+1)&=\frac{(\tfrac32)_m}{(-N-\thalf)_{m+1}}\, +(x+\thalf)\,R_m(x(x+1);\thalf,-\thalf,N), +\label{34} +\end{align} +where $R_m$ is a dual Hahn polynomial (9.6.1). For the proofs use +(9.6.2), (9.11.2), (9.6.4) and (9.11.4). +% +\paragraph{Generating functions} +\begin{multline} +\sum_{x=0}^N\binom Nx K_m(x;p,N)K_n(x;q,N)z^x\\ +=\left(\frac{p-z+pz}p\right)^m +\left(\frac{q-z+qz}q\right)^n +(1+z)^{N-m-n} +K_m\left(n;-\,\frac{(p-z+pz)(q-z+qz)}z,N\right). +\label{107} +\end{multline} +This follows immediately from Rosengren \cite[(3.5)]{K8}, which goes back +to Meixner \cite{K9}. +% +\subsection*{9.12 Laguerre} +\label{sec9.12} +\paragraph{Notation} +Here the Laguerre polynomial is denoted by $L_n^\al$ instead of +$L_n^{(\al)}$. +% +\paragraph{Hypergeometric representation} +\begin{align} +L_n^\al(x)&= +\frac{(\al+1)_n}{n!}\,\hyp11{-n}{\al+1}x +\label{182}\\ +&=\frac{(-x)^n}{n!} \hyp20{-n,-n-\al}-{-\,\frac1x} +\label{183}\\ +&=\frac{(-x)^n}{n!}\,C_n(n+\al;x), +\label{184} +\end{align} +where $C_n$ in \eqref{184} is a +\hyperref[sec9.14]{Charlier polynomial}. +Formula \eqref{182} is (9.12.1). Then \eqref{183} follows by reversal +of summation. Finally \eqref{184} follows by \eqref{183} and \eqref{179}. +It is also the remark on top of p.244 in \mycite{KLS}, and it is essentially +\myciteKLS{416}{(2.7.10)}. +% +\paragraph{Uniqueness of orthogonality measure} +The coefficient of $p_{n-1}(x)$ in (9.12.4) behaves as $O(n^2)$ as $n\to\iy$. +Hence \eqref{93} holds, by which the orthogonality measure is unique. +% +\paragraph{Special value} +\begin{equation} +L_n^{\al}(0)=\frac{(\al+1)_n}{n!}\,. +\label{53} +\end{equation} +Use (9.12.1) or see \mycite{DLMF}{18.6.1)}. +% +\paragraph{Quadratic transformations} +\begin{align} +H_{2n}(x)&=(-1)^n\,2^{2n}\,n!\,L_n^{-1/2}(x^2), +\label{54}\\ +H_{2n+1}(x)&=(-1)^n\,2^{2n+1}\,n!\,x\,L_n^{1/2}(x^2). +\label{55} +\end{align} +See p.244, Remarks, last two formulas. +Or see \mycite{DLMF}{(18.7.19), (18.7.20)}. +% +\paragraph{Fourier transform} +\begin{equation} +\frac1{\Ga(\al+1)}\,\int_0^\iy \frac{L_n^\al(y)}{L_n^\al(0)}\, +e^{-y}\,y^\al\,e^{ixy}\,dy= +i^n\,\frac{y^n}{(iy+1)^{n+\al+1}}\,, +\label{14} +\end{equation} +see \mycite{DLMF}{(18.17.34)}. +% +\paragraph{Differentiation formulas} +Each differentiation formula is given in two equivalent forms. +\begin{equation} +\frac d{dx}\left(x^\al L_n^\al(x)\right)= +(n+\al)\,x^{\al-1} L_n^{\al-1}(x),\qquad +\left(x\frac d{dx}+\al\right)L_n^\al(x)= +(n+\al)\,L_n^{\al-1}(x). +\label{76} +\end{equation} +% +\begin{equation} +\frac d{dx}\left(e^{-x} L_n^\al(x)\right)= +-e^{-x} L_n^{\al+1}(x),\qquad +\left(\frac d{dx}-1\right)L_n^\al(x)= +-L_n^{\al+1}(x). +\label{77} +\end{equation} +% +Formulas \eqref{76} and \eqref{77} follow from +\mycite{DLMF}{(13.3.18), (13.3.20)} +together with (9.12.1). +% +\paragraph{Generalized Hermite polynomials} +See \myciteKLS{146}{p.156}, \cite[Section 1.5.1]{K26}. +These are defined by +\begin{equation} +H_{2m}^\mu(x):=\const L_m^{\mu-\half}(x^2),\qquad +H_{2m+1}^\mu(x):=\const x\,L_m^{\mu+\half}(x^2). +\label{78} +\end{equation} +Then for $\mu>-\thalf$ we have orthogonality relation +\begin{equation} +\int_{-\iy}^{\iy} H_m^\mu(x)\,H_n^\mu(x)\,|x|^{2\mu}e^{-x^2}\,dx +=0\qquad(m\ne n). +\label{79} +\end{equation} +Let the Dunkl operator $T_\mu$ be defined by \eqref{72}. +If we choose the constants in \eqref{78} as +\begin{equation} +H_{2m}^\mu(x)=\frac{(-1)^m(2m)!}{(\mu+\thalf)_m}\,L_m^{\mu-\half}(x^2),\qquad +H_{2m+1}^\mu(x)=\frac{(-1)^m(2m+1)!}{(\mu+\thalf)_{m+1}}\, + x\,L_m^{\mu+\half}(x^2) + \label{80} +\end{equation} +then (see \cite[(1.6)]{K5}) +\begin{equation} +T_\mu H_n^\mu=2n\,H_{n-1}^\mu. +\label{81} +\end{equation} +Formula \eqref{81} with \eqref{80} substituted gives rise to two +differentiation formulas involving Laguerre polynomials which are equivalent to +(9.12.6) and \eqref{76}. + +Composition of \eqref{81} with itself gives +\[ +T_\mu^2 H_n^\mu=4n(n-1)\,H_{n-2}^\mu, +\] +which is equivalent to the composition of (9.12.6) and \eqref{76}: +\begin{equation} +\left(\frac{d^2}{dx^2}+\frac{2\al+1}x\,\frac d{dx}\right)L_n^\al(x^2) +=-4(n+\al)\,L_{n-1}^\al(x^2). +\label{82} +\end{equation} +% +\subsection*{9.14 Charlier} +\label{sec9.14} +% +\paragraph{Hypergeometric representation} +\begin{align} +C_n(x;a)&=\hyp20{-n,-x}-{-\,\frac1a} +\label{179}\\ +&=\frac{(-x)_n}{a^n} \hyp11{-n}{x-n+1}a +\label{180}\\ +&=\frac{n!}{(-a)^n}\,L_n^{x-n}(a), +\label{181} +\end{align} +where $L_n^\al(x)$ is a +\hyperref[sec9.12]{Laguerre polynomial}. +Formula \eqref{179} is (9.14.1). Then \eqref{180} follows by reversal +of the summation. Finally \eqref{181} follows by \eqref{180} and +(9.12.1). It is also the Remark on p.249 of \mycite{KLS}, and it +was earlier given in \myciteKLS{416}{(2.7.10)}. +% +\paragraph{Uniqueness of orthogonality measure} +The coefficient of $p_{n-1}(x)$ in (9.14.4) behaves as $O(n)$ as $n\to\iy$. +Hence \eqref{93} holds, by which the orthogonality measure is unique. +% +\subsection*{9.15 Hermite} +\label{sec9.15} +% +\paragraph{Uniqueness of orthogonality measure} +The coefficient of $p_{n-1}(x)$ in (9.15.4) behaves as $O(n)$ as $n\to\iy$. +Hence \eqref{93} holds, by which the orthogonality measure is unique. +% +\paragraph{Fourier transforms} +\begin{equation} +\frac1{\sqrt{2\pi}}\,\int_{-\iy}^\iy H_n(y)\,e^{-\half y^2}\,e^{ixy}\,dy= +i^n\,H_n(x)\,e^{-\half x^2}, +\label{15} +\end{equation} +see \mycite{AAR}{(6.1.15) and Exercise 6.11}. +\begin{equation} +\frac1{\sqrt\pi}\,\int_{-\iy}^\iy H_n(y)\,e^{-y^2}\,e^{ixy}\,dy= +i^n\,x^n\,e^{-\frac14 x^2}, +\label{16} +\end{equation} +see \mycite{DLMF}{(18.17.35)}. +\begin{equation} +\frac{i^n}{2\sqrt\pi}\,\int_{-\iy}^\iy y^n\,e^{-\frac14 y^2}\,e^{-ixy}\,dy= +H_n(x)\,e^{-x^2}, +\label{17} +\end{equation} +see \mycite{AAR}{(6.1.4)}. +% +\subsection*{14.1 Askey-Wilson} +\label{sec14.1} +% +\paragraph{Symmetry} +The Askey-Wilson polynomials $p_n(x;a,b,c,d\,|\,q)$ are \,|\,symmetric +in $a,b,c,d$. +\sLP +This follows from the orthogonality relation (14.1.2) +together with the value of its coefficient of $x^n$ given in (14.1.5b). +Alternatively, combine (14.1.1) with \mycite{GR}{(III.15)}.\\ +As a consequence, it is sufficient to give generating function (14.1.13). Then the generating +functions (14.1.14), (14.1.15) will follow by symmetry in the parameters. +% +\paragraph{Basic hypergeometric representation} +In addition to (14.1.1) we have (in notation \eqref{111}): +\begin{multline} +p_n(\cos\tha;a,b,c,d\,|\, q) +=\frac{(ae^{-i\tha},be^{-i\tha},ce^{-i\tha},de^{-i\tha};q)_n} +{(e^{-2i\tha};q)_n}\,e^{in\tha}\\ +\times {}_8W_7\big(q^{-n}e^{2i\tha};ae^{i\tha},be^{i\tha}, +ce^{i\tha},de^{i\tha},q^{-n};q,q^{2-n}/(abcd)\big). +\label{113} +\end{multline} +This follows from (14.1.1) by combining (III.15) and (III.19) in +\mycite{GR}. +It is also given in \myciteKLS{513}{(4.2)}, but be aware for some slight errors. +The symmetry in $a,b,c,d$ is evident from \eqref{113}. +% +\paragraph{Special value} +\begin{equation} +p_n\big(\thalf(a+a^{-1});a,b,c,d\,|\, q\big)=a^{-n}\,(ab,ac,ad;q)_n\,, +\label{40} +\end{equation} +and similarly for arguments $\thalf(b+b^{-1})$, $\thalf(c+c^{-1})$ and +$\thalf(d+d^{-1})$ by symmetry of $p_n$ in $a,b,c,d$. +% +\paragraph{Trivial symmetry} +\begin{equation} +p_n(-x;a,b,c,d\,|\, q)=(-1)^n p_n(x;-a,-b,-c,-d\,|\, q). +\label{41} +\end{equation} +Both \eqref{40} and \eqref{41} are obtained from (14.1.1). +% +\paragraph{Re: (14.1.5)} +Let +\begin{equation} +p_n(x):=\frac{p_n(x;a,b,c,d\,|\, q)}{2^n(abcdq^{n-1};q)_n}=x^n+\wt k_n x^{n-1} ++\cdots\;. +\label{18} +\end{equation} +Then +\begin{equation} +\wt k_n=-\frac{(1-q^n)(a+b+c+d-(abc+abd+acd+bcd)q^{n-1})} +{2(1-q)(1-abcdq^{2n-2})}\,. +\label{19} +\end{equation} +This follows because $\tilde k_n-\tilde k_{n+1}$ equals the coefficient +$\thalf\bigl(a+a^{-1}-(A_n+C_n)\bigr)$ of $p_n(x)$ in (14.1.5). +% +\paragraph{Generating functions} +Rahman \myciteKLS{449}{(4.1), (4.9)} gives: +\begin{align} +&\sum_{n=0}^\iy \frac{(abcdq^{-1};q)_n a^n}{(ab,ac,ad,q;q)_n}\,t^n\, +p_n(\cos\tha;a,b,c,d\,|\,q) +\nonumber\\ +&=\frac{(abcdtq^{-1};q)_\iy}{(t;q)_\iy}\, +\qhyp65{(abcdq^{-1})^\half,-(abcdq^{-1})^\half,(abcd)^\half, +-(abcd)^\half,a e^{i\tha},a e^{-i\tha}} +{ab,ac,ad,abcdtq^{-1},qt^{-1}}{q,q} +\nonumber\\ +&+\frac{(abcdq^{-1},abt,act,adt,ae^{i\tha},ae^{-i\tha};q)_\iy} +{(ab,ac,ad,t^{-1},ate^{i\tha},ate^{-i\tha};q)_\iy} +\nonumber\\ +&\times\qhyp65{t(abcdq^{-1})^\half,-t(abcdq^{-1})^\half,t(abcd)^\half, +-t(abcd)^\half,at e^{i\tha},at e^{-i\tha}} +{abt,act,adt,abcdt^2q^{-1},qt}{q,q}\quad(|t|<1). +\label{185} +\end{align} +In the limit \eqref{109} the first term on the \RHS\ of \eqref{185} +tends to the \LHS\ of (9.1.15), while the second term tends formally +to 0. The special case $ad=bc$ of \eqref{185} was earlier given in +\myciteKLS{236}{(4.1), (4.6)}. +% +\paragraph{Limit relations}\quad\sLP +{\bf Askey-Wilson $\longrightarrow$ Wilson}\\ +Instead of (14.1.21) we can keep a polynomial of degree $n$ while the limit is approached: +\begin{equation} +\lim_{q\to1}\frac{p_n(1-\thalf x(1-q)^2;q^a,q^b,q^c,q^d\,|\, q)}{(1-q)^{3n}} +=W_n(x;a,b,c,d). +\label{109} +\end{equation} +For the proof first derive the corresponding limit for the monic polynomials by comparing +(14.1.5) with (9.4.4). +\bLP +{\bf Askey-Wilson $\longrightarrow$ Continuous Hahn}\\ +Instead of (14.4.15) we can keep a polynomial of degree $n$ while the limit is approached: +\begin{multline} +\lim_{q\uparrow1} +\frac{p_n\big(\cos\phi-x(1-q)\sin\phi;q^a e^{i\phi},q^b e^{i\phi},q^{\overline a} e^{-i\phi}, +q^{\overline b} e^{-i\phi}\,|\, q\big)} +{(1-q)^{2n}}\\ +=(-2\sin\phi)^n\,n!\,p_n(x;a,b,\overline a,\overline b)\qquad +(0<\phi<\pi). +\label{177} +\end{multline} +Here the \RHS\ has a continuous Hahn polynomial (9.4.1). +For the proof first derive the corresponding limit for the monic polynomials by comparing +(14.1.5) with (9.1.5). +In fact, define the monic polynomial +\[ +\wt p_n(x):= +\frac{p_n\big(\cos\phi-x(1-q)\sin\phi;q^a e^{i\phi},q^b e^{i\phi},q^{\overline a} e^{-i\phi}, +q^{\overline b} e^{-i\phi}\,|\, q\big)} +{(-2(1-q)\sin\phi)^n\,(abcdq^{n-1};q)_n}\,. +\] +Then it follows from (14.1.5) that +\begin{equation*} +x\,\wt p_n(x)=\wt p_{n+1}(x) ++\frac{(1-q^a)e^{i\phi}+(1-q^{-a})e^{-i\phi}+\wt A_n+\wt C_n}{2(1-q)\sin\phi}\,\wt p_n(x)\\ ++\frac{\wt A_{n-1} \wt C_n}{(1-q)^2 \sin^2\phi}\,\wt p_{n-1}(x), +\end{equation*} +where $\wt A_n$ and $\wt C_n$ are as given after (14.1.3) with $a,b,c,d$ replaced by +$q^a e^{i\phi},q^b e^{i\phi},q^{\overline a} e^{-i\phi},q^{\overline b} e^{-i\phi}$. +Then the recurrence equation for $\wt p_n(x)$ tends for $q\uparrow 1$ to +the recurrence equation (9.4.4) with $c=\overline a$, $d=\overline b$. +\bLP +{\bf Askey-Wilson $\longrightarrow$ Meixner-Pollaczek}\\ +Instead of (14.9.15) we can keep a polynomial of degree $n$ while the limit is approached: +\begin{equation} +\lim_{q\uparrow1} +\frac{p_n\big(\cos\phi-x(1-q)\sin\phi; +q^\la e^{i\phi},0,q^\la e^{-i\phi},0\,|\, q\big)}{(1-q)^n} +=n!\,P_n^{(\la)}(x;\pi-\phi)\quad +(0<\phi<\pi). +\label{178} +\end{equation} +Here the \RHS\ has a Meixner-Pollaczek polynomial (9.7.1). +For the proof first derive the corresponding limit for the monic polynomials by comparing +(14.1.5) with (9.7.4). +In fact, define the monic polynomial +\[ +\wt p_n(x):= +\frac{p_n\big(\cos\phi-x(1-q)\sin\phi; +q^\la e^{i\phi},0,q^\la e^{-i\phi},0\,|\, q\big)}{(-2(1-q)\sin\phi)^n}\,. +\] +Then it follows from (14.1.5) that +\begin{equation*} +x\,\wt p_n(x)=\wt p_{n+1}(x) ++\frac{(1-q^\la)e^{i\phi}+(1-q^{-\la})e^{-i\phi}+\wt A_n+\wt C_n} +{2(1-q)\sin\phi}\,\wt p_n(x)\\ ++\frac{\wt A_{n-1} \wt C_n}{(1-q)^2 \sin^2\phi}\,\wt p_{n-1}(x), +\end{equation*} +where $\wt A_n$ and $\wt C_n$ are as given after (14.1.3) with $a,b,c,d$ replaced by +$q^\la e^{i\phi},0,q^\la e^{-i\phi},0$. +Then the recurrence equation for $\wt p_n(x)$ tends for $q\uparrow 1$ to +the recurrence equation (9.7.4). +% +\paragraph{References} +See also Koornwinder \cite{K7}. +% +\subsection*{14.2 $q$-Racah} +\label{sec14.2} +\paragraph{Symmetry} +\begin{equation} +R_n(x;\al,\be,q^{-N-1},\de\,|\, q) +=\frac{(\be q,\al\de^{-1}q;q)_n}{(\al q,\be\de q;q)_n}\,\de^n\, +R_n(\de^{-1}x;\be,\al,q^{-N-1},\de^{-1}\,|\, q). +\label{84} +\end{equation} +This follows from (14.2.1) combined with \mycite{GR}{(III.15)}. +\sLP +In particular, +\begin{equation} +R_n(x;\al,\be,q^{-N-1},-1\,|\, q) +=\frac{(\be q,-\al q;q)_n}{(\al q,-\be q;q)_n}\,(-1)^n\, +R_n(-x;\be,\al,q^{-N-1},-1\,|\, q), +\label{85} +\end{equation} +and +\begin{equation} +R_n(x;\al,\al,q^{-N-1},-1\,|\, q) +=(-1)^n\,R_n(-x;\al,\al,q^{-N-1},-1\,|\, q), +\label{86} +\end{equation} + +\paragraph{Trivial symmetry} +Clearly from (14.2.1): +\begin{equation} +R_n(x;\al,\be,\ga,\de\,|\, q)=R_n(x;\be\de,\al\de^{-1},\ga,\de\,|\, q) +=R_n(x;\ga,\al\be\ga^{-1},\al,\ga\de\al^{-1}\,|\, q). +\label{83} +\end{equation} +For $\al=q^{-N-1}$ this shows that the three cases +$\al q=q^{-N}$ or $\be\de q=q^{-N}$ or $\ga q=q^{-N}$ of (14.2.1) +are not essentially different. +% +\paragraph{Duality} +It follows from (14.2.1) that +\begin{equation} +R_n(q^{-y}+\ga\de q^{y+1};q^{-N-1},\be,\ga,\de\,|\, q) +=R_y(q^{-n}+\be q^{n-N};\ga,\de,q^{-N-1},\be\,|\, q)\quad +(n,y=0,1,\ldots,N). +\end{equation} +% +\subsection*{14.3 Continuous dual $q$-Hahn} +\label{sec14.3} +The continuous dual $q$-Hahn polynomials are the special case $d=0$ of the +Askey-Wilson polynomials: +\[ +p_n(x;a,b,c\,|\, q):=p_n(x;a,b,c,0\,|\, q). +\] +Hence all formulas in \S14.3 are specializations for $d=0$ of formulas in \S14.1. +% +\subsection*{14.4 Continuous $q$-Hahn} +\label{sec14.4} +The continuous $q$-Hahn polynomials are the special case +of Askey-Wilson polynomials with parameters +$a e^{i\phi},b e^{i\phi},a e^{-i\phi},b e^{-i\phi}$: +\[ +p_n(x;a,b,\phi\,|\, q):= +p_n(x;a e^{i\phi},b e^{i\phi},a e^{-i\phi},b e^{-i\phi}\,|\, q). +\] +In \myciteKLS{72}{(4.29)} and \mycite{GR}{(7.5.43)} +(who write $p_n(x;a,b\,|\,q)$, $x=\cos(\tha+\phi)$) +and in \mycite{KLS}{\S14.4} (who writes $p_n(x;a,b,c,d;q)$, +$x=\cos(\tha+\phi)$) +the parameter +dependence on $\phi$ is incorrectly omitted. + +Since all formulas in \S14.4 are specializations of formulas in \S14.1, +there is no real need to give these specializations explicitly. +In particular, the limit (14.4.15) is in fact a limit from Askey-Wilson to +continuous $q$-Hahn. See also \eqref{177}. +% +\subsection*{14.5 Big $q$-Jacobi} +\label{sec14.5} +% +\paragraph{Different notation} +See p.442, Remarks: +\begin{equation} +P_n(x;a,b,c,d;q):=P_n(qac^{-1}x;a,b,-ac^{-1}d;q) +=\qhyp32{q^{-n},q^{n+1}ab,qac^{-1}x}{qa,-qac^{-1}d}{q,q}. +\label{123} +\end{equation} +Furthermore, +\begin{equation} +P_n(x;a,b,c,d;q)=P_n(\la x;a,b,\la c,\la d;q), +\label{141} +\end{equation} +\begin{equation} +P_n(x;a,b,c;q)=P_n(-q^{-1}c^{-1}x;a,b,-ac^{-1},1;q) +\label{142} +\end{equation} +% +\paragraph{Orthogonality relation} +(equivalent to (14.5.2), see also \cite[(2.42), (2.41), (2.36), (2.35)]{K17}). +Let $c,d>0$ and either $a\in (-c/(qd),1/q)$, $b\in(-d/(cq),1/q)$ or +$a/c=-\overline b/d\notin\RR$. Then +\begin{equation} +\int_{-d}^c P_m(x;a,b,c,d;q) P_n(x;a,b,c,d;q)\, +\frac{(qx/c,-qx/d;q)_\iy}{(qax/c,-qbx/d;q)_\iy}\,d_qx=h_n\,\de_{m,n}\,, +\label{124} +\end{equation} +where +\begin{equation} +\frac{h_n}{h_0}=q^{\half n(n-1)}\left(\frac{q^2a^2d}c\right)^n\, +\frac{1-qab}{1-q^{2n+1}ab}\, +\frac{(q,qb,-qbc/d;q)_n}{(qa,qab,-qad/c;q)_n} +\label{125} +\end{equation} +and +\begin{equation} +h_0=(1-q)c\,\frac{(q,-d/c,-qc/d,q^2ab;q)_\iy} +{(qa,qb,-qbc/d,-qad/c;q)_\iy}\,. +\label{126} +\end{equation} +% +\paragraph{Other hypergeometric representation and asymptotics} +\begin{align} +&P_n(x;a,b,c,d;q) +=\frac{(-qbd^{-1}x;q)_n}{(-q^{-n}a^{-1}cd^{-1};q)_n}\, +\qhyp32{q^{-n},q^{-n}b^{-1},cx^{-1}}{qa,-q^{-n}b^{-1}dx^{-1}}{q,q} +\label{138}\\ +&\qquad=(qac^{-1}x)^n\,\frac{(qb,cx^{-1};q)_n}{(qa,-qac^{-1}d;q)_n}\, +\qhyp32{q^{-n},q^{-n}a^{-1},-qbd^{-1}x}{qb,q^{1-n}c^{-1}x} +{q,-q^{n+1}ac^{-1}d} +\label{132}\\ +&\qquad=(qac^{-1}x)^n\,\frac{(qb,q;q)_n}{(-qac^{-1}d;q)_n}\, +\sum_{k=0}^n\frac{(cx^{-1};q)_{n-k}}{(q,qa;q)_{n-k}}\, +\frac{(-qbd^{-1}x;q)_k}{(qb,q;q)_k}\,(-1)^k q^{\half k(k-1)}(-dx^{-1})^k. +\label{133} +\end{align} +Formula \eqref{138} follows from \eqref{123} by +\mycite{GR}{(III.11)} and next \eqref{132} follows by series inversion +\mycite{GR}{Exercise 1.4(ii)}. +Formulas \eqref{138} and \eqref{133} are also given in +\mycite{Ism}{(18.4.28), (18.4.29)}. +It follows from \eqref{132} or \eqref{133} that +(see \myciteKLS{298}{(1.17)} or \mycite{Ism}{(18.4.31)}) +\begin{equation} +\lim_{n\to\iy}(qac^{-1}x)^{-n} P_n(x;a,b,c,d;q) +=\frac{(cx^{-1},-dx^{-1};q)_\iy}{(-qac^{-1}d,qa;q)_\iy}\,, +\label{134} +\end{equation} +uniformly for $x$ in compact subsets of $\CC\backslash\{0\}$. +(Exclusion of the spectral points $x=cq^m,dq^m$ ($m=0,1,2,\ldots$), +as was done in \myciteKLS{298} and \mycite{Ism}, is not necessary. However, +while \eqref{134} yields 0 at these points, a more refined asymptotics +at these points is given in \myciteKLS{298} and \mycite{Ism}.)$\;$ +For the proof of \eqref{134} use that +\begin{equation} +\lim_{n\to\iy}(qac^{-1}x)^{-n} P_n(x;a,b,c,d;q) +=\frac{(qb,cx^{-1};q)_n}{(qa,-qac^{-1}d;q)_n}\, +\qhyp11{-qbd^{-1}x}{qb}{q,-dx^{-1}}, +\label{135} +\end{equation} +which can be evaluated by \mycite{GR}{(II.5)}. +Formula \eqref{135} follows formally from \eqref{132}, and it follows rigorously, by +dominated convergence, from \eqref{133}. +% +\paragraph{Symmetry} +(see \cite[\S2.5]{K17}). +\begin{equation} +\frac{P_n(-x;a,b,c,d;q)}{P_n(-d/(qb);a,b,c,d;q)} +=P_n(x;b,a,d,c;q). +\end{equation} +% +\paragraph{Special values} +\begin{align} +P_n(c/(qa);a,b,c,d;q)&=1,\\ +P_n(-d/(qb);a,b,c,d;q)&=\left(-\,\frac{ad}{bc}\right)^n\, +\frac{(qb,-qbc/d;q)_n}{(qa,-qad/c;q)_n}\,,\\ +P_n(c;a,b,c,d;q)&= +q^{\half n(n+1)}\left(\frac{ad}c\right)^n +\frac{(-qbc/d;q)_n}{(-qad/c;q)_n}\,,\\ +P_n(-d;a,b,c,d;q)&=q^{\half n(n+1)} (-a)^n\,\frac{(qb;q)_n}{(qa;q)_n}\,. +\end{align} +% +\paragraph{Quadratic transformations} +(see \cite[(2.48), (2.49)]{K17} and \eqref{128}).\\ +These express big $q$-Jacobi polynomials $P_m(x;a,a,1,1;q)$ in terms of little +$q$-Jacobi polynomials (see \S14.12). +\begin{align} +P_{2n}(x;a,a,1,1;q)&=\frac{p_n(x^2;q^{-1},a^2;q^2)}{p_n((qa)^{-2};q^{-1},a^2;q^2)}\,, +\label{130}\\ +P_{2n+1}(x;a,a,1,1;q)&=\frac{qax\,p_n(x^2;q,a^2;q^2)}{p_n((qa)^{-2};q,a^2;q^2)}\,. +\label{131} +\end{align} +Hence, by (14.12.1), \mycite{GR}{Exercise 1.4(ii)} and \eqref{128}, +\begin{align} +P_n(x;a,a,1,1;q)&=\frac{(qa^2;q^2)_n}{(qa^2;q)_n}\,(qax)^n\, +\qhyp21{q^{-n},q^{-n+1}}{q^{-2n+1}a^{-2}}{q^2,(ax)^{-2}} +\label{136}\\ +&=\frac{(q;q)_n}{(qa^2;q)_n}\,(qa)^n\, +\sum_{k=0}^{[\half n]}(-1)^k q^{k(k-1)} +\frac{(qa^2;q^2)_{n-k}}{(q^2;q^2)_k\,(q;q)_{n-2k}}\,x^{n-2k}. +\label{137} +\end{align} +% +\paragraph{$q$-Chebyshev polynomials} +In \eqref{123}, with $c=d=1$, the cases $a=b=q^{-\half}$ and $a=b=q^\half$ can be considered +as $q$-analogues of the Chebyshev polynomials of the first and second kind, respectively +(\S9.8.2) because of the limit (14.5.17). The quadratic relations \eqref{130}, \eqref{131} +can also be specialized to these cases. The definition of the $q$-Chebyshev polynomials +may vary by normalization and by dilation of argument. They were considered in +\cite{K18}. +By \myciteKLS{24}{p.279} and \eqref{130}, \eqref{131}, the {\em Al-Salam-Ismail polynomials} +$U_n(x;a,b)$ ($q$-dependence suppressed) in the case $a=q$ can be expressed as +$q$-Chebyshev polynomials of the second kind: +\begin{equation*} +U_n(x,q,b)=(q^{-3} b)^{\half n}\,\frac{1-q^{n+1}}{1-q}\, +P_n(b^{-\half}x;q^\half,q^\half,1,1;q). +\end{equation*} +Similarly, by \cite[(5.4), (5.1), (5.3)]{K19} and \eqref{130}, \eqref{131}, Cigler's $q$-Chebyshev +polynomials $T_n(x,s,q)$ and $U_n(x,s,q)$ +can be expressed in terms of the $q$-Chebyshev cases of \eqref{123}: +\begin{align*} +T_n(x,s,q)&=(-s)^{\half n}\,P_n((-qs)^{-\half} x;q^{-\half},q^{-\half},1,1;q),\\ +U_n(x,s,q)&=(-q^{-2}s)^{\half n}\,\frac{1-q^{n+1}}{1-q}\, +P_n((-qs)^{-\half} x;q^{\half},q^{\half},1,1;q). +\end{align*} +% +\paragraph{Limit to Discrete $q$-Hermite I} +\begin{equation} +\lim_{a\to0} a^{-n}\,P_n(x;a,a,1,1;q)=q^n\,h_n(x;q). +\label{139} +\end{equation} +Here $h_n(x;q)$ is given by (14.28.1). +For the proof of \eqref{139} use \eqref{138}. +% +\paragraph{Pseudo big $q$-Jacobi polynomials} +Let $a,b,c,d\in\CC$, $z_+>0$, $z_-<0$ such that +$\tfrac{(ax,bx;q)_\iy}{(cx,dx;q)_\iy}>0$ for $x\in z_- q^\ZZ\cup z_+ q^\ZZ$. +Then $(ab)/(qcd)>0$. Assume that $(ab)/(qcd)<1$. +Let $N$ be the largest nonnegative integer such that $q^{2N}>(ab)/(qcd)$. +Then +\begin{multline} +\int_{z_- q^\ZZ\cup z_+ q^\ZZ}P_m(cx;c/b,d/a,c/a;q)\,P_n(cx;c/b,d/a,c/a;q)\, +\frac{(ax,bx;q)_\iy}{(cx,dx;q)_\iy}\,d_qx=h_n\de_{m,n}\\ +(m,n=0,1,\ldots,N), +\label{114} +\end{multline} +where +\begin{equation} +\frac{h_n}{h_0}=(-1)^n\left(\frac{c^2}{ab}\right)^n q^{\half n(n-1)} q^{2n}\, +\frac{(q,qd/a,qd/b;q)_n}{(qcd/(ab),qc/a,qc/b;q)_n}\, +\frac{1-qcd/(ab)}{1-q^{2n+1}cd/(ab)} +\label{115} +\end{equation} +and +\begin{equation} +h_0=\int_{z_- q^\ZZ\cup z_+ q^\ZZ}\frac{(ax,bx;q)_\iy}{(cx,dx;q)_\iy}\,d_qx +=(1-q)z_+\, +\frac{(q,a/c,a/d,b/c,b/d;q)_\iy}{(ab/(qcd);q)_\iy}\, +\frac{\tha(z_-/z_+,cdz_-z_+;q)}{\tha(cz_-,dz_-,cz_+,dz_+;q)}\,. +\label{116} +\end{equation} +See Groenevelt \& Koelink \cite[Prop.~2.2]{K14}. +Formula \eqref{116} was first given by Slater \cite[(5)]{K15} as an evaluation +of a sum of two ${}_2\psi_2$ series. +The same formula is given in Slater \myciteKLS{471}{(7.2.6)} and in +\mycite{GR}{Exercise 5.10}, but in both cases with the same slight error, +see \cite[2nd paragraph after Lemma 2.1]{K14} for correction. +The theta function is given by \eqref{117}. +Note that +\begin{equation} +P_n(cx;c/b,d/a,c/a;q)=P_n(-q^{-1}ax;c/b,d/a,-a/b,1;q). +\label{145} +\end{equation} + +In \cite{K29} the weights of the pseudo big $q$-Jacobi polynomials +occur in certain measures on the space of $N$-point configurations +on the so-called extended Gelfand-Tsetlin graph. +% +\subsubsection*{Limit relations} +\paragraph{Pseudo big $q$-Jacobi $\longrightarrow$ Discrete Hermite II} +\begin{equation} +\lim_{a\to\iy}i^n q^{\half n(n-1)} P_n(q^{-1}a^{-1}ix;a,a,1,1;q)= +\wt h_n(x;q). +\label{144} +\end{equation} +For the proof use \eqref{137} and \eqref{143}. +Note that $P_n(q^{-1}a^{-1}ix;a,a,1,1;q)$ is obtained from the +\RHS\ of \eqref{144} by replacing $a,b,c,d$ by $-ia^{-1},ia^{-1},i,-i$. +% +\paragraph{Pseudo big $q$-Jacobi $\longrightarrow$ Pseudo Jacobi} +\begin{equation} +\lim_{q\uparrow1}P_n(iq^{\half(-N-1+i\nu)}x;-q^{-N-1},-q^{-N-1},q^{-N+i\nu-1};q) +=\frac{P_n(x;\nu,N)}{P_n(-i;\nu,N)}\,. +\label{118} +\end{equation} +Here the big $q$-Jacobi polynomial on the \LHS\ equals +$P_n(cx;c/b,d/a,c/a;q)$ with\\ +$a=iq^{\half(N+1-i\nu)}$, $b=-iq^{\half(N+1+i\nu)}$, +$c=iq^{\half(-N-1+i\nu)}$, $d=-iq^{\half(-N-1-i\nu)}$. +% +\subsection*{14.7 Dual $q$-Hahn} +\label{sec14.7} +\paragraph{Orthogonality relation} +More generally we have (14.7.2) with positive weights in any of the following +cases: +(i) $0<\ga q<1$, $0<\de q<1$;\quad +(ii) $0<\ga q<1$, $\de<0$;\quad +(iii) $\ga<0$, $\de>q^{-N}$;\quad +(iv) $\ga>q^{-N}$, $\de>q^{-N}$;\quad +(v) $01,\;qb1$ +if $p>q^{-1}$. +% +\paragraph{History} +The origin of the name of the quantum $q$-Krawtchouk polynomials +is by their interpretation +as matrix elements of irreducible corepresentations of (the quantized +function algebra of) the quantum group $SU_q(2)$ considered +with respect to its quantum subgroup $U(1)$. The orthogonality +relation and dual orthogonality relation of these polynomials +are an expression of the unitarity of these corepresentations. +See for instance \myciteKLS{343}{Section 6}. +% +\subsection*{14.16 Affine $q$-Krawtchouk} +\label{sec14.16} +% +\paragraph{$q$-Hypergeometric representation} +For $n=0,1,\ldots,N$ +(see (14.16.1)): +\begin{align} +K_n^{\rm Aff}(y;p,N;q) +&=\frac1{(p^{-1}q^{-1};q^{-1})_n}\,\qhyp21{q^{-n},q^{-N}y^{-1}}{q^{-N}}{q,p^{-1}y} +\label{156}\\ +&=\qhyp32{q^{-n},y,0}{q^{-N},pq}{q,q}. +\label{157} +\end{align} +% +\paragraph{Self-duality} +By \eqref{157}: +\begin{equation} +K_n^{\rm Aff}(q^{-x};p,N;q)=K_x^{\rm Aff}(q^{-n};p,N;q)\qquad +(n,x\in\{0,1,\ldots,N\}). +\label{168} +\end{equation} +% +\paragraph{Special values} +By \eqref{156} and \mycite{GR}{(II.4)}: +\begin{equation} +K_n^{\rm Aff}(1;p,N;q)=1,\qquad +K_n^{\rm Aff}(q^{-N};p,N;q)=\frac1{((pq)^{-1};q^{-1})_n}\,. +\label{165} +\end{equation} +By \eqref{165} and \eqref{168} we have also +\begin{equation} +K_N^{\rm Aff}(q^{-x};p,N;q)=\frac1{((pq)^{-1};q^{-1})_x}\,. +\label{170} +\end{equation} +% +\paragraph{Limit for $q\to1$ to Krawtchouk} (see (14.16.14) and Section \hyperref[sec9.11]{9.11}): +\begin{align} +\lim_{q\to1} K_n^{\rm Aff}(1+(1-q)x;p,N;q)&=K_n(x;1-p,N), +\label{162}\\ +\lim_{q\to1} K_n^{\rm Aff}(q^{-x};p,N;q)&=K_n(x;1-p,N). +\label{166} +\end{align} +% +\paragraph{A relation between quantum and affine $q$-Krawtchouk}\quad\\ +By \eqref{152}, \eqref{156}, \eqref{165} and \eqref{168} +we have for $x\in\{0,1,\ldots,N\}$: +\begin{align} +K_{N-n}^{\rm qtm}(q^{-x};p^{-1}q^{-N-1},N;q) +&=\frac{K_x^{\rm Aff}(q^{-n};p,N;q)}{K_x^{\rm Aff}(q^{-N};p,N;q)} +\label{171}\\ +&=\frac{K_n^{\rm Aff}(q^{-x};p,N;q)}{K_N^{\rm Aff}(q^{-x};p,N;q)}\,. +\label{172} +\end{align} +Formula \eqref{171} is given in \cite[formula after (12)]{K24} +and \cite[(59)]{K25}. +In view of \eqref{164} and \eqref{166} +formula \eqref{172} has \eqref{149} as a limit case for +$q\to 1$. +% +\paragraph{Affine $q^{-1}$-Krawtchouk} +By \eqref{156}, \eqref{165}, +\eqref{154} and \eqref{152} (see also p.505, first formula): +\begin{align} +\frac{K_n^{\rm Aff}(y;p,N;q^{-1})}{K_n^{\rm Aff}(q^N;p,N;q^{-1})} +&=\qhyp21{q^{-n},q^{-N}y}{q^{-N}}{q,p^{-1}q^{n+1}} +\label{158}\\ +&=K_n^{\rm qtm}(q^{-N}y;p^{-1},N;q). +\label{159} +\end{align} +Formula \eqref{159} is equivalent to \eqref{160}. +Just as for \eqref{160}, it tends after suitable substitutions to +\eqref{10} as $q\to1$. + +The orthogonality relation (14.16.2) holds with positive weights for $q>1$ +if $0-1) +\label{119} +\end{equation} +with +\begin{equation} +\frac{h_n}{h_0}=\frac{(q^{\al+1};q)_n}{(q;q)_n q^n},\qquad +h_0=-\,\frac{(q^{-\al};q)_\iy}{(q;q)_\iy}\,\frac\pi{\sin(\pi\al)}\,. +\label{120} +\end{equation} +The expression for $h_0$ (which is Askey's $q$-gamma evaluation +\cite[(4.2)]{K16}) +should be interpreted by continuity in $\al$ for +$\al\in\Znonneg$. +Explicitly we can write +\begin{equation} +h_n=q^{-\half\al(\al+1)}\,(q;q)_\al\,\log(q^{-1})\qquad(\al\in\Znonneg). +\label{121} +\end{equation} +% +\subsubsection*{Expansion of $x^n$} +\begin{equation} +x^n=q^{-\half n(n+2\al+1)}\,(q^{\al+1};q)_n\, +\sum_{k=0}^n\frac{(q^{-n};q)_k}{(q^{\al+1};q)_k}\,q^k\,L_k^\al(x;q). +\label{37} +\end{equation} +This follows from \eqref{36} by the equality given in the Remark at the end +of \S14.20. Alternatively, it can be derived in the same way as \eqref{36} +from the generating function (14.21.14). +% +\subsubsection*{Quadratic transformations} +$q$-Laguerre polynomials $L_n^\al(x;q)$ with $\al=\pm\half$ are +related to discrete $q$-Hermite II polynomials $\wt h_n(x;q)$: +\begin{align} +L_n^{-1/2}(x^2;q^2)&= +\frac{(-1)^n q^{2n^2-n}}{(q^2;q^2)_n}\,\wt h_{2n}(x;q), +\label{38}\\ +xL_n^{1/2}(x^2;q^2)&= +\frac{(-1)^n q^{2n^2+n}}{(q^2;q^2)_n}\,\wt h_{2n+1}(x;q). +\label{39} +\end{align} +These follows from \eqref{28} and \eqref{29}, respectively, by applying +the equalities given in the Remarks at the end of \S14.20 and \S14.28. +% +\subsection*{14.27 Stieltjes-Wigert} +\label{sec14.27} +% +\subsubsection*{An alternative weight function} +The formula on top of p.547 should be corrected as +\begin{equation} +w(x)=\frac\ga{\sqrt\pi}\,x^{-\half}\exp(-\ga^2\ln^2 x),\quad x>0,\quad +{\rm with}\quad\ga^2=-\,\frac1{2\ln q}\,. +\label{94} +\end{equation} +For $w$ the weight function given in \mycite{Sz}{\S2.7} the \RHS\ of \eqref{94} +equals $\const w(q^{-\half}x)$. See also +\mycite{DLMF}{\S18.27(vi)}. +% +\subsection*{14.28 Discrete $q$-Hermite I} +\label{sec14.28} +% +\paragraph{History} +Discrete $q$ Hermite I polynomials (not yet with this name) first occurred in +Hahn \myciteKLS{261}, see there p.29, case V and the $q$-weight $\pi(x)$ given by +the second expression on line 4 of p.30. However note that on the line on p.29 dealing with +case V, one should read $k^2=q^{-n}$ instead of $k^2=-q^n$. Then, with the indicated +substitutions, \myciteKLS{261}{(4.11), (4.12)} yield constant multiples of +$h_{2n}(q^{-1}x;q)$ and $h_{2n+1}(q^{-1}x;q)$, respectively, + due to the quadratic transformations \eqref{28}, \eqref{29} together with (4.20.1). +% +\subsection*{14.29 Discrete $q$-Hermite II} +\label{sec14.29} +% +\paragraph{Basic hypergeometric representation}(see (14.29.1)) +\begin{equation} +\wt h_n(x;q)=x^n\,\qhyp21{q^{-n},q^{-n+1}}0{q^2,-q^2 x^{-2}}. +\label{143} +\end{equation} +% +\renewcommand{\refname}{Standard references} +\begin{thebibliography}{999999} +\label{sec_ref1} +% +\mybibitem{AAR} +G. E. Andrews, R. Askey and R. Roy, +{\em Special functions}, +Cambridge University Press, 1999. +% +\mybibitem{DLMF} +{\em NIST Handbook of Mathematical Functions}, +Cambridge University Press, 2010;\\ +{\em DLMF, Digital Library of Mathematical Functions}, +\url{http://dlmf.nist.gov}. +% +\mybibitem{GR} +G.~Gasper and M.~Rahman, +{\em Basic hypergeometric series}, 2nd edn., +Cambridge University Press, 2004. +% +\mybibitem{HTF1} +A. Erd\'elyi, +{\em Higher transcendental functions, Vol. 1}, +McGraw-Hill, 1953. +% +\mybibitem{HTF2} +A. Erd\'elyi, +{\em Higher transcendental functions, Vol. 2}, +McGraw-Hill, 1953. +% +\mybibitem{Ism} +M. E. H. Ismail, +{\em Classical and quantum orthogonal polynomials in one variable}, +Cambridge University Press, 2005; reprinted and corrected, 2009. +% +\mybibitem{KLS} +R. Koekoek, P.~A. Lesky and R.~F. Swarttouw, +{\em Hypergeometric orthogonal polynomials and their $q$-analogues}, +Springer-Verlag, 2010. +% +\mybibitem{Sz} +G. Szeg{\H{o}}, +{\em Orthogonal polynomials}, +Colloquium Publications 23, +American Mathematical Society, Fourth Edition, 1975. +% +\end{thebibliography} +% +\renewcommand{\refname}{References from Koekoek, Lesky \& Swarttouw} +\begin{thebibliography}{999} +\label{sec_ref2} +% +\mybibitemKLS{24} +W. A. Al-Salam and M. E. H. Ismail, +{\em Orthogonal polynomials associated with the Rogers-Ramanujan continued fraction}, +Pacific J. Math. 104 (1983), 269--283. +% +\mybibitemKLS{46} +R. Askey, +{\em Orthogonal polynomials and special functions}, +CBMS Regional Conference Series, Vol.~21, SIAM, 1975. +% +\mybibitemKLS{51} + R. Askey, +{\em Beta integrals and the associated orthogonal polynomials}, +in: {\em Number theory, Madras 1987}, +Lecture Notes in Mathematics 1395, Springer-Verlag, 1989, pp. 84--121. +% +\mybibitemKLS{63} +R. Askey and M. E. H. Ismail, +{\em A generalization of ultraspherical polynomials}, +in: {\em Studies in Pure Mathematics}, +Birkh\"auser, 1983, pp. 55--78. +% +\mybibitemKLS{64} +R. Askey and M. E. H. Ismail, +{\em Recurrence relations, continued fractions, and orthogonal polynomials}, +Mem. Amer. Math. Soc. 49 (1984), no. 300. +% +\mybibitemKLS{72} +R. Askey and J. A. Wilson, +{\em Some basic hypergeometric orthogonal polynomials that generalize Jacobi polynomials}, +Mem. Amer. Math. Soc. 54 (1985), no. 319. +% +\mybibitemKLS{79} +N. M. Atakishiyev and A. U. Klimyk, +{\em On $q$-orthogonal polynomials, dual to little and big +$q$-Jacobi polynomials}, +J. Math. Anal. Appl. 294 (2004), 246--257. +% +\mybibitemKLS{91} +W. N. Bailey, +{\em The generating function of Jacobi polynomials}, +J. London Math. Soc. 13 (1938), 8--12. +% +\mybibitemKLS{109} +F. Brafman, +{\em Generating functions of Jacobi and related polynomials}, +Proc. Amer. Math. Soc. 2 (1951), 942--949. +% +\mybibitemKLS{146} +T. S. Chihara, +{\em An introduction to orthogonal polynomials}, Gordon and Breach, 1978; +reprinted Dover Publications, 2011. +% +\mybibitemKLS{161} +Ph. Delsarte, {\em Association schemes and $t$-designs in regular +semilattices}, J. Combin. Theory Ser. A 20 (1976), 230--243. +% +\mybibitemKLS{186} +C. F. Dunkl, +{\em An addition theorem for some $q$-Hahn polynomials}, +Monatsh. Math. 85 (1977), 5--37. +% +\mybibitemKLS{234} +G. Gasper and M. Rahman, +{\em Positivity of the Poisson kernel for the continuous +$q$-ultraspherical polynomials}, +SIAM J. Math. Anal. 14 (1983), 409--420. +% +\mybibitem{236} + G. Gasper and M. Rahman, +{\em Positivity of the Poisson kernel for the continuous $q$-Jacobi +polynomials and some quadratic transformation formulas for basic +hypergeometric series}, +SIAM J. Math. Anal. 17 (1986), 970--999. +% +\mybibitemKLS{261} +W. Hahn, +{\em \"Uber Orthogonalpolynome, die $q$-Differenzengleichungen gen\"ugen}, +Math. Nachr. 2 (1949), 4--34. +% +\mybibitemKLS{281} +M. E. H. Ismail, J. Letessier, G. Valent and J. Wimp, +{\em Two families of associated Wilson polynomials}, +Canad. J. Math. 42 (1990), 659--695. +% +\mybibitemKLS{298} +M. E. H. Ismail and J. A. Wilson, +{\em Asymptotic and generating relations for the $q$-Jacobi and +${}_4 \phi_3$ polynomials}, +J. Approx. Theory 36 (1982), 43--54. +% +\mybibitemKLS{322} +T. Koornwinder, +{\em Jacobi polynomials III. Analytic proof of the addition formula}, +SIAM J. Math. Anal. 6 (1975) 533--543. +% +\mybibitemKLS{342} +T. H. Koornwinder, +{\em Meixner-Pollaczek polynomials and the Heisenberg algebra}, +J. Math. Phys. 30 (1989), 767--769. +% +\mybibitemKLS{343} +T. H. Koornwinder, +{\em Representations of the twisted $SU(2)$ quantum group and some +$q$-hypergeometric orthogonal polynomials}, Indag. Math. 51 (1989), 97--117. +% +\mybibitemKLS{351} +T. H. Koornwinder, +{\em The structure relation for Askey-Wilson polynomials}, +J.~Comput.\ Appl.\ Math.\ 207 (2007), 214--226; {\tt arXiv:math/0601303v3}. +% +\mybibitemKLS{382} +P. A. Lesky, +{\em Endliche und unendliche Systeme von kontinuierlichen klassischen Orthogonalpolynomen}, +Z. Angew. Math. Mech. 76 (1996), 181--184. +% +\mybibitemKLS{384} + P. A. Lesky, +{\em Einordnung der Polynome von Romanovski-Bessel in das Askey-Tableau}, +Z.~Angew. Math. Mech. 78 (1998), 646--648. +% +\mybibitemKLS{406} +J. Meixner, +{\em Orthogonale Polynomsysteme mit einer besonderen Gestalt der erzeugenden Funktion}, +J. London Math. Soc. 9 (1934), 6--13. +% +\mybibitemKLS{416} +A. F. Nikiforov, S. K. Suslov and V. B. Uvarov, +{\em Classical orthogonal polynomials of a discrete variable}, +Springer-Verlag, 1991. +% +\mybibitemKLS{449} +M. Rahman, +{\em Some generating functions for the associated Askey-Wilson polynomials}, +J.~Comput. Appl. Math. 68 (1996), 287--296. +% +\mybibitemKLS{463} +V. Romanovski, +{\em Sur quelques classes nouvelles de polyn\^omes orthogonaux}, +C. R. Acad. Sci. Paris 188 (1929), 1023--1025. +% +\mybibitemKLS{471} +L. J. Slater, +{\em Generalized hypergeometric functions}, Cambridge University Press, 1966. +% +\mybibitemKLS{485} +D. Stanton, +{\em A short proof of a generating function for Jacobi polynomials}, +Proc. Amer. Math. Soc. 80 (1980), 398--400. +% +\mybibitemKLS{488} +D. Stanton, +{\em Orthogonal polynomials and Chevalley groups}, +in: {\em Special functions: group theoretical aspects and applications}, +Reidel, 1984, pp. 87-128. +% +\mybibitemKLS{513} +J. A. Wilson, +{\em Asymptotics for the ${}_4F_3$ polynomials}, +J. Approx. Theory 66 (1991), 58--71. +% +\end{thebibliography} +% +\makeatletter +\renewcommand\@biblabel[1]{[K#1]} +\makeatother +% +\renewcommand{\refname}{Other references} +\begin{thebibliography}{999} +\label{sec_ref3} +% +% +\bibitem{K16} +R. Askey, +{\em Ramanujan's extensions of the gamma and beta functions}, +Amer. Math. Monthly 87 (1980), 346--359. +% +\bibitem{K2} +R. Askey and J. Fitch, +{\em Integral representations for Jacobi polynomials and some applications}, +J. Math. Anal. Appl. 26 (1969), 411--437. +% +\bibitem{K24} +M. N. Atakishiyev and V. A. Groza, +{\em The quantum algebra $U_q(su_2)$ and $q$-Krawtchouk families of +polynomials}, +J. Phys. A 37 (2004), 2625--2635. +% +\bibitem{K18} +M. Atakishiyeva and N. Atakishiyev, +{\em On discrete $q$-extensions of Chebyshev polynomials}, +Commun. Math. Anal. 14 (2013), 1--12. +% +\bibitem{K27} +S. Belmehdi, +{\em Generalized Gegenbauer orthogonal polynomials}, +J. Comput. Appl. Math. 133 (2001), 195--205. +% +\bibitem{K5} +Y. Ben Cheikh and M. Gaied, +{\em Characterization of the Dunkl-classical symmetric orthogonal polynomials}, +Appl. Math. Comput. 187 (2007), 105--114. +% +\bibitem{K19} +J. Cigler, +{\em A simple approach to $q$-Chebyshev polynomials}, +{\tt arXiv:1201.4703v2 [math.CO]}, 2012. +% +\bibitem{K23} +Ph. Delsarte, +{\em Properties and applications of the recurrence +$F(i+1,k+1,n+1)=q^{k+1}F(i,k+1,n)-q^{k}F(i,k,n)$}, +SIAM J. Appl. Math. 31 (1976), 262--270. +% +\bibitem{K26} +C. F. Dunkl and Y. Xu, +{\em Orthogonal polynomials of several variables}, +Cambridge University Press, 2014, second ed. +% +\bibitem{K3} +E. Feldheim, +{\em Relations entre les polynomes de Jacobi, Laguerre et Hermite}, +Acta Math. 75 (1942), 117--138. +% +\bibitem{K21} +W. Gautschi, +{\em On mean convergence of extended Lagrange interpolation}, +J. Comput. Appl. Math. 43 (1992), 19--35. +% +\bibitem{K25} +V. X. Genest, S. Post, L. Vinet, G.-F. Yu and A. Zhedanov, +{\em $q$-Rotations and Krawtchouk polynomials}, +arXiv:1408.5292v2 [math-ph], 2014. +% +\bibitem{K28} +V. X. Genest, L. Vinet and A. Zhedanov, +{\em A "continuous" limit of the Complementary Bannai-Ito polynomials: +Chihara polynomials}, +SIGMA 10 (2014), 038, 18 pp.; arXiv:1309.7235v3 [math.CA]. +% +\bibitem{K29} +V. Gorin and G. Olshanski, +{\em A quantization of the harmonic analysis on the infinite-dimensional +unitary group}, +\href{http://arxiv.org/abs/1504.06832}{arXiv:1504.06832}v1 [math.RT], 2015. +% +\bibitem{K1} +M. J. Gottlieb, +{\em Concerning some polynomials orthogonal on a finite or enumerable set of points}, +Amer. J. Math. 60 (1938), 453--458. +% +\bibitem{K14} +W. Groenevelt and E. Koelink, +{\em The indeterminate moment problem for the $q$-Meixner polynomials}, +J. Approx. Theory 163 (2011), 836--863. +% +\bibitem{K11} +K. Jordaan and F. To\'okos, +{\em Orthogonality and asymptotics of Pseudo-Jacobi polynomials for + non-classical parameters}, +J. Approx. Theory 178 (2014), 1--12. +% +\bibitem{K7} +T. H. Koornwinder, {\em Askey-Wilson polynomial}, Scholarpedia 7 (2012), no.~7, +7761;\\ + \url{http://www.scholarpedia.org/article/Askey-Wilson_polynomial}. +% +\bibitem{K17} +T. H. Koornwinder, +{$q$-Special functions, a tutorial}, +{\tt arXiv:math/9403216v2 [math.CA]}, 2013. + % + \bibitem{K10} + N. N. Leonenko and N. \v{S}uvak, +{\em Statistical inference for student diffusion process}, +Stoch. Anal. Appl. 28 (2010), 972--1002. +% +\bibitem{K22} +J. C. Mason, +{\em Chebyshev polynomials of the second, third and fourth kinds in +approximation, indefinite integration, and integral transforms}, +J. Comput. Appl. Math. 49 (1993), 169--178. +% +\bibitem{K20} +J. C. Mason and D. Handscomb, +{\em Chebyshev polynomials}, +Chapman \& Hall / CRC, 2002. +% +\bibitem{K9} +J. Meixner, +{\em Umformung gewisser Reihen, deren Glieder Produkte hypergeometrischer +Funktionen sind}, +Deutsche Math. 6 (1942), 341--349. +% +\bibitem{K4} +N. Nielsen, +{\em Recherches sur les polyn\^omes d' Hermite}, +Kgl. Danske Vidensk. Selsk. Math.-Fys. Medd. I.6, K\o benhavn, 1918. +% +\bibitem{K12} +J. Peetre, +{\em Correspondence principle for the quantized annulus, Romanovski polynomials, +and Morse potential}, +J. Funct. Anal. 117 (1993), 377--400. +% +\bibitem{K8} +H. Rosengren, +{\em Multivariable orthogonal polynomials and coupling coefficients for +discrete series representations}, +SIAM J. Math. Anal. 30 (1999), 233--272. +% +\bibitem{K13} +E. J. Routh, +{\em On some properties of certain solutions of a differential equation of the second order}, +Proc. London Math. Soc. 16 (1885), 245--261. +% +\bibitem{K6} +J. A. Shohat and J. D. Tamarkin, +{\em The problem of moments}, +American Mathematical Society, 1943. +% +\bibitem{K15} +L. J. Slater, +{\em General transformations of bilateral series}, +Quart. J. Math., Oxford Ser. (2) 3 (1952), 73--80. +% +%until K29 +\end{thebibliography} +\quad\\ +\begin{footnotesize} +\begin{quote} +{T. H. Koornwinder, Korteweg-de Vries Institute, University of Amsterdam,\\ +P.O.\ Box 94248, 1090 GE Amsterdam, The Netherlands; + +\vspace{\smallskipamount} +email: }{\tt T.H.Koornwinder@uva.nl} +\end{quote} +\end{footnotesize} +\end{document} \ No newline at end of file diff --git a/KLSadd_insertion/data/KoLeSw.pdf b/KLSadd_insertion/data/KoLeSw.pdf new file mode 100644 index 0000000..ac31ef6 Binary files /dev/null and b/KLSadd_insertion/data/KoLeSw.pdf differ diff --git a/KLSadd_insertion/src/FileChangerLatex.py b/KLSadd_insertion/src/FileChangerLatex.py new file mode 100644 index 0000000..6fe754e --- /dev/null +++ b/KLSadd_insertion/src/FileChangerLatex.py @@ -0,0 +1,64 @@ +""" +Rahul Shah +11/20/15 +FileChangerLatex.py +Reads in from KLSadd.tex, finds places to be changed and adds +to end of section +""" + +__author__ = "Rahul Shah" +__status__ = "Development" + +# Open the document to be read +# Figure out which chapter to read + +subsection = "" +a = -1 +chapter = "" +chapters = [] +with open("KLSadd.tex", "rb") as file: + for line in file: + # finds all mentions of subsections in KLSadd + # used to determine chapter number + # tests every subsection to find if it has a number + # eliminates Introduction, etc + chapter = "" + subsection = "" + toCopy = False + if "\\subsection*{" in line: + # finds the subsection and subsubsections + for word in line: + try: + chapter += str(int(word)) + except ValueError: + a = -1 + + if word == ".": + chapter += "." + + if chapter is not "": + chapters.append(chapter) + # END OF LOOP why can't I have nice brackets like java :( + """ + list contains all of the subsections. Begin chapter file searching + """ + words = "" + for line2 in file: + words += line2 + + print(words) + numFile = "" + fileList = [] + for s in chapters: + numFile = "" + if ("." in s[0:2]): + numFile = s[0] + else: + numFile = s[0:2] + fileList.append(int(numFile)) + + # numFile now contains the right number of the file to access + # stored in fileList + + file.close() +# end of FileChangerLatex.py diff --git a/KLSadd_insertion/src/__init__.py b/KLSadd_insertion/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/KLSadd_insertion/src/linetest.py b/KLSadd_insertion/src/linetest.py new file mode 100644 index 0000000..b86133b --- /dev/null +++ b/KLSadd_insertion/src/linetest.py @@ -0,0 +1,161 @@ +""" +Written by Rahul Shah +Outdated project in terms of function, now that updateChapters does what it does and more + Kept for reference +""" + +entireFile = "" +subsections = [] +index = 0 +headings = [] +sections = [] +mathPeople = [] +newCommands = [] +name = "" +temp = "" +with open("KLSadd.tex", "r") as file: + entireFile = file.readlines() + for word in entireFile: + index+=1 + if("smallskipamount" in word): + newCommands.append(index-1) + if("mybibitem[1]" in word): + newCommands.append(index) + #1/27/16 RS added \large\bf KLSadd: to make KLSadd additions appear like the other paragraphs + if("paragraph{" in word): + temp = word[0:word.find("{")+ 1] + "\large\\bf KLSadd: " + word[word.find("{")+ 1: word.find("}")+1] + entireFile[entireFile.index(word): entireFile.index(word)+1] = temp + if("\\subsection*{" in word and "." in word): + subsections.append(index) + headings.append(word) + name = word[word.find(" ")+1:word.find("}")] + mathPeople.append(name) + name = "" + #1/29/16 get all of the new commands + comms = ''.join(entireFile[newCommands[0]:newCommands[1]]) + paras = [] + for i in range(len(subsections)-1): + str = ''.join(entireFile[subsections[i]: subsections[i+1]-1]) + paras.append(str) + sec = "" + for f in headings: + for i in f: + try: + int(i) + sec += i + except: + pass + if("." in i): + sec+=i + sections.append(sec) + + sec = "" + #sections now holds all sections + + numFile = "" + filenums = [] + for s in sections: + numFile = "" + if("." in s[0:2]): + numFile = s[0] + else: + numFile = s[0:2] + filenums.append(int(numFile)) + #filenums now has the file numbers like 1,9,14,etc + + #SO python is nothing like java, I have to read in the entire chapter + #file and then change it and THEN put it back into the chapter file + + #chapter 9 + with open("tempchap9.tex", "r") as ch9: + entire9 = ch9.readlines() + ch9.close() + #chapter 14 + with open("tempchap14.tex", "r") as ch14: + entire14 = ch14.readlines() + ch14.close() + + references9 = [] + footmiscIndex = 0 + index = 0 + beginIndex9= -1 + #now I have a list of the names, only store indices + #of the paragraph if its in a section with these names + #TODO make a method to do this + canAdd = False + for word in entire9: + index+=1 + if("begin{document}" in word): + beginIndex9 += index + if("footmisc" in word): + footmiscIndex+= index + #need to check subsection and section because + #KLSadd also fixes some subsections + if("section{" in word or "subsection*{" in word): + w = word[word.find("{")+1:word.find("}")] + if(w in mathPeople): + canAdd = True + if("\\subsection*{References}" in word and canAdd == True): + references9.append(index) + canAdd = False + canAdd = False + references14 = [] + index = 0 + footmiscIndex14 = 0 + beginIndex14 = -1 + for word in entire14: + index+=1 + if("begin{document}" in word): + beginIndex14 += index + if("footmisc" in word): + footmiscIndex14+= index + #need to check subsection and section because + #KLSadd also fixes some subsections + if("section{" in word or "subsection*{" in word): + w = word[word.find("{")+1:word.find("}")] + if(w in mathPeople): + canAdd = True + if("\\subsection*{References}" in word and canAdd == True): + references14.append(index) + canAdd = False + #references9 is now full of indexes to put fixed paragraphs + + #TODO make into a method + with open("newtempchap09.tex", "w") as temp9: + count = 0 + + #1/29/16 add hyperref, xparse, cite packages after the footmisc package + entire9[footmiscIndex] += "\\usepackage[pdftex]{hyperref} \n\\usepackage {xparse} \n\\usepackage{cite} \n" + #1/29/16 add in the newcommands from KLSadd.tex + entire9[beginIndex9-1] += comms + #1/27/16 add \large\bf KLSadd: after every paragraph{ + for i in references9: + entire9[i-3] += "% RS: add begin" + entire9[i-3] += paras[count] + entire9[i-3] += "% RS: add end" + count+=1 + entire9[i-1] += paras[count] + + + str = ''.join(entire9) + temp9.write(str) + + + + #works, as far as I know, huzzah + #references14 is now full of indexes to put fixed paragraphs + with open("newtempchap14.tex", "w") as temp14: + entire14[footmiscIndex14] += "\\usepackage[pdftex]{hyperref} \n\\usepackage {xparse} \n\\usepackage{cite} \n" + entire14[beginIndex14 -3] += comms + for i in references14: + entire14[i-3] += " RS: add begin" + entire14[i-3] += paras[count] + #entire14[i-3] += "% RS: add end" + count+=1 + str = ''.join(entire14) + temp14.write(str) + + + + + diff --git a/KLSadd_insertion/src/updateChapters.py b/KLSadd_insertion/src/updateChapters.py new file mode 100644 index 0000000..22c6a85 --- /dev/null +++ b/KLSadd_insertion/src/updateChapters.py @@ -0,0 +1,741 @@ +import os + +__author__ = "Rahul Shah" +__status__ = "Development" +__credits__ = ["Rahul Shah", "Edward Bian"] + +# Path to data directory +DATA_DIR = os.path.dirname(os.path.realpath(__file__)) + "/../data/" + +# holds all subsections in each chapter section along with the what holds + +# w, h = 2, 100 +# sorter_check = [[0 for _ in range(w)] for __ in range(h)] + + +def bracket_finder(word_to_search): + """ + :param word_to_search: + :return: The string between the first set of brackets + """ + # This function is mainly for convenience and layered brackets + first_bracket = True; + first_bracket_location = 0; + last_bracket_location = 0; + layers = 0; + counter = 0; + for character_examined in word_to_search: + if character_examined == "{" and first_bracket == True: + first_bracket_location = word_to_search.index(character_examined) + first_bracket = False; + elif character_examined == "{" and first_bracket != True: + layers += 1; + elif character_examined == "}": + if layers == 0: + last_bracket_location = counter + else: + layers -= 1 + counter += 1 + # Goes through every character while recording layer to not extract the wrong string + word_to_search2 = word_to_search[first_bracket_location + 1:last_bracket_location] + for character_examined in word_to_search2: + if character_examined.isalpha(): + first_char = word_to_search2.index(character_examined) + return word_to_search2[first_char:] + # This loop is for chapter sections that may start with numbers or other symbols, it makes the output start on the section name + return word_to_search[first_bracket_location+1:last_bracket_location] + + +def chap_1_placer(chap1, kls, klsaddparas, cp1commands): + """ + :param chap1: Chapter 1 text file + :param kls: KLSadd, the addendum + :param klsaddparas: Paragraphs that the code has identified to be sorted + :return: Returns chapter 1 with the sections inserted into the right places from the introduction of KLSadd + It's bascially a modified version of fix_chapter_sort + """ + + + chapter_start = True + index = 0 + kls_sub_chap1 = [] + kls_header_chap1 = [] + for item in kls: + index += 1 + line = str(item) + if "\\subsection" in line: + temp = bracket_finder(line) + if chapter_start and ("\\paragraph{" in line or "\\subsubsection*{" in line): + for item in klsaddparas: + if index < item: + klsloc = klsaddparas.index(item) + break + t = ''.join(kls[index-1: klsaddparas[klsloc]]) + kls_sub_chap1.append(t) # append the whole paragraph, every paragraph should end with a % comment + kls_header_chap1.append(temp) # append the name of subsection + + break + intro_to_add = ''.join(kls_sub_chap1) + chap1 = chap1[:len(chap1)-1] + commentticker = 0 + + # These commands mess up PDF reading and mus tbe commented out + for line in cp1commands: + prev_line = cp1commands[cp1commands.index(line) - 1] + if "\\newcommand{\qhypK}[5]{\,\mbox{}_{#1}\phi_{#2}\!\left(" not in prev_line: + if "\\newcommand\\half{\\frac12}" in line: + linetoadd = "%" + line + cp1commands[commentticker] = linetoadd + + elif "\\newcommand{\\hyp}[5]{\\,\\mbox{}_{#1}F_{#2}\\!\\left(" in line: + linetoadd = "%" + line + cp1commands[commentticker] = linetoadd + + elif "\\genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}" in line: + linetoadd = "%" + line + cp1commands[commentticker] = linetoadd + + elif "\\newcommand{\\qhyp}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(" in line: + linetoadd = "%" + line + cp1commands[commentticker] = linetoadd + + commentticker += 1 + if "\\newpage" in line and "\hbox{}" not in line: + chap1[chap1.index(line)] = "" + if '\myciteKLS' in line: + linetoadd = line.replace('\myciteKLS', '\cite') + cp1commands[commentticker] = linetoadd + + cp1commandsstring = ''.join(cp1commands) + index = 0 + for word in chap1: + index += 1 + if "\\newcommand" in chap1[index]: + chap1[index - 1] = cp1commandsstring + break + ticker1 = 0 + # Formatting to make the Latex file run + while ticker1 < len(chap1): + if '\\myciteKLS' in chap1[ticker1]: + chap1[ticker1] = chap1[ticker1].replace('\\myciteKLS', '\\cite') + ticker1 += 1 + + chap1 = ''.join(chap1) + total_chap1 = chap1 + "\\paragraph{\\bf KLS Addendum: Generalities}" + intro_to_add + "\\end{document}" + + return total_chap1 + + +def extraneous_section_deleter(entered_list): + """ + Removes sections that are irrelevant and will slow or confuse the program + + :param entered_list: List of paragraphs + :return: Extraneous name free output + """ + # Returns the sections with unique names (per section) (as the following are often duplicated) + return [item for item in entered_list if "reference" not in item.lower() and "limit relation" not in item.lower() + and "symmetry" not in item.lower() and " hypergeometric representation" not in item.lower()] + + +def new_keywords(kls, kls_list): + """ + This section checks through the Addendum and identifies words that are valid keywords of sections + It then takes that list and removes duplicates, as well as printing the output to another file. + + :param kls: The addendum that provides the words. + :param kls_list: List of identified keywords. + :return: Outputs results as a list + """ + + kls_list_chap = [] + for item in kls: + if "paragraph{" in item or "subsubsection*{" in item: + kls_list.append(item[item.find("{") + 1: len(item) - 2]) + kls_list = extraneous_section_deleter(kls_list) + + kls_list.append("Limit Relation") + for item in kls_list: + if item not in kls_list_chap: + kls_list_chap.append(item) + #Preserves original kls_list, while allowing editting (special value is classed under symmetry) + kls_list_chap[kls_list_chap.index("Special value")] = "Symmetry" + kls_list_chap.append("Special value") + w = 2 + h = len(kls_list_chap)+1 + #sorter_check tells the program which chapter the code is on and how many sections under a keyword have been sorted. + sorter_check = [[0 for _ in range(w)] for __ in range(h)] + return kls_list_chap, sorter_check + + +def fix_chapter_sort(kls, chap, word, sortloc, klsaddparas, sortmatch_2, tempref, sorter_check): + """ + This function sorts through the input files and identifies and places sections from the addendum after their + respective subsections in the chapter. + + :param kls: The addendum where the sections to be inserted are found. + :param chap: The destination of inserted sections. + :param word: The keyword that is being processed. + :param sortloc: The location in the list of words, of the word being sorted. + :param klsaddparas: Locations of possible sections + :param sortmatch_2: Subsections that the program finds a match for in the chapter (a list of those that will be sorted) + :return: This function outputs the processed chapter into a larger function for further processing. + """ + hyper_headers_chap = [] + hyper_subs_chap = [] + + + special_input = 0 + name_chap = word.lower() + if name_chap == "orthogonality": + special_input = 1 + elif name_chap == "special value": + special_input = 2 + elif name_chap == "symmetry": + special_input = 3 + elif name_chap == "bilateral generating function": + special_input = 4 + #These sections either share names with others or are categorized under others, so they must be processed specially + + khyper_header_chap = [] + k_hyper_sub_chap = [] + index = 0 + + chapterstart = False + for item in kls: + index += 1 + line = str(item) + if "\\subsection" in line: + temp = bracket_finder(line) + if temp.lower() == 'wilson': + chapterstart = True + if special_input in (0, 2, 4) and name_chap in line.lower() and chapterstart and ("\\paragraph{" in line or "\\subsubsection*{" in line) or \ + (special_input in (1, 3) and "orthogonality relation" not in line.lower() and name_chap in line.lower() and chapterstart + and ("\\paragraph{" in line or "\\subsubsection*{" in line)): + for item in klsaddparas: + if index < item: + klsloc = klsaddparas.index(item) + break + t = ''.join(kls[index: klsaddparas[klsloc]]) + k_hyper_sub_chap.append(t) # append the whole paragraph, pray every paragraph ends with a % comment + khyper_header_chap.append(temp) # append the name of subsection + + for item in khyper_header_chap: + if item == "Pseudo Jacobi (or Routh-Romanovski)": + khyper_header_chap[khyper_header_chap.index(item)] = "Pseudo Jacobi" + k_hyp_index_iii = 0 + offset = 0 + + item = 0 + while item < len(khyper_header_chap): + try: + if khyper_header_chap[item] == khyper_header_chap[item + 1] and "generating functions" in name_chap: + k_hyper_sub_chap[item + 1] = k_hyper_sub_chap[item] + "\paragraph{\\bf KLS Addendum: Bilateral generating functions}" + k_hyper_sub_chap[item + 1] + khyper_header_chap[item] = "/x00" + k_hyper_sub_chap[item] = "/x00" + #/x00 is a filler character that must be unique, it can be changed, as long as the replacement isn't ever going to be an actual section + elif khyper_header_chap[item] == khyper_header_chap[item+1]: + k_hyper_sub_chap[item + 1] = k_hyper_sub_chap[item] + "\paragraph{\\bf KLS Addendum: " + \ + word + "}" + k_hyper_sub_chap[item + 1] + khyper_header_chap[item] = "/x00" + k_hyper_sub_chap[item] = "/x00" + else: + item += 1 + except IndexError: + item += 1 + + temp_counter = 0 + while temp_counter < len(khyper_header_chap): + if khyper_header_chap[temp_counter] == "/x00": + del khyper_header_chap[temp_counter] + del k_hyper_sub_chap[temp_counter] + else: + temp_counter += 1 + + chap9 = 0 + + if sorter_check[sortloc][0] == 0: + sorter_check[sortloc][0] += 1 + chap9 = 1 + else: + offset = sorter_check[sortloc][1] + # if special_input == 1: + # offset = 8 + + if special_input in (2, 3): + name_chap = 'hypergeometric representation' + + + # Uses of numbers like 12, or 9 are for specific lengths of strings (like \\subsection{) where the + # section does not change + ''' + ''' + for d in range(0, len(tempref)): # check every section and subsection line + item = tempref[d] + line = str(chap[item]) + if "\\section{" in line or "\\subsection{" in line: + if "\\subsection{" in line: + temp = bracket_finder(line) + else: + temp = bracket_finder(line) + + if name_chap in line.lower(): + if special_input in (0, 2, 3, 4) or "orthogonality relation" not in line: + hyper_subs_chap.append([tempref[d + 1]]) # appends the index for the line before following subsection + hyper_headers_chap.append(temp) # appends the name of the section the hypergeo subsection is in + ''' + Section below should + ''' + counteri = 0 + for i in khyper_header_chap: + i = i.replace(' I','~I') + khyper_header_chap[counteri] = i + counteri += 1; + + if temp in khyper_header_chap: + try: + chap[tempref[d + 1] - 1] += "\paragraph{\\bf KLS Addendum: " + word + "}" + \ + k_hyper_sub_chap[k_hyp_index_iii + offset] + if chap9 == 1: + sorter_check[sortloc][1] += 1 + k_hyp_index_iii += 1 + with open(DATA_DIR + "shiftedsections.tex", "a") as shifted: + shifted.write("KLS Addendum: " + word + " to " + temp + "\n") + except IndexError: + print chap[tempref[d+1] - 1] + print + print("Warning! Code has found an error involving section finding for '" + name_chap + "'.") + + if len(hyper_headers_chap) != 0: + sortmatch_2.append(k_hyper_sub_chap) + return chap + + +def cut_words(word_to_find, word_to_search_in): + """ + This function checks through the outputs of later sections and removes duplicates, so that the output file does + not have duplicates. + + :param word_to_find: Word that is being found + :param word_to_search_in: The big word that is being searched + :return: The big word without the word that was searched for + """ + find_string = word_to_find + search_string = word_to_search_in + precheck = 1 + if find_string in search_string: + if "\\paragraph{\\bf KLS Addendum: " in search_string or "\\subsubsection*{\\bf KLS Addendum: " in search_string: + while True: + if "\\paragraph{\\bf KLS Addendum: " in search_string[search_string.find(find_string)-precheck:search_string.find(find_string)] or \ + "\\subsubsection*{\\bf KLS Addendum: " in search_string[search_string.find(find_string) - precheck:search_string.find(find_string)]: + return search_string[:search_string.find(find_string) - precheck] + search_string[search_string.find(find_string) + len(find_string):] + else: + precheck += 1 + + else: + cut = search_string[:search_string.find(find_string)] + search_string[search_string.find(find_string) + len(find_string):] + return cut + else: + return search_string + + +def prepare_for_pdf(chap): + """ + Edits the chapter string sent to include hyperref, xparse, and cite packages + + :param chap: The chapter (9 or 14) that is being processed as a list of lines in each LaTeX chapter + :return: The processed chapter, ready for additional processing + """ + + # (list) -> list + foot_misc_index = 0 + for i, line in enumerate(chap): + if "footmisc" in line: + foot_misc_index += i + 1 + + chap.insert(foot_misc_index, "\\usepackage[pdftex]{hyperref} \n\\usepackage {xparse} \n\\usepackage{cite} \n") + #This is so things generate correctly + return chap + + +def get_commands(kls, new_commands): + """ + This method reads in relevant commands that are in KLS Addendum.tex and returns them as a list + + :param kls: The addendum is the source of what is being found + :return: + """ + index = 0 + for word in kls: + index += 1 + if "smallskipamount" in word: + new_commands.append(index - 1) + if "mybibitem[1]" in word: + new_commands.append(index) + return kls[new_commands[0]:new_commands[1]] + #Addendum needs these to generate correctly + + + +def insert_commands(kls, chap, commands): + """ + Inserts commands identified in previous functions. + This method addresses the goal of hardcoding in the necessary comma vnds to let the chapter files run as pdf's. + Currently only works with chapter 9 + + :param kls: Addendum to look through + :param chap: The chapter that is receiving commands (9 or 14) as a list of lines in each LaTeX chapter + :param commands: Commands to be inserted + :return: chap, processed + """ + # reads in the newCommands[] and puts them in chap + begin_index = -1 # the index of the "begin document" keyphrase, this is where the new commands need to be inserted. + # find index of begin document in KLS Addendum + index = 0 + + for word in kls: + index += 1 + if "begin{document}" in word: + begin_index += index + temp_index = 0 + + for i in commands: + chap.insert(begin_index + temp_index, i) + temp_index += 1 + return chap + #Puts the commands in the chapter so they do something + + +def find_references(chapter, chapticker, math_people): + """ + This function searches the chapters and locates potential destinations of additions from the addendum. + It puts these destinations in a list. + + :param chapter: The chapter being searched. + :param chapticker: Which chapter is being searched (9 or 14). + :return: List of references, ref9_3 and ref14_3 are references for chapter 9 and 14 specifically + """ + ref9_3 = [] + ref14_3 = [] + references = [] + index = -1 + # chaptercheck designates which chapter is being searched for references + chaptercheck = 0 + if chapticker == 9: + chaptercheck = str(9) + elif chapticker == 14: + chaptercheck = str(14) + # canAdd tells the program whether the next section is a reference + add_next_section = False + + for word in chapter: + index += 1 + special_detector = 1 + # check sections and subsections + if("section{" in word or "subsection*{" in word) and ("subsubsection*{" not in word): + processed_word = word[word.find("{")+1: word.find("}")] + specially_formatted_word = word[word.find("{")+1: word.find("~")] + if "bessel" in word.lower() and chapticker == 9: + ref9_3.append(index) + if ("big $q$-legendre" in word.lower() or "little $q$-legendre" in word.lower() or "continuous $q$-legendre" in word.lower()) and chapticker == 14: + ref14_3.append(index) + for unit in math_people: + subunit = unit[unit.find(" ")+1: unit.find("#")] + # System of checks that verifies if section is in chapter + if (processed_word in subunit or specially_formatted_word in subunit) and (chaptercheck in unit) and len(processed_word) == len(subunit) or\ + ("Pseudo Jacobi" in processed_word and "Pseudo Jacobi (or Routh-Romanovski)" in subunit): + add_next_section = True + if chapticker == 9: + ref9_3.append(index) + elif chapticker == 14: + ref14_3.append(index) + special_detector = 0 + if "\\subsection*{References}" in word and add_next_section: + # Appends valid locations + references.append(index) + if chapticker == 9: + ref9_3.append(index) + elif chapticker == 14: + ref14_3.append(index) + add_next_section = False + #The if statement differentiates chapters 9 and 14 + if "subsection*{" in word and "References" not in word: + if chapticker == 9: + ref9_3.append(index) + elif chapticker == 14: + ref14_3.append(index) + if "\\section{" in word and special_detector == 1 and chaptercheck == "14": + w2 = word[word.find("{") + 1: word.find("}")] + if "Bessel" not in w2: + ref14_3.append(index) + + return references, ref9_3, ref14_3 + + +def reference_placer(chap, references, p, chapticker2): + """ + Places identified additions from the addendum list into the chapter list. The list returned will be turned into a + string and written into the new text document + + :param chap: LaTeX Chapter receiving the additions, with each line an element of a list. + :param references: List containing references to where subsections begin/end + :param p: List containing additions to be added. + :param chapticker2: Which chapter is being searched (9 or 14). + :return: Returns the chapter, complete with additions + """ + # count is used to represent the values in count + count = 0 + # Tells which chapter it's on + designator = 0 + if chapticker2 == 9: + designator = "9." + elif chapticker2 == 14: + designator = "14." + + for i in references: + # Place before References paragraph + word1 = str(p[count]) + if designator in word1[word1.find("\\subsection*{") + 1: word1.find("}")]: + chap[i - 2] += "%Begin KLS Addendum additions" + if "In addition to the Chebyshev poly" in p[count]: + chap[i - 2] += "\paragraph{\\bf KLS Addendum Addition}" + chap[i - 2] += p[count] + chap[i - 2] += "%End of KLS Addendum additions" + + count += 1 + else: + while designator not in word1[word1.find("\\subsection*{") + 1: word1.find("}")]: + word1 = str(p[count]) + if designator in word1[word1.find("\\subsection*{") + 1: word1.find("}")]: + chap[i - 2] += "%Begin KLS Addendum additions" + chap[i - 2] += p[count] + chap[i - 2] += "%End of KLS Addendum additions" + count += 1 + else: + count += 1 + + return chap + + + +def fix_chapter(chap, references, paragraphs_to_be_added, kls, kls_list_all, chapticker2, new_commands, klsaddparas, sortmatch_2, tempref, sorter_check): + # method to change file string(actually a list right now), returns string to be written to file + # If you write a method that changes something, it is preferred that you call the method in here + """ + Removes specific lines stopping the latex file from converting into python, as well as running the + functions responsible for sorting sections and placing the correct additions in the correct places + + :param chap: Chapter being processed. + :param references: List containing references (used in reference placer). + :param paragraphs_to_be_added: List containing additions to be added. + :param kls: The addendum that contains sections to be added (not processed). + :param kls_list_all: List of all identified keywords, fed into the chapter sorter. + :param chapticker2: Which chapter is being searched (9 or 14). + :return: entire chapter, with all other methods applied to it + """ + + sort_location = 0 + + for name in kls_list_all: + fix_chapter_sort(kls, chap, name, sort_location, klsaddparas, sortmatch_2, tempref, sorter_check) + sort_location += 1 + + for paragraph in range(len(paragraphs_to_be_added)): + for subsection in sortmatch_2: + for lines_in_subsection in subsection: + if "%" == lines_in_subsection[-2]: + lines_in_subsection = lines_in_subsection[:-3] + #print "memes" + #print c + elif "%" == lines_in_subsection[-1]: + lines_in_subsection = lines_in_subsection[:-2] + # if "Formula (9.8.15) was first obtained by Brafman" in c and "Formula (9.8.15) was first obtained by Brafman"in paragraphs_to_be_added[a]: + # print c + # print "DING" + # print paragraphs_to_be_added[a] + + paragraphs_to_be_added[paragraph] = cut_words(lines_in_subsection, paragraphs_to_be_added[paragraph]) + + reference_placer(chap, references, paragraphs_to_be_added, chapticker2) + # Reference_placer is the one that does all the work + # If anything needs to be done before commands are put in, do it here + chap = prepare_for_pdf(chap) + cms = get_commands(kls,new_commands) + chap = insert_commands(kls, chap, cms) + # The above 3 lines insert comments into the new revised chapter + # The final output (addendum + chapter) is made here + commentticker = 0 + + # These commands mess up PDF reading and mus tbe commented out + for line in chap: + prev_line = chap[chap.index(line)-1] + if "\\newcommand{\qhypK}[5]{\,\mbox{}_{#1}\phi_{#2}\!\left(" not in prev_line: + if "\\newcommand\\half{\\frac12}" in line: + linetoadd = "%" + line + chap[commentticker] = linetoadd + elif "\\newcommand{\\hyp}[5]{\\,\\mbox{}_{#1}F_{#2}\\!\\left(" in line: + linetoadd = "%" + line + chap[commentticker] = linetoadd + elif "\\genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}" in line: + linetoadd = "%" + line + chap[commentticker] = linetoadd + elif "\\newcommand{\\qhyp}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(" in line: + linetoadd = "%" + line + chap[commentticker] = linetoadd + commentticker += 1 + if "\\newpage" in line and "\hbox{}" not in line: + chap[chap.index(line)] = "" + ticker1 = 0 + # Formatting to make the Latex file run + while ticker1 < len(chap): + if '\\myciteKLS' in chap[ticker1]: + chap[ticker1] = chap[ticker1].replace('\\myciteKLS', '\\cite') + ticker1 += 1 + return chap + + +def main(klsfile, klswrite9, klswrite14, klswrite1, klsread9, klsread14, klsread1): + """ + Runs all of the other functions and outputs their results into an output file as well as putting together the list + of additions that is fed into fix_chapter. + + """ + chap_nums = [] + new_commands = [] # used to hold the indexes of the commands + + # contains the locations of things with "paragraph{" in KLSadd, these are subsections that need to be sorted + klsaddparas = [] + math_people = [] + + # Stores all keywords + kls_list_full = [] + + sortmatch_2 = [] + + # open the KLSadd file to do things with + with open(DATA_DIR + klsfile, "r") as add: + # store the file as a string + addendum = add.readlines() + kls_list_all = new_keywords(addendum, kls_list_full)[0] + # Makes sections look like other sections + sorter_check = new_keywords(addendum, kls_list_full)[1] + + for item in addendum: + addendum[addendum.index(item)] = item.replace("\\eqref{","\\eqref{KLS Addendum: ") + + for word in addendum: + if "paragraph{" in word: + lenword = len(word) - 1 + temp = word[0:word.find("{") + 1] + "\\bf KLS Addendum: " + word[word.find("{") + 1: lenword] + addendum[addendum.index(word)] = temp + if "subsubsection*{" in word: + lenword = len(word) - 1 + addendum[addendum.index(word)] = word[0:word.find("{") + 1] + "\\bf KLS Addendum: " + \ + word[word.find("{") + 1: lenword] + index = 0 + indexes = [] + + # Designates sections that need stuff added + # gets the index + startindex = 99999 + #number must be larger than all the others, thus 99999 + for word in addendum: + index += 1 + if "." in word and "\\subsection*{" in word: + if "9." in word: + chap_nums.append(9) + name = word[word.find("{") + 1: word.find("}")] + math_people.append(name + "#") + if "14." in word: + chap_nums.append(14) + name = word[word.find("{") + 1: word.find("}")] + math_people.append(name + "#") + if name == "9.1 Wilson": + #9.1 Wilson is here as it is the start of chapter 9, and where the introduction ends + startindex = addendum.index(word) + indexes.append(index-1) + if "paragraph{" in word and index > startindex-1: + klsaddparas.append(index-1) + if "subsub" in word and index > startindex-1: + klsaddparas.append(index - 1) + if "\subsection*{" in word and index > startindex-1: + klsaddparas.append(index - 1) + if "\\renewcommand{\\refname}{Standard references}" in word: + klsaddparas.append(index-1) + indexes.append(index - 1) + + # Looks for sections to sort + # now indexes holds all of the places there is a section + # using these indexes, get all of the words in between and add that to the paras[] + paras = [] + + for i in range(len(indexes)-1): + + box = ''.join(addendum[indexes[i]: indexes[i+1]-1]) + paras.append(box) + + + # paras now holds the paragraphs that need to go into the chapter files, but they need to go in the appropriate + # section(like Wilson, Racah, Hahn, etc.) so we use the mathPeople variable + # we can use the section names to place the relevant paragraphs in the right place + + # parse both files 9 and 14 as strings + + with open(DATA_DIR + klsread1, "r") as ch1: + entire1 = ch1.readlines() # reads in as a list of strings + + cp1commands = get_commands(addendum, new_commands) + with open(DATA_DIR + klswrite1, "w") as temp1: + temp1.write(chap_1_placer(entire1, addendum, klsaddparas, cp1commands)) + + + # chapter 9 + with open(DATA_DIR + klsread9, "r") as ch9: + entire9 = ch9.readlines() # reads in as a list of strings + + # chapter 14 + with open(DATA_DIR + klsread14, "r") as ch14: + entire14 = ch14.readlines() + + # call the findReferences method to find the index of the References paragraph in the two file strings + # two variables for the references lists one for chapter 9 one for chapter 14 + + chapticker = 9 + references9 = find_references(entire9, chapticker, math_people) + ref9_3 = references9[1] + references9 = references9[0] + chapticker = 14 + references14 = find_references(entire14, chapticker, math_people) + ref14_3 = references14[2] + references14 = references14[0] + + + + # call the fixChapter method to get a list with the addendum paragraphs added in + + chapticker2 = 9 + str9 = ''.join(fix_chapter(entire9, references9, paras, addendum, kls_list_all, chapticker2, new_commands, klsaddparas, sortmatch_2, ref9_3, sorter_check)) + + chapticker2 = 14 + str14 = ''.join(fix_chapter(entire14, references14, paras, addendum, kls_list_all, chapticker2, new_commands, klsaddparas, sortmatch_2, ref14_3, sorter_check)) + + + + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # If you are writing something that will make a change to the chapter files, write it BEFORE this line, this part + # is where the lists representing the words/strings in the chapter are joined together and updated as a string! + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + # write to files + # new output files for safety + with open(DATA_DIR + klswrite9, "w") as temp9: + temp9.write(str9) + + with open(DATA_DIR + klswrite14, "w") as temp14: + temp14.write(str14) + + print "Files sorted" + # Will print when code done + +if __name__ == '__main__': + main("KLSaddII.tex", "updated9.tex", "updated14.tex", "updated1.tex", "chap09.tex", "chap14.tex", "chap01.tex") \ No newline at end of file diff --git a/KLSadd_insertion/test/test_chap1_placer.py b/KLSadd_insertion/test/test_chap1_placer.py new file mode 100644 index 0000000..90aacfd --- /dev/null +++ b/KLSadd_insertion/test/test_chap1_placer.py @@ -0,0 +1,16 @@ + +__author__ = 'Edward Bian' +__status__ = 'Development' + +from unittest import TestCase +from updateChapters import chap_1_placer + + +class TestChap1Placer(TestCase): + + def test_chap1_placer(self): + self.assertEquals(chap_1_placer(['WordsAndSomeMoreWords', 'SampleEquation', '\\end{document}'] + , ['\\subsection*{Generalities}', '\\paragraph{MathFunction}', 'MathEquations', 'WordsAndStuff', + '\\subsection*{9.1 Wilson}', '\\paragraph{Symmetry}', 'WordsAndStuff'], [0,1,4,5]) + , 'WordsAndSomeMoreWordsSampleEquation\\paragraph{\\bf KLS Addendum: Generalities}\\paragraph{MathFunction}MathEquationsWordsAndStuff\\end{document}') + diff --git a/KLSadd_insertion/test/test_commands.py b/KLSadd_insertion/test/test_commands.py new file mode 100644 index 0000000..30cd77b --- /dev/null +++ b/KLSadd_insertion/test/test_commands.py @@ -0,0 +1,43 @@ + +__author__ = 'Edward Bian' +__status__ = 'Development' + +from unittest import TestCase +from updateChapters import get_commands +from updateChapters import insert_commands +from updateChapters import prepare_for_pdf + + +class TestGetCommands(TestCase): + + def test_get_commands(self): + self.assertEquals(get_commands(['FakeCommands', 'MoreFakeCommands', '\\newcommand\\smallskipamount', 'Words', + '\\newcommandBob', '\\newcommand\\mybibitem[1]', 'KLSAddendumStuff', + '\\begin{document}'],[]), ['\\newcommand\\smallskipamount', 'Words', + '\\newcommandBob', '\\newcommand\\mybibitem[1]']) + + +class TestInsertCommands(TestCase): + + def test_insert_commands(self): + self.assertEquals(insert_commands(['Words','Commands','\\begin{document}','KLSAddendum', + '\subsection*{Introduction}'], + ['Words','Commands','\\begin{document}', + '\subsection*{Hypergeometric representation}'], + ['\\newcommand\\smallskipamount', '\\newcommand\\de\\delta', + '\\newcommand\\la\\lambda' + '\\newcommand\\mybibitem[1]']), + (['Words','Commands','\\newcommand\\smallskipamount', + '\\newcommand\\de\\delta', '\\newcommand\\la\\lambda' + '\\newcommand\\mybibitem[1]', '\\begin{document}', + '\subsection*{Hypergeometric representation}'])) + + +class TestPrepareForPDF(TestCase): + + def test_prepare_for_pdf(self): + self.assertEquals(prepare_for_pdf(['\\newcommand\\smallskipamount', '\usepackage[bottom]{footmisc}', + '\subsection*{Hypergeometric representation}']), + ['\\newcommand\\smallskipamount', '\usepackage[bottom]{footmisc}', + '\\usepackage[pdftex]{hyperref} \n\\usepackage {xparse} \n\\usepackage{cite} \n', + '\subsection*{Hypergeometric representation}']) diff --git a/KLSadd_insertion/test/test_fix_chapter.py b/KLSadd_insertion/test/test_fix_chapter.py new file mode 100644 index 0000000..e50a4c4 --- /dev/null +++ b/KLSadd_insertion/test/test_fix_chapter.py @@ -0,0 +1,118 @@ + +__author__ = 'Edward Bian' +__status__ = 'Development' + +from unittest import TestCase +from updateChapters import fix_chapter + + +class TestFixChapter(TestCase): + def test_fix_chapter(self): + +#fix_chapter(chap, references , paragraphs_to_be_added , kls, kls_list_all (basically word), chapticker2, new_commands, klsaddparas, sortmatch_2, tempref, sorter_check): +#fix_chapter_sort(chap, [5] , [\\subsection*{9.1 Wilson}\n\\label{sec9.1}\n%\n, kls, word, sortloc(should be 0) , 0, , blank?, , klsaddparas, sortmatch_2, tempref, sorter_check): +# fix_chapter_sort( kls, chap, word, sortloc , klsaddparas, sortmatch_2, tempref, sorter_check): +# fix_chapter( chap, references, paragraphs_to_be_added, kls, kls_list_all, chapticker2, new_commands , klsaddparas, sortmatch_2, tempref, sorter_check): + self.assertEquals(fix_chapter(['\\newcommand{\qhypK}[5]{\,\mbox{}_{#1}\phi_{#2}\!\left(' + , '\\newcommand\half{\\frac50}' + , '\\newcommand\half{\\frac12}' + , '\\newcommand{\\hyp}[5]{\\,\\mbox{}_{#1}F_{#2}\\!\\left(' + , '\\genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}' + , '\\newcommand{\\qhyp}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(' + , '\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + , '\\subsection*{Orthogonality relation}' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '\\myciteKLS' + , '\\end{eqnarray}'] + ,[5],['\\subsection*{9.1 Wilson}\\n\\label{sec9.1}\\n%\\n'] + , ['\\newcommand\\smallskipamount' + , '\\newcommand\\mybibitem[1]' + ,'%' + , '\\subsection*{9.1 Wilson}' + , '\\paragraph{Hypergeometric Representation}' + , 'The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetric' + , 'in $a,b,c,d$.' + , '\\renewcommand{\\refname}{Standard references}'] + , ['Hypergeometric Representation'] + , 0, [], [3, 4, 7], [['%ab']], [6, 7, 12, 15], [[0, 0], [0, 0]]) + + # Expected output: + + , ['\\newcommand\\mybibitem[1]' + , '\\usepackage[pdftex]{hyperref} \n\\usepackage {xparse} \n\\usepackage{cite} \n' + , '\\newcommand{\\qhypK}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(' + , '\\newcommand\half{\\frac50}' + , '%\\newcommand\\half{\\frac12}' + , '%\\newcommand{\\hyp}[5]{\\,\\mbox{}_{#1}F_{#2}\\!\\left(%Begin KLS Addendum additions\\subsection*{9.1 Wilson}\\n\\label{sec9.1}\\n%\\n%End of KLS Addendum additions' + , '%\\genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}' + , '%\\newcommand{\\qhyp}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(' + , '\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + , '\\subsection*{Orthogonality relation}\\paragraph{\\bf KLS Addendum: Hypergeometric Representation}The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetricin $a,b,c,d$.' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '\\cite' + , '\\newcommand\\smallskipamount' + , '\\end{eqnarray}']) + self.assertEquals(fix_chapter(['\\newcommand{\qhypK}[5]{\,\mbox{}_{#1}\phi_{#2}\!\left(' + , '\\newcommand\half{\\frac50}' + , '\\newcommand\half{\\frac12}' + , '\\newcommand{\\hyp}[5]{\\,\\mbox{}_{#1}F_{#2}\\!\\left(' + , '\\genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}' + , '\\newcommand{\\qhyp}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(' + , '\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + , '\\subsection*{Orthogonality relation}' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '\\myciteKLS' + , '\\end{eqnarray}'] + ,[5],['\\subsection*{9.1 Wilson}\\n\\label{sec9.1}\\n%\\n'] + , ['\\newcommand\\smallskipamount' + , '\\newcommand\\mybibitem[1]' + ,'%' + , '\\subsection*{9.1 Wilson}' + , '\\paragraph{Hypergeometric Representation}' + , 'The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetric' + , 'in $a,b,c,d$.' + , '\\renewcommand{\\refname}{Standard references}'] + , ['Hypergeometric Representation'] + , 0, [], [3, 4, 7], [['%a']], [6, 7, 12, 15], [[0, 0], [0, 0]]) + + # Expected output: + + , ['\\newcommand\\mybibitem[1]' + , '\\usepackage[pdftex]{hyperref} \n\\usepackage {xparse} \n\\usepackage{cite} \n' + , '\\newcommand{\\qhypK}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(' + , '\\newcommand\half{\\frac50}' + , '%\\newcommand\\half{\\frac12}' + , '%\\newcommand{\\hyp}[5]{\\,\\mbox{}_{#1}F_{#2}\\!\\left(%Begin KLS Addendum additions\\subsection*{9.1 Wilson}\\n\\label{sec9.1}\\n%\\n%End of KLS Addendum additions' + , '%\\genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}' + , '%\\newcommand{\\qhyp}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(' + , '\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + , '\\subsection*{Orthogonality relation}\\paragraph{\\bf KLS Addendum: Hypergeometric Representation}The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetricin $a,b,c,d$.' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '\\cite' + , '\\newcommand\\smallskipamount' + , '\\end{eqnarray}']) + +['\\newcommand\\mybibitem[1]', '\\usepackage[pdftex]{hyperref} \n\\usepackage {xparse} \n\\usepackage{cite} \n', '\\newcommand{\\qhypK}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(', '\newcommand\\half{\x0crac12}', '%\\newcommand{\\hyp}[5]{\\,\\mbox{}_{#1}F_{#2}\\!\\left(', '%\\genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}%Begin KLS Addendum additions\\subsection*{9.1 Wilson}\\n\\label{sec9.1}\\n%\\n%End of KLS Addendum additions', '%\\newcommand{\\qhyp}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(', '\\section{Wilson}\\index{Wilson polynomials}', '\\subsection*{Hypergeometric representation}', '\\begin{eqnarray}', '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\', '\\end{eqnarray}', '\\subsection*{Orthogonality relation}\\paragraph{\\bf KLS Addendum: Hypergeometric Representation}The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetricin $a,b,c,d$.', '\\begin{eqnarray}', '\\label{OrthIWilson}', '& &\\frac{1}{2\\pi}\\int_0^{\\infty}', '\\newcommand\\smallskipamount', '\\end{eqnarray}'] +['\\newcommand\\mybibitem[1]', '\\usepackage[pdftex]{hyperref} \n\\usepackage {xparse} \n\\usepackage{cite} \n', '\\newcommand{\\qhypK}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(', '\\newcommand\\half{\\frac12}', '%\\newcommand{\\hyp}[5]{\\,\\mbox{}_{#1}F_{#2}\\!\\left(', '%\\genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}%Begin KLS Addendum additions\\subsection*{9.1 Wilson}\\n\\label{sec9.1}\\n%\\n%End of KLS Addendum additions', '%\\newcommand{\\qhyp}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(', '\\section{Wilson}\\index{Wilson polynomials}', '\\subsection*{Hypergeometric representation}', '\\begin{eqnarray}', '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\', '\\end{eqnarray}', '\\subsection*{Orthogonality relation}\\paragraph{\\bf KLS Addendum: Hypergeometric Representation}The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetricin $a,b,c,d$.', '\\begin{eqnarray}', '\\label{OrthIWilson}', '& &\\frac{1}{2\\pi}\\int_0^{\\infty}', '\\newcommand\\smallskipamount', '\\end{eqnarray}'] + + diff --git a/KLSadd_insertion/test/test_fix_chapter_sort.py b/KLSadd_insertion/test/test_fix_chapter_sort.py new file mode 100644 index 0000000..8acda86 --- /dev/null +++ b/KLSadd_insertion/test/test_fix_chapter_sort.py @@ -0,0 +1,162 @@ + +__author__ = 'Edward Bian' +__status__ = 'Development' + +from unittest import TestCase +from updateChapters import fix_chapter_sort + + +class TestFixChapterSort(TestCase): + def test_fix_chapter_sort(self): + self.assertEquals(fix_chapter_sort(['%' + , '\\subsection*{9.1 Wilson}' + , '\\paragraph{Hypergeometric Representation}' + , 'The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetric' + , 'in $a,b,c,d$.' + , '\\renewcommand{\\refname}{Standard references}'] + ,['\\section{Wilson}\\index{Wilson polynomials}' + ,'\\subsection*{Hypergeometric representation}' + ,'\\begin{eqnarray}' + ,'& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + ,'\\end{eqnarray}' + ,'\\subsection*{Orthogonality relation}' + ,'\\begin{eqnarray}' + ,'\\label{OrthIWilson}' + ,'& &\\frac{1}{2\\pi}\\int_0^{\\infty}' + ,'\\end{eqnarray}'],'Hypergeometric Representation',0,[1,2,5],[],[0, 1, 5, 9],[[0, 0], [0, 0]]) + ,['\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}\\paragraph{\\bf KLS Addendum: Hypergeometric Representation}The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetricin $a,b,c,d$.' + , '\\subsection*{Orthogonality relation}' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '& &\\frac{1}{2\\pi}\\int_0^{\\infty}' + , '\\end{eqnarray}']) + self.assertEquals(fix_chapter_sort(['%' + , '\\subsection*{9.1 Wilson}' + , '\\subsection*{14.1 Askey}' + , '\\paragraph{Orthogonality}' + , 'The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetric' + , 'in $a,b,c,d$.' + , '\\renewcommand{\\refname}{Standard references}'] + , ['\\section{Askey}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + , '\\subsection*{Orthogonality}' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '& &\\frac{1}{2\\pi}\\int_0^{\\infty}' + , '\\end{eqnarray}'], 'Orthogonality', 0, [1, 2, 3, 6], [], [0, 1, 5, 9],[[1, 0], [1, 0]]) + , ['\\section{Askey}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + , '\\subsection*{Orthogonality}' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '& &\\frac{1}{2\\pi}\\int_0^{\\infty}\\paragraph{\\bf KLS Addendum: Orthogonality}The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetricin $a,b,c,d$.' + , '\\end{eqnarray}']) + self.assertEquals(fix_chapter_sort(['%' + , '\\subsection*{9.1 Wilson}' + , '\\paragraph{Special Value}' + , 'The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetric' + , 'in $a,b,c,d$.' + , '\\renewcommand{\\refname}{Standard references}'] + , ['\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + , '\\subsection{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '& &\\frac{1}{2\\pi}\\int_0^{\\infty}' + , '\\end{eqnarray}'], 'Special value', 0, [1, 2, 5], [], [0, 1, 5, 9], [[0, 0], [0, 0]]) + , ['\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}\\paragraph{\\bf KLS Addendum: Special value}The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetricin $a,b,c,d$.' + , '\\subsection{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '& &\\frac{1}{2\\pi}\\int_0^{\\infty}' + , '\\end{eqnarray}']) + self.assertEquals(fix_chapter_sort(['%' + , '\\subsection*{9.1 Wilson)' + , '\\subsection*{9.2 Pseudo Jacobi (or Routh-Romanovski)}' + , '\\paragraph{Symmetry}' + , 'The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetric' + , 'in $a,b,c,d$.' + , '\\renewcommand{\\refname}{Standard references}'] + , ['\\section{Pseudo Jacobi}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + , '\\subsection*{Orthogonality}' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '& &\\frac{1}{2\\pi}\\int_0^{\\infty}' + , '\\end{eqnarray}'], 'Symmetry', 0, [1, 2, 3, 6], [], [0, 1, 5, 9], [[0, 0], [0, 0]]) + , ['\\section{Pseudo Jacobi}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}\\paragraph{\\bf KLS Addendum: Symmetry}The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetricin $a,b,c,d$.' + , '\\subsection*{Orthogonality}' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '& &\\frac{1}{2\\pi}\\int_0^{\\infty}' + , '\\end{eqnarray}']) + self.assertEquals(fix_chapter_sort(['%' + , '\\subsection*{9.1 Wilson}' + , '\\paragraph{Hypergeometric Representation}' + , 'The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetric' + , 'in $a,b,c,d$.' + , '\\renewcommand{\\refname}{Standard references}'] + , ['\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + , '\\subsection*{Basic Hypergeometric representation}' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '& &\\frac{1}{2\\pi}\\int_0^{\\infty}' + , '\\end{eqnarray}'], 'Hypergeometric Representation', 0, [1, 2, 5], [], [0, 1, 5, 9], [[0, 0], [0, 0]]) + , ['\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}\\paragraph{\\bf KLS Addendum: Hypergeometric Representation}The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetricin $a,b,c,d$.' + , '\\subsection*{Basic Hypergeometric representation}' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '& &\\frac{1}{2\\pi}\\int_0^{\\infty}' + , '\\end{eqnarray}']) + self.assertEquals(fix_chapter_sort(['%' + , '\\subsection*{9.1 Wilson}' + , '\\paragraph{Symmetry}' + , 'The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetric' + ,'\\paragraph{Trivial Symmetry}' + , 'Words' + , '\\renewcommand{\\refname}{Standard references}'] + , ['\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + ,'%'] + , 'Symmetry', 0, [1, 2, 4, 6], [], [0, 1, 5], [[0, 0], [0, 0]]) + , ['\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}\\paragraph{\\bf KLS Addendum: Symmetry}The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetric\\paragraph{\\bf KLS Addendum: Symmetry}Words' + , '%']) \ No newline at end of file diff --git a/KLSadd_insertion/test/test_generic_functions.py b/KLSadd_insertion/test/test_generic_functions.py new file mode 100644 index 0000000..665dfdc --- /dev/null +++ b/KLSadd_insertion/test/test_generic_functions.py @@ -0,0 +1,32 @@ + +__author__ = 'Edward Bian' +__status__ = 'Development' + +from unittest import TestCase +from updateChapters import new_keywords +from updateChapters import extraneous_section_deleter +from updateChapters import cut_words + +class TestNewKeywords(TestCase): + + def test_new_keywords(self): + self.assertEquals(new_keywords(['\\subsubsection*{ThisIsATest}\n', '\\subsubsection*{Special value}\n'] + ,[]), (['ThisIsATest', 'Symmetry', 'Limit Relation', 'Special value'],[[0,0],[0,0],[0,0],[0,0], [0,0]])) + + +class TestExtraneousSectionDeleter(TestCase): + + def test_extraneous_section_deleter(self): + self.assertEquals(extraneous_section_deleter(['reference', 'bananas', 'limit relation', 'symmetry','458673', + 'limit relations', 'apple']), ['bananas', '458673', 'apple']) + + +class TestCutWords(TestCase): + + def test_cut_words(self): + self.assertEquals(cut_words('MoreWords','WordsAndSomeMoreWords'), 'WordsAndSome') + self.assertEquals(cut_words('SupposedToFail', 'WordsAndSomeMoreWords'), 'WordsAndSomeMoreWords') + self.assertEquals(cut_words('StuffFromAddenum', '''StuffFromAddenum\\begin{equation}\\end{equation}'''), + '''\\begin{equation}\\end{equation}''') + + diff --git a/KLSadd_insertion/test/test_main.py b/KLSadd_insertion/test/test_main.py new file mode 100644 index 0000000..91bfd31 --- /dev/null +++ b/KLSadd_insertion/test/test_main.py @@ -0,0 +1,115 @@ + +__author__ = 'Edward Bian' +__status__ = 'Development' + +from unittest import TestCase +from updateChapters import fix_chapter + + +class TestFixChapter(TestCase): + def test_fix_chapter(self): + +#fix_chapter(chap, references , paragraphs_to_be_added , kls, kls_list_all (basically word), chapticker2, new_commands, klsaddparas, sortmatch_2, tempref, sorter_check): +#fix_chapter_sort(chap, [5] , [\\subsection*{9.1 Wilson}\n\\label{sec9.1}\n%\n, kls, word, sortloc(should be 0) , 0, , blank?, , klsaddparas, sortmatch_2, tempref, sorter_check): +# fix_chapter_sort( kls, chap, word, sortloc , klsaddparas, sortmatch_2, tempref, sorter_check): +# fix_chapter( chap, references, paragraphs_to_be_added, kls, kls_list_all, chapticker2, new_commands , klsaddparas, sortmatch_2, tempref, sorter_check): + self.assertEquals(fix_chapter(['\\newcommand{\qhypK}[5]{\,\mbox{}_{#1}\phi_{#2}\!\left(' + , '\\newcommand\half{\\frac50}' + , '\\newcommand\half{\\frac12}' + , '\\newcommand{\\hyp}[5]{\\,\\mbox{}_{#1}F_{#2}\\!\\left(' + , '\\genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}' + , '\\newcommand{\\qhyp}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(' + , '\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + , '\\subsection*{Orthogonality relation}' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '\\myciteKLS' + , '\\end{eqnarray}'] + ,[5],['\\subsection*{9.1 Wilson}\\n\\label{sec9.1}\\n%\\n'] + , ['\\newcommand\\smallskipamount' + , '\\newcommand\\mybibitem[1]' + ,'%' + , '\\subsection*{9.1 Wilson}' + , '\\paragraph{Hypergeometric Representation}' + , 'The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetric' + , 'in $a,b,c,d$.' + , '\\renewcommand{\\refname}{Standard references}'] + , ['Hypergeometric Representation'] + , 9, [], [3, 4, 7], [['%ab']], [6, 7, 12, 15], [[0, 0], [0, 0]]) + + # Expected output: + + , ['\\newcommand\\mybibitem[1]' + , '\\usepackage[pdftex]{hyperref} \n\\usepackage {xparse} \n\\usepackage{cite} \n' + , '\\newcommand{\\qhypK}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(' + , '\\newcommand\half{\\frac50}' + , '%\\newcommand\\half{\\frac12}' + , '%\\newcommand{\\hyp}[5]{\\,\\mbox{}_{#1}F_{#2}\\!\\left(%Begin KLS Addendum additions\\subsection*{9.1 Wilson}\\n\\label{sec9.1}\\n%\\n%End of KLS Addendum additions' + , '%\\genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}' + , '%\\newcommand{\\qhyp}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(' + , '\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + , '\\subsection*{Orthogonality relation}\\paragraph{\\bf KLS Addendum: Hypergeometric Representation}The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetricin $a,b,c,d$.' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '\\cite' + , '\\newcommand\\smallskipamount' + , '\\end{eqnarray}']) + self.assertEquals(fix_chapter(['\\newcommand{\qhypK}[5]{\,\mbox{}_{#1}\phi_{#2}\!\left(' + , '\\newcommand\half{\\frac50}' + , '\\newcommand\half{\\frac12}' + , '\\newcommand{\\hyp}[5]{\\,\\mbox{}_{#1}F_{#2}\\!\\left(' + , '\\genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}' + , '\\newcommand{\\qhyp}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(' + , '\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + , '\\subsection*{Orthogonality relation}' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '\\myciteKLS' + , '\\end{eqnarray}'] + ,[5],['\\subsection*{9.1 Wilson}\\n\\label{sec9.1}\\n%\\n'] + , ['\\newcommand\\smallskipamount' + , '\\newcommand\\mybibitem[1]' + ,'%' + , '\\subsection*{9.1 Wilson}' + , '\\paragraph{Hypergeometric Representation}' + , 'The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetric' + , 'in $a,b,c,d$.' + , '\\renewcommand{\\refname}{Standard references}'] + , ['Hypergeometric Representation'] + , 9, [], [3, 4, 7], [['%a']], [6, 7, 12, 15], [[0, 0], [0, 0]]) + + # Expected output: + + , ['\\newcommand\\mybibitem[1]' + , '\\usepackage[pdftex]{hyperref} \n\\usepackage {xparse} \n\\usepackage{cite} \n' + , '\\newcommand{\\qhypK}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(' + , '\\newcommand\half{\\frac50}' + , '%\\newcommand\\half{\\frac12}' + , '%\\newcommand{\\hyp}[5]{\\,\\mbox{}_{#1}F_{#2}\\!\\left(%Begin KLS Addendum additions\\subsection*{9.1 Wilson}\\n\\label{sec9.1}\\n%\\n%End of KLS Addendum additions' + , '%\\genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}' + , '%\\newcommand{\\qhyp}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(' + , '\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + , '\\subsection*{Orthogonality relation}\\paragraph{\\bf KLS Addendum: Hypergeometric Representation}The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetricin $a,b,c,d$.' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '\\cite' + , '\\newcommand\\smallskipamount' + , '\\end{eqnarray}']) + + diff --git a/KLSadd_insertion/test/test_reference_finder.py b/KLSadd_insertion/test/test_reference_finder.py new file mode 100644 index 0000000..b06028d --- /dev/null +++ b/KLSadd_insertion/test/test_reference_finder.py @@ -0,0 +1,61 @@ + +__author__ = 'Edward Bian' +__status__ = 'Development' + +from unittest import TestCase +from updateChapters import find_references + +class TestFindReferences(TestCase): + + def test_find_references(self): + self.assertEquals(find_references(['\\section{Pseudo Jacobi}\\index{Racah polynomials}', + '\\subsection*{Hypergeometric representation}', '\\begin{eqnarray}', + '\\label{DefRacah}', '& &R_n(\lambda(x);\alpha,\beta,\gamma,\delta)\nonumber\\' + , '& &{}=\hyp{4}{3}{-n,n+\alpha+\beta+1,-x,', '\end{eqnarray}' + , 'with $N$ a nonnegative integer.', '\subsection*{References}', + '\cite{Askey89I}, \cite{AskeyWilson79}, \cite{AskeyWilson85}'], + 0, ['9.9 Pseudo Jacobi (or Routh-Romanovski)#']), ([8], [0, 1, 8], [])) + self.assertEquals(find_references(['\\section{Pseudo Jacobi}\\index{Racah polynomials}', + '\\subsection*{Hypergeometric representation}', '\\begin{eqnarray}', + '\\label{DefRacah}', '& &R_n(\lambda(x);\alpha,\beta,\gamma,\delta)\nonumber\\' + , '& &{}=\hyp{4}{3}{-n,n+\alpha+\beta+1,-x,', '\end{eqnarray}' + , 'with $N$ a nonnegative integer.', '\subsection*{References}', + '\cite{Askey89I}, \cite{AskeyWilson79}, \cite{AskeyWilson85}'], + 1, ['9.9 Pseudo Jacobi (or Routh-Romanovski)#']), ([8], [], [0, 1, 8])) + self.assertEquals(find_references(['\\section{Racah}\\index{Racah polynomials}', + '\\subsection*{Hypergeometric representation}', '\\begin{eqnarray}', + '\\label{DefRacah}', '& &R_n(\lambda(x);\alpha,\beta,\gamma,\delta)\nonumber\\' + , '& &{}=\hyp{4}{3}{-n,n+\alpha+\beta+1,-x,', '\end{eqnarray}' + , 'with $N$ a nonnegative integer.', '\subsection*{References}', + '\cite{Askey89I}, \cite{AskeyWilson79}, \cite{AskeyWilson85}'], + 0, ['9.2 Racah#']), ([8], [0, 1, 8], [])) + self.assertEquals(find_references(['\\section{Racah}\\index{Racah polynomials}', + '\\subsection*{Hypergeometric representation}', '\\begin{eqnarray}', + '\\label{DefRacah}', '& &R_n(\lambda(x);\alpha,\beta,\gamma,\delta)\nonumber\\' + , '& &{}=\hyp{4}{3}{-n,n+\alpha+\beta+1,-x,', '\end{eqnarray}' + , 'with $N$ a nonnegative integer.', '\subsection*{References}', + '\cite{Askey89I}, \cite{AskeyWilson79}, \cite{AskeyWilson85}'], + 0, ['9.2 Racah#']), ([8], [0, 1, 8], [])) + self.assertEquals(find_references(['\\section{Unique}\\index{Racah polynomials}', + '\\subsection*{Hypergeometric representation}', '\\begin{eqnarray}', + '\\label{DefRacah}', '& &R_n(\lambda(x);\alpha,\beta,\gamma,\delta)\nonumber\\' + , '& &{}=\hyp{4}{3}{-n,n+\alpha+\beta+1,-x,', '\end{eqnarray}' + , 'with $N$ a nonnegative integer.', '\subsection*{References}', + '\cite{Askey89I}, \cite{AskeyWilson79}, \cite{AskeyWilson85}'], + 1, ['9.2 Racah#']), ([], [], [0, 1])) + self.assertEquals(find_references(['\\section{Unique}\\index{Racah polynomials}', + '\\subsection*{Bessel}', '\\begin{eqnarray}', + '\\label{DefRacah}', + '& &R_n(\lambda(x);\alpha,\beta,\gamma,\delta)\nonumber\\' + , '& &{}=\hyp{4}{3}{-n,n+\alpha+\beta+1,-x,', '\end{eqnarray}' + , 'with $N$ a nonnegative integer.', '\subsection*{References}', + '\cite{Askey89I}, \cite{AskeyWilson79}, \cite{AskeyWilson85}'], + 0, ['9.2 Racah#']), ([], [1, 1], [])) + self.assertEquals(find_references(['\\section{Unique}\\index{Racah polynomials}', + '\\subsection*{Big $q$-Legendre}', '\\begin{eqnarray}', + '\\label{DefRacah}', + '& &R_n(\lambda(x);\alpha,\beta,\gamma,\delta)\nonumber\\' + , '& &{}=\hyp{4}{3}{-n,n+\alpha+\beta+1,-x,', '\end{eqnarray}' + , 'with $N$ a nonnegative integer.', '\subsection*{References}', + '\cite{Askey89I}, \cite{AskeyWilson79}, \cite{AskeyWilson85}'], + 1, ['9.2 Racah#']), ([], [], [0, 1, 1])) \ No newline at end of file diff --git a/KLSadd_insertion/test/test_reference_placer.py b/KLSadd_insertion/test/test_reference_placer.py new file mode 100644 index 0000000..f17989c --- /dev/null +++ b/KLSadd_insertion/test/test_reference_placer.py @@ -0,0 +1,52 @@ + +__author__ = 'Edward Bian' +__status__ = 'Development' + +from unittest import TestCase +from updateChapters import reference_placer + + +class TestReferencePlacer(TestCase): + + def test_reference_placer(self): + self.assertEquals(reference_placer(['\\section{Racah}\\index{Racah polynomials}', + '\\subsection*{Hypergeometric representation}', '\\begin{eqnarray}', + '\\label{DefRacah}', '& &R_n(\lambda(x);\alpha,\beta,\gamma,\delta)\nonumber\\' + , '& &{}=\hyp{4}{3}{-n,n+\alpha+\beta+1,-x,', '\end{eqnarray}' + , 'with $N$ a nonnegative integer.', '\\subsection*{References}', + '\cite{Askey89I}, \cite{AskeyWilson79}, \cite{AskeyWilson85}'],[9], + ['\\subsection*{9.1 Racah}\\label{sec9.1}\\paragraph{\\large\\bf KLSadd: Hypergeometric representation}In addition to (9.1.1) we have'], + 0), ['\\section{Racah}\\index{Racah polynomials}', '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '\\label{DefRacah}', '& &R_n(\lambda(x);\alpha,\beta,\gamma,\delta)\nonumber\\' + , '& &{}=\hyp{4}{3}{-n,n+\alpha+\beta+1,-x,', '\end{eqnarray}' + , 'with $N$ a nonnegative integer.%Begin KLS Addendum additions\\subsection*{9.1 Racah}\\label{sec9.1}\\paragraph{\\large\\bf KLSadd: Hypergeometric representation}In addition to (9.1.1) we have%End of KLS Addendum additions', '\\subsection*{References}', + '\cite{Askey89I}, \cite{AskeyWilson79}, \cite{AskeyWilson85}']) + + self.assertEquals(reference_placer(['\\section{Racah}\\index{Racah polynomials}', + '\\subsection*{Hypergeometric representation}', '\\begin{eqnarray}', + '\\label{DefRacah}', '& &R_n(\lambda(x);\alpha,\beta,\gamma,\delta)\nonumber\\' + , '& &{}=\hyp{4}{3}{-n,n+\alpha+\beta+1,-x,', '\end{eqnarray}' + , 'with $N$ a nonnegative integer.', '\\subsection*{References}', + '\cite{Askey89I}, \cite{AskeyWilson79}, \cite{AskeyWilson85}'], [9], + ['\\subsection*{14.1 Racah}\\label{sec9.1}\\paragraph{\\large\\bf KLSadd: Hypergeometric representation}In addition to (9.1.1) we have'], + 1), ['\\section{Racah}\\index{Racah polynomials}', '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '\\label{DefRacah}', '& &R_n(\lambda(x);\alpha,\beta,\gamma,\delta)\nonumber\\' + , '& &{}=\hyp{4}{3}{-n,n+\alpha+\beta+1,-x,', '\end{eqnarray}' + , 'with $N$ a nonnegative integer.%Begin KLS Addendum additions\\subsection*{14.1 Racah}\\label{sec9.1}\\paragraph{\\large\\bf KLSadd: Hypergeometric representation}In addition to (9.1.1) we have%End of KLS Addendum additions', '\\subsection*{References}', + '\cite{Askey89I}, \cite{AskeyWilson79}, \cite{AskeyWilson85}']) + + self.assertEquals(reference_placer(['\\section{Racah}\\index{Racah polynomials}', + '\\subsection*{Hypergeometric representation}', '\\begin{eqnarray}', + '\\label{DefRacah}', '& &R_n(\lambda(x);\alpha,\beta,\gamma,\delta)\nonumber\\' + , '& &{}=\hyp{4}{3}{-n,n+\alpha+\beta+1,-x,', '\end{eqnarray}' + , 'with $N$ a nonnegative integer.', '\\subsection*{References}', + '\cite{Askey89I}, \cite{AskeyWilson79}, \cite{AskeyWilson85}'], [9], + ['MiscWords', '\\subsection*{9.1 Racah}\\label{sec9.1}\\paragraph{\\large\\bf KLSadd: Hypergeometric representation}In addition to (9.1.1) we have'], + 0), ['\\section{Racah}\\index{Racah polynomials}', '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '\\label{DefRacah}', '& &R_n(\lambda(x);\alpha,\beta,\gamma,\delta)\nonumber\\' + , '& &{}=\hyp{4}{3}{-n,n+\alpha+\beta+1,-x,', '\end{eqnarray}' + , 'with $N$ a nonnegative integer.%Begin KLS Addendum additions\\subsection*{9.1 Racah}\\label{sec9.1}\\paragraph{\\large\\bf KLSadd: Hypergeometric representation}In addition to (9.1.1) we have%End of KLS Addendum additions', '\\subsection*{References}', + '\cite{Askey89I}, \cite{AskeyWilson79}, \cite{AskeyWilson85}']) \ No newline at end of file diff --git a/KLSadd_insertion/test/test_updateChapters_main.py b/KLSadd_insertion/test/test_updateChapters_main.py new file mode 100644 index 0000000..9c1e7e1 --- /dev/null +++ b/KLSadd_insertion/test/test_updateChapters_main.py @@ -0,0 +1,105 @@ + +__author__ = 'Edward Bian' +__status__ = 'Development' + +from unittest import TestCase +from updateChapters import fix_chapter + + +class TestFixChapter(TestCase): + def test_fix_chapter(self): + ''' + self.assertEquals(fix_chapter(['\section{Wilson}\index{Wilson polynomials}' + ,'\par' + ,'\subsection*{Hypergeometric representation}' + ,'\\begin{eqnarray}' + ,'\label{DefWilson}' + ,'& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + ,'& &{}=\hyp{4}{3}{-n,n+a+b+c+d-1,a+ix,a-ix}{a+b,a+c,a+d}{1}.' + ,'\end{eqnarray}' + ,'\\newpage' + ,'\subsection*{Orthogonality relation}' + ,'If $Re(a,b,c,d)>0$ and non-real parameters occur in conjugate pairs, then' + ,'\\begin{eqnarray}' + ,'\label{OrthIWilson}' + ,'\end{eqnarray}' + ,'\subsection*{References}'], + [14],['\\subsection*{9.1 Wilson}\\n\\label{sec9.1}\\n%\\n\\n%\\n\\n%\\n\\n%\\n\\n'], + [#'\\newcommand{\hyp}[5]{\,\mbox{}_{#1}F_{#2}\!\left(' + #,' \genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}' + #,'\\newcommand{\qhyp}[5]{\,\mbox{}_{#1}\phi_{#2}\!\left(,' + #,' \genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}' + '%' + ,'\subsection*{9.1 Wilson}' + ,'\label{sec9.1}' + ,'%' + ,'\paragraph{Symmetry}' + ,'The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetric in $a,b,c,d$.' + ,'\\' + ,'This follows from the orthogonality relation (9.1.2)' + ,'together with the value of its coefficient of $y^n$ given in (9.1.5b).' + ,'Alternatively, combine (9.1.1) with \mycite{AAR}{Theorem 3.1.1}.\\' + ,'As a consequence, (9.1.12). Then the generating' + ,'functions (9.1.13), (9.1.14) will follow by symmetry in the parameters.' + ,'\\renewcommand{\\refname}{Standard references}'] + ,['Symmetry', 'Limit Relation', 'Special value'], 0, [],[1,4],[],[0,2,9,14] + , [[0,0],[0,0],[0,0],[0,0]]),[]) + ''' +#fix_chapter(chap, references , paragraphs_to_be_added , kls, kls_list_all (basically word), chapticker2, new_commands, klsaddparas, sortmatch_2, tempref, sorter_check): +#fix_chapter_sort(chap, [5] , [\\subsection*{9.1 Wilson}\n\\label{sec9.1}\n%\n, kls, word, sortloc(should be 0) , 0, , blank?, , klsaddparas, sortmatch_2, tempref, sorter_check): +# fix_chapter_sort( kls, chap, word, sortloc , klsaddparas, sortmatch_2, tempref, sorter_check): +# fix_chapter( chap, references, paragraphs_to_be_added, kls, kls_list_all, chapticker2, new_commands , klsaddparas, sortmatch_2, tempref, sorter_check): + self.assertEquals(fix_chapter(['\\newcommand{\qhypK}[5]{\,\mbox{}_{#1}\phi_{#2}\!\left(' + , '\\newcommand\\half{\\frac12}' + , '\\newcommand{\\hyp}[5]{\\,\\mbox{}_{#1}F_{#2}\\!\\left(' + , '\\genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}' + , '\\newcommand{\\qhyp}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(' + , '\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + , '\\subsection*{Orthogonality relation}' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '& &\\frac{1}{2\\pi}\\int_0^{\\infty}' + , '\\end{eqnarray}'] + + + ,[5],['\\subsection*{9.1 Wilson}\\n\\label{sec9.1}\\n%\\n'] + + , ['\\newcommand\\smallskipamount' + , '\\newcommand\\mybibitem[1]' + ,'%' + , '\\subsection*{9.1 Wilson}' + , '\\paragraph{Hypergeometric Representation}' + , 'The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetric' + , 'in $a,b,c,d$.' + , '\\renewcommand{\\refname}{Standard references}'] + + + + , ['Hypergeometric Representation'] + , 0, [], [3, 4, 7], [], [5, 6, 11, 14], [[0, 0], [0, 0]]) + , ['\\newcommand\\mybibitem[1]' + , '\\usepackage[pdftex]{hyperref} \n\\usepackage {xparse} \n\\usepackage{cite} \n' + , '\\newcommand{\\qhypK}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(' + , '\\newcommand\\half{\\frac12}' + , '%\\newcommand{\\hyp}[5]{\\,\\mbox{}_{#1}F_{#2}\\!\\left(' + , '%\\genfrac{}{}{0pt}{}{#3}{#4};#5\\right)}%Begin KLS Addendum additions\\subsection*{9.1 Wilson}\\n\\label{sec9.1}\\n%\\n%End of KLS Addendum additions' + , '%\\newcommand{\\qhyp}[5]{\\,\\mbox{}_{#1}\\phi_{#2}\\!\\left(' + , '\\section{Wilson}\\index{Wilson polynomials}' + , '\\subsection*{Hypergeometric representation}' + , '\\begin{eqnarray}' + , '& &\\frac{W_n(x^2;a,b,c,d)}{(a+b)_n(a+c)_n(a+d)_n}\\nonumber\\' + , '\\end{eqnarray}' + , '\\subsection*{Orthogonality relation}\\paragraph{\\bf KLS Addendum: Hypergeometric Representation}The Wilson polynomial $W_n(y;a,b,c,d)$ is symmetricin $a,b,c,d$.' + , '\\begin{eqnarray}' + , '\\label{OrthIWilson}' + , '& &\\frac{1}{2\\pi}\\int_0^{\\infty}' + , '\\newcommand\\smallskipamount' + , '\\end{eqnarray}']) + + + + diff --git a/Macro-Replacement/cosSubstitution.py b/Macro-Replacement/cosSubstitution.py deleted file mode 100644 index 44ae2f8..0000000 --- a/Macro-Replacement/cosSubstitution.py +++ /dev/null @@ -1,75 +0,0 @@ -def checkEq(equation): - - theta=False - phi=False - x=False - if "\\theta" in equation: - theta=True - if "\\phi" in equation: - phi=True - mac=False - - for c in equation: - if c=="\\": - mac=True - if not c.isalpha(): - mac=False - if not mac and c=="x": - x=True - break - - if x and theta and not phi: - return("$x=\\cos@@{\\theta}$ ") - elif x and theta and phi: - return("$x=\\cos@{\\theta+\\phi}$ ") - else: - return("") - -def cos_substitution(input): - - lines = input.split('\n') - toWrite="" - p="" - math=False - substitution=False - - for line in lines: - - if "\\begin{equation}" in line: - math=True - equation="" - subLine="" - - if "\\end{equation}" in line: - - math=False - substitution=False - p=checkEq(equation) - if p!="" and not ("$x=\\cos@@{\\theta}$" in subLine or "$x=\\cos@{\\theta+\\phi}$" in subLine): - #print equation+"\n"+subLine - if subLine=="": - toWrite+="% \substitution{"+p+"}\n" - else: - subLine=subLine.strip("\n") - subLine=subLine.strip("}")+"\n" - toWrite+=subLine+"% "+p+"}\n" - else: - #toWrite+=subLine + '\n' #CHERRY CHANGE - toWrite += subLine #CHERRY CHANGE - - if "\\substitution" in line: - substitution=True - math=False - subLine="" - - if math: - equation+=line.replace("\n"," ") - toWrite+=line + '\n' - - elif substitution: - subLine+=line + '\n' - - else: - toWrite+=line + '\n' - - return toWrite diff --git a/Macro-Replacement/drmfdriver.py b/Macro-Replacement/drmfdriver.py deleted file mode 100644 index f3b51da..0000000 --- a/Macro-Replacement/drmfdriver.py +++ /dev/null @@ -1,63 +0,0 @@ -#Driver file for the DRMF seeding program - -from optparse import OptionParser, OptionValueError -import replace -import search -from drmfconfig import ConfigFile - -#parse command line args and either replace or generate replacement file -def main(): - - parser = OptionParser(usage="usage: %prog [options] inputfile outputfile") - - #validates mode, prevents both -r and -s - def validate(option, opt_string, value, parser): - - to_raise = OptionValueError("cannot specify both search and replace") - if opt_string == "--replace" or opt_string == "-r": - - if parser.values.replace: - raise to_raise - setattr(parser.values, "replace", True) - - else: - - if parser.values.search: - raise to_raise - setattr(parser.values, "search", True) - - parser.add_option("-r", "--replace", default=False, action="callback", dest="replace", callback=validate, help="make replacements from input file write them to the output file [default]" ) - parser.add_option("-s", "--search", default=False, action="callback", dest="search", callback=validate, help="write a log of replacemnts that should be made in the input file to the output file (including line numbers)") - - parser.add_option("-v", "--verbose", action="store_true", default=False, dest="verbose", help="print out information about replacements as they occur") - - parser.add_option("-c", "--config", action="store", default="function_regex", dest="config_file_name", help="the name of the configuration file to use") - - options, args = parser.parse_args() - - #ensure both input file and output file are present - if len(args) != 2: - raise TypeError("must specify both input file and output file") - - in_file = args[0] - out_file = args[1] - - #no action specified, default to replace - if not (options.replace or options.search): - options.replace = True - - #user specified replace option - if options.replace: - to_run = replace - - #user specified search option - else: - to_run = search - - func_list = ConfigFile(options.config_file_name, verbose=options.verbose).all_funcs - - to_run.run(in_file, out_file, func_list) - -#call main function when this file is run directly -if __name__ == "__main__": - main() diff --git a/Macro-Replacement/parentheses.py b/Macro-Replacement/parentheses.py deleted file mode 100644 index 8905e5e..0000000 --- a/Macro-Replacement/parentheses.py +++ /dev/null @@ -1,70 +0,0 @@ -"""Goes through input file, numbers every opening and corresponding closing parenthesis and writes result to output file.""" - -import sys -import re - -_last_val = 0 - -def remove(input, curly=False, cached=False): - """Goes through input and replaces any opening and closing parentheses with numbered markers.""" - - global _last_val - - counter = 0 - - #resume from previous count - if cached: - counter = _last_val - - updated = "" - - open = "(" - close = ")" - - #if client wants to replace curly braces, adjust accordingly - if curly: - open = "{" - close = "}" - - #go through input and replace parentheses with labels - for character in input: - - #found an opening parenthesis, replace it with its label - if character == open: - - character = "###open_{0}###".format(counter) - counter += 1 - - #found a closing parenthesis, replace it with its label - if character == close: - counter -= 1 - - if counter < 0: - counter = 0 - - character = "###close_{0}###".format(counter) - - updated += character - - _last_val = counter #store our spot - - return updated - -def insert(input, curly=False): - """Goes through input and replaces any numbered markers with opening and closing parentheses.""" - - o_rep = "(" - c_rep = ")" - - #adjust for curly braces - if curly: - o_rep = "{" - c_rep = "}" - - open_pattern = r'###open_\d###' - close_pattern = r'###close_\d###' - - input = re.sub(open_pattern, o_rep, input) - input = re.sub(close_pattern, c_rep, input) - - return input \ No newline at end of file diff --git a/Macro-Replacement/replace_special.py b/Macro-Replacement/replace_special.py deleted file mode 100644 index c325a6d..0000000 --- a/Macro-Replacement/replace_special.py +++ /dev/null @@ -1,342 +0,0 @@ -"""Replace i, e, and \pi with \iunit, \expe, and \cpi respectively.""" - -import re -import sys - -#for compatibility with Python 3 -try: - from itertools import izip -except ImportError: - izip = zip - -import parentheses -from utilities import writeout -from utilities import readin - -EQ_STARTS = [ r'\begin{equation}' , r'\begin{equation*}' , r'\begin{align}' , r'\begin{eqnarray}' , r'\begin{eqnarray*}' , r'\begin{multline}' , r'\begin{multline*}' ] -EQ_ENDS = [ r'\end{equation}' , r'\end{equation*}' , r'\end{align}' , r'\end{eqnarray}' , r'\begin{eqnarray*}' , r'\begin{multline}' , r'\begin{multline*}' ] - -IND_START = r'\index{' - -NAME = 0 -SEEN = 1 - -CASES_START = r'\begin{cases}' -CASES_END = r'\end{cases}' - -EQMIX_START = r'\begin{equationmix}' -EQMIX_END = r'\end{equationmix}' - -STD_REGEX = r'.*?###open_(\d+)###.*?###close_\1###' - -def main(): - - if len(sys.argv) != 3: - - fname = "ZE.1.tex" - ofname = "ZES.tex" - - else: - - fname = sys.argv[1] - ofname = sys.argv[2] - - writeout(ofname, remove_special(readin(fname))) - -def remove_special(content): - """Removes the excess pieces from the given content and returns the updated version as a string.""" - - #various flags that will help us keep track of what elements we are inside of currently - inside = { - "constraint": [r'\constraint{', False], - "substitution": [r'\substitution{', False], - "drmfnote": [r'\drmfnote{', False], - "drmfname": [r'\drmfname{', False], - "proof": [r'\proof{', False] - } - - should_replace = False - in_ind = False - in_eq = False - - pi_pat = re.compile(r'(\s*)\\pi(\s*\b|[aeiou])') -# expe_kk = re.compile(r'(?:\\)\b([^d\\]?\W*)\s*e\s*\^') -# expe_pat = re.compile(r'(?:\\)?\b([^d\\]?\W*)\s*e\s*\^') - expe_kk = re.compile(r'(?0}', r'\\ZZ_{\\ge0}' - ] - - spaces_pat = re.compile(r' {2,}') - paren_pat = re.compile(r'\(\s*(.*?)\s*\)') - - dollar_pat = re.compile(r'(?{)?' - pattern += _create_named_groups(_create_group_names(_frequencies["subscript"], "sub", end=num_args)) - pattern += r'(?(_' + str(_frequencies["subscript"]) + '_sub_open)})' - - _frequencies["subscript"] += 1 - - return pattern - -#matches a superscript with num_args comma-delimited arguments -def superscript(num_args=1): - - pattern = r'\^(?P<_' + str(_frequencies["superscript"]) + r'_sup_open>{)?' - pattern += r'(?:' + _create_named_groups(_create_group_names(_frequencies["superscript"], "sup", end=num_args)) + r'|' + simple_arg_list(num_args) + r')' - pattern += r'(?_' + str(_frequencies["superscript"]) + r'_sup_open)})' - - _frequencies["superscript"] += 1 - - return pattern - - -#matches a simple argument list (no ; or |) -def simple_arg_list(num_args=1, all_paren=False): - - o_paren = open_paren - c_paren = close_paren - if not all_paren: - o_paren = r'\(' - c_paren = r'\)' - - pattern = o_paren - pattern += _create_named_groups(_create_group_names(_frequencies["simple_arg_list"], "arg", end=num_args)) - pattern += c_paren - - _frequencies["simple_arg_list"] += 1 - - return pattern - -#matches argument lists with elements delimited by , | and ; -#parameters ending in _ex signify exclusivity (i.e. semi_first_ex means a ; ONLY comes after the first argument) -def semi_bar_arg_list(num_args, all_paren=False, semi_first_ex=False, semi_first=False, semi_last=False, semi_last_ex=False, num_groups=1, group_size=2, bar_first=False, bar_last=False): - - o_paren = open_paren + r'?\(' - c_paren = close_paren + r'?\)' - if not all_paren: - o_paren = r'\(' - c_paren = r'\)' - - #make sure that semi_first is set if semi_first_ex is set - if semi_first_ex: - semi_first = True - - if semi_last_ex: - semi_last = True - - #ensure ; and | are not both first or last - if (semi_first and bar_first) or (semi_last and bar_last): - raise ValueError("semicolon and bar cannot be in the same place") - - - pattern = o_paren - - start_loc = 0 - - #; or | is going at the front or end - if any([semi_first, semi_last, bar_first, bar_last]): - - if bar_first: #bar is after first argument ONLY - - pattern += _create_named_groups(_create_group_names(_frequencies["semi_bar_arg_list"], "arg", end=1)) + r'\|' + _whitespace + r'*' - start_loc += 1 - - - elif semi_first: #semicolon is after first argument - - pattern += _create_named_groups(_create_group_names(_frequencies["semi_bar_arg_list"], "arg", end=1)) + r';' + _whitespace + r'*' - start_loc += 1 - - if semi_first_ex:#semicolon is ONLY after first argument - pattern += _create_named_groups(_create_group_names(_frequencies["semi_bar_arg_list"], "arg", start=start_loc, end=num_args-1)) - start_loc = num_args - 1 - - #semicolon is ONLY before last argument - if semi_last_ex: - - pattern += _create_named_groups(_create_group_names(_frequencies["semi_bar_arg_list"], "arg", start=start_loc, end=num_args-1)) - - #unecessary if only first or last has ; - if not (semi_first_ex or semi_last_ex): - - expected = num_args - start_loc - - #figure out how many items there are to be grouped - if semi_last or bar_last: - expected -= 1 - - #ensure that the number of groups, size of each one, and the number of arguments all make sense - if num_groups * group_size != expected: - raise ValueError("{0} * {1} != {2}".format(num_groups, group_size, expected)) - - - #go through however many ;-separated groups there are - for group in range(num_groups): - - pattern += _create_named_groups(_create_group_names(_frequencies["semi_bar_arg_list"], "arg", start=start_loc, end=start_loc+group_size)) - pattern += _whitespace + r'*;' - - start_loc += group_size - - pattern = pattern[:-1] - - #remove trailing ; if something comes after - if semi_last or bar_last: - if semi_last: #semicolon is before last argument - - pattern += _whitespace + r'*;' + _create_named_groups(_create_group_names(_frequencies["semi_bar_arg_list"], "arg", start=num_args-1, end=num_args)) + r')' - - elif bar_last: #bar is before last argument - - pattern += _whitespace + r'*\|' + _create_named_groups(_create_group_names(_frequencies["semi_bar_arg_list"], "arg", start=num_args-1, end=num_args)) + r')' - - else: #list ends normally - - pattern += r'),' + _create_named_groups(_create_group_names(_frequencies["semi_bar_arg_list"], "arg", start=start_loc, end=num_args)) - - pattern += c_paren - - _frequencies["semi_bar_arg_list"] += 1 - - return pattern - -#creates a list of numbered group names to use in _create_named_groups -def _create_group_names(index_num, name, start=0, end=1): - - groups = [] - - for i in range(start + 1, end + 1): - groups.append("_{0}_{1}_{2}".format(index_num, name, i)) - - return groups - -#creates a pattern that matches function arguments as named groups -def _create_named_groups(*groups): - - pattern_string = "" - - for group in groups[0]: - pattern_string += r'{whitespace}*(?P<{group}>{valid}+),'.format(whitespace=_whitespace, group=group, valid=valid) - - - return pattern_string[:-1] - - -#returns the number of times a given function has been called -def get_freq(name): - return _frequencies[name] - -def main(): - - print("") - print(r'R' + subscript() + semi_bar_arg_list(5,semi_first_ex=True, bar_last=True, all_paren=True)) - print("") - print("") -if __name__ == "__main__": - main() diff --git a/Pipeline/src/pipeline.py b/Pipeline/src/pipeline.py new file mode 100644 index 0000000..2db5b87 --- /dev/null +++ b/Pipeline/src/pipeline.py @@ -0,0 +1,31 @@ +import glob +import sys + +sys.path.append('../../DLMF_preprocessing/src') +from utilities import readin as readin +from utilities import writeout +from remove_excess import remove_excess as step1 +from replace_special import remove_special as step2 +from prepare_annotations import prepare_annotations as step3 + +sys.path.append('../../tex2Wiki/src') +from tex2Wiki import readin as step4 +from tex2Wiki import writeout as step5 + + +# step1 = imp.load_source('remove_excess','../../AlexDanoff/src/remove_excess.py') + +def main(): + if len(sys.argv) != 2: + pattern = "../../data/[0-9]*ZE.tex" # [A-Z][A-Z] + else: + pattern = sys.argv[1] + for fname in glob.glob(pattern): + print "Processing " + fname + writeout(fname + "-processed.tex", step3(step2(step1(readin(fname))))) + step4(fname + "-processed.tex") + step5(fname + "-dump.xml") + + +if __name__ == "__main__": + main() diff --git a/README.md b/README.md index ee19c88..f6d8acf 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,12 @@ # DRMF-Seeding-Project +[![Build Status](https://travis-ci.org/DRMF/DRMF-Seeding-Project.svg?branch=master)](https://travis-ci.org/DRMF/DRMF-Seeding-Project) +[![Coverage Status](https://coveralls.io/repos/github/DRMF/DRMF-Seeding-Project/badge.svg?branch=master)](https://coveralls.io/github/DRMF/DRMF-Seeding-Project?branch=master) +[![Code Issues](https://www.quantifiedcode.com/api/v1/project/b097e91550e147b2b02e345ffb1c5162/badge.svg)](https://www.quantifiedcode.com/app/project/b097e91550e147b2b02e345ffb1c5162) +[![Code Health](https://landscape.io/github/DRMF/DRMF-Seeding-Project/master/landscape.svg?style=flat)](https://landscape.io/github/DRMF/DRMF-Seeding-Project/master) + This project is meant to convert different designated source formats to semantic LaTeX for the -DRMF project. One major aspect of this conversion is the inclusion, insertion, and replacement +[DRMF project](https://drmf.wmflabs.org). One major aspect of this conversion is the inclusion, insertion, and replacement of LaTeX semantic macros. ## MediaWiki Wikitext Generation @@ -17,14 +22,32 @@ Parts of this code were developed by Alex Danoff and Azeem Mohammed. To achieve the desired result, one should execute the progams in the following order (using the output of the previous program as input for the next one): -1. remove_excess.py -2. replace_special.py -3. prepare_annotations.py +1. `remove_excess.py` +2. `replace_special.py` +3. `prepare_annotations.py` + +## BMP Seeding Project + +## Maple CFSF Seeding Project + +This Python code (developed by Joon Bang) translates Maple files from Annie Cuyt's continued fractions package for special functions ([CFSF](http://www.swmath.org/software/13927)) to LaTeX. -## eCF Seeding Project +The project is located in the `maple2latex` folder. ## DLMF Seeding Project -## BMP Seeding Project +## Mathematica eCF Seeding Project + +This Python code (mostly developed by Kevin Chen) translates Mathematica files to LaTeX. + +## KLSadd Insertion Project +`linetest.py` and `updateChapters.py` written by Rahul Shah and Edward Bian + +Edits the DRMF chapter files to include the relevant KLS addendum additions. Additions are (currently) only being added right before the "References" paragraphs in each section. The `linetest.py` file is the first working model of the code, but it is very messy and esoteric. Comments have been made to aid interpretation. The new project file, `updateChapters.py` is a more readable version. + +TODO in `updateChapters.py`: +FINISHED- implemented smart fix for "hypergeometric representation" paragraphs. Now the content in these paragraphs are appended directly from the KLS section into the chapter's hypergeometric representation paragraphs +Needs to be done: +-implement the same smart fix for "Limit relations" paragraphs. Current code for this implementation does not work and has spotty logic that does not encompass all variations of limit relations paragraphs (such as the one subsubsection in chapter 9) diff --git a/eCF-Seeding-Project/conversion_ecf.py b/eCF-Seeding-Project/conversion_ecf.py deleted file mode 100644 index 4ea201a..0000000 --- a/eCF-Seeding-Project/conversion_ecf.py +++ /dev/null @@ -1,477 +0,0 @@ -#Divya Gandla -#Master Code - -import re - -#existing file named text.txt -file=open('test1.txt','r').read() - -#output written to newText.txt -newFile=open('newIdentities.txt','w') - -listOfGVars=["Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", "Theta", "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omicron", "Pi", "Rho", "Sigma", - "Tau", "Upsilon", "Phi", "Chi", "Psi", "Omega", "alpha", "beta", "gamma", "delta", "epsilon", "zeta", "eta", "theta", "iota", "kappa", "lambda", "mu", "nu", "Xi", "Omicron", "Pi", "Rho", "Sigma", - "tau", "upsilon", "phi", "chi", "psi", "omega"] - -def replaceGreekVars(s): - newFile=s; - for gvar in listOfGVars: - #original ex: \[Delta] - oldGVar="\[" + gvar + "]"; - - #replacement ex: \delta - newGVar= chr(92) + gvar.lower(); - newFile=(newFile.replace(oldGVar, newGVar)); - - #adds a space after the replacement of the greek letter if it's followed by A-Z or a-z - for i in range(len(newFile)): - if newFile[i:i+len(newGVar)]== newGVar: - if ord(newFile[i+len(newGVar): i+len(newGVar)+1]) >= 65 and ord(newFile[i+len(newGVar): i+len(newGVar)+1]) <= 90: - newFile=(newFile.replace(newGVar, newGVar+" ")); - elif ord(newFile[i+len(newGVar): i+len(newGVar)+1]) >= 97 and ord(newFile[i+len(newGVar): i+len(newGVar)+1]) <= 122: - newFile=newFile.replace(newGVar, newGVar+" "); - - #special case: replace "pi" with "\cpi" <-- circular pi - newFile=newFile.replace("Pi","\cpi"); - - - return newFile; - -def findArgs(s, functionName): - newReplacings=[] - - #finds capture groups (includes brackets in arguments) - replacings=(re.findall(r''+ functionName + '(\[.*\])',s)) - for i in replacings: - recurse=i.find(functionName) - #if the function name is found in the replacing, regex is used to find the inner function's arguments - #regex's string is from the position of the function name till the end - replacings.extend(re.findall(r''+ functionName + '(\[.*\])',i[recurse:])) - if recurse>=0: - #if the function name is found in the replacing, regex is used to find the inner function's arguments - #regex's string is from the position of the last instance(of function name) plus the length(of function name) till the end - replacings.extend(re.findall(r''+ functionName + '(\[.*\])',i[recurse+len(functionName):])) - - #gets rid of extra ] - for i in replacings: - countOpen=0 - countClose=0 - position=0 - for char in i: - if char=='[': - countOpen=countOpen+1 - elif char==']': - countClose=countClose+1 - #if the num open and close are same, the string is appended till that location - if countOpen==countClose: - newReplacings.append(i[0:position+1]) - break - position=position+1 - - return newReplacings - -def replaceSqrt(s): - arguments=findArgs(s, "Sqrt") - for i in arguments: - s=s.replace("Sqrt"+ i, "\\sqrt{" + i[1:len(i)-1] + "}") - return(s) - -def replacePolygamma(s): - arguments=findArgs(s, "Polygamma") - for i in arguments: - commaLoc=i.find(',') - if i[1:2] != "0": - s=s.replace("Polygamma" +i, "\\polygamma{" + i[1:commaLoc]+"}@{" +i[commaLoc+1:len(i)-1]+ "}") - elif i[1:2] == "0": - s=s.replace("Polygamma" +i, "\\digamma@{" + i[3:len(i)-1] +"}") - return s - -def removeInactive(s): - arguments=findArgs(s, "Inactive") - for i in arguments: - s=s.replace("Inactive"+i, i[1:len(i)-1]) - return s - -def replaceCos(s): - arguments=findArgs(s, "Cos") - for i in arguments: - if len(i)==3: - s=s.replace("Cos"+i,"\\cos@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("Cos"+i,"\\cos@{"+i[1:len(i)-1]+"}") - return s - -def replaceSin(s): - arguments=findArgs(s, "Sin") - for i in arguments: - if len(i)==3: - s=s.replace("Sin"+i,"\\sin@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("Sin"+i,"\\sin@{"+i[1:len(i)-1]+"}") - return s - -def replaceTan(s): - arguments=findArgs(s, "Tan") - for i in arguments: - if len(i)==3: - s=s.replace("Tan"+i,"\\tan@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("Tan"+i,"\\tan@{"+i[1:len(i)-1]+"}") - return s - -def replaceCsc(s): - arguments=findArgs(s, "Csc") - for i in arguments: - if len(i)==3: - s=s.replace("Csc"+i,"\\csc@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("Csc"+i,"\\csc@{"+i[1:len(i)-1]+"}") - return s - -def replaceSec(s): - arguments=findArgs(s, "Sec") - for i in arguments: - if len(i)==3: - s=s.replace("Sec"+i,"\\sec@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("Sec"+i,"\\sec@{"+i[1:len(i)-1]+"}") - return s - -def replaceCot(s): - arguments=findArgs(s, "Cot") - for i in arguments: - if len(i)==3: - s=s.replace("Cot"+i,"\\cot@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("Cot"+i,"\\cot@{"+i[1:len(i)-1]+"}") - return s -def replaceCosh(s): - arguments=findArgs(s, "Cosh") - for i in arguments: - if len(i)==3: - s=s.replace("Cosh"+i,"\\cosh@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("Cosh"+i,"\\cosh@{"+i[1:len(i)-1]+"}") - return s - -def replaceSinh(s): - arguments=findArgs(s, "Sinh") - for i in arguments: - if len(i)==3: - s=s.replace("Sinh"+i,"\\sinh@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("Sinh"+i,"\\sinh@{"+i[1:len(i)-1]+"}") - return s - -def replaceTanh(s): - arguments=findArgs(s, "Tanh") - for i in arguments: - if len(i)==3: - s=s.replace("Tanh"+i,"\\tanh@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("Tanh"+i,"\\tanh@{"+i[1:len(i)-1]+"}") - return s - -def replaceCsch(s): - arguments=findArgs(s, "Csch") - for i in arguments: - if len(i)==3: - s=s.replace("Csch"+i,"\\csch@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("Csch"+i,"\\csch@{"+i[1:len(i)-1]+"}") - return s - -def replaceSech(s): - arguments=findArgs(s, "Sech") - for i in arguments: - if len(i)==3: - s=s.replace("Sech"+i,"\\sech@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("Sech"+i,"\\sech@{"+i[1:len(i)-1]+"}") - return s - -def replaceCoth(s): - arguments=findArgs(s, "Coth") - for i in arguments: - if len(i)==3: - s=s.replace("Coth"+i,"\\coth@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("Coth"+i,"\\coth@{"+i[1:len(i)-1]+"}") - return s - -def replaceArcCos(s): - arguments=findArgs(s, "ArcCos") - for i in arguments: - if len(i)==3: - s=s.replace("ArcCos"+i,"\\acos@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("ArcCos"+i,"\\acos@{"+i[1:len(i)-1]+"}") - return s - -def replaceArcSin(s): - arguments=findArgs(s, "ArcSin") - for i in arguments: - if len(i)==3: - s=s.replace("ArcSin"+i,"\\asin@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("ArcSin"+i,"\\asin@{"+i[1:len(i)-1]+"}") - return s - -def replaceArcTan(s): - arguments=findArgs(s, "ArcTan") - for i in arguments: - if len(i)==3: - s=s.replace("ArcTan"+i,"\\atan@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("ArcTan"+i,"\\atan@{"+i[1:len(i)-1]+"}") - return s - -def replaceArcCsc(s): - arguments=findArgs(s, "ArcCsc") - for i in arguments: - if len(i)==3: - s=s.replace("ArcCsc"+i,"\\acsc@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("ArcCsc"+i,"\\acsc@{"+i[1:len(i)-1]+"}") - return s - -def replaceArcSec(s): - arguments=findArgs(s, "ArcSec") - for i in arguments: - if len(i)==3: - s=s.replace("ArcSec"+i,"\\asec@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("ArcSec"+i,"\\asec@{"+i[1:len(i)-1]+"}") - return s - -def replaceArcCot(s): - arguments=findArgs(s, "ArcCot") - for i in arguments: - if len(i)==3: - s=s.replace("ArcCot"+i,"\\acot@@{"+i[1:len(i)-1]+"}") - else: - s=s.replace("ArcCot"+i,"\\acot@{"+i[1:len(i)-1]+"}") - return s - -def replaceInfinity(s): - recurse=s.find("Infinity") - while recurse>=0: - s=s.replace("Infinity", "\infty") - recurse=s.find("Infinity") - return s - -def ContinuedFractionK(s): - arguments=findArgs(s, "ContinuedFractionK") - for i in arguments: - location=i.find(",{") - if location<0: - location=i.find(", {") - var=i[1:location] - s=s.replace("ContinuedFractionK"+i, "\ContinuedFractionK{k}{1}{\infty}@{"+var+"}") - return s - -def replaceAbs(s): - arguments=findArgs(s, "Abs") - for i in arguments: - s=s.replace("Abs"+i, "\Abs@{"+i[1:len(i)-1]+"}") - return s - -def comparativeRelators(s): - s=s.replace("LessEqual", "\\leq") - s=s.replace("Less", "<") - return s - -def element(s): - #http://texblog.org/2007/08/27/number-sets-prime-natural-integer-rational-real-and-complex-in-latex/ - arguments=findArgs(s,"Element") - for i in arguments: - location=i.rfind(", ") - if location<0: - location=i.rfind(",") - - if location>=0: - var=i[location+1:len(i)-1].strip() - z=i[1:location].strip() - - if (var=="Complexes"): - s=s.replace("Element"+i, z+" \in \Complex") - elif (var=="Wholes"): - s=s.replace("Element"+i, z+" \in \Whole") - elif (var=="Naturals"): - s=s.replace("Element"+i, z+" \in \\NatNumber") - elif (var=="Integers"): - s=s.replace("Element"+i, z+" \in \Integer") - elif (var=="Irrationals"): - s=s.replace("Element"+i, z+" \in \Irrational") - elif (var=="Reals"): - s=s.replace("Element"+i, z+" \in \Real") - elif (var=="Rational"): - s=s.replace("Element"+i, z+" \in \Rational") - elif (var=="Primes"): - s=s.replace("Element"+i, z+" \in \Prime") - return s - -def markup(file): - - newFile="" - equations=findArgs(file,"ConditionalExpression") - constraints=[] - - #looks through each equation set including the conditional expression - for index in range(len(equations)): - equation=equations[index] - location=equation.find(", Element") - if location==-1: - location=equation.find(",Element") - #there are no constraints if Element[ ] is not found - if location==-1: - location=len(equation) - - newFile=newFile+"\\begin{equation} \n" + equation[1:location] + "% \\constraint{\n" - - #find constraints - c=findArgs(equation,"Element") - for element in c: - location=element.rfind(", ") - if location<0: - location=element.rfind(",") - if location>=0: - var=element[location+1:len(element)-1].strip() - z=element[1:location].strip() - elif element.count("|") >0: - for index in range(element.count("|")+1): - #if it is the first constraint then it is from beginning to the first location of the |, the loc is increased each time to get through all of the constraints - if index==0: - loc=element.find("|") - constraints.append(element[1:loc]) - elif index==element.count: - loc=element.find("|", loc+1) - constraints.append(element[loc, element.find(",")]) - else: - constraints.append(element[loc:element.find("|", loc+1)]) - loc=element.find("|", loc+1) - print(var) - - for index in range(len(constraints)): - print(constraint) - if (var=="Complexes"): - newFile="% "+ newFile+ consraint+ "\in \Complex" - elif (var=="Wholes"): - newFile="% "+ newFile+ consraint+ "\in \\NonNegInteger" - elif (var=="Naturals"): - newFile="% "+ newFile+ consraint+ "\in \\NatNumber" - elif (var=="Integers"): - newFile="% "+ newFile+ consraint+ "\in \Integer" - elif (var=="Irrationals"): - newFile="% "+ newFile+ consraint+ "\in \Irrationals" - elif (var=="Reals"): - newFile="% "+ newFile+ consraint+ "\in \Real" - elif (var=="Rational"): - newFile="% "+ newFile+ consraint+ "\in \Rational" - elif (var=="Primes"): - newFile="% "+ newFile+ consraint+ "\in \Prime" - return newFile - -def equationSetUp(s): - - - newFile="\\begin {equation}\n" - start=s.find("ConditionalExpression[")+ len("ConditionalExpression[") - end=s.rfind(",") - end=s.rfind(",",0,end) - newFile=newFile+s[start:end]+"\n" - constraints=[] - if (s.find("Element["))>0: - elements=s[s.find("Element[",end)+ len("Element["): len(s)-1] - newFile=newFile+"% \constraint{\n" - numCon=elements.count("|")+1 - location=0 - for index in range(numCon): - if index==0: - if numCon==1: - constraints.append(elements[0:elements.find(",")].strip()) - else: - location=elements.find("|") - constraints.append(elements[0:location].strip()) - elif index==numCon-1: - constraints.append(elements[location+1:elements.find(",",location)].strip()) - else: - constraints.append(elements[location+1:elements.find("|", location+1)].strip()) - location=elements.find("|", location+1) - var=elements[elements.rfind(",")+1:len(elements)-1].strip() - for index in range(len(constraints)): - if index==len(constraints)-1: - if (var=="Complexes"): - newFile=newFile+"% "+ constraints[index]+ " \in \Complex }\n" - elif (var=="Wholes"): - newFile=newFile+"% "+ constraints[index]+ " \in \\NonNegInteger }\n" - elif (var=="Naturals"): - newFile=newFile+"% "+ constraints[index]+ " \in \\NatNumber }\n" - elif (var=="Integers"): - newFile=newFile+"% "+ constraints[index]+ " \in \Integer }\n" - elif (var=="Irrationals"): - newFile=newFile+"% "+ constraints[index]+ " \in \Irrationals }\n" - elif (var=="Reals"): - newFile=newFile+"% "+ constraints[index]+ " \in \Real }\n" - elif (var=="Rational"): - newFile=newFile+"% "+ constraints[index]+ " \in \Rational }\n" - elif (var=="Primes"): - newFile=newFile+"% "+ constraints[index]+ " \in \Prime }\n" - else: - if (var=="Complexes"): - newFile=newFile+"% "+ constraints[index]+ " \in \Complex &\n" - elif (var=="Wholes"): - newFile=newFile+"% "+ constraints[index]+ " \in \\NonNegInteger &\n" - elif (var=="Naturals"): - newFile=newFile+"% "+ constraints[index]+ " \in \\NatNumber &\n" - elif (var=="Integers"): - newFile=newFile+"% "+ constraints[index]+ " \in \Integer &\n" - elif (var=="Irrationals"): - newFile=newFile+"% "+ constraints[index]+ " \in \Irrationals &\n" - elif (var=="Reals"): - newFile=newFile+"% "+ constraints[index]+ " \in \Real &\n" - elif (var=="Rational"): - newFile=newFile+"% "+ constraints[index]+ " \in \Rational &\n" - elif (var=="Primes"): - newFile=newFile+"% "+ constraints[index]+ " \in \Prime &\n" - return(newFile+"\\end {equation} \n\n") - - -file=removeInactive(file) -file=replaceGreekVars(file) -file=replaceSqrt(file) -file=replacePolygamma(file) -file=replaceCos(file) -file=replaceSin(file) -file=replaceTan(file) -file=replaceCsc(file) -file=replaceSec(file) -file=replaceCot(file) -file=replaceArcCos(file) -file=replaceArcSin(file) -file=replaceArcTan(file) -file=replaceArcCsc(file) -file=replaceArcSec(file) -file=replaceArcCot(file) -file=replaceCosh(file) -file=replaceSinh(file) -file=replaceTanh(file) -file=replaceCsch(file) -file=replaceSech(file) -file=replaceCoth(file) -file=replaceInfinity(file) -file=ContinuedFractionK(file) -file=replaceAbs(file) -file=comparativeRelators(file) - - -count=0 -position=0 -yorn=False -for index in range(len(file)): - if file[index: index+2]=="(*": - count=index - position=file.find("\n", index) - position=file.find("\n", position+1) - newFile.write(equationSetUp(file[index: position]).replace("*"," ")) -newFile.close() diff --git a/eCF/.gitignore b/eCF/.gitignore new file mode 100644 index 0000000..b5ffbf6 --- /dev/null +++ b/eCF/.gitignore @@ -0,0 +1,28 @@ +Divya/ +other/ + +data/Identities.* +data/newIdentities.* +data/newIdentitiesnew.* +data/IdentitiesTest.m +data/References.txt +data/ZE.3.* +data/ZE.3new.* +data/ZE.4.* +data/questions.txt + +src/test.txt +src/Glossary.csv +src/new.Glossary.csv +src/new.Glossary.updated.csv +src/pythonTest.py +src/tasks.txt +src/README_Glossary +src/x.log + +*.sty +*.aux +*.csv +*.sty +*.out +*.log diff --git a/eCF/data/functions b/eCF/data/functions new file mode 100644 index 0000000..5a51260 --- /dev/null +++ b/eCF/data/functions @@ -0,0 +1,116 @@ + Abs, \abs, ({-}), () + AiryAi, \AiryAi, (@{-}), (AiryAiPrime) + AiryAiPrime, \AiryAi', (@{-}), () + AiryBi, \AiryBi, (@{-}), (AiryBiPrime) + AiryBiPrime, \AiryBi', (@{-}), () + ArcCos, \acos, (@@{-}), (ArcCosh) + ArcCosh, \acosh, (@@{-}), () + ArcCot, \acot, (@@{-}), (ArcCoth) + ArcCoth, \acoth, (@@{-}), () + ArcCsc, \acsc, (@@{-}), (ArcCsch) + ArcCsch, \acsch, (@@{-}), () + ArcSec, \asec, (@@{-}), (ArcSech) + ArcSech, \asech, (@@{-}), () + ArcSin, \asin, (@@{-}), (ArcSinh) + ArcSinh, \asinh, (@@{-}), () + ArcTan, \atan, (@@{-}), (ArcTanh) + ArcTanh, \atanh, (@@{-}), () + Arg, \ph, (@{-}), () + BetaRegularized, \IncI, ({-}@{-}{-}), () + Binomial, \binom, ({-}{-}), () + BernoulliB, \BernoulliB, ({-}, {-}@{-}), () + BesselI, \BesselI, ({-}@{-}), (SphericalBesselI) + BesselJ, \BesselJ, ({-}@{-}), (SphericalBesselJ) + BesselK, \BesselK, ({-}@{-}), (SphericalBesselK) + BesselY, \BesselY, ({-}@{-}), (SphericalBesselY) + ChebyshevT, \ChebyT, ({-}@{-}), () + ChebyshevU, \ChebyU, ({-}@{-}), () + Cos, \cos, (@@{-}), (ArcCos, Cosh, CosIntegral) + Cosh, \cosh, (@@{-}), (ArcCosh, CoshIntegral) + CoshIntegral, \CoshInt, (@{-}), () + CosIntegral, \CosInt, (@{-}), () + Cot, \cot, (@@{-}), (ArcCot, Coth) + Coth, \coth, (@@{-}), (ArcCoth) + Csc, \csc, (@@{-}), (ArcCsc, Csch) + Csch, \csch, (@@{-}), (ArcCsch) + DawsonF, \DawsonsInt, (@{-}), () + D, \deriv, ({-}{-}), (ParabolicCylinderD) + EllipticE, \CompEllIntE, (@{-}), () + EllipticK, \CompEllIntK, (@{-}), () + Erf, \erf, (@{-}), () + EllipticTheta, \JacobiTheta, ({-}@{-}{-}), () + Erfc, \erfc, (@{-}), () + Erfi, \inverf, (@{-}), () + ExpIntegralE, \ExpIntn, ({-}@{-}), () + ExpIntegralEi, \ExpInti, (@{-}), () + Fibonacci, \Fibonacci, (Number{-}, {-}@{-}), () + Floor, \floor, ({-}), () + FresnelC, \FresnelCos, (@{-}), () + FresnelS, \FresnelSin, (@{-}), () + GammaRegularized, \GammaQ, (@{-}{-}), () + GegenbauerC, \Ultra, ({-}{-}@{-}), () + HankelH1, \HankelHi, ({-}@{-}), (SphericalHankelH1) + HankelH2, \HankelHii, ({-}@{-}), (SphericalHankelH2) + HarmonicNumber, \HarmonicNumber, ({-}, [-]{-}), () + HermiteH, \Hermite, ({-}@{-}), (HermiteHe) + HurwitzLerchPhi, \HurwitzLerchPhi, (@{-}{-}{-}), () + HurwitzZeta, \HurwitzZeta, (@{-}{-}), () + Hypergeometric0F1, \HyperpFq, ({0}{1}@@{}{-}{-}), (Hypergeometric0F1Regularized) + Hypergeometric1F1, \HyperpFq, ({1}{1}@@{-}{-}{-}), (Hypergeometric1F1Regularized) + Hypergeometric2F1, \HyperpFq, ({2}{1}@@{-,-}{-}{-}), (Hypergeometric2F1Regularized) + Hypergeometric0F1Regularized, \HyperboldpFq, ({0}{1}@@{}{-}{-}), () + Hypergeometric1F1Regularized, \HyperboldpFq, ({1}{1}@@{-}{-}{-}), () + Hypergeometric2F1Regularized, \HyperboldpFq, ({2}{1}@@{-,-}{-}{-}), () + HypergeometricPFQ, \HyperpFq, ({-}{-}@@--{-}), (QHypergeometricPFQ) + HypergeometricU, \KummerU, (@{-}{-}{-}), () + Im, \imagpart, ({-}), () + JacobiCN, \Jacobicn, (@{-}{-}), () + JacobiDN, \Jacobidn, (@{-}{-}), () + JacobiP, \JacobiP, ({-}{-}{-}@{-}), () + JacobiSN, \Jacobisn, (@{-}{-}), () + KelvinBei, \Kelvinbei, ({-}, {-}@@{-}), () + KelvinBer, \Kelvinber, ({-}, {-}@@{-}), () + KelvinKei, \Kelvinkei, ({-}, {-}@@{-}), () + KelvinKer, \Kelvinker, ({-}, {-}@@{-}), () + KroneckerDelta, \Kronecker, ({-}{0}, {-}{-}), () + LaguerreL, \Laguerre, ({-}@{-}, [-]{-}@{-}), () + LerchPhi, \LerchPhi, (@{-}{-}{-}), (HurwitzLerchPhi) + Log, \ln, (@{-}), (PolyLog, LogInt, LogGamma, ProductLog) + LogGamma, \ln, (@@{\EulerGamma@{-}}), () + LogIntegral, \LogInt, (@{-}), () + LucasL, \LucasL, ({-}, {-}@{-}), () + Max, \max, ((-,-), (-,-,-)), () + Min, \min, ((-,-), (-,-,-)), () + Mod, , (({-}\bmod{-})), () + ParabolicCylinderD, \WhitD, ({-}@{-}), () + Pochhammer, \pochhammer, ({-}{-}), (QPochhammer) + PolyLog, \Polylogarithm, ({-}@{-}, S{-}{-}@{-}), () + ProductLog, \LambertW, (@{-}), () + QHypergeometricPFQ, \qHyperrphis, ({-}{-}@@--{-}{-}), () + RamanujanTauTheta, \RamanujanTauTheta, (@{-}), () + Re, \realpart, ({-}), (Regularized, Real) + RiemannSiegelTheta, \RiemannSiegelTheta, (@{-}), () + Sec, \sec, (@@{-}), (ArcSec, Sech) + Sech, \sech, (@@{-}), (ArcSech) + Sinc, \sinc, (@@{-}), () + Sign, \sign, (@@{-}), () + Sin, \sin, (@@{-}), (ArcSin, Sinh, SinIntegral, Sinc) + Sinh, \sinh, (@@{-}), (ArcSinh, SinhIntegral) + SinhIntegral, \SinhInt, (@{-}), () + SinIntegral, \SinInt, (@{-}), () + SphericalBesselJ, \SphBesselJ, ({-}@{-}), () + SphericalBesselY, \SphBesselY, ({-}@{-}), () + SphericalHankelH1, \SphHankelHi, ({-}@{-}), () + SphericalHankelH2, \SphHankelHii, ({-}@{-}), () + Sqrt, \sqrt, ({-}), () + StieltjesGamma, \StieltjesConstants, ({-}), () + StirlingS1, \StirlingS, (@{-}{-}), () + StruveH, \StruveH, ({-}@{-}), () + StruveL, \StruveL, ({-}@{-}), () + Subscript, \text, ({-}_{-}), () + Tan, \tan, (@@{-}), (ArcTan, Tanh) + Tanh, \tanh, (@@{-}), (ArcTanh) + UnitStep, \HeavisideH, (@{-}), () + WhittakerM, \WhitM, ({-}{-}@{-}), () + WhittakerW, \WhitW, ({-}{-}@{-}), () + Zeta, \RiemannZeta, (@{-}, @{-,-}), () \ No newline at end of file diff --git a/eCF/src/__init__.py b/eCF/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/eCF/src/mathematica_to_latex.py b/eCF/src/mathematica_to_latex.py new file mode 100644 index 0000000..f97771d --- /dev/null +++ b/eCF/src/mathematica_to_latex.py @@ -0,0 +1,1022 @@ +""" + + Started by Divya Gandla, Version Without Regex by Kevin Chen + DRMF Project: Converting Mathematica to LaTeX + + http://www.wolframfoundation.org/programs/eCF_Identities.pdf + +""" + +__author__ = 'Kevin Chen' +__status__ = 'Development' +__credits__ = ["Divya Gandla", "Kevin Chen"] + +import os + +DIR_NAME = os.path.dirname(os.path.realpath(__file__)) + '/../data/' + +SYMBOLS = { + 'Alpha': 'alpha', 'Beta': 'beta', 'Gamma': 'gamma', 'Delta': 'delta', + 'Epsilon': 'epsilon', 'Zeta': 'zeta', 'Eta': 'eta', 'Theta': 'theta', + 'Iota': 'iota', 'Kappa': 'kappa', 'Lambda': 'lambda', 'Mu': 'mu', + 'Nu': 'nu', 'Xi': 'xi', 'Omicron': 'o', 'Pi': 'pi', 'Rho': 'rho', + 'Sigma': 'sigma', 'Tau': 'tau', 'Upsilon': 'upsilon', 'Phi': 'phi', + 'Chi': 'chi', 'Psi': 'phi', 'Omega': 'omega', + + 'CapitalAlpha': ' A', 'CapitalBeta': ' B', 'CapitalGamma': 'Gamma', + 'CapitalDelta': 'Delta', 'CapitalEpsilon': 'E', 'CapitalZeta': ' Z', + 'CapitalEta': ' H', 'CapitalTheta': 'Theta', 'CapitalIota': ' I', + 'CapitalKappa': 'K', 'CapitalLambda': 'Lambda', 'CapitalMu': ' M', + 'CapitalNu': ' N', 'CapitalXi': 'Xi', 'CapitalOmicron': 'O', + 'CapitalPi': 'Pi', 'CapitalRho': ' P', 'CapitalSigma': 'Sigma', + 'CapitalTau': ' T', 'CapitalUpsilon': ' Y', 'CapitalPhi': 'Phi', + 'CapitalChi': ' X', 'CapitalPsi': 'Psi', 'CapitalOmega': 'Omega', + + 'CurlyEpsilon': 'varepsilon', 'CurlyTheta': 'vartheta', + 'CurlyKappa': 'varkappa', 'CurlyPi': 'varpi', 'CurlyRho': 'varrho', + 'FinalSigma': 'varsigma', 'CurlyPhi': 'varphi', + 'CurlyCapitalUpsilon': 'varUpsilon', + + 'Aleph': 'aleph', 'Bet': 'beth', 'Gimel': 'gimel', 'Dalet': 'daleth', + + 'Infinity': 'infty'} + +LEFT_BRACKETS = list('([{') +RIGHT_BRACKETS = list(')]}') +TRIG_OUTER = ('ArcCos', 'ArcCosh', 'ArcCot', 'ArcCoth', 'ArcCsc', 'ArcCsch', + 'ArcSec', 'ArcSech', 'ArcSin', 'ArcSinh', 'ArcTan', 'ArcTanh', + 'Sinc') +TRIG_INNER = ('Cos', 'Cot', 'Csc', 'Sec', 'Sin', 'Tan', + 'Cosh', 'Coth', 'Csch', 'Sech', 'Sinh', 'Tanh') +E_EXCEPT = ('EulerGamma', 'Epsilon', 'EulerConstant', 'EulerBeta', + 'ExpIntn', 'ExpInti', 'CompEllIntE', 'CompEllIntK') + + +def find_surrounding(line, function, ex=(), start=0): + # (str, str(, tuple, int)) -> tuple + """ + Finds the indices of the beginning and end of a function; this is the main + function that powers the converter. + + :param line: line with functions that are going to be searched + :param function: the function you're trying to find the surrounding + brackets for + :param ex: exceptions that shouldn't be converted, because conversions do + not see if a function is a part of another function (e.g. the + function "NotEquals" could get converted if a program was told + the original is "Equals" + :param start: index of where to start finding (used if there are multiple + of one function in a line + :returns: positions of opening and ending brackets + """ + positions = [0, 0] + line = line[start:] + positions[0] = line.find(function) + + # Finds the exceptions (if any) and returns indeces after the exception + if ex != '' and len(ex) >= 1: + for e in ex: + if (line.find(e) != -1 and + line.find(e) <= positions[0] and + line.find(e) + len(e) >= positions[0] + len(function)): + return [line.find(e) + len(e) + start, + line.find(e) + len(e) + start] + + # Finds the start and end of a function + count = 0 + for j in range(positions[0] + len(function), len(line) + 1): + + if line[j] in list('([{'): + count += 1 + if line[j] in list(')]}'): + count -= 1 + if count == 0: + if j == positions[0] + len(function): + positions[0] = positions[1] + else: + positions[1] = j + 1 + break + + return positions[0] + start, positions[1] + start + + +def arg_split(line, sep): + # (str, str) -> list + """ + Works very much like 'split', but does not split when the separator is + inside parentheses, brackets, or braces. Useful for nested statements. + + :param line: line to be split + :param sep: seperator (character) + :returns: list of segments + """ + args = [] + count = i = 0 + end = len(line) + 1 + line = line + sep + + while i != end: + if line[i] in LEFT_BRACKETS: + count += 1 + if line[i] in RIGHT_BRACKETS: + count -= 1 + if count == 0 and line[i] == sep: + args.append(line[:i]) + end -= i + 1 + line = line[i + 1:] + i = 0 + else: + i += 1 + + return args + + +def search(line, i, sign, direction=-1): + # (str, list, str(, int)) -> int + """ + Searches for the ends of fractions or carats; excludes signs in brackets + + :param line: line to be searched + :param i: the starting point, usually a "/" or a "^" + :param sign: list of excluding symbols + :param direction: direction of search, left: -1, right: 1 + :returns: indice of end + """ + j = i + direction + if direction == -1: + end = -1 + else: + end = len(line) + count = 0 + + for j in range(i + direction, end, direction): + if line[j] in LEFT_BRACKETS: + count += direction + if line[j] in RIGHT_BRACKETS: + count -= direction + if count == 0 and line[j] in sign: + count -= 1 + if count < 0: + break + if count == 0 and j == end - direction: + j += direction + break + + if direction == 1: + j -= 1 + + return j + + +def process_references(pathr): + # (str) -> dict + """ + Opens references file and process it into a dictionary + + :param pathr: directory of file to be read from + :return: dictionary of processed references + """ + with open(pathr) as refs: + references = list(line.split('\n') for line in + refs.read().split('\n\n')) + + key = [] + value = [] + for pair in references: + key.append(pair[0][3:-1].replace('"', '')) + value.append('&'.join(pair[1:])) + + return dict(zip(key, value)) + + +def master_function(line, params): + # (str, tuple) -> str + """ + A master function, reads in the conversion templates from the 'functions' + file and performs the conversion. + + :param line: line to be converted + :param params: tuple containing Mathematica function, equivalent LaTeX + function, the format, using "-" as argument placings, and + exceptions, if any + :returns: converted line + """ + m, l, sep, ex = params[:5] + sep = [i.split('-') for i in sep] + multi = list('+-*/') + for _ in range(line.count(m)): + try: + pos + except NameError: + pos = find_surrounding(line, m, ex=ex) + else: + pos = find_surrounding(line, m, ex=ex, + start=pos[0] + (0, len(l) + 1) + [(1, 0).index(pos[1] == pos[0])]) + + if pos[0] != pos[1]: + args = arg_split(line[pos[0] + len(m) + 1:pos[1] - 1], ',') + + # Special functions that change the order of arguments: + if m == 'GegenbauerC': + args[0], args[1] = args[1], args[0] + if m == 'HarmonicNumber' and len(args) == 2: + args[0], args[1] = args[1], args[0] + if m == 'LaguerreL' and len(args) == 3: + args[0], args[1] = args[1], args[0] + if m in ('HypergeometricPFQ', 'QHypergeometricPFQ'): + if args[1] == '{}': + args.insert(0, 0) + else: + args.insert(0, len(arg_split(args[1][1:-1], ','))) + if args[1] == '{}': + args.insert(0, 0) + else: + args.insert(0, len(arg_split(args[1][1:-1], ','))) + + # If the arguments in a trig function are more than one variable, + # then instead of "@@" make it "@" + if (m in TRIG_OUTER or m in TRIG_INNER) and \ + sum([args[0].count(element) for element in multi]) != 0: + sep[0][0] = sep[0][0].replace('@@', '@') + + # Add parens around ambiguous functions (trig functions) + if m in TRIG_OUTER and len(line) != pos[1] and line[pos[1]] == '^': + line = line[:pos[0]] + '(' + l + \ + '%s'.join(sep[[len(y) for y in sep] + .index(len(args) + 1)]) + ')' + line[pos[1]:] + # Add the inner square, like \cos^2{x} + elif m in TRIG_INNER and len(line) != pos[1] and \ + line[pos[1]] == '^': + if line[pos[1] + 1] == '{' and line[pos[1] + 3] == '}': + line = line[:pos[0]] + l + line[pos[1]:pos[1] + 4] + \ + '%s'.join(sep[[len(y) for y in sep]. + index(len(args) + 1)]) + line[pos[1] + 4:] + else: + line = line[:pos[0]] + '(' + l + \ + '%s'.join(sep[[len(y) for y in sep]. + index(len(args) + 1)]) + ')' + \ + line[pos[1]:] + else: + line = line[:pos[0]] + l + \ + '%s'.join(sep[[len(y) for y in sep]. + index(len(args) + 1)]) + line[pos[1]:] + line %= tuple(args) + + return line + + +def remove_inactive(line): + # (str) -> str + """ + Removes 'Inactive' and its surrounding brackets. + + :param line: line to be converted + :returns: converted line + """ + for _ in range(line.count('Inactive')): + pos = find_surrounding(line, 'Inactive') + if pos[0] != pos[1]: + line = line[:pos[0]] + line[pos[0] + 9:pos[1] - 1] + line[pos[1]:] + + return line + + +def remove_conditionalexpression(line): + # (str) -> str + """ + Removes 'ConditionalExpression' and its surrounding brackets. + + :param line: line to be converted + :returns: converted line + """ + for _ in range(line.count('ConditionalExpression')): + pos = find_surrounding(line, 'ConditionalExpression') + if pos[0] != pos[1]: + line = line[:pos[0]] + line[pos[0] + 22:pos[1] - 1] + line[pos[1]:] + + return line + + +def remove_symbol(line): + # (str) -> str + """ + Removes 'Symbol' and its surrounding brackets. + + :param line: line to be converted + :returns: converted line + """ + for _ in range(line.count('Symbol')): + pos = find_surrounding(line, 'Symbol') + if pos[0] != pos[1]: + line = line[:pos[0]] + line[pos[0] + 7:pos[1] - 1] + line[pos[1]:] + + return line + + +def carat(line): + # (str) -> str + """ + Converts carats ('^') to ones with braces instead of parentheses. e.g: + 'a ^ (b + c)' would only show the first character 'b' as superscript in + LaTeX, but converting it to + 'a ^ {b + c}' would make it look correct in LaTeX, with 'b + c' as the + superscript. + + :param line: line to be converted + :returns: converted line + """ + i = 0 + + while i != len(line): + if line[i] == '^': + k = search(line, i, list('*/+-=, '), 1) + if line[i + 1] == '(' and line[k] == ')': + line = line[:i] + '^{' + line[i + 2:k] + '}' + line[k + 1:] + else: + line = line[:i] + '^{' + line[i + 1:k + 1] + '}' + line[k + 1:] + + i += 1 + + return line + + +def beta(line): + # (str) -> str + """ + Converts Mathematica's 'Beta' function to the equivalent LaTeX macro, + taking into account the variations for the different number of arguments. + + :param line: line to be convertedmathematica_to_latex.py:324 + :returns: converted line + """ + for _ in range(line.count('Beta')): + try: + pos + except NameError: + pos = find_surrounding(line, 'Beta', + ex=('BetaRegularized', '[Beta]')) + else: + pos = find_surrounding(line, 'Beta', + ex=('BetaRegularized', '[Beta]'), + start=pos[0] + (0, 9) + [(1, 0).index(pos[1] == pos[0])]) + + if pos[0] != pos[1]: + args = arg_split(line[pos[0] + 5:pos[1] - 1], ',') + if len(args) == 2: + line = (line[:pos[0]] + '\\EulerBeta@{{{0}}}{{{1}}}' + .format(args[0], args[1]) + line[pos[1]:]) + else: + line = (line[:pos[0]] + '\\IncBeta{{{0}}}@{{{1}}}{{{2}}}' + .format(args[0], args[1], args[2]) + line[pos[1]:]) + + return line + + +def cfk(line): + # (str) -> str + """ + Converts Mathematica's 'ContinuedFractionK' to the equivalent LaTeX macro. + + :param line: line to be converted + :returns: converted line + """ + for _ in range(line.count('ContinuedFractionK')): + try: + pos + except NameError: + pos = find_surrounding(line, 'ContinuedFractionK', ex='') + else: + pos = find_surrounding(line, 'ContinuedFractionK', ex='', + start=pos[0] + (0, 5) + [(1, 0).index(pos[1] == pos[0])]) + + if pos[0] != pos[1]: + args = arg_split(line[pos[0] + 19:pos[1] - 1], ',') + moreargs = arg_split(args[-1][1:-1], ',') + if len(args) == 3: + line = (line[:pos[0]] + + '\\CFK{{{0}}}{{{1}}}{{{2}}}@@{{{3}}}{{{4}}}' + .format(moreargs[0], moreargs[1], moreargs[2], + args[0], args[1]) + line[pos[1]:]) + else: + line = (line[:pos[0]] + + '\\CFK{{{0}}}{{{1}}}{{{2}}}@@{{1}}{{{3}}}' + .format(moreargs[0], moreargs[1], moreargs[2], + args[0]) + line[pos[1]:]) + + return line + + +def gamma(line): + # (str) -> str + """ + Converts Mathematica's 'Gamma' function to the equivalent LaTeX macro, + taking into account the variations for the different number of arguments. + + :param line: line to be converted + :returns: converted line + """ + for _ in range(line.count('Gamma')): + try: + pos + except NameError: + pos = find_surrounding(line, 'Gamma', + ex=('PolyGamma', 'CapitalGamma', 'LogGamma', + 'EulerGamma', 'IncGamma', 'Gamma]', + 'GammaQ', 'GammaRegularized', + 'StieltjesGamma')) + else: + pos = find_surrounding(line, 'Gamma', + ex=('PolyGamma', 'CapitalGamma', 'LogGamma', + 'EulerGamma', 'IncGamma', 'Gamma]', + 'GammaQ', 'GammaRegularized', + 'StieltjesGamma'), + start=pos[0] + (0, 11) + [(1, 0).index(pos[1] == pos[0])]) + + if pos[0] != pos[1]: + args = arg_split(line[pos[0] + 6:pos[1] - 1], ',') + if len(args) == 1: + line = (line[:pos[0]] + '\\EulerGamma@{{{0}}}' + .format(args[0]) + line[pos[1]:]) + elif len(args) == 2: + line = (line[:pos[0]] + '\\IncGamma@{{{0}}}{{{1}}}' + .format(args[0], args[1]) + line[pos[1]:]) + else: + line = (line[:pos[0]] + '\\Incgamma@{{{0}}}{{{1}}} - ' + .format(args[0], args[1]) + '\\Incgamma@{{{0}}}{{{1}}}' + .format(args[0], args[2]) + line[pos[1]:]) + + return line.replace('Incgamma', 'IncGamma') + # needed or the addition of an 'IncGamma' would screw up the rest + + +def integrate(line): + # (str) -> str + """ + Converts Mathematica's 'Integrate' function to the equivalent LaTeX macro. + + :param line: line to be converted + :returns: converted line + """ + for _ in range(line.count('Integrate')): + try: + pos + except NameError: + pos = find_surrounding(line, 'Integrate', ex='') + else: + pos = find_surrounding(line, 'Integrate', ex='', + start=pos[0] + (0, 10) + [(1, 0).index(pos[1] == pos[0])]) + + if pos[0] != pos[1]: + args = arg_split(line[pos[0] + 10:pos[1] - 1], ',') + moreargs = arg_split(args[1][1:-1], ',') + line = (line[:pos[0]] + '\\int_{{{1}}}^{{{2}}}{{{3}}}d{{{0}}}' + .format(moreargs[0], moreargs[1], moreargs[2], args[0]) + + line[pos[1]:]) + + return line + + +def legendrep(line): + # (str) -> str + """ + Converts Mathematica's 'LegendreP' function to the equivalent LaTeX macro, + taking into account the variations for the different number of arguments. + + :param line: line to be converted + :returns: converted line + """ + for _ in range(line.count('LegendreP')): + try: + pos + except NameError: + pos = find_surrounding(line, 'LegendreP', ex='') + else: + pos = find_surrounding(line, 'LegendreP', ex='', + start=pos[0] + (0, 10) + [(1, 0).index(pos[1] == pos[0])]) + + if pos[0] != pos[1]: + args = arg_split(line[pos[0] + 10:pos[1] - 1], ',') + if len(args) == 2: + line = (line[:pos[0]] + '\\LegendreP{{{0}}}@{{{1}}}' + .format(args[0], args[1]) + line[pos[1]:]) + else: + # len(args) == 4 + if args[2] in ('1', '2'): + line = (line[:pos[0]] + '\\FerrersP[{1}]{{{0}}}@{{{2}}}' + .format(args[0], args[1], args[3]) + line[pos[1]:]) + else: + # args[2] == 3 + line = (line[:pos[0]] + '\\LegendreP[{1}]{{{0}}}@{{{2}}}' + .format(args[0], args[1], args[3]) + line[pos[1]:]) + + return line + + +def legendreq(line): + # (str) -> str + """ + Converts Mathematica's 'LegendreQ' function to the equivalent LaTeX macro, + taking into account the variations for the different number of arguments. + + :param line: line to be converted + :returns: converted line + """ + for _ in range(line.count('LegendreQ')): + try: + pos + except NameError: + pos = find_surrounding(line, 'LegendreQ', ex='') + else: + pos = find_surrounding(line, 'LegendreQ', ex='', + start=pos[0] + (0, 10) + [(1, 0).index(pos[1] == pos[0])]) + + if pos[0] != pos[1]: + args = arg_split(line[pos[0] + 10:pos[1] - 1], ',') + if len(args) == 2: + line = (line[:pos[0]] + '\\LegendreQ{{{0}}}@{{{1}}}' + .format(args[0], args[1]) + line[pos[1]:]) + else: + # len(args) == 4 + if args[2] in ('1', '2'): + line = (line[:pos[0]] + '\\FerrersQ[{1}]{{{0}}}@{{{2}}}' + .format(args[0], args[1], args[3]) + line[pos[1]:]) + else: + # args[2] == 3 + line = (line[:pos[0]] + '\\LegendreQ[{1}]{{{0}}}@{{{2}}}' + .format(args[0], args[1], args[3]) + line[pos[1]:]) + + return line + + +def polyeulergamma(line): + # (str) -> str + """ + Converts Mathematica's 'Polygamma' function to the equivalent LaTeX macro, + taking into account the variations for the different number of arguments. + + :param line: line to be converted + :returns: converted line + """ + for _ in range(line.count('PolyGamma')): + try: + pos + except NameError: + pos = find_surrounding(line, 'PolyGamma', ex='') + else: + pos = find_surrounding(line, 'PolyGamma', ex='', + start=pos[0] + (0, 10) + [(1, 0).index(pos[1] == pos[0])]) + + if pos[0] != pos[1]: + args = arg_split(line[pos[0] + 10:pos[1] - 1], ',') + if len(args) == 2: + line = (line[:pos[0]] + '\\polygamma{{{0}}}@{{{1}}}' + .format(args[0], args[1]) + line[pos[1]:]) + else: + line = (line[:pos[0]] + '\\digamma@{{{0}}}' + .format(args[0]) + line[pos[1]:]) + + return line + + +def product(line): + # (str) -> str + """ + Converts Mathematica's product sum function to the equivalent LaTeX macro. + + :param line: line to be converted + :returns: converted line + """ + for _ in range(line.count('Product')): + try: + pos + except NameError: + pos = find_surrounding(line, 'Product', ex='') + else: + pos = find_surrounding(line, 'Product', ex='', + start=pos[0] + (0, 6) + [(1, 0).index(pos[1] == pos[0])]) + + if pos[0] != pos[1]: + args = arg_split(line[pos[0] + 8:pos[1] - 1], ',') + moreargs = arg_split(args[-1][1:-1], ',') + line = (line[:pos[0]] + '\\Prod{{{0}}}{{{1}}}{{{2}}}@{{{3}}}' + .format(moreargs[0], moreargs[1], moreargs[2], args[0]) + + line[pos[1]:]) + + return line + + +def qpochhammer(line): + # (str) -> str + """ + Converts Mathematica's 'QPochhammer' function to the equivalent LaTeX + macro. + + :param line: line to be converted + :returns: converted line + """ + for _ in range(line.count('QPochhammer')): + try: + pos + except NameError: + pos = find_surrounding(line, 'QPochhammer', ex='') + else: + pos = find_surrounding(line, 'QPochhammer', ex='', + start=pos[0] + (0, 13) + [(1, 0).index(pos[1] == pos[0])]) + + if pos[0] != pos[1]: + args = arg_split(line[pos[0] + 12:pos[1] - 1], ',') + + if len(args) == 1: + line = (line[:pos[0]] + '\\qPochhammer{{{0}}}{{{1}}}{2}' + .format(args[0], args[0], '{\\infty}') + line[pos[1]:]) + elif len(args) == 2: + line = (line[:pos[0]] + '\\qPochhammer{{{0}}}{{{1}}}{2}' + .format(args[0], args[1], '{\\infty}') + line[pos[1]:]) + else: # len(args) = 3 + line = (line[:pos[0]] + '\\qPochhammer{{{0}}}{{{1}}}{{{2}}}' + .format(args[0], args[1], args[2]) + line[pos[1]:]) + + return line + + +def summation(line): + # (str) -> str + """ + Converts Mathematica's summation function to the equivalent LaTeX macro. + + :param line: line to be converted + :returns: converted line + """ + for _ in range(line.count('Sum')): + try: + pos + except NameError: + pos = find_surrounding(line, 'Sum', ex='') + else: + pos = find_surrounding(line, 'Sum', ex='', + start=pos[0] + (0, 5) + [(1, 0).index(pos[1] == pos[0])]) + + if pos[0] != pos[1]: + args = arg_split(line[pos[0] + 4:pos[1] - 1], ',') + moreargs = arg_split(args[-1][1:-1], ',') + line = (line[:pos[0]] + '\\Sum{{{0}}}{{{1}}}{{{2}}}@{{{3}}}' + .format(moreargs[0], moreargs[1], moreargs[2], args[0]) + + line[pos[1]:]) + + return line + + +def constraint(line): + # (str) -> str + """ + Converts Mathematica's 'Element', 'NotElement', and 'Inequality' functions + to LaTeX formatting using \\constraint{}. + + :param line: line to be converted + :returns: converted line + """ + sections = arg_split(line, ',') + + if len(sections) in (1, 0): + return line + + constraints = arg_split(sections[-1].replace('&&', '&'), '&') + + for i, element, in enumerate(constraints): + if i == 0: + constraints[i] = ('\n% \\constraint{$' + + element.replace('&', ' \\land ')) + else: + constraints[i] = ('\n% & $' + + element.replace('&', ' \\land ')) + if i == len(constraints) - 1: + constraints[i] += '$}' + else: + constraints[i] += '$' + + line = sections[0] + ''.join(constraints) + + mathematica_elements = ('Complexes', 'Wholes', 'Naturals', 'Integers', + 'Irrationals', 'Reals', 'Rational', 'Primes') + latex_elements = ('Complex', 'Whole', 'NatNumber', 'Integer', + 'Irrational', 'Real', 'Rational', 'Prime') + + for _ in range(line.count('Element')): + + try: + pos1 + except NameError: + pos1 = find_surrounding(line, 'Element', ex=('NotElement',)) + else: + pos1 = find_surrounding(line, 'Element', ex=('NotElement',), + start=pos1[0] + (0, 8) + [(1, 0).index(pos1[1] == pos1[0])]) + + if pos1[0] != pos1[1]: + sep = arg_split(line[pos1[0] + 8:pos1[1] - 1], ',') + sep[1] = latex_elements[mathematica_elements.index(sep[1])] + line = (line[:pos1[0]] + sep[0].replace('|', ',') + ' \\in \\' + + sep[1] + line[pos1[1]:]) + + for _ in range(line.count('NotElement')): + + try: + pos2 + except NameError: + pos2 = find_surrounding(line, 'NotElement', ex=()) + else: + pos2 = find_surrounding(line, 'NotElement', ex=(), + start=pos2[0] + (0, 11) + [(1, 0).index(pos2[1] == pos2[0])]) + + if pos2[0] != pos2[1]: + sep = arg_split(line[pos2[0] + 11:pos2[1] - 1], ',') + sep[1] = latex_elements[mathematica_elements.index(sep[1])] + line = (line[:pos2[0]] + sep[0].replace('|', ',') + + ' \\notin \\' + sep[1] + line[pos2[1]:]) + + for _ in range(line.count('Inequality')): + pos3 = find_surrounding(line, 'Inequality') + line = (line[:pos3[0]] + + ''.join(line[pos3[0] + 11:pos3[1] - 1].split(',')) + + line[pos3[1]:]) + + return line + + +def convert_fraction(line): + # (str) -> str + """ + Converts Mathematica fractions, which are only '/', to LaTeX + \\frac{}{}-ions. + + :param line: line to be converted + :returns: converted line + """ + i = 0 + sign = list('*+-=,<>&') + + while i != len(line): + if line[i] == '/': + + j = search(line, i, sign) + k = search(line, i, sign, 1) + + # Removes extra surrounding parentheses, if there are any. + # This won't work if you're doing "( )( )/( )( )": it will + # incorrectly change it to " )( / )( ", but there are no cases of + # this happening yet, so I have not gone to fixing this yet. + if (line[j + 1] == '(' and line[i - 1] == ')' and + line[i + 1] == '(' and line[k] == ')'): + # ()/() + line = '{0}\\frac{{{1}}}{{{2}}}{3}' \ + .format(line[:j + 1], line[j + 2:i - 1], + line[i + 2:k], line[k + 1:]) + elif line[j + 1] == '(' and line[i - 1] == ')': + # ()/-- + line = '{0}\\frac{{{1}}}{{{2}}}{3}' \ + .format(line[:j + 1], line[j + 2:i - 1], + line[i + 1:k + 1], line[k + 1:]) + elif line[i + 1] == '(' and line[k] == ')': + # --/() + line = '{0}\\frac{{{1}}}{{{2}}}{3}' \ + .format(line[:j + 1], line[j + 1:i], + line[i + 2:k], line[k + 1:]) + else: + # --/-- + line = '{0}\\frac{{{1}}}{{{2}}}{3}' \ + .format(line[:j + 1], line[j + 1:i], + line[i + 1:k + 1], line[k + 1:]) + i += 1 + + return line + + +def piecewise(line): + # (str) -> str + """ + Converts Mathematica's piecewise function to LaTeX, using 'cases'. + + :param line: line to be converted + :returns: converted line + """ + for _ in range(line.count('Piecewise')): + try: + pos + except NameError: + pos = find_surrounding(line, 'Piecewise', ex='') + else: + pos = find_surrounding(line, 'Piecewise', ex='', + start=pos[0] + (0, 15) + [(1, 0).index(pos[1] == pos[0])]) + + if pos[0] != pos[1]: + args = arg_split(line[pos[0] + 10:pos[1] - 1], ',') + + piece = ' \\\\ '.join([' & '.join(arg_split(i[1:-1], ',')) + for i in arg_split(args[0][1:-1], ',')]) + + if len(args) == 1: + piece += ' \\\\ 0 & \\text{True}' + else: + piece += ' \\\\ ' + args[1] + ' & \\text{True}' + + line = (line[:pos[0]] + '{\\begin{cases} ' + piece + + ' \\end{cases}}' + line[pos[1]:]) + + return line + + +def replace_operators(line): + # (str) -> str + """ + Replaces basic operators. + + :param line: line to be converted + :returns: converted line + """ + line = line.replace('==', '=') + line = line.replace('!=', ' \\ne ') + line = line.replace('||', ' \\lor ') + line = line.replace('>=', ' \\geq ') + line = line.replace('<=', ' \\leq ') + line = line.replace('LessEqual', ' \\leq ') + line = line.replace('Less', '<') + line = line.replace('>', ' > ') + line = line.replace('<', ' < ') + line = line.replace('=', ' = ') + line = line.replace('^', ' ^ ') + line = line.replace('*', ' ') + line = line.replace('+', ' + ') + line = line.replace('-', ' - ') + line = line.replace(',', ', ') + + # This is so that things in a constraint, which is denoted by percentage + # signs, don't get operators converted + if '%' in line: + parts = (line[:line.index('%')], line[line.index('%'):]) + line = parts[0] + line = line.replace('(', '\\left( ') + line = line.replace(')', ' \\right)') + line = line.replace(' ', ' ') + line += parts[1] + else: + line = line.replace('(', '\\left( ') + line = line.replace(')', ' \\right)') + line = line.replace(' ', ' ') + + line = line.replace('"a"', 'a') + line = line.replace('Catalan', '\\CatalansConstant') + line = line.replace('GoldenRatio', '\\GoldenRatio') + line = line.replace('Pi', '\\pi') + line = line.replace('CalculateData`Private`nu', '\\nu') + line = line.replace('\\Jacobisn@{t}{m ^ {2}} ^ {2}', + '\\Jacobisn^{2}@{t}{m ^ {2}}') + + # Replaces "E" constant with "\\expe" + for word in E_EXCEPT: + line = line.replace(word, word.replace('E', 'A')) + line = line.replace('E', '\\expe') + for word in E_EXCEPT: + line = line.replace(word.replace('E', 'A'), word) + + return line + + +def replace_vars(line): + # (str) -> str + """ + Replaces the easy to convert variables in Mathematica to its equivalent + LaTeX code in the dictionary 'symbols'. + + :param line: line to be converted + :returns: converted line + """ + for word in SYMBOLS: + if SYMBOLS[word][0] == ' ': + line = line.replace('\\[' + word + ']', SYMBOLS[word][1:]) + elif word == 'Infinity': + line = line.replace('Infinity', '\\infty') + else: + line = line.replace('[' + word + ']', SYMBOLS[word]) + + return line + + +def main(pathw=DIR_NAME + 'newIdentities.tex', + pathr=DIR_NAME + 'Identities.m', + pathref=DIR_NAME + 'References.txt'): + # ((str, str)) -> None + """ + Opens Mathematica file with identities and puts converted lines into + newIdentities.tex. + + :param pathw: directory of file to be written to + :param pathr: directory of file to be read from + :param pathref: directory of file with references to be inserted + :returns: None + """ + references = process_references(pathref) + + with open(pathw, 'w') as latex: + with open(pathr, 'r') as mathematica: + + latex.write('\n\\documentclass{article}\n\n' + '\\usepackage{amsmath}\n' + '\\usepackage{amsfonts}\n' + '\\usepackage{amssymb}\n' + '\\usepackage{breqn}\n' + '\\usepackage{DLMFmath}\n' + '\\usepackage{DRMFfcns}\n' + '\\usepackage[paperwidth=15in, paperheight=20in, ' + 'margin=0.5in]{geometry}\n\n' + '\\begin{document}\n\n\n') + + for line in mathematica: + line = line.replace('\n', '') + + if '(*' in line and '*)' in line: + mtt = line[4:-3].replace('"', '') + line = '\\begin{equation}' + latex.write(line + '\n') + else: + line = line.replace(' ', '') + + line = remove_inactive(line) + line = remove_conditionalexpression(line) + line = remove_symbol(line) + + line = line.replace('EulerGamma', '\\EulerConstant') + + line = carat(line) + + for func in FUNCTION_CONVERSIONS: + line = master_function(line, func) + + line = beta(line) + line = cfk(line) + line = gamma(line) + line = integrate(line) + line = legendrep(line) + line = legendreq(line) + line = polyeulergamma(line) + line = product(line) + line = qpochhammer(line) + line = summation(line) + + line = convert_fraction(line) + line = constraint(line) + line = piecewise(line) + line = replace_operators(line) + line = replace_vars(line) + + if line != '': + line += '\n% \\mathematicatag{$\\tt{' + mtt + '}$}' + try: + line += '\n% \\mathematicareference{$\\text{' + \ + references[mtt] + '}$}' + except KeyError: + pass + line = ' ' + line + '\n\\end{equation}' + + print line + latex.write(line + '\n') + + latex.write('\n\n\\end{document}\n') + + +# Open data/functions, and process the data into a comprehensible tuple that +# gets fed into the "master_function" function +with open(DIR_NAME + 'functions') as functions: + FUNCTION_CONVERSIONS = list(arg_split(line.replace(' ', ''), ',') for line + in functions.read().split('\n') + if (line != '' and '#' not in line)) + +for index, item in enumerate(FUNCTION_CONVERSIONS): + FUNCTION_CONVERSIONS[index][2] = \ + tuple(arg_split(FUNCTION_CONVERSIONS[index][2][1:-1], ',')) + + if FUNCTION_CONVERSIONS[index][3] == '()': + FUNCTION_CONVERSIONS[index][3] = '' + else: + FUNCTION_CONVERSIONS[index][3] = \ + tuple(FUNCTION_CONVERSIONS[index][3][1:-1].split(',')) + + FUNCTION_CONVERSIONS[index] = tuple(FUNCTION_CONVERSIONS[index]) + +FUNCTION_CONVERSIONS = tuple(FUNCTION_CONVERSIONS) + + +if __name__ == '__main__': + main() diff --git a/eCF/test/__init__.py b/eCF/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/eCF/test/data/test.m b/eCF/test/data/test.m new file mode 100644 index 0000000..1864fd5 --- /dev/null +++ b/eCF/test/data/test.m @@ -0,0 +1,5 @@ +(* {"description", number}*) +equation + +(* {"nodescription", number}*) +equation \ No newline at end of file diff --git a/eCF/test/data/test.tex b/eCF/test/data/test.tex new file mode 100644 index 0000000..bef7adc --- /dev/null +++ b/eCF/test/data/test.tex @@ -0,0 +1,27 @@ + +\documentclass{article} + +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{amssymb} +\usepackage{breqn} +\usepackage{DLMFmath} +\usepackage{DRMFfcns} +\usepackage[paperwidth=15in, paperheight=20in, margin=0.5in]{geometry} + +\begin{document} + + +\begin{equation} + equation +% \mathematicatag{$\tt{description, number}$} +% \mathematicareference{$\text{test reference line 1&test reference line 2}$} +\end{equation} + +\begin{equation} + equation +% \mathematicatag{$\tt{nodescription, number}$} +\end{equation} + + +\end{document} diff --git a/eCF/test/data/testref.txt b/eCF/test/data/testref.txt new file mode 100644 index 0000000..b61ac73 --- /dev/null +++ b/eCF/test/data/testref.txt @@ -0,0 +1,3 @@ +% {"description", number} +test reference line 1 +test reference line 2 \ No newline at end of file diff --git a/eCF/test/test_arg_split.py b/eCF/test/test_arg_split.py new file mode 100644 index 0000000..44946a8 --- /dev/null +++ b/eCF/test/test_arg_split.py @@ -0,0 +1,33 @@ + +__author__ = 'Kevin Chen' +__status__ = 'Development' + +from unittest import TestCase +from mathematica_to_latex import arg_split + + +class TestArgumentSplit(TestCase): + + def test_normal(self): + self.assertEqual(arg_split(','.join(list('abcdef')), ','), ','.join(list('abcdef')).split(',')) + + def test_empty(self): + self.assertEqual(arg_split(',,,,,,', ','), ',,,,,,'.split(',')) + + def test_some_empty(self): + before = 'a,,b,,c,,d' + after = ['a', '', 'b', '', 'c', '', 'd'] + self.assertEqual(arg_split(before, ','), after) + + def test_parens(self): + before = '(a,b),[c,d],{e,(f,g)}' + after = ['(a,b)', '[c,d]', '{e,(f,g)}'] + self.assertEqual(arg_split(before, ','), after) + + def test_combined(self): + before = 'a,(b,c),,[d,e],,,{fg,hi}' + after = ['a', '(b,c)', '', '[d,e]', '', '', '{fg,hi}'] + self.assertEqual(arg_split(before, ','), after) + + def test_none(self): + self.assertEqual(arg_split('noseperator', ','), ['noseperator']) diff --git a/eCF/test/test_carat.py b/eCF/test/test_carat.py new file mode 100644 index 0000000..f7c6b9f --- /dev/null +++ b/eCF/test/test_carat.py @@ -0,0 +1,31 @@ + +__author__ = 'Kevin Chen' +__status__ = 'Development' + +from unittest import TestCase +from mathematica_to_latex import carat + + +class TestCarat(TestCase): + + def test_seperate(self): + self.assertEqual(carat('a^b'), 'a^{b}') + self.assertEqual(carat('a^b*c'), 'a^{b}*c') + self.assertEqual(carat('a^b/c'), 'a^{b}/c') + self.assertEqual(carat('a^b+c'), 'a^{b}+c') + self.assertEqual(carat('a^b-c'), 'a^{b}-c') + self.assertEqual(carat('a^b=c'), 'a^{b}=c') + self.assertEqual(carat('a^b,c'), 'a^{b},c') + self.assertEqual(carat('a^b c'), 'a^{b} c') + + def test_parentheses(self): + self.assertEqual(carat('a^(b+c)'), 'a^{b+c}') + self.assertEqual(carat('a^(b+c)*d'), 'a^{b+c}*d') + self.assertEqual(carat('a^(b+c)/d'), 'a^{b+c}/d') + self.assertEqual(carat('a^(b+c)+d'), 'a^{b+c}+d') + self.assertEqual(carat('a^(b+c)-d'), 'a^{b+c}-d') + self.assertEqual(carat('a^(b+c)=d'), 'a^{b+c}=d') + self.assertEqual(carat('a^(b+c),d'), 'a^{b+c},d') + + def test_none(self): + self.assertEqual(carat('nocarat'), 'nocarat') diff --git a/eCF/test/test_constraint.py b/eCF/test/test_constraint.py new file mode 100644 index 0000000..0f469f5 --- /dev/null +++ b/eCF/test/test_constraint.py @@ -0,0 +1,158 @@ + +__author__ = 'Kevin Chen' +__status__ = 'Development' + +from unittest import TestCase +from mathematica_to_latex import constraint + + +class TestConstraint(TestCase): + + def test_element_singlevar(self): + self.assertEqual(constraint('text,Element[a,Complexes]'), + 'text\n' + '% \constraint{$a \in \Complex$}') + self.assertEqual(constraint('text,Element[a,Wholes]'), + 'text\n' + '% \constraint{$a \in \Whole$}') + self.assertEqual(constraint('text,Element[a,Naturals]'), + 'text\n' + '% \constraint{$a \in \\NatNumber$}') + self.assertEqual(constraint('text,Element[a,Integers]'), + 'text\n' + '% \constraint{$a \in \Integer$}') + self.assertEqual(constraint('text,Element[a,Irrationals]'), + 'text\n' + '% \constraint{$a \in \Irrational$}') + self.assertEqual(constraint('text,Element[a,Reals]'), + 'text\n' + '% \constraint{$a \in \Real$}') + self.assertEqual(constraint('text,Element[a,Rational]'), + 'text\n' + '% \constraint{$a \in \Rational$}') + self.assertEqual(constraint('text,Element[a,Primes]'), + 'text\n' + '% \constraint{$a \in \Prime$}') + + def test_element_multivar(self): + self.assertEqual(constraint('text,Element[a|b|c|d,Complexes]'), + 'text\n' + '% \constraint{$a,b,c,d \in \Complex$}') + self.assertEqual(constraint('text,Element[a|b|c|d,Wholes]'), + 'text\n' + '% \constraint{$a,b,c,d \in \Whole$}') + self.assertEqual(constraint('text,Element[a|b|c|d,Naturals]'), + 'text\n' + '% \constraint{$a,b,c,d \in \\NatNumber$}') + self.assertEqual(constraint('text,Element[a|b|c|d,Integers]'), + 'text\n' + '% \constraint{$a,b,c,d \in \Integer$}') + self.assertEqual(constraint('text,Element[a|b|c|d,Irrationals]'), + 'text\n' + '% \constraint{$a,b,c,d \in \Irrational$}') + self.assertEqual(constraint('text,Element[a|b|c|d,Reals]'), + 'text\n' + '% \constraint{$a,b,c,d \in \Real$}') + self.assertEqual(constraint('text,Element[a|b|c|d,Rational]'), + 'text\n' + '% \constraint{$a,b,c,d \in \Rational$}') + self.assertEqual(constraint('text,Element[a|b|c|d,Primes]'), + 'text\n' + '% \constraint{$a,b,c,d \in \Prime$}') + + def test_notelement_singlevar(self): + self.assertEqual(constraint('text,NotElement[a,Complexes]'), + 'text\n' + '% \\constraint{$a \\notin \\Complex$}') + self.assertEqual(constraint('text,NotElement[a,Wholes]'), + 'text\n' + '% \\constraint{$a \\notin \\Whole$}') + self.assertEqual(constraint('text,NotElement[a,Naturals]'), + 'text\n' + '% \\constraint{$a \\notin \\NatNumber$}') + self.assertEqual(constraint('text,NotElement[a,Integers]'), + 'text\n' + '% \\constraint{$a \\notin \\Integer$}') + self.assertEqual(constraint('text,NotElement[a,Irrationals]'), + 'text\n' + '% \\constraint{$a \\notin \\Irrational$}') + self.assertEqual(constraint('text,NotElement[a,Reals]'), + 'text\n' + '% \\constraint{$a \\notin \\Real$}') + self.assertEqual(constraint('text,NotElement[a,Rational]'), + 'text\n' + '% \\constraint{$a \\notin \\Rational$}') + self.assertEqual(constraint('text,NotElement[a,Primes]'), + 'text\n' + '% \\constraint{$a \\notin \\Prime$}') + + def test_notelement_multivar(self): + self.assertEqual(constraint('text,NotElement[a|b|c|d,Complexes]'), + 'text\n' + '% \\constraint{$a,b,c,d \\notin \\Complex$}') + self.assertEqual(constraint('text,NotElement[a|b|c|d,Wholes]'), + 'text\n' + '% \\constraint{$a,b,c,d \\notin \\Whole$}') + self.assertEqual(constraint('text,NotElement[a|b|c|d,Naturals]'), + 'text\n' + '% \\constraint{$a,b,c,d \\notin \\NatNumber$}') + self.assertEqual(constraint('text,NotElement[a|b|c|d,Integers]'), + 'text\n' + '% \\constraint{$a,b,c,d \\notin \\Integer$}') + self.assertEqual(constraint('text,NotElement[a|b|c|d,Irrationals]'), + 'text\n' + '% \\constraint{$a,b,c,d \\notin \\Irrational$}') + self.assertEqual(constraint('text,NotElement[a|b|c|d,Reals]'), + 'text\n' + '% \\constraint{$a,b,c,d \\notin \\Real$}') + self.assertEqual(constraint('text,NotElement[a|b|c|d,Rational]'), + 'text\n' + '% \\constraint{$a,b,c,d \\notin \\Rational$}') + self.assertEqual(constraint('text,NotElement[a|b|c|d,Primes]'), + 'text\n' + '% \\constraint{$a,b,c,d \\notin \\Prime$}') + + def test_inequality(self): + self.assertEqual(constraint('text,Inequality[a,Less,b,LessEqual,c]'), + 'text\n' + '% \\constraint{$aLessbLessEqualc$}') + + def test_multiple(self): + self.assertEqual(constraint('text,Element[a,Complexes]&&Element[b,Wholes]'), + 'text\n' + '% \\constraint{$a \\in \\Complex$\n' + '% & $b \\in \\Whole$}') + self.assertEqual(constraint('text,Element[a,Complexes]&&Element[b,Wholes]&&Element[c,Naturals]'), + 'text\n' + '% \\constraint{$a \\in \\Complex$\n' + '% & $b \\in \\Whole$\n' + '% & $c \\in \\NatNumber$}') + + self.assertEqual(constraint('text,NotElement[a,Complexes]&&NotElement[b,Wholes]'), + 'text\n' + '% \\constraint{$a \\notin \\Complex$\n' + '% & $b \\notin \\Whole$}') + self.assertEqual(constraint('text,NotElement[a,Complexes]&&NotElement[b,Wholes]&&NotElement[c,Naturals]'), + 'text\n' + '% \\constraint{$a \\notin \\Complex$\n' + '% & $b \\notin \\Whole$\n' + '% & $c \\notin \\NatNumber$}') + + self.assertEqual(constraint('text,Inequality[a,Less,b]&&Inequality[b,Less,c]'), + 'text\n' + '% \\constraint{$aLessb$\n' + '% & $bLessc$}') + self.assertEqual(constraint('text,Inequality[a,Less,b]&&Inequality[b,Less,c]&&Inequality[c,Less,d]'), + 'text\n' + '% \\constraint{$aLessb$\n' + '% & $bLessc$\n' + '% & $cLessd$}') + + self.assertEqual(constraint('text,Element[a|b|c,Complexes]&&NotElement[d|e|f,Primes]&&Inequality[g,Less,h,Less,i]'), + 'text\n' + '% \\constraint{$a,b,c \\in \\Complex$\n' + '% & $d,e,f \\notin \\Prime$\n' + '% & $gLesshLessi$}') + + def test_none(self): + self.assertEqual(constraint('noconstraint'), 'noconstraint') \ No newline at end of file diff --git a/eCF/test/test_convert_fraction.py b/eCF/test/test_convert_fraction.py new file mode 100644 index 0000000..2fe9dd5 --- /dev/null +++ b/eCF/test/test_convert_fraction.py @@ -0,0 +1,39 @@ + +__author__ = 'Kevin Chen' +__status__ = 'Development' + +from unittest import TestCase +from mathematica_to_latex import convert_fraction + + +class TestConvertFraction(TestCase): + + def test_stop(self): + self.assertEqual(convert_fraction('a*b/c*d'), 'a*\\frac{b}{c}*d') + self.assertEqual(convert_fraction('a+b/c+d'), 'a+\\frac{b}{c}+d') + self.assertEqual(convert_fraction('a-b/c-d'), 'a-\\frac{b}{c}-d') + self.assertEqual(convert_fraction('a=b/c=d'), 'a=\\frac{b}{c}=d') + self.assertEqual(convert_fraction('a,b/c,d'), 'a,\\frac{b}{c},d') + self.assertEqual(convert_fraction('ab/c>d'), 'a>\\frac{b}{c}>d') + self.assertEqual(convert_fraction('a&b/c&d'), 'a&\\frac{b}{c}&d') + + def test_paren(self): + self.assertEqual(convert_fraction('a*(b+c)/(d+e)*f'), 'a*\\frac{b+c}{d+e}*f') + self.assertEqual(convert_fraction('a+(b+c)/(d+e)+f'), 'a+\\frac{b+c}{d+e}+f') + self.assertEqual(convert_fraction('a-(b+c)/(d+e)-f'), 'a-\\frac{b+c}{d+e}-f') + self.assertEqual(convert_fraction('a=(b+c)/(d+e)=f'), 'a=\\frac{b+c}{d+e}=f') + self.assertEqual(convert_fraction('a,(b+c)/(d+e),f'), 'a,\\frac{b+c}{d+e},f') + self.assertEqual(convert_fraction('a<(b+c)/(d+e)(b+c)/(d+e)>f'), 'a>\\frac{b+c}{d+e}>f') + self.assertEqual(convert_fraction('a&(b+c)/(d+e)&f'), 'a&\\frac{b+c}{d+e}&f') + + self.assertEqual(convert_fraction('(a)/(b)'), '\\frac{a}{b}') + self.assertEqual(convert_fraction('a/(b)'), '\\frac{a}{b}') + self.assertEqual(convert_fraction('(a)/b'), '\\frac{a}{b}') + self.assertEqual(convert_fraction('a/b'), '\\frac{a}{b}') + + self.assertEqual(convert_fraction('a(b+c)/d(e+f)'), '\\frac{a(b+c)}{d(e+f)}') + + def test_none(self): + self.assertEqual(convert_fraction('nofraction'), 'nofraction') diff --git a/eCF/test/test_find_surrounding.py b/eCF/test/test_find_surrounding.py new file mode 100644 index 0000000..af509f3 --- /dev/null +++ b/eCF/test/test_find_surrounding.py @@ -0,0 +1,8 @@ + +__author__ = 'Kevin Chen' +__status__ = 'Development' + +from unittest import TestCase +from mathematica_to_latex import find_surrounding + + diff --git a/eCF/test/test_main.py b/eCF/test/test_main.py new file mode 100644 index 0000000..f102f6d --- /dev/null +++ b/eCF/test/test_main.py @@ -0,0 +1,48 @@ + +__author__ = 'Kevin Chen' +__status__ = 'Development' + +from unittest import TestCase +from mathematica_to_latex import main + +import os + +PATHW = os.path.dirname(os.path.realpath(__file__)) + '/data/test.tex' +PATHR = os.path.dirname(os.path.realpath(__file__)) + '/data/test.m' +PATHREF = os.path.dirname(os.path.realpath(__file__)) + '/data/testref.txt' + + +class TestMain(TestCase): + + def test_generation(self): + main(pathw=PATHW, pathr=PATHR, pathref=PATHREF) + with open(PATHW, 'r') as l: + latex = l.read() + self.assertEqual( + latex, ('\n' + '\\documentclass{article}\n' + '\n' + '\\usepackage{amsmath}\n' + '\\usepackage{amsfonts}\n' + '\\usepackage{amssymb}\n' + '\\usepackage{breqn}\n' + '\\usepackage{DLMFmath}\n' + '\\usepackage{DRMFfcns}\n' + '\\usepackage[paperwidth=15in, paperheight=20in, margin=0.5in]{geometry}\n' + '\n' + '\\begin{document}\n' + '\n' + '\n' + '\\begin{equation}\n' + ' equation\n' + '% \\mathematicatag{$\\tt{description, number}$}\n' + '% \\mathematicareference{$\\text{test reference line 1&test reference line 2}$}\n' + '\\end{equation}\n' + '\n' + '\\begin{equation}\n' + ' equation\n' + '% \\mathematicatag{$\\tt{nodescription, number}$}\n' + '\\end{equation}\n' + '\n' + '\n' + '\\end{document}\n')) diff --git a/eCF/test/test_master_function.py b/eCF/test/test_master_function.py new file mode 100644 index 0000000..41ef177 --- /dev/null +++ b/eCF/test/test_master_function.py @@ -0,0 +1,110 @@ + +__author__ = 'Kevin Chen' +__status__ = 'Development' + +import os +from unittest import TestCase +from mathematica_to_latex import master_function +from mathematica_to_latex import arg_split + + +with open(os.path.dirname(os.path.realpath(__file__)) + '/../data/functions') as functions: + FUNCTION_CONVERSIONS = list(arg_split(line.replace(' ', ''), ',') for line + in functions.read().split('\n') + if (line != '' and '#' not in line)) + + +for index, item in enumerate(FUNCTION_CONVERSIONS): + FUNCTION_CONVERSIONS[index][2] = tuple(arg_split(FUNCTION_CONVERSIONS[index][2][1:-1], ',')) + + if FUNCTION_CONVERSIONS[index][3] == '()': + FUNCTION_CONVERSIONS[index][3] = '' + else: + FUNCTION_CONVERSIONS[index][3] = tuple(FUNCTION_CONVERSIONS[index][3][1:-1].split(',')) + + FUNCTION_CONVERSIONS[index] = tuple(FUNCTION_CONVERSIONS[index]) + +FUNCTION_CONVERSIONS = tuple(FUNCTION_CONVERSIONS) +TRIG_OUTER = ('ArcCos', 'ArcCosh', 'ArcCot', 'ArcCoth', 'ArcCsc', 'ArcCsch', + 'ArcSec', 'ArcSech', 'ArcSin', 'ArcSinh', 'ArcTan', 'ArcTanh', + 'Sinc') +TRIG_INNER = ('Cos', 'Cot', 'Csc', 'Sec', 'Sin', 'Tan', + 'Cosh', 'Coth', 'Csch', 'Sech', 'Sinh', 'Tanh') +MULTI = list('+-*/') + + +class TestMasterFunction(TestCase): + + def test_conversion(self): + for function in FUNCTION_CONVERSIONS: + for case in function[2]: + args = list('abcdefg'[:case.count('-')]) + before = function[0] + '[' + ','.join(args) + ']' + after = function[1] + case.replace('-', '%s') + + if function[0] == 'GegenbauerC': + args[0], args[1] = args[1], args[0] + if function[0] == 'HarmonicNumber' and case.count('-') == 2: + args[0], args[1] = args[1], args[0] + if function[0] == 'LaguerreL' and case.count('-') == 3: + args[0], args[1] = args[1], args[0] + + after %= tuple(args) + + if function[0] == 'HypergeometricPFQ': + self.assertEqual(master_function('HypergeometricPFQ[{},{},a]', function), + '\\HyperpFq{0}{0}@@{}{}{a}') + self.assertEqual(master_function('--HypergeometricPFQ[{},{},a]--', function), + '--\\HyperpFq{0}{0}@@{}{}{a}--') + self.assertEqual(master_function('HypergeometricPFQ[{a,b,c},{d,e,f},g]', function), + '\\HyperpFq{3}{3}@@{a,b,c}{d,e,f}{g}') + self.assertEqual(master_function('--HypergeometricPFQ[{a,b,c},{d,e,f},g]--', function), + '--\\HyperpFq{3}{3}@@{a,b,c}{d,e,f}{g}--') + self.assertEqual(master_function('HypergeometricPFQ[{},{},HypergeometricPFQ[{},{},a]]', function), + '\\HyperpFq{0}{0}@@{}{}{\\HyperpFq{0}{0}@@{}{}{a}}') + elif function[0] == 'QHypergeometricPFQ': + self.assertEqual(master_function('QHypergeometricPFQ[{},{},a,b]', function), + '\\qHyperrphis{0}{0}@@{}{}{a}{b}') + self.assertEqual(master_function('--QHypergeometricPFQ[{},{},a,b]--', function), + '--\\qHyperrphis{0}{0}@@{}{}{a}{b}--') + self.assertEqual(master_function('QHypergeometricPFQ[{a,b,c},{d,e,f},g,h]', function), + '\\qHyperrphis{3}{3}@@{a,b,c}{d,e,f}{g}{h}') + self.assertEqual(master_function('--QHypergeometricPFQ[{a,b,c},{d,e,f},g,h]--', function), + '--\\qHyperrphis{3}{3}@@{a,b,c}{d,e,f}{g}{h}--') + else: + self.assertEqual(master_function(before, function), after) + self.assertEqual(master_function('--{0}--'.format(before), function), '--{0}--'.format(after)) + + # Test single and double "@" signs + if function[0] in TRIG_OUTER or function[0] in TRIG_INNER: + for sep in MULTI: + before2 = before[:-1] + sep + 'b]' + after2 = after.replace('@@', '@')[:-1] + sep + 'b}' + self.assertEqual(master_function(before2, function), after2) + self.assertEqual(master_function('--{0}--'.format(before2), function), '--{0}--'.format(after2)) + + before2 = before + '^{b+c}' + after2 = '(' + after + ')^{b+c}' + self.assertEqual(master_function(before2, function), after2) + self.assertEqual(master_function('--{0}--'.format(before2), function), '--{0}--'.format(after2)) + + # Test powers for trig and hyperbolic functions + if function[0] in TRIG_INNER: + before2 = before + '^{b}' + after2 = after[:-5] + '^{b}@@{a}' + self.assertEqual(master_function(before2, function), after2) + self.assertEqual(master_function('--{0}--'.format(before2), function), '--{0}--'.format(after2)) + + # Test an exception + if function[0] == 'D': + self.assertEqual(master_function('\\[Delta]', function), '\\[Delta]') + + def test_exception(self): + for function in FUNCTION_CONVERSIONS: + if function[3] != '': + for exception in function[3]: + self.assertEqual(master_function(exception + '[]', function), exception + '[]') + + def test_none(self): + for func in FUNCTION_CONVERSIONS: + self.assertEqual(master_function('nofunction', func), 'nofunction') diff --git a/eCF/test/test_piecewise.py b/eCF/test/test_piecewise.py new file mode 100644 index 0000000..2a01df9 --- /dev/null +++ b/eCF/test/test_piecewise.py @@ -0,0 +1,53 @@ + +__author__ = 'Kevin Chen' +__status__ = 'Development' + +from unittest import TestCase +from mathematica_to_latex import piecewise + +class TestPiecewise(TestCase): + + def test_single(self): + self.assertEqual(piecewise( + 'Piecewise[{{var,cond}}]'), + '{\\begin{cases} var & cond \\\\ 0 & \\text{True} \\end{cases}}') + self.assertEqual(piecewise( + '--Piecewise[{{var,cond}}]--'), + '--{\\begin{cases} var & cond \\\\ 0 & \\text{True} \\end{cases}}--') + self.assertEqual(piecewise( + 'Piecewise[{{var,cond}},0]'), + '{\\begin{cases} var & cond \\\\ 0 & \\text{True} \\end{cases}}') + self.assertEqual(piecewise( + '--Piecewise[{{var,cond}},0]--'), + '--{\\begin{cases} var & cond \\\\ 0 & \\text{True} \\end{cases}}--') + self.assertEqual(piecewise( + 'Piecewise[{{var,cond}},num]'), + '{\\begin{cases} var & cond \\\\ num & \\text{True} \\end{cases}}') + self.assertEqual(piecewise( + '--Piecewise[{{var,cond}},num]--'), + '--{\\begin{cases} var & cond \\\\ num & \\text{True} \\end{cases}}--') + + def test_multiple(self): + self.assertEqual(piecewise( + 'Piecewise[{{var1,cond1},{var2,cond2}},0]'), + '{\\begin{cases} var1 & cond1 \\\\ var2 & cond2 \\\\ 0 & \\text{True} \\end{cases}}') + self.assertEqual(piecewise( + '--Piecewise[{{var1,cond1},{var2,cond2}},0]--'), + '--{\\begin{cases} var1 & cond1 \\\\ var2 & cond2 \\\\ 0 & \\text{True} \\end{cases}}--') + self.assertEqual(piecewise( + 'Piecewise[{{var1,cond1},{var2,cond2},{var3,cond3}},0]'), + '{\\begin{cases} var1 & cond1 \\\\ var2 & cond2 \\\\ var3 & cond3 \\\\ 0 & \\text{True} \\end{cases}}') + self.assertEqual(piecewise( + '--Piecewise[{{var1,cond1},{var2,cond2},{var3,cond3}},0]--'), + '--{\\begin{cases} var1 & cond1 \\\\ var2 & cond2 \\\\ var3 & cond3 \\\\ 0 & \\text{True} \\end{cases}}--') + + def test_nested(self): + self.assertEqual(piecewise( + 'Piecewise[{{Piecewise[{{var,Piecewise[{{var,cond}}]}}],Piecewise[{{var,cond}}]}}]'), + '{\\begin{cases} {\\begin{cases} var & {\\begin{cases} var & cond \\\\ 0 & \\text{True} \\end{cases}} \\\\ 0 & \\text{True} \\end{cases}} & {\\begin{cases} var & cond \\\\ 0 & \\text{True} \\end{cases}} \\\\ 0 & \\text{True} \\end{cases}}') + self.assertEqual(piecewise( + '--Piecewise[{{Piecewise[{{var,Piecewise[{{var,cond}}]}}],Piecewise[{{var,cond}}]}}]--'), + '--{\\begin{cases} {\\begin{cases} var & {\\begin{cases} var & cond \\\\ 0 & \\text{True} \\end{cases}} \\\\ 0 & \\text{True} \\end{cases}} & {\\begin{cases} var & cond \\\\ 0 & \\text{True} \\end{cases}} \\\\ 0 & \\text{True} \\end{cases}}--') + + def test_none(self): + self.assertEqual(piecewise('nopiecewise'), 'nopiecewise') diff --git a/eCF/test/test_removal_functions.py b/eCF/test/test_removal_functions.py new file mode 100644 index 0000000..7af5f7b --- /dev/null +++ b/eCF/test/test_removal_functions.py @@ -0,0 +1,61 @@ + +__author__ = 'Kevin Chen' +__status__ = 'Development' + +from unittest import TestCase +from mathematica_to_latex import remove_inactive +from mathematica_to_latex import remove_conditionalexpression +from mathematica_to_latex import remove_symbol + + +BEFORE1 = ('Inactive[test]', + 'testInactive[test]test', + 'Inactive[testInactive[test]test]', + 'testInactive[testInactive[test]test]test') +BEFORE2 = ('ConditionalExpression[test]', + 'testConditionalExpression[test]test', + 'ConditionalExpression[testConditionalExpression[test]test]', + 'testConditionalExpression[testConditionalExpression[test]test]test') +BEFORE3 = ('Symbol[test]', + 'testSymbol[test]test', + 'Symbol[testSymbol[test]test]', + 'testSymbol[testSymbol[test]test]test') +AFTER = ('test', + 'testtesttest', + 'testtesttest', + 'testtesttesttesttest') + + +class TestRemovalFunctions(TestCase): + + def test_single(self): + self.assertEqual(remove_inactive( + BEFORE1[0]), AFTER[0]) + self.assertEqual(remove_conditionalexpression( + BEFORE2[0]), AFTER[0]) + self.assertEqual(remove_symbol( + BEFORE3[0]), AFTER[0]) + + def test_single_withsurrounding(self): + self.assertEqual(remove_inactive( + BEFORE1[1]), AFTER[1]) + self.assertEqual(remove_conditionalexpression( + BEFORE2[1]), AFTER[1]) + self.assertEqual(remove_symbol( + BEFORE3[1]), AFTER[1]) + + def test_nested_inactive(self): + self.assertEqual(remove_inactive( + BEFORE1[2]), AFTER[2]) + self.assertEqual(remove_conditionalexpression( + BEFORE2[2]), AFTER[2]) + self.assertEqual(remove_symbol( + BEFORE3[2]), AFTER[2]) + + def test_nested_withsurrounding(self): + self.assertEqual(remove_inactive( + BEFORE1[3]), AFTER[3]) + self.assertEqual(remove_conditionalexpression( + BEFORE2[3]), AFTER[3]) + self.assertEqual(remove_symbol( + BEFORE3[3]), AFTER[3]) diff --git a/eCF/test/test_replace_operators.py b/eCF/test/test_replace_operators.py new file mode 100644 index 0000000..e88fac5 --- /dev/null +++ b/eCF/test/test_replace_operators.py @@ -0,0 +1,47 @@ + +__author__ = 'Kevin Chen' +__status__ = 'Development' + +from unittest import TestCase +from mathematica_to_latex import replace_operators + + +class TestReplaceOperators(TestCase): + + def test_without_percent(self): + self.assertEqual(replace_operators('=='), ' = ') + self.assertEqual(replace_operators('!='), ' \\ne ') + self.assertEqual(replace_operators('||'), ' \\lor ') + self.assertEqual(replace_operators('>='), ' \\geq ') + self.assertEqual(replace_operators('<='), ' \\leq ') + self.assertEqual(replace_operators('LessEqual'), ' \\leq ') + self.assertEqual(replace_operators('Less'), ' < ') + self.assertEqual(replace_operators('>'), ' > ') + self.assertEqual(replace_operators('<'), ' < ') + self.assertEqual(replace_operators('='), ' = ') + self.assertEqual(replace_operators('^'), ' ^ ') + self.assertEqual(replace_operators('*'), ' ') + self.assertEqual(replace_operators('+'), ' + ') + self.assertEqual(replace_operators('-'), ' - ') + self.assertEqual(replace_operators(','), ', ') + self.assertEqual(replace_operators('('), '\\left( ') + self.assertEqual(replace_operators(')'), ' \\right)') + self.assertEqual(replace_operators(' '), ' ') + self.assertEqual(replace_operators('"a"'), 'a') + + def test_constants(self): + self.assertEqual(replace_operators('Catalan'), '\\CatalansConstant') + self.assertEqual(replace_operators('GoldenRatio'), '\\GoldenRatio') + self.assertEqual(replace_operators('Pi'), '\\pi') + self.assertEqual(replace_operators('CalculateData`Private`nu'), '\\nu') + self.assertEqual(replace_operators('E EulerGamma Epsilon EulerConstant EulerBeta ExpIntn ExpInti CompEllIntE CompEllIntK'), + '\\expe EulerGamma Epsilon EulerConstant EulerBeta ExpIntn ExpInti CompEllIntE CompEllIntK') + + def test_with_percent(self): + self.assertEqual(replace_operators('(%('), '\\left( %(') + self.assertEqual(replace_operators(')%)'), ' \\right)%)') + self.assertEqual(replace_operators(' % '), ' % ') + + def test_none(self): + self.assertEqual(replace_operators(''), '') + self.assertEqual(replace_operators('%'), '%') \ No newline at end of file diff --git a/eCF/test/test_replace_vars.py b/eCF/test/test_replace_vars.py new file mode 100644 index 0000000..68c796b --- /dev/null +++ b/eCF/test/test_replace_vars.py @@ -0,0 +1,44 @@ + +__author__ = 'Kevin Chen' +__status__ = 'Development' + +from unittest import TestCase +from mathematica_to_latex import replace_vars + +SYMBOLS = { + 'Alpha': 'alpha', 'Beta': 'beta', 'Gamma': 'gamma', 'Delta': 'delta', + 'Epsilon': 'epsilon', 'Zeta': 'zeta', 'Eta': 'eta', 'Theta': 'theta', + 'Iota': 'iota', 'Kappa': 'kappa', 'Lambda': 'lambda', 'Mu': 'mu', + 'Nu': 'nu', 'Xi': 'xi', 'Omicron': 'o', 'Pi': 'pi', 'Rho': 'rho', + 'Sigma': 'sigma', 'Tau': 'tau', 'Upsilon': 'upsilon', 'Phi': 'phi', + 'Chi': 'chi', 'Psi': 'phi', 'Omega': 'omega', + + 'CapitalAlpha': ' A', 'CapitalBeta': ' B', 'CapitalGamma': 'Gamma', + 'CapitalDelta': 'Delta', 'CapitalEpsilon': 'E', 'CapitalZeta': ' Z', + 'CapitalEta': ' H', 'CapitalTheta': 'Theta', 'CapitalIota': ' I', + 'CapitalKappa': 'K', 'CapitalLambda': 'Lambda', 'CapitalMu': ' M', + 'CapitalNu': ' N', 'CapitalXi': 'Xi', 'CapitalOmicron': 'O', + 'CapitalPi': 'Pi', 'CapitalRho': ' P', 'CapitalSigma': 'Sigma', + 'CapitalTau': ' T', 'CapitalUpsilon': ' Y', 'CapitalPhi': 'Phi', + 'CapitalChi': ' X', 'CapitalPsi': 'Psi', 'CapitalOmega': 'Omega', + + 'CurlyEpsilon': 'varepsilon', 'CurlyTheta': 'vartheta', + 'CurlyKappa': 'varkappa', 'CurlyPi': 'varpi', 'CurlyRho': 'varrho', + 'FinalSigma': 'varsigma', 'CurlyPhi': 'varphi', + 'CurlyCapitalUpsilon': 'varUpsilon', + + 'Aleph': 'aleph', 'Bet': 'beth', 'Gimel': 'gimel', 'Dalet': 'daleth'} + + +class TestReplaceVars(TestCase): + + def test_replace_symbols(self): + for word in SYMBOLS: + after = '\\' + SYMBOLS[word] + self.assertEqual(replace_vars('\\[' + word + ']'), after.replace('\\ ', '')) + + def test_replace_infinity(self): + self.assertEqual(replace_vars('Infinity'), '\\infty') + + def test_none(self): + self.assertEqual(replace_vars('novariables'), 'novariables') diff --git a/eCF/test/test_search.py b/eCF/test/test_search.py new file mode 100644 index 0000000..cfd50e5 --- /dev/null +++ b/eCF/test/test_search.py @@ -0,0 +1,15 @@ + +__author__ = 'Kevin Chen' +__status__ = 'Development' + +from unittest import TestCase +from mathematica_to_latex import search + + +class TestSearch(TestCase): + + def test_end(self): + pass + + def test_parens(self): + pass diff --git a/eCF/test/test_single_macro_conversion_functions.py b/eCF/test/test_single_macro_conversion_functions.py new file mode 100644 index 0000000..0c05961 --- /dev/null +++ b/eCF/test/test_single_macro_conversion_functions.py @@ -0,0 +1,218 @@ + +__author__ = 'Kevin Chen' +__status__ = 'Development' + +from unittest import TestCase +from mathematica_to_latex import beta +from mathematica_to_latex import cfk +from mathematica_to_latex import gamma +from mathematica_to_latex import integrate +from mathematica_to_latex import legendrep +from mathematica_to_latex import legendreq +from mathematica_to_latex import polyeulergamma +from mathematica_to_latex import product +from mathematica_to_latex import qpochhammer +from mathematica_to_latex import summation + + +class TestBeta(TestCase): + + def test_single(self): + self.assertEqual(beta('Beta[a,b]'), '\\EulerBeta@{a}{b}') + self.assertEqual(beta('--Beta[a,b]--'), '--\\EulerBeta@{a}{b}--') + self.assertEqual(beta('Beta[z,a,b]'), '\\IncBeta{z}@{a}{b}') + self.assertEqual(beta('--Beta[z,a,b]--'), '--\\IncBeta{z}@{a}{b}--') + self.assertEqual(beta('Beta[a,b]Beta[z,a,b]'), '\\EulerBeta@{a}{b}\\IncBeta{z}@{a}{b}') + self.assertEqual(beta('--Beta[a,b]--Beta[z,a,b]--'), '--\\EulerBeta@{a}{b}--\\IncBeta{z}@{a}{b}--') + + def test_nested(self): + self.assertEqual(beta('Beta[Beta[a,b],Beta[a,b]]'), '\\EulerBeta@{\\EulerBeta@{a}{b}}{\\EulerBeta@{a}{b}}') + self.assertEqual(beta('--Beta[Beta[a,b],Beta[a,b]]--'), '--\\EulerBeta@{\\EulerBeta@{a}{b}}{\\EulerBeta@{a}{b}}--') + self.assertEqual(beta('Beta[Beta[z,a,b],Beta[z,a,b],Beta[z,a,b]]'), '\\IncBeta{\\IncBeta{z}@{a}{b}}@{\\IncBeta{z}@{a}{b}}{\\IncBeta{z}@{a}{b}}') + self.assertEqual(beta('--Beta[Beta[z,a,b],Beta[z,a,b],Beta[z,a,b]]--'), '--\\IncBeta{\\IncBeta{z}@{a}{b}}@{\\IncBeta{z}@{a}{b}}{\\IncBeta{z}@{a}{b}}--') + + def test_exceptions(self): + self.assertEqual(beta('BetaRegularized[z,a,b]'), 'BetaRegularized[z,a,b]') + self.assertEqual(beta('\\[Beta]'), '\\[Beta]') + + +class TestCFK(TestCase): + + def test_single(self): + self.assertEqual(cfk('ContinuedFractionK[f,g,{i,imin,imax}]'), '\\CFK{i}{imin}{imax}@@{f}{g}') + self.assertEqual(cfk('--ContinuedFractionK[f,g,{i,imin,imax}]--'), '--\\CFK{i}{imin}{imax}@@{f}{g}--') + self.assertEqual(cfk('ContinuedFractionK[g,{i,imin,imax}]'), '\\CFK{i}{imin}{imax}@@{1}{g}') + self.assertEqual(cfk('--ContinuedFractionK[g,{i,imin,imax}]--'), '--\\CFK{i}{imin}{imax}@@{1}{g}--') + self.assertEqual(cfk('ContinuedFractionK[f,g,{i,imin,imax}]ContinuedFractionK[g,{i,imin,imax}]'), '\\CFK{i}{imin}{imax}@@{f}{g}\\CFK{i}{imin}{imax}@@{1}{g}') + self.assertEqual(cfk('--ContinuedFractionK[f,g,{i,imin,imax}]--ContinuedFractionK[g,{i,imin,imax}]--'), '--\\CFK{i}{imin}{imax}@@{f}{g}--\\CFK{i}{imin}{imax}@@{1}{g}--') + + def test_nested(self): + self.assertEqual(cfk('ContinuedFractionK[ContinuedFractionK[f,g,{i,imin,imax}],ContinuedFractionK[f,g,{i,imin,imax}],{i,imin,imax}]'), '\\CFK{i}{imin}{imax}@@{\\CFK{i}{imin}{imax}@@{f}{g}}{\\CFK{i}{imin}{imax}@@{f}{g}}') + self.assertEqual(cfk('--ContinuedFractionK[ContinuedFractionK[f,g,{i,imin,imax}],ContinuedFractionK[f,g,{i,imin,imax}],{i,imin,imax}]--'), '--\\CFK{i}{imin}{imax}@@{\\CFK{i}{imin}{imax}@@{f}{g}}{\\CFK{i}{imin}{imax}@@{f}{g}}--') + self.assertEqual(cfk('ContinuedFractionK[ContinuedFractionK[g,{i,imin,imax}],{i,imin,imax}]'), '\\CFK{i}{imin}{imax}@@{1}{\\CFK{i}{imin}{imax}@@{1}{g}}') + + def test_none(self): + self.assertEqual(cfk('none'), 'none') + + +class TestGamma(TestCase): + + def test_single(self): + self.assertEqual(gamma('Gamma[z]'), '\\EulerGamma@{z}') + self.assertEqual(gamma('--Gamma[z]--'), '--\\EulerGamma@{z}--') + self.assertEqual(gamma('Gamma[a,z]'), '\\IncGamma@{a}{z}') + self.assertEqual(gamma('--Gamma[a,z]--'), '--\\IncGamma@{a}{z}--') + self.assertEqual(gamma('Gamma[a,z0,z1]'), '\\IncGamma@{a}{z0} - \\IncGamma@{a}{z1}') + self.assertEqual(gamma('--Gamma[a,z0,z1]--'), '--\\IncGamma@{a}{z0} - \\IncGamma@{a}{z1}--') + + def test_nested(self): + self.assertEqual(gamma('Gamma[Gamma[z]]'), '\\EulerGamma@{\\EulerGamma@{z}}') + self.assertEqual(gamma('--Gamma[Gamma[z]]--'), '--\\EulerGamma@{\\EulerGamma@{z}}--') + self.assertEqual(gamma('Gamma[Gamma[a,z],Gamma[a,z]]'), '\\IncGamma@{\\IncGamma@{a}{z}}{\\IncGamma@{a}{z}}') + self.assertEqual(gamma('--Gamma[Gamma[a,z],Gamma[a,z]]--'), '--\\IncGamma@{\\IncGamma@{a}{z}}{\\IncGamma@{a}{z}}--') + + def test_exceptions(self): + self.assertEqual(gamma('PolyGamma[n,z]'), 'PolyGamma[n,z]') + self.assertEqual(gamma('\\[CapitalGamma]'), '\\[CapitalGamma]') + self.assertEqual(gamma('LogGamma[z]'), 'LogGamma[z]') + self.assertEqual(gamma('EulerGamma'), 'EulerGamma') + self.assertEqual(gamma('\\IncGamma@{a}{b}'), '\\IncGamma@{a}{b}') + self.assertEqual(gamma('\\[Gamma]'), '\\[Gamma]') + self.assertEqual(gamma('\\GammaQ@{a}{z}'), '\\GammaQ@{a}{z}') + self.assertEqual(gamma('GammaRegularized[a,z]'), 'GammaRegularized[a,z]') + self.assertEqual(gamma('StieltjesGamma[k]'), 'StieltjesGamma[k]') + + def test_none(self): + self.assertEqual(gamma('none'), 'none') + + +class TestIntegrate(TestCase): + + def test_single(self): + self.assertEqual(integrate('Integrate[f,{x,xmin,xmax}]'), '\\int_{xmin}^{xmax}{f}d{x}') + self.assertEqual(integrate('--Integrate[f,{x,xmin,xmax}]--'), '--\\int_{xmin}^{xmax}{f}d{x}--') + + def test_nested(self): + self.assertEqual(integrate('Integrate[Integrate[f,{x,xmin,xmax}],{Integrate[f,{x,xmin,xmax}],xmin,xmax}]'), '\\int_{xmin}^{xmax}{\\int_{xmin}^{xmax}{f}d{x}}d{\\int_{xmin}^{xmax}{f}d{x}}') + self.assertEqual(integrate('--Integrate[Integrate[f,{x,xmin,xmax}],{Integrate[f,{x,xmin,xmax}],xmin,xmax}]--'), '--\\int_{xmin}^{xmax}{\\int_{xmin}^{xmax}{f}d{x}}d{\\int_{xmin}^{xmax}{f}d{x}}--') + + def test_none(self): + self.assertEqual(integrate('none'), 'none') + + +class TestLegendreP(TestCase): + + def test_single(self): + self.assertEqual(legendrep('LegendreP[n,x]'), '\\LegendreP{n}@{x}') + self.assertEqual(legendrep('--LegendreP[n,x]--'), '--\\LegendreP{n}@{x}--') + self.assertEqual(legendrep('LegendreP[n,m,1,x]'), '\\FerrersP[m]{n}@{x}') + self.assertEqual(legendrep('--LegendreP[n,m,1,x]--'), '--\\FerrersP[m]{n}@{x}--') + self.assertEqual(legendrep('LegendreP[n,m,2,x]'), '\\FerrersP[m]{n}@{x}') + self.assertEqual(legendrep('--LegendreP[n,m,2,x]--'), '--\\FerrersP[m]{n}@{x}--') + self.assertEqual(legendrep('LegendreP[n,m,3,x]'), '\\LegendreP[m]{n}@{x}') + self.assertEqual(legendrep('--LegendreP[n,m,3,x]--'), '--\\LegendreP[m]{n}@{x}--') + + def test_nested(self): + self.assertEqual(legendrep('LegendreP[LegendreP[n,x],LegendreP[n,x]]'), '\\LegendreP{\\LegendreP{n}@{x}}@{\\LegendreP{n}@{x}}') + self.assertEqual(legendrep('--LegendreP[LegendreP[n,x],LegendreP[n,x]]--'), '--\\LegendreP{\\LegendreP{n}@{x}}@{\\LegendreP{n}@{x}}--') + self.assertEqual(legendrep('LegendreP[LegendreP[n,m,1,x],LegendreP[n,m,1,x],1,LegendreP[n,m,1,x]]'), '\\FerrersP[\\FerrersP[m]{n}@{x}]{\\FerrersP[m]{n}@{x}}@{\\FerrersP[m]{n}@{x}}') + self.assertEqual(legendrep('--LegendreP[LegendreP[n,m,1,x],LegendreP[n,m,1,x],1,LegendreP[n,m,1,x]]--'), '--\\FerrersP[\\FerrersP[m]{n}@{x}]{\\FerrersP[m]{n}@{x}}@{\\FerrersP[m]{n}@{x}}--') + self.assertEqual(legendrep('LegendreP[LegendreP[n,m,3,x],LegendreP[n,m,3,x],3,LegendreP[n,m,3,x]]'), '\\LegendreP[\\LegendreP[m]{n}@{x}]{\\LegendreP[m]{n}@{x}}@{\\LegendreP[m]{n}@{x}}') + self.assertEqual(legendrep('--LegendreP[LegendreP[n,m,3,x],LegendreP[n,m,3,x],3,LegendreP[n,m,3,x]]--'), '--\\LegendreP[\\LegendreP[m]{n}@{x}]{\\LegendreP[m]{n}@{x}}@{\\LegendreP[m]{n}@{x}}--') + + def test_none(self): + self.assertEqual(legendrep('none'), 'none') + + +class TestLegendreQ(TestCase): + + def test_single(self): + self.assertEqual(legendreq('LegendreQ[n,x]'), '\\LegendreQ{n}@{x}') + self.assertEqual(legendreq('--LegendreQ[n,x]--'), '--\\LegendreQ{n}@{x}--') + self.assertEqual(legendreq('LegendreQ[n,m,1,x]'), '\\FerrersQ[m]{n}@{x}') + self.assertEqual(legendreq('--LegendreQ[n,m,1,x]--'), '--\\FerrersQ[m]{n}@{x}--') + self.assertEqual(legendreq('LegendreQ[n,m,2,x]'), '\\FerrersQ[m]{n}@{x}') + self.assertEqual(legendreq('--LegendreQ[n,m,2,x]--'), '--\\FerrersQ[m]{n}@{x}--') + self.assertEqual(legendreq('LegendreQ[n,m,3,x]'), '\\LegendreQ[m]{n}@{x}') + self.assertEqual(legendreq('--LegendreQ[n,m,3,x]--'), '--\\LegendreQ[m]{n}@{x}--') + + def test_nested(self): + self.assertEqual(legendreq('LegendreQ[LegendreQ[n,x],LegendreQ[n,x]]'), '\\LegendreQ{\\LegendreQ{n}@{x}}@{\\LegendreQ{n}@{x}}') + self.assertEqual(legendreq('--LegendreQ[LegendreQ[n,x],LegendreQ[n,x]]--'), '--\\LegendreQ{\\LegendreQ{n}@{x}}@{\\LegendreQ{n}@{x}}--') + self.assertEqual(legendreq('LegendreQ[LegendreQ[n,m,1,x],LegendreQ[n,m,1,x],1,LegendreQ[n,m,1,x]]'), '\\FerrersQ[\\FerrersQ[m]{n}@{x}]{\\FerrersQ[m]{n}@{x}}@{\\FerrersQ[m]{n}@{x}}') + self.assertEqual(legendreq('--LegendreQ[LegendreQ[n,m,1,x],LegendreQ[n,m,1,x],1,LegendreQ[n,m,1,x]]--'), '--\\FerrersQ[\\FerrersQ[m]{n}@{x}]{\\FerrersQ[m]{n}@{x}}@{\\FerrersQ[m]{n}@{x}}--') + self.assertEqual(legendreq('LegendreQ[LegendreQ[n,m,3,x],LegendreQ[n,m,3,x],3,LegendreQ[n,m,3,x]]'), '\\LegendreQ[\\LegendreQ[m]{n}@{x}]{\\LegendreQ[m]{n}@{x}}@{\\LegendreQ[m]{n}@{x}}') + self.assertEqual(legendreq('--LegendreQ[LegendreQ[n,m,3,x],LegendreQ[n,m,3,x],3,LegendreQ[n,m,3,x]]--'), '--\\LegendreQ[\\LegendreQ[m]{n}@{x}]{\\LegendreQ[m]{n}@{x}}@{\\LegendreQ[m]{n}@{x}}--') + + def test_none(self): + self.assertEqual(legendreq('none'), 'none') + + +class TestPolyEulergamma(TestCase): + + def test_single(self): + self.assertEqual(polyeulergamma('PolyGamma[z]'), '\\digamma@{z}') + self.assertEqual(polyeulergamma('--PolyGamma[z]--'), '--\\digamma@{z}--') + self.assertEqual(polyeulergamma('PolyGamma[n,z]'), '\\polygamma{n}@{z}') + self.assertEqual(polyeulergamma('--PolyGamma[n,z]--'), '--\\polygamma{n}@{z}--') + self.assertEqual(polyeulergamma('PolyGamma[z]PolyGamma[n,z]'), '\\digamma@{z}\\polygamma{n}@{z}') + self.assertEqual(polyeulergamma('--PolyGamma[z]--PolyGamma[n,z]--'), '--\\digamma@{z}--\\polygamma{n}@{z}--') + + def test_nested(self): + self.assertEqual(polyeulergamma('PolyGamma[PolyGamma[z]]'), '\\digamma@{\\digamma@{z}}') + self.assertEqual(polyeulergamma('--PolyGamma[PolyGamma[z]]--'), '--\\digamma@{\\digamma@{z}}--') + self.assertEqual(polyeulergamma('PolyGamma[PolyGamma[n,z],PolyGamma[n,z]]'), '\\polygamma{\\polygamma{n}@{z}}@{\\polygamma{n}@{z}}') + self.assertEqual(polyeulergamma('--PolyGamma[PolyGamma[n,z],PolyGamma[n,z]]--'), '--\\polygamma{\\polygamma{n}@{z}}@{\\polygamma{n}@{z}}--') + + def test_none(self): + self.assertEqual(polyeulergamma('none'), 'none') + + +class TestProduct(TestCase): + + def test_single(self): + self.assertEqual(product('Product[f,{i,imin,imax}]'), '\\Prod{i}{imin}{imax}@{f}') + self.assertEqual(product('--Product[f,{i,imin,imax}]--'), '--\\Prod{i}{imin}{imax}@{f}--') + + def test_nested(self): + self.assertEqual(product('Product[Product[f,{i,imin,imax}],{Product[f,{i,imin,imax}],imin,imax}]'), '\\Prod{\\Prod{i}{imin}{imax}@{f}}{imin}{imax}@{\\Prod{i}{imin}{imax}@{f}}') + self.assertEqual(product('--Product[Product[f,{i,imin,imax}],{Product[f,{i,imin,imax}],imin,imax}]--'), '--\\Prod{\\Prod{i}{imin}{imax}@{f}}{imin}{imax}@{\\Prod{i}{imin}{imax}@{f}}--') + + def test_none(self): + self.assertEqual(product('none'), 'none') + + +class TestQPochhammer(TestCase): + + def test_single(self): + self.assertEqual(qpochhammer('QPochhammer[a,q,n]'), '\\qPochhammer{a}{q}{n}') + self.assertEqual(qpochhammer('--QPochhammer[a,q,n]--'), '--\\qPochhammer{a}{q}{n}--') + self.assertEqual(qpochhammer('QPochhammer[a,q]'), '\\qPochhammer{a}{q}{\\infty}') + self.assertEqual(qpochhammer('--QPochhammer[a,q]--'), '--\\qPochhammer{a}{q}{\\infty}--') + self.assertEqual(qpochhammer('QPochhammer[q]'), '\\qPochhammer{q}{q}{\\infty}') + self.assertEqual(qpochhammer('--QPochhammer[q]--'), '--\\qPochhammer{q}{q}{\\infty}--') + self.assertEqual(qpochhammer('QPochhammer[a,q,n]QPochhammer[a,q]QPochhammer[q]'), '\\qPochhammer{a}{q}{n}\\qPochhammer{a}{q}{\\infty}\\qPochhammer{q}{q}{\\infty}') + self.assertEqual(qpochhammer('--QPochhammer[a,q,n]--QPochhammer[a,q]--QPochhammer[q]--'), '--\\qPochhammer{a}{q}{n}--\\qPochhammer{a}{q}{\\infty}--\\qPochhammer{q}{q}{\\infty}--') + + def test_nested(self): + self.assertEqual(qpochhammer('QPochhammer[QPochhammer[q],QPochhammer[q],QPochhammer[q]]'), '\\qPochhammer{\\qPochhammer{q}{q}{\\infty}}{\\qPochhammer{q}{q}{\\infty}}{\\qPochhammer{q}{q}{\\infty}}') + self.assertEqual(qpochhammer('--QPochhammer[QPochhammer[q],QPochhammer[q],QPochhammer[q]]--'), '--\\qPochhammer{\\qPochhammer{q}{q}{\\infty}}{\\qPochhammer{q}{q}{\\infty}}{\\qPochhammer{q}{q}{\\infty}}--') + self.assertEqual(qpochhammer('QPochhammer[QPochhammer[q],QPochhammer[q]]'), '\\qPochhammer{\\qPochhammer{q}{q}{\\infty}}{\\qPochhammer{q}{q}{\\infty}}{\\infty}') + self.assertEqual(qpochhammer('--QPochhammer[QPochhammer[q],QPochhammer[q]]--'), '--\\qPochhammer{\\qPochhammer{q}{q}{\\infty}}{\\qPochhammer{q}{q}{\\infty}}{\\infty}--') + + def test_none(self): + self.assertEqual(qpochhammer('none'), 'none') + + +class TestSummation(TestCase): + + def test_single(self): + self.assertEqual(summation('Sum[f,{i,imin,imax}]'), '\\Sum{i}{imin}{imax}@{f}') + self.assertEqual(summation('--Sum[f,{i,imin,imax}]--'), '--\\Sum{i}{imin}{imax}@{f}--') + + def test_nested(self): + self.assertEqual(summation('Sum[Sum[f,{i,imin,imax}],{Sum[f,{i,imin,imax}],imin,imax}]'), '\\Sum{\\Sum{i}{imin}{imax}@{f}}{imin}{imax}@{\\Sum{i}{imin}{imax}@{f}}') + self.assertEqual(summation('--Sum[Sum[f,{i,imin,imax}],{Sum[f,{i,imin,imax}],imin,imax}]--'), '--\\Sum{\\Sum{i}{imin}{imax}@{f}}{imin}{imax}@{\\Sum{i}{imin}{imax}@{f}}--') + + def test_none(self): + self.assertEqual(summation('none'), 'none') \ No newline at end of file diff --git a/Macro-Replacement/README.md b/macro_replacement/README.md similarity index 100% rename from Macro-Replacement/README.md rename to macro_replacement/README.md diff --git a/macro_replacement/src/cosSubstitution.py b/macro_replacement/src/cosSubstitution.py new file mode 100644 index 0000000..0129893 --- /dev/null +++ b/macro_replacement/src/cosSubstitution.py @@ -0,0 +1,81 @@ +__author__ = "Cherry Zou" +__status__ = "Development" + + +def checkEq(equation): + + theta = False + phi = False + x = False + if "\\theta" in equation: + theta = True + if "\\phi" in equation: + phi = True + mac = False + + for c in equation: + if c == "\\": + mac = True + if not c.isalpha(): + mac = False + if not mac and c == "x": + x = True + break + + if x and theta and not phi: + return("$x=\\cos@@{\\theta}$ ") + elif x and theta and phi: + return("$x=\\cos@{\\theta+\\phi}$ ") + else: + return("") + + +def cos_substitution(input): + + lines = input.split('\n') + toWrite = "" + p = "" + math = False + substitution = False + + for line in lines: + + if "\\begin{equation}" in line: + math = True + equation = "" + subLine = "" + + if "\\end{equation}" in line: + + math = False + substitution = False + p = checkEq(equation) + if p != "" and not ( + "$x=\\cos@@{\\theta}$" in subLine or "$x=\\cos@{\\theta+\\phi}$" in subLine): + # print equation+"\n"+subLine + if subLine == "": + toWrite += "% \substitution{" + p + "}\n" + else: + subLine = subLine.strip("\n") + subLine = subLine.strip("}") + "\n" + toWrite += subLine + "% " + p + "}\n" + else: + # toWrite+=subLine + '\n' #CHERRY CHANGE + toWrite += subLine # CHERRY CHANGE + + if "\\substitution" in line: + substitution = True + math = False + subLine = "" + + if math: + equation += line.replace("\n", " ") + toWrite += line + '\n' + + elif substitution: + subLine += line + '\n' + + else: + toWrite += line + '\n' + + return toWrite diff --git a/Macro-Replacement/drmfconfig.py b/macro_replacement/src/drmfconfig.py similarity index 60% rename from Macro-Replacement/drmfconfig.py rename to macro_replacement/src/drmfconfig.py index 5cce9cc..fd9d6c7 100644 --- a/Macro-Replacement/drmfconfig.py +++ b/macro_replacement/src/drmfconfig.py @@ -1,12 +1,18 @@ +__author__ = "Cherry Zou" +__status__ = "Development" + import os import sys -from snippets import * from function import Function +# If there are errors it probably has to do with the missing import below +# from snippets import * + + class ConfigFile(object): """Represents a configuration file (containing regular expressions) used for seeding the DRMF""" - #creates a new config file object from the file with name file_name + # creates a new config file object from the file with name file_name def __init__(self, file_name, verbose=False): self._config_file = open(file_name, "r") @@ -16,26 +22,26 @@ def __init__(self, file_name, verbose=False): self._all_funcs = self._get_all_funcs(verbose) - #read in config file and return all_funcs list + # read in config file and return all_funcs list def _get_all_funcs(self, verbose): offset = 0 all_funcs = [] self._config_file.seek(offset) - #read in whole file + # read in whole file while offset < self._file_size: chunk = "" in_line = "" - #read in entire macro + # read in entire macro while not in_line.endswith("~?~"): in_line = self._config_file.readline().strip() offset += len(in_line) - #skip line if it's empty or a comment + # skip line if it's empty or a comment if in_line == '' or in_line.startswith("%"): in_line = "" continue @@ -46,24 +52,36 @@ def _get_all_funcs(self, verbose): # print(chunk + '\n') chunk = chunk[:-3] try: - macro, abbr, regexes, replacements, description = chunk.split("`") + macro, abbr, regexes, replacements, description = chunk.split( + "`") except ValueError as ve: print("ValueError: {0}".format(ve)) print(chunk) - sys.exit(-1) + sys.exit(-1) regexes = regexes.split("~-~") replacements = replacements.split("~-~") - #create each regular expression and replacement from the strings in the file + # create each regular expression and replacement from the strings + # in the file try: regexes = [eval(regex) for regex in regexes] - replacements = [eval(replacement) for replacement in replacements] + replacements = [eval(replacement) + for replacement in replacements] except SyntaxError as se: - print("ERROR IN CONFIG FILE: {0}\n\tSYNTAX ERROR ON REGEX FOR {1}:".format(self._file_name, macro)) + print( + "ERROR IN CONFIG FILE: {0}\n\tSYNTAX ERROR ON REGEX FOR {1}:".format( + self._file_name, macro)) print(se.text) sys.exit(-1) - all_funcs.append(Function(macro, abbr, regexes, replacements, description, verbose=verbose)) + all_funcs.append( + Function( + macro, + abbr, + regexes, + replacements, + description, + verbose=verbose)) return all_funcs diff --git a/macro_replacement/src/drmfdriver.py b/macro_replacement/src/drmfdriver.py new file mode 100644 index 0000000..5627336 --- /dev/null +++ b/macro_replacement/src/drmfdriver.py @@ -0,0 +1,96 @@ +__author__ = "Cherry Zou" +__status__ = "Development" + +# Driver file for the DRMF seeding program + +from optparse import OptionParser, OptionValueError +import replace +import search +from drmfconfig import ConfigFile + +# parse command line args and either replace or generate replacement file + + +def main(): + + parser = OptionParser(usage="usage: %prog [options] inputfile outputfile") + + # validates mode, prevents both -r and -s + def validate(option, opt_string, value, parser): + + to_raise = OptionValueError("cannot specify both search and replace") + if opt_string == "--replace" or opt_string == "-r": + + if parser.values.replace: + raise to_raise + setattr(parser.values, "replace", True) + + else: + + if parser.values.search: + raise to_raise + setattr(parser.values, "search", True) + + parser.add_option( + "-r", + "--replace", + default=False, + action="callback", + dest="replace", + callback=validate, + help="make replacements from input file write them to the output file [default]") + parser.add_option( + "-s", + "--search", + default=False, + action="callback", + dest="search", + callback=validate, + help="write a log of replacemnts that should be made in the input file to the output file (including line numbers)") + + parser.add_option( + "-v", + "--verbose", + action="store_true", + default=False, + dest="verbose", + help="print out information about replacements as they occur") + + parser.add_option( + "-c", + "--config", + action="store", + default="function_regex", + dest="config_file_name", + help="the name of the configuration file to use") + + options, args = parser.parse_args() + + # ensure both input file and output file are present + if len(args) != 2: + raise TypeError("must specify both input file and output file") + + in_file = args[0] + out_file = args[1] + + # no action specified, default to replace + if not (options.replace or options.search): + options.replace = True + + # user specified replace option + if options.replace: + to_run = replace + + # user specified search option + else: + to_run = search + + func_list = ConfigFile( + options.config_file_name, + verbose=options.verbose).all_funcs + + to_run.run(in_file, out_file, func_list) + +# call main function when this file is run directly +if __name__ == "__main__": + main() diff --git a/Macro-Replacement/function.py b/macro_replacement/src/function.py similarity index 53% rename from Macro-Replacement/function.py rename to macro_replacement/src/function.py index 679f197..b1e9072 100644 --- a/Macro-Replacement/function.py +++ b/macro_replacement/src/function.py @@ -1,14 +1,27 @@ +__author__ = "Cherry Zou" +__status__ = "Development" + import re + class Function(object): """This class represents a mathematical function or polynomial. It provides methods to search for the function and replace it using a given replace function""" - #create the function object with the given name, abbreviation, regex patterns, and replacement function - def __init__(self, macro, abbr, regexes, replacements, description, verbose=False): - - #ensure correct number of regexes and replacements have been provided + # create the function object with the given name, abbreviation, regex + # patterns, and replacement function + def __init__( + self, + macro, + abbr, + regexes, + replacements, + description, + verbose=False): + + # ensure correct number of regexes and replacements have been provided if len(regexes) != len(replacements): - raise ValueError(name + " - must provide the same number of replacements as regexes") + raise ValueError( + name + " - must provide the same number of replacements as regexes") self._macro = macro self._abbr = abbr @@ -19,42 +32,50 @@ def __init__(self, macro, abbr, regexes, replacements, description, verbose=Fals # self._name = macro[1:macro.index("{")] - #finds the pattern in content using regexes + # finds the pattern in content using regexes def make_subs(self, content): total = 0 counter = 0 - #use each regex/replacement pair to make substitutions + # use each regex/replacement pair to make substitutions for regex, replacement in zip(self._regexes, self._replace): pattern = None try: pattern = re.compile(regex) except Exception as e: - print("\t\t\t\tERROR WHEN CREATING REGEX - {0} - {1} - {2}".format(regex, self._macro, e)) + print( + "\t\t\t\tERROR WHEN CREATING REGEX - {0} - {1} - {2}".format(regex, self._macro, e)) all_matches = pattern.findall(content) - total += len(all_matches) + total += len(all_matches) content = re.sub(pattern, self._move_and, content) - + try: content = re.sub(pattern, replacement, content) - except Exception as e: - print("ERROR IN MAKING SUBSTITUTIONS FOR FUNCTION {0}: REGEX: {1} REPLACEMENT: {2} - {3}".format(self._macro, regex, replacement, e)) + except Exception as e: + print( + "ERROR IN MAKING SUBSTITUTIONS FOR FUNCTION {0}: REGEX: {1} REPLACEMENT: {2} - {3}".format( + self._macro, regex, replacement, e)) counter += 1 - #only print out info if verbose is specified + # only print out info if verbose is specified if self._verbose: - print("MAKING SUBS FOR {0} WITH REGEX #{1}".format(self._macro, counter)) + print( + "MAKING SUBS FOR {0} WITH REGEX #{1}".format( + self._macro, counter)) for match in all_matches: print("\t{0}".format(match)) - print("\tTOTAL SUBS FOR {0} ({1} REGEXES): {2}".format(self._macro, len(self._regexes), total)) + print( + "\tTOTAL SUBS FOR {0} ({1} REGEXES): {2}".format( + self._macro, len( + self._regexes), total)) return content - #moves and ampersands from in the macro to the beginning + # moves and ampersands from in the macro to the beginning def _move_and(self, match): match = match.group(0) @@ -68,7 +89,7 @@ def _move_and(self, match): return match - #getters for macro abbreviation and description + # getters for macro abbreviation and description @property def macro(self): return self._macro @@ -86,48 +107,51 @@ def get_all_starts(self, content): starts = [] - #use each pattern given in the config file + # use each pattern given in the config file for regex in self._regexes: pattern = None try: pattern = re.compile(regex) except Exception as e: - print("\t\t\t\tERROR WHEN CREATING REGEX - {0} - {1} - {2}".format(regex, self._macro, e)) + print( + "\t\t\t\tERROR WHEN CREATING REGEX - {0} - {1} - {2}".format(regex, self._macro, e)) - #go through each match and add its starting location + # go through each match and add its starting location for match in pattern.finditer(content): - - #print more info if verbose + + # print more info if verbose if self._verbose: - print("{0} - {1} - {2} - {3}".format(self._name, regex, match.start(), match.group())) + print("{0} - {1} - {2} - {3}".format(self._name, + regex, match.start(), match.group())) starts.append(match.start()) - - #returns a string that maintains the number of lines in the file but will not match further patterns + + # returns a string that maintains the number of lines in the file + # but will not match further patterns def repl(match): - return "\n" * match.group().count("\n") + return "\n" * match.group().count("\n") content = pattern.sub(repl, content) return starts - #counts the number of times each pattern occurs in lines + # counts the number of times each pattern occurs in lines def count(self, lines): - + occurences = 0 - #use each regex to count occurences + # use each regex to count occurences for regex in self._regexes: if regex is r'\(Q_(\w+)Q_(\w+)\)(?:\\left|\\Bigg|\\bigg|\\big|\\Big|\\bigl)?\((.*?);(.*?),(.*?);q(?:\\right|\\Bigg|\\bigg|\\big|\\Big|\\bigr)?\)': print('hi') occurences += 2 continue - + regex = re.compile(regex) occurences += len(regex.findall(lines)) - lines = regex.sub(' ', lines) #replace matches with ' ' to avoid rematching - + # replace matches with ' ' to avoid rematching + lines = regex.sub(' ', lines) return occurences diff --git a/Macro-Replacement/function_regex b/macro_replacement/src/function_regex similarity index 100% rename from Macro-Replacement/function_regex rename to macro_replacement/src/function_regex diff --git a/Macro-Replacement/identifiers.py b/macro_replacement/src/identifiers.py similarity index 67% rename from Macro-Replacement/identifiers.py rename to macro_replacement/src/identifiers.py index bc73c98..0be6fd7 100644 --- a/Macro-Replacement/identifiers.py +++ b/macro_replacement/src/identifiers.py @@ -1,4 +1,9 @@ -import sys, re +__author__ = "Cherry Zou" +__status__ = "Development" + +import sys +import re + def searchAll(match): """Determines which macros are present in a given match and creates the corresponding identifier string.""" @@ -10,112 +15,131 @@ def searchAll(match): abbr = func.abbr num = func.count(match) - #more than zero matches + # more than zero matches if num > 0: tempstring += "{abbr} {num}:".format(**locals()) return tempstring + def _replace(match): pattern = re.compile(r'\\end{' + match.group(1) + '}') - if (re.search(pattern, match.group(2)) != None or re.search(pattern, match.group(3)) != None): + if (re.search(pattern, match.group(2)) is not None or re.search( + pattern, match.group(3)) is not None): return match.group() - tempstring = '\\begin{' + match.group(1) + '}\\label{' + match.group(3) + '}%' + tempstring = '\\begin{' + \ + match.group(1) + '}\\label{' + match.group(3) + '}%' tempstring += searchAll(match.group(2)) tempstring += match.group(2) + '\\end{' + match.group(1) + '}' return tempstring + def _replace2(match): pattern = re.compile(r'\\label{') - if (re.search(pattern, match.group(2)) != None): + if (re.search(pattern, match.group(2)) is not None): return match.group() tempstring = '\\begin{' + match.group(1) + '}%' tempstring += searchAll(match.group(2)) tempstring += match.group(2) + '\n\\end{' + match.group(1) + '}' return tempstring + def replace2(match): - tempstring = '\\begin{' + match.group(1) + '}\\label{' + match.group(3) + '}%' + tempstring = '\\begin{' + \ + match.group(1) + '}\\label{' + match.group(3) + '}%' pattern = re.compile(r'\\nonumber') pattern2 = re.compile(r'\\label{') pattern3 = re.compile(r'\\end{') - if (re.search(pattern, match.group(2)) != None or re.search(pattern2, match.group(2)) != None or re.search(pattern3, match.group(2)) != None): + if (re.search(pattern, + match.group(2)) is not None or re.search(pattern2, + match.group(2)) is not None or re.search(pattern3, + match.group(2)) is not None): return match.group() tempstring += searchAll(match.group(2)) tempstring += match.group(2) return tempstring + def replace3(match): tempstring = '\\\\\n\\label{' + match.group(2) + '}' + '%' pattern = re.compile(r'\\nonumber') pattern2 = re.compile(r'\\label{') - if (re.search(pattern, match.group(1)) != None): + if (re.search(pattern, match.group(1)) is not None): return match.group() tempstring += searchAll(match.group(1)) tempstring += match.group(1) return tempstring + def replace3v2(match): tempstring = '\\\\\n\\label{' + match.group(2) + '}' + '%' pattern = re.compile(r'\\nonumber') pattern2 = re.compile(r'\\label{') - if (re.search(pattern, match.group(1)) != None or re.search(pattern2, match.group(1)) != None): + if (re.search(pattern, match.group(1)) is not None or re.search( + pattern2, match.group(1)) is not None): return match.group() tempstring += searchAll(match.group(1)) tempstring += match.group(1) return tempstring + def replace4(match): tempstring = '\\\\\n\\nonumber%' pattern = re.compile(r'\\nonumber') pattern2 = re.compile(r'\\label{') - if (re.search(pattern2, match.group(1)) != None): + if (re.search(pattern2, match.group(1)) is not None): return match.group() tempstring += searchAll(match.group(1)) tempstring += match.group(1) return tempstring + def replace5(match): tempstring = '\\begin{' + match.group(1) + '}\\nonumber%' pattern = re.compile(r'\\nonumber') pattern2 = re.compile(r'\\label{') - if (re.search(pattern, match.group(2)) != None or re.search(pattern2, match.group(2)) != None): + if (re.search(pattern, match.group(2)) is not None or re.search( + pattern2, match.group(2)) is not None): return match.group() tempstring += searchAll(match.group(2)) tempstring += match.group(2) return tempstring + def replace6(match): tempstring = '\\sLP\n\\nonumber%' pattern = re.compile(r'\\nonumber') pattern2 = re.compile(r'\\label{') - if (re.search(pattern2, match.group(1)) != None): + if (re.search(pattern2, match.group(1)) is not None): return match.group() tempstring += searchAll(match.group(1)) tempstring += match.group(1) return tempstring + def replace7(match): tempstring = '\\sLP\n\\label{' + match.group(2) + '}' + '%' pattern = re.compile(r'\\nonumber') pattern2 = re.compile(r'\\label{') - if (re.search(pattern, match.group(1)) != None): + if (re.search(pattern, match.group(1)) is not None): return match.group() tempstring += searchAll(match.group(1)) tempstring += match.group(1) return tempstring - + def replacealign(match): matchstring = match.group() - labelpattern1 = re.compile(r'\\begin{(align)}(.+?)\\label{(.*?)}', re.DOTALL) + labelpattern1 = re.compile( + r'\\begin{(align)}(.+?)\\label{(.*?)}', re.DOTALL) labelpattern2 = re.compile(r'\\\\(.+?)\\label{(.*?)}', re.DOTALL) - labelpattern2v2 = re.compile(r'\\\\(?!\n\\nonumber)(.{2,}?)\\label{(.*?)}', re.DOTALL) + labelpattern2v2 = re.compile( + r'\\\\(?!\n\\nonumber)(.{2,}?)\\label{(.*?)}', re.DOTALL) labelpattern3 = re.compile(r'\\begin{(align)}(.+?)\\nonumber', re.DOTALL) labelpattern4 = re.compile(r'\\\\(.+?)\\nonumber', re.DOTALL) @@ -133,37 +157,48 @@ def replacealign(match): return matchstring + def eqnarray_rpl1(match): - tempstring = '\\begin{' + match.group(1) + '}\\label{' + match.group(2) + '}%' + tempstring = '\\begin{' + \ + match.group(1) + '}\\label{' + match.group(2) + '}%' tempstring += searchAll(match.group(3)) - if (re.match('\n', match.group(3)) == None): + if (re.match('\n', match.group(3)) is None): tempstring += '\n' tempstring += match.group(3) + match.group(4) return tempstring + def eqnarray_rpl2(match): tempstring = '\\\\\n\\nonumber%' tempstring += searchAll(match.group(1)) - if (re.match('\n', match.group(1)) == None): + if (re.match('\n', match.group(1)) is None): tempstring += '\n' tempstring += match.group(1) + match.group(2) return tempstring + def eqnarray_rpl3(match): tempstring = '\\\\\n\\nonumber%' tempstring += searchAll(match.group(1)) - if (re.match('\n', match.group(1)) == None): + if (re.match('\n', match.group(1)) is None): tempstring += '\n' tempstring += match.group(1) return tempstring + def eqnarray_replace(match): matchstring = match.group() - pattern1 = re.compile(r'\\begin{(eqnarray)}\s*\\label{(.*?)}\s*(.*?)(\s*\\end{\1}|\\nonumber)', re.DOTALL) - pattern2 = re.compile(r'\\nonumber\\\\\s+(.*?)(\s*\\end{eqnarray}|\\nonumber)', re.DOTALL) - pattern3 = re.compile(r'(? 0: list = name_pat.findall(line)[0] names[list[0]] = (list[1]).strip() - + drmf = open('./DRMFfcns.sty', 'r').read() dlmf = open('./DLMFfcns.sty', 'r').read() - + global drmfdlmf drmfdlmf = drmf + dlmf - + KLS_pat = re.compile(r'section{([^\n]+)}\n(.+?){Symmetry}', re.DOTALL) content = KLS_pat.sub(rpl_section, content) - section_pat = re.compile(r'section{(.+?)}(.+?)\\subsection\*{Reference', re.DOTALL) + section_pat = re.compile( + r'section{(.+?)}(.+?)\\subsection\*{Reference', + re.DOTALL) content = section_pat.sub(rpl_section, content) - + return content + def rpl_section(match): section_n = match.group(1) - macro_n = names[section_n] # holds current macro name only + macro_n = names[section_n] # holds current macro name only matchstr = match.group(0) - + params = 0 args = 0 - dlmf_pat = re.compile(r'\\defSpecFun{' + macro_n + '}\[(\d)\].+?\[meaning=.+?\]{(\d)}') + dlmf_pat = re.compile( + r'\\defSpecFun{' + + macro_n + + '}\[(\d)\].+?\[meaning=.+?\]{(\d)}') if len(dlmf_pat.findall(drmfdlmf)) > 0: list = dlmf_pat.findall(drmfdlmf)[0] params = int(list[0]) @@ -67,7 +80,9 @@ def rpl_section(match): if args == 0 and params == 0: # special case for chebyU and chebyT - hyper_pat = re.compile(r'{Normalized recurrence relations}(.+?)\\subsection', re.DOTALL) + hyper_pat = re.compile( + r'{Normalized recurrence relations}(.+?)\\subsection', + re.DOTALL) matchstr = hyper_pat.sub(cheby_case_helper, matchstr) return matchstr @@ -81,49 +96,59 @@ def rpl_section(match): macro_regex = macro_regex + ''.join([a for s in range(args)]) macro_regex = macro_regex + '(?!})' - hyper_pat = re.compile(r'{Normalized recurrence relation}(.+?)\\subsection', re.DOTALL) + hyper_pat = re.compile( + r'{Normalized recurrence relation}(.+?)\\subsection', + re.DOTALL) hyper_pat.sub(find_name, matchstr) - monic_pat = re.compile(r'p_(?P{)?([^=_;,|$]+?)(?(open)})\(([^=_;,|$]+?)\)(?!\))') + monic_pat = re.compile( + r'p_(?P{)?([^=_;,|$]+?)(?(open)})\(([^=_;,|$]+?)\)(?!\))') matchstr = monic_pat.sub(make_monic, match.group(0)) return matchstr + def find_name(match): matchstr = match.group(0) - macro_pat = re.compile(macro_regex) - + macro_pat = re.compile(macro_regex) + macro_pat.sub(find_args, matchstr) return + def find_args(match): global fullmacro - fullmacro = '\\monic' + match.group(0) + fullmacro = '\\monic' + match.group(0) return + def make_monic(match): before_m = fullmacro.split('@')[0] before_m = before_m[:before_m.rfind('{')] - after_m = fullmacro.split('@')[1] - + after_m = fullmacro.split('@')[1] + if after_m.find('}{') != -1: after_m = after_m[after_m.find('}{') + 1:] else: after_m = "" - output = before_m + '{' + match.group(2) + '}@@{' + match.group(3) + '}' + after_m + output = before_m + \ + '{' + match.group(2) + '}@@{' + match.group(3) + '}' + after_m return output + def cheby_case_helper(match): - - cheby_pat = re.compile(r'\\begin{equation}(.+?)\\end{equation}\nwhere(.+?)\n', re.DOTALL) + + cheby_pat = re.compile( + r'\\begin{equation}(.+?)\\end{equation}\nwhere(.+?)\n', + re.DOTALL) matchstr = cheby_pat.sub(cheby_case, match.group(0)) return matchstr - + def cheby_case(match): m = '' @@ -134,8 +159,11 @@ def cheby_case(match): elif 'ChebyU' in match.group(0): m = 'ChebyU' - monic_pat = re.compile(r'p_(?P{)?([^=_;,|$]+?)(?(open)})\(([^=_;,|$]+?)\)') - matchstr = monic_pat.sub('\\monic' + m + '{\g<2>}@@{\g<3>}', match.group(0)) + monic_pat = re.compile( + r'p_(?P{)?([^=_;,|$]+?)(?(open)})\(([^=_;,|$]+?)\)') + matchstr = monic_pat.sub( + '\\monic' + m + '{\g<2>}@@{\g<3>}', + match.group(0)) return matchstr diff --git a/Macro-Replacement/normalized.py b/macro_replacement/src/normalized.py similarity index 72% rename from Macro-Replacement/normalized.py rename to macro_replacement/src/normalized.py index 2810622..45ee7ad 100644 --- a/Macro-Replacement/normalized.py +++ b/macro_replacement/src/normalized.py @@ -1,10 +1,15 @@ +__author__ = "Cherry Zou" +__status__ = "Development" + import re import sys -from snippets import * +# If there are errors it probably has to do with the missing import below +# from snippets import * + def main(): - #input from command line + # input from command line if len(sys.argv) != 3: print('Usage: programname.py inputfile outputfile') sys.exit() @@ -16,11 +21,12 @@ def main(): content = replace_normalized(content) - #writes output + # writes output file = open(outputfile, 'w') file.write(content) file.close() + def replace_normalized(content): normalized_file = open('normalized_names', 'r').read() @@ -28,27 +34,36 @@ def replace_normalized(content): global names names = {} name_pat = re.compile(r'section{(.*?)}\s(.+)') - + lines = normalized_file.split('\n') for line in lines: if len(name_pat.findall(line)) > 0: list = name_pat.findall(line)[0] names[list[0]] = (list[1]).strip() - KLS_pat = re.compile(r'()section{([^\n]+)}\n(.+?){Symmetry}', re.DOTALL) #TODO: add recurrence relation + KLS_pat = re.compile( + r'()section{([^\n]+)}\n(.+?){Symmetry}', + re.DOTALL) # TODO: add recurrence relation content = KLS_pat.sub(rpl_section, content) - section_pat = re.compile(r'(section{(.+?)}.+?{Orthogonality relation})(.+?\\subsection\*{Recurrence relation}.+?)(\\subsection)', re.DOTALL) + section_pat = re.compile( + r'(section{(.+?)}.+?{Orthogonality relation})(.+?\\subsection\*{Recurrence relation}.+?)(\\subsection)', + re.DOTALL) content = section_pat.sub(rpl_section, content) - section_pat = re.compile(r'(section{(.+?)}.+?{Orthogonality relation})(.+?)(\\subsection)', re.DOTALL) + section_pat = re.compile( + r'(section{(.+?)}.+?{Orthogonality relation})(.+?)(\\subsection)', + re.DOTALL) content = section_pat.sub(rpl_section, content) - section_pat = re.compile(r'(section{(.+?)}.+?{Recurrence relation})(.+?)(\\subsection)', re.DOTALL) + section_pat = re.compile( + r'(section{(.+?)}.+?{Recurrence relation})(.+?)(\\subsection)', + re.DOTALL) content = section_pat.sub(rpl_section, content) return content + def rpl_section(match): section_n = match.group(2) @@ -61,7 +76,7 @@ def rpl_section(match): # correct macro name not found return matchstr - macro_pat = names[section_n] # holds current pattern + macro_pat = names[section_n] # holds current pattern # extracts macro name global full_macro @@ -79,10 +94,11 @@ def rpl_section(match): # makes replacements in section normalized_pat = re.compile(macro_pat) search_in = normalized_pat.sub(replace_macro, search_in) - #print(search_in) + # print(search_in) return match.group(1) + search_in + match.group(4) + def replace_macro(match): before_m = full_macro[:full_macro.find('{') + 1] diff --git a/Macro-Replacement/normalized_names b/macro_replacement/src/normalized_names similarity index 100% rename from Macro-Replacement/normalized_names rename to macro_replacement/src/normalized_names diff --git a/AlexDanoff/parentheses.py b/macro_replacement/src/parentheses.py similarity index 74% rename from AlexDanoff/parentheses.py rename to macro_replacement/src/parentheses.py index 6f995d1..2b7a0a8 100644 --- a/AlexDanoff/parentheses.py +++ b/macro_replacement/src/parentheses.py @@ -1,3 +1,6 @@ +__author__ = "Cherry Zou" +__status__ = "Development" + """Goes through input file, numbers every opening and corresponding closing parenthesis and writes result to output file.""" import sys @@ -5,14 +8,15 @@ _last_val = 0 + def remove(input, curly=False, cached=False): """Goes through input and replaces any opening and closing parentheses with numbered markers.""" - + global _last_val counter = 0 - #resume from previous count + # resume from previous count if cached: counter = _last_val @@ -21,21 +25,21 @@ def remove(input, curly=False, cached=False): open = "(" close = ")" - #if client wants to replace curly braces, adjust accordingly + # if client wants to replace curly braces, adjust accordingly if curly: open = "{" close = "}" - #go through input and replace parentheses with labels + # go through input and replace parentheses with labels for character in input: - #found an opening parenthesis, replace it with its label + # found an opening parenthesis, replace it with its label if character == open: character = "###open_{0}###".format(counter) counter += 1 - #found a closing parenthesis, replace it with its label + # found a closing parenthesis, replace it with its label if character == close: counter -= 1 @@ -46,17 +50,18 @@ def remove(input, curly=False, cached=False): updated += character - _last_val = counter #store our spot + _last_val = counter # store our spot return updated + def insert(input, curly=False): """Goes through input and replaces any numbered markers with opening and closing parentheses.""" o_rep = "(" - c_rep = ")" - - #adjust for curly braces + c_rep = ")" + + # adjust for curly braces if curly: o_rep = "{" c_rep = "}" diff --git a/Macro-Replacement/replace.py b/macro_replacement/src/replace.py similarity index 73% rename from Macro-Replacement/replace.py rename to macro_replacement/src/replace.py index 76b9b4f..c53a64a 100644 --- a/Macro-Replacement/replace.py +++ b/macro_replacement/src/replace.py @@ -1,53 +1,64 @@ #!/usr/bin/python +__author__ = "Cherry Zou" +__status__ = "Development" + """This module contains the code for the 'replace' functionality of the DRMF seeding program.""" import identifiers import sys import re import os -from snippets import * + +# If there are errors it probably has to do with the missing import below +# from snippets import * + from function import Function from replace_special import remove_special from monics import replace_monics from normalized import replace_normalized from cosSubstitution import cos_substitution -#Changes the '\mid ' to '|' and '\half' to '\frac{1}{2}' +# Changes the '\mid ' to '|' and '\half' to '\frac{1}{2}' + + def replace_basic(content): content = content.replace(r'\mid q', '|q') content = content.replace(r'\half', r'\frac{1}{2}') - + return content -#go through input file and make replacements specified +# go through input file and make replacements specified + + def replace_all(content, all_funcs): - #perform replacement using each imported module + # perform replacement using each imported module for func in all_funcs: content = func.make_subs(content) return content + def run(inputfile, outputfile, all_funcs): """Reads in content from inputfile, performs replacement for every function provided, and writes results to outputfile.""" - file = open(inputfile,"r") + file = open(inputfile, "r") content = file.read() - #Header replacements + # Header replacements content = content.replace(r'\usepackage{amssymb}', '\\usepackage{amsfonts}\n%\\usepackage{breqn}\n\\usepackage{DLMFmath}\n\\usepackage{DRMFfcns}\n\\usepackage{amssymb}') content = replace_basic(content) #content = identifiers.LabelAll(content, all_funcs) - #Makes replacements + # Makes replacements content = replace_all(content, all_funcs) content = replace_monics(content) content = replace_normalized(content) content = remove_special(content) content = cos_substitution(content) - #Writes the converted string into the output file - file2 = open(outputfile,"w") + # Writes the converted string into the output file + file2 = open(outputfile, "w") file2.write(content) file2.close() diff --git a/macro_replacement/src/replace_special.py b/macro_replacement/src/replace_special.py new file mode 100644 index 0000000..9d68e60 --- /dev/null +++ b/macro_replacement/src/replace_special.py @@ -0,0 +1,425 @@ +"""Replace i, e, and \pi with \iunit, \expe, and \cpi respectively.""" + +import re +import sys + +# for compatibility with Python 3 +try: + from itertools import izip +except ImportError: + izip = zip + +import parentheses +from utilities import writeout +from utilities import readin + +EQ_STARTS = [ + r'\begin{equation}', + r'\begin{equation*}', + r'\begin{align}', + r'\begin{eqnarray}', + r'\begin{eqnarray*}', + r'\begin{multline}', + r'\begin{multline*}'] +EQ_ENDS = [ + r'\end{equation}', + r'\end{equation*}', + r'\end{align}', + r'\end{eqnarray}', + r'\begin{eqnarray*}', + r'\begin{multline}', + r'\begin{multline*}'] + +IND_START = r'\index{' + +NAME = 0 +SEEN = 1 + +CASES_START = r'\begin{cases}' +CASES_END = r'\end{cases}' + +EQMIX_START = r'\begin{equationmix}' +EQMIX_END = r'\end{equationmix}' + +STD_REGEX = r'.*?###open_(\d+)###.*?###close_\1###' + + +def main(): + if len(sys.argv) != 3: + + fname = "ZE.1.tex" + ofname = "ZES.tex" + + else: + + fname = sys.argv[1] + ofname = sys.argv[2] + + writeout(ofname, remove_special(readin(fname))) + + +def remove_special(content): + """Removes the excess pieces from the given content and returns the updated version as a string.""" + + # various flags that will help us keep track of what elements we are + # inside of currently + inside = { + "constraint": [r'\constraint{', False], + "substitution": [r'\substitution{', False], + "drmfnote": [r'\drmfnote{', False], + "drmfname": [r'\drmfname{', False], + "proof": [r'\proof{', False] + } + + should_replace = False + in_ind = False + in_eq = False + + pi_pat = re.compile(r'(\s*)\\pi(\s*\b|[aeiou])') + # expe_kk = re.compile(r'(?:\\)\b([^d\\]?\W*)\s*e\s*\^') + # expe_pat = re.compile(r'(?:\\)?\b([^d\\]?\W*)\s*e\s*\^') + expe_kk = re.compile(r'(?0}', + r'\\ZZ_{\\ge0}'] + + spaces_pat = re.compile(r' {2,}') + paren_pat = re.compile(r'\(\s*(.*?)\s*\)') + + dollar_pat = re.compile(r'(?{)?' + pattern += _create_named_groups( + _create_group_names( + _frequencies["subscript"], + "sub", + end=num_args)) + pattern += r'(?(_' + str(_frequencies["subscript"]) + '_sub_open)})' + + _frequencies["subscript"] += 1 + + return pattern + +# matches a superscript with num_args comma-delimited arguments + + +def superscript(num_args=1): + + pattern = r'\^(?P<_' + str(_frequencies["superscript"]) + r'_sup_open>{)?' + pattern += r'(?:' + _create_named_groups( + _create_group_names( + _frequencies["superscript"], + "sup", + end=num_args)) + r'|' + simple_arg_list(num_args) + r')' + pattern += r'(?_' + str(_frequencies["superscript"]) + r'_sup_open)})' + + _frequencies["superscript"] += 1 + + return pattern + + +# matches a simple argument list (no ; or |) +def simple_arg_list(num_args=1, all_paren=False): + + o_paren = open_paren + c_paren = close_paren + if not all_paren: + o_paren = r'\(' + c_paren = r'\)' + + pattern = o_paren + pattern += _create_named_groups( + _create_group_names( + _frequencies["simple_arg_list"], + "arg", + end=num_args)) + pattern += c_paren + + _frequencies["simple_arg_list"] += 1 + + return pattern + +# matches argument lists with elements delimited by , | and ; +# parameters ending in _ex signify exclusivity (i.e. semi_first_ex means a +# ; ONLY comes after the first argument) + + +def semi_bar_arg_list( + num_args, + all_paren=False, + semi_first_ex=False, + semi_first=False, + semi_last=False, + semi_last_ex=False, + num_groups=1, + group_size=2, + bar_first=False, + bar_last=False): + + o_paren = open_paren + r'?\(' + c_paren = close_paren + r'?\)' + if not all_paren: + o_paren = r'\(' + c_paren = r'\)' + + # make sure that semi_first is set if semi_first_ex is set + if semi_first_ex: + semi_first = True + + if semi_last_ex: + semi_last = True + + # ensure ; and | are not both first or last + if (semi_first and bar_first) or (semi_last and bar_last): + raise ValueError("semicolon and bar cannot be in the same place") + + pattern = o_paren + + start_loc = 0 + + #; or | is going at the front or end + if any([semi_first, semi_last, bar_first, bar_last]): + + if bar_first: # bar is after first argument ONLY + + pattern += _create_named_groups( + _create_group_names( + _frequencies["semi_bar_arg_list"], + "arg", + end=1)) + r'\|' + _whitespace + r'*' + start_loc += 1 + + elif semi_first: # semicolon is after first argument + + pattern += _create_named_groups( + _create_group_names( + _frequencies["semi_bar_arg_list"], + "arg", + end=1)) + r';' + _whitespace + r'*' + start_loc += 1 + + if semi_first_ex: # semicolon is ONLY after first argument + pattern += _create_named_groups( + _create_group_names( + _frequencies["semi_bar_arg_list"], + "arg", + start=start_loc, + end=num_args - 1)) + start_loc = num_args - 1 + + # semicolon is ONLY before last argument + if semi_last_ex: + + pattern += _create_named_groups( + _create_group_names( + _frequencies["semi_bar_arg_list"], + "arg", + start=start_loc, + end=num_args - 1)) + + # unecessary if only first or last has ; + if not (semi_first_ex or semi_last_ex): + + expected = num_args - start_loc + + # figure out how many items there are to be grouped + if semi_last or bar_last: + expected -= 1 + + # ensure that the number of groups, size of each one, and the number of + # arguments all make sense + if num_groups * group_size != expected: + raise ValueError( + "{0} * {1} != {2}".format(num_groups, group_size, expected)) + + # go through however many ;-separated groups there are + for group in range(num_groups): + + pattern += _create_named_groups( + _create_group_names( + _frequencies["semi_bar_arg_list"], + "arg", + start=start_loc, + end=start_loc + + group_size)) + pattern += _whitespace + r'*;' + + start_loc += group_size + + pattern = pattern[:-1] + + # remove trailing ; if something comes after + if semi_last or bar_last: + if semi_last: # semicolon is before last argument + + pattern += _whitespace + r'*;' + _create_named_groups( + _create_group_names( + _frequencies["semi_bar_arg_list"], + "arg", + start=num_args - 1, + end=num_args)) + r')' + + elif bar_last: # bar is before last argument + + pattern += _whitespace + r'*\|' + _create_named_groups( + _create_group_names( + _frequencies["semi_bar_arg_list"], + "arg", + start=num_args - 1, + end=num_args)) + r')' + + else: # list ends normally + + pattern += r'),' + _create_named_groups( + _create_group_names( + _frequencies["semi_bar_arg_list"], + "arg", + start=start_loc, + end=num_args)) + + pattern += c_paren + + _frequencies["semi_bar_arg_list"] += 1 + + return pattern + +# creates a list of numbered group names to use in _create_named_groups + + +def _create_group_names(index_num, name, start=0, end=1): + + groups = [] + + for i in range(start + 1, end + 1): + groups.append("_{0}_{1}_{2}".format(index_num, name, i)) + + return groups + +# creates a pattern that matches function arguments as named groups + + +def _create_named_groups(*groups): + + pattern_string = "" + + for group in groups[0]: + pattern_string += r'{whitespace}*(?P<{group}>{valid}+),'.format( + whitespace=_whitespace, group=group, valid=valid) + + return pattern_string[:-1] + + +# returns the number of times a given function has been called +def get_freq(name): + return _frequencies[name] + + +def main(): + + print("") + print( + r'R' + + subscript() + + semi_bar_arg_list( + 5, + semi_first_ex=True, + bar_last=True, + all_paren=True)) + print("") + print("") +if __name__ == "__main__": + main() diff --git a/Macro-Replacement/utilities.py b/macro_replacement/src/utilities.py similarity index 77% rename from Macro-Replacement/utilities.py rename to macro_replacement/src/utilities.py index c215f05..bfbe958 100644 --- a/Macro-Replacement/utilities.py +++ b/macro_replacement/src/utilities.py @@ -1,13 +1,14 @@ +__author__ = "Cherry Zou" +__status__ = "Development" + """ Provides utility/helper functions for use in other files. """ -from __future__ import print_function - import re import sys -#remap input function if necessary +# remap input function if necessary if int(sys.version[0]) >= 3: raw_input = input @@ -16,9 +17,9 @@ def debug(function): """ Decorator that starts pdb before calling the function. """ - + def inner(*args, **kwargs): - + import pdb pdb.set_trace() @@ -26,6 +27,7 @@ def inner(*args, **kwargs): return inner + def get_input(prompt, valid=None, list=False, wait=True, preserve_case=False): """ Requests input from stdin until a valid response is given. @@ -42,7 +44,7 @@ def get_input(prompt, valid=None, list=False, wait=True, preserve_case=False): typed character as input (using getch). For example::: - + get_input("enter your name:") enter your name: monty @@ -61,7 +63,7 @@ def get_input(prompt, valid=None, list=False, wait=True, preserve_case=False): ] get_input("enter your eye color:", colors) - + enter your eye color: red That is not a valid response. Please try again. @@ -72,49 +74,50 @@ def get_input(prompt, valid=None, list=False, wait=True, preserve_case=False): input_function = raw_input - #add quit option and redefine raw_input if we're not waiting + # add quit option and redefine raw_input if we're not waiting if not wait: valid.add("q") - - #returns the result of using getch with a prompt + + # returns the result of using getch with a prompt def _getch_input(prompt_str): print(prompt_str, end="") to_return = _getch() print("") - + return to_return input_function = _getch_input - #add a space after the prompt for readability + # add a space after the prompt for readability if not prompt.endswith(" "): prompt = prompt + " " - response = input_function(prompt) - - #add spaces and commas to the valid characters for a list + response = input_function(prompt) + + # add spaces and commas to the valid characters for a list if list: valid.add(",") valid.add(" ") - #keep asking for input until a valid response is given - while (valid and - (any(char not in valid for char in response.lower()) or not list) - and (response.lower() not in valid or list) - or response.strip() == ""): + # keep asking for input until a valid response is given + while (valid and + (any(char not in valid for char in response.lower()) or not list) + and (response.lower() not in valid or list) + or response.strip() == ""): print("That is not a valid response. Please try again.") - response = input_function(prompt) + response = input_function(prompt) to_return = response.lower() - - #give response as typed if preserve case specified + + # give response as typed if preserve case specified if preserve_case: to_return = response return to_return + def readin(filename): """ Returns the content of filename as a list of lines. @@ -122,21 +125,23 @@ def readin(filename): return open(filename, "r").read() + def writeout(filename, content, append=False): """ Writes content to file filename. """ - + mode = "w" - - #append to the file instead of overwriting + + # append to the file instead of overwriting if append: mode = "a" - #write content + # write content with open(filename, mode) as out: out.write(content) + def get_line_lengths(content): """ Returns a list of the total number of bytes before the end of each line in content. @@ -144,31 +149,33 @@ def get_line_lengths(content): lengths = [0] - total = 0 + total = 0 - #go through every line + # go through every line for i, line in enumerate(content.split("\n")): length = len(line) - total += length + 1 #account for missing newlines + total += length + 1 # account for missing newlines lengths.append(total) return lengths + def unpack_list(first, second, *rest): """ Simulates Python 3's extended iterable unpacking. - + Usage: my_list = [1,2,3,4] - + unpack_list(*my_list) #returns (1, 2, (3, 4)) """ return first, second, rest + def get_last_line(fname): """ Returns the last line in file `fname`. @@ -177,21 +184,21 @@ def get_last_line(fname): all_lines = "" last_line = "" - #get last line + # get last line with open(fname, "r+") as file: all_lines = file.read().split("\n") - last_line = all_lines[-1] + last_line = all_lines[-1] del all_lines[-1] - #if the last line is a number, delete it + # if the last line is a number, delete it try: int(last_line) - #print("it's a number") - #write back all the lines except the last one + #print("it's a number") + # write back all the lines except the last one with open(fname, "w+") as file: for line in all_lines: - file.write(line + "\n") + file.write(line + "\n") except ValueError: #print("it's not a number") @@ -199,6 +206,7 @@ def get_last_line(fname): return last_line + def remove_inner_whitespace(line): """ Removes any repeated spaces from inside `line` (after the first word character) and returns the new string. @@ -207,7 +215,7 @@ def remove_inner_whitespace(line): stripped = line.lstrip() leading_space = len(line) - len(stripped) - stripped = re.sub(r' {2,}', ' ', stripped) + stripped = re.sub(r' {2,}', ' ', stripped) return ' ' * leading_space + stripped @@ -216,44 +224,47 @@ def find_line(byte, line_lengths): """ Determines which line the character `byte` bytes from the start of the file occurs on using a binary search. """ - + return _find_line_helper(byte, line_lengths, 0, len(line_lengths) - 1) -#uses recursive binary-search-esque algorithm to find what line the given byte is on +# uses recursive binary-search-esque algorithm to find what line the given +# byte is on + + def _find_line_helper(byte, line_lengths, start, end): mid = (start + end) // 2 if line_lengths[mid] == byte: - return mid+1 + return mid + 1 next_start = start next_end = end - #target byte is less than mid + # target byte is less than mid if byte < line_lengths[mid]: left = mid - 1 - #target byte between left and mid + # target byte between left and mid if line_lengths[left] < byte: return mid next_end = left - #target byte is between mid and right + # target byte is between mid and right if line_lengths[mid] <= byte: right = mid + 1 - + if line_lengths[right] == byte: return right + 1 - #if we're out of bounds, it's on the last possible line + # if we're out of bounds, it's on the last possible line if right >= end: - return end + return end - #target byte between mid and right + # target byte between mid and right if byte < line_lengths[right]: return right @@ -261,13 +272,15 @@ def _find_line_helper(byte, line_lengths, start, end): return _find_line_helper(byte, line_lengths, next_start, next_end) + class _Getch: """ Gets a single character from standard input. Does not echo to the screen. - + From http://code.activestate.com/recipes/134892/ By Danny Yoo """ + def __init__(self): try: self.impl = _GetchWindows() @@ -278,11 +291,15 @@ def __call__(self): return self.impl() class _GetchUnix: + def __init__(self): - import tty, sys + import tty + import sys def __call__(self): - import sys, tty, termios + import sys + import tty + import termios fd = sys.stdin.fileno() old_settings = termios.tcgetattr(fd) try: @@ -293,7 +310,9 @@ def __call__(self): termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) return ch + class _GetchWindows: + def __init__(self): import msvcrt @@ -302,4 +321,3 @@ def __call__(self): return msvcrt.getch() _getch = _Getch() - diff --git a/main_page/.gitignore b/main_page/.gitignore new file mode 100644 index 0000000..3caccc4 --- /dev/null +++ b/main_page/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +backups/ +*Glossary.csv* +!test/fake.Glossary.csv diff --git a/main_page/categories.txt b/main_page/categories.txt new file mode 100644 index 0000000..eee3923 --- /dev/null +++ b/main_page/categories.txt @@ -0,0 +1,10 @@ +F - real or complex valued functions. +P - polynomials. +I - integer valued functions. +O - operators. +SM - semantic macros. +Q - quantifiers, set operators, and symbols. +SN - sets of numbers. +C - constants. +L - linear algebra. +D - distributions. diff --git a/main_page/main_page.mmd b/main_page/main_page.mmd new file mode 100644 index 0000000..7cbe107 --- /dev/null +++ b/main_page/main_page.mmd @@ -0,0 +1,5228 @@ +drmf_bof +'''Main Page''' +The '''NIST Digital Repository of Mathematical Formulae''' is designed for +a mathematically literate audience and should + +# facilitate interaction among a [[community]] of mathematicians and scientists interested in [[wikipedia:compendia|compendia]] formulae data for '''orthogonal polynomials and special functions'''; +# be [[expandable]], allowing the input of new formulae from the literature; +# represent the context-free full [[semantic]] information concerning individual formulas; +# have a user friendly, consistent, and hyperlinkable viewpoint and authoring [[perspective]]; +# contain easily [[Special:MathSearch|searchable]] mathematics; and +# take advantage of modern [[MathML]] tools for easy to read, scalably rendered content driven mathematics. + +For more information see [http://link.springer.com/chapter/10.1007%2F978-3-319-08434-3_30 Digital Repository of Mathematical Formulae] or [http://arxiv.org/abs/1404.6519 arXiv:1404.6519]. + +== Sample Seeding Project Implementations == + +DLMF: [[Zeta and Related Functions]] + +KLS and KLSadd: [[Orthogonal Polynomials]] + +== Useful Pages == + +[[GitHub|How to Upload Your Project to GitHub]] + +[[Wikilabs|How to get access to Wikilabs/Wikitech]] + +[https://github.com/DRMF/DRMF/blob/master/doc/upload_and_connect.MD Upload and Connect] + +== Sample formula home pages with DLMF proofs given == + +
+* [[Formula:DLMF:25.2:E9]] +* [[Formula:DLMF:25.5:E2]] +* [[Formula:DLMF:25.5:E4]] +* [[Formula:DLMF:25.5:E6]] +* [[Formula:DLMF:25.8:E7]] +* [[Formula:DLMF:25.8:E8]] +* [[Formula:DLMF:25.11:E7]] +* [[Formula:DLMF:25.11:E10]] +* [[Formula:DLMF:25.11:E11]] +* [[Formula:DLMF:25.11:E15]] +* [[Formula:DLMF:25.11:E17]] +* [[Formula:DLMF:25.11:E24]] +* [[Formula:DLMF:25.11:E27]] +* [[Formula:DLMF:25.11:E28]] +* [[Formula:DLMF:25.11:E30]] +* [[Formula:DLMF:25.11:E31]] +* [[Formula:DLMF:25.11:E35]] +
+ += Digital Repository of Mathematical Formulae = +
+# [[Algebraic and Analytic Methods]] +# [[Asymptotic Approximations]] +# [[Numerical Methods]] +# [[Elementary Functions]] +# [[Gamma Function]] +# [[Exponential, Logarithmic, Sine, and Cosine Integrals]] +# [[Error Functions, Dawson’s and Fresnel Integrals]] +# [[Incomplete Gamma and Related Functions]] +# [[Airy and Related Functions]] +# [[Bessel Functions]] +# [[Struve and Related Functions]] +# [[Parabolic Cylinder Functions]] +# [[Confluent Hypergeometric Functions]] +# [[Legendre and Related Functions]] +# [[Hypergeometric Function]] +# [[Generalized Hypergeometric Functions and Meijer G-Function|Generalized Hypergeometric Functions and Meijer ''G''-Function]] +# [[q-Hypergeometric and Related Functions|''q''-Hypergeometric and Related Functions]] +# [[Orthogonal Polynomials]] +# [[Elliptic Integrals]] +# [[Theta Functions]] +# [[Multidimensional Theta Functions]] +# [[Jacobian Elliptic Functions]] +# [[Weierstrass Elliptic and Modular Functions]] +# [[Bernoulli and Euler Polynomials]] +# [[Zeta and Related Functions]] +# [[Combinatorial Analysis]] +# [[Functions of Number Theory]] +# [[Mathieu Functions and Hill’s Equation]] +# [[Lamé Functions]] +# [[Spheroidal Wave Functions]] +# [[Heun Functions]] +# [[Painlevé Transcendents]] +# [[Coulomb Functions]] +# [[3j,6j,9j Symbols|''3j,6j,9j'' Symbols]] +# [[Functions of Matrix Argument]] +# [[Integrals with Coalescing Saddles]] +
+ +== Definition Pages == + +
+* [[Definition:AffqKrawtchouk|AffqKrawtchouk]] +* [[Definition:AlSalamCarlitzI|AlSalamCarlitzI]] +* [[Definition:AlSalamCarlitzII|AlSalamCarlitzII]] +* [[Definition:AlSalamIsmail|AlSalamIsmail]] +* [[Definition:AntiDer|AntiDer]] +* [[Definition:BesselPolyIIparam|BesselPolyIIparam]] +* [[Definition:BesselPolyTheta|BesselPolyTheta]] +* [[Definition:bigqJacobiIVparam|bigqJacobiIVparam]] +* [[Definition:bigqLaguerre|bigqLaguerre]] +* [[Definition:bigqLegendre|bigqLegendre]] +* [[Definition:CiglerqChebyT|CiglerqChebyT]] +* [[Definition:CiglerqChebyU|CiglerqChebyU]] +* [[Definition:ctsbigqHermite|ctsbigqHermite]] +* [[Definition:ctsdualqHahn|ctsdualqHahn]] +* [[Definition:ctsqHahn|ctsqHahn]] +* [[Definition:ctsqJacobi|ctsqJacobi]] +* [[Definition:ctsqLaguerre|ctsqLaguerre]] +* [[Definition:ctsqLegendre|ctsqLegendre]] +* [[Definition:f|f]] +* [[Definition:GenHermite|GenHermite]] +* [[Definition:GottliebLaguerre|GottliebLaguerre]] +* [[Definition:Int|Int]] +* [[Definition:JacksonqBesselII|JacksonqBesselII]] +* [[Definition:JacksonqBesselIII|JacksonqBesselIII]] +* [[Definition:littleqLegendre|littleqLegendre]] +* [[Definition:lrselection|lrselection]] +* [[Definition:monicAlSalamCarlitzI|monicAlSalamCarlitzI]] +* [[Definition:monicAlSalamCarlitzII|monicAlSalamCarlitzII]] +* [[Definition:monicAlSalamChihara|monicAlSalamChihara]] +* [[Definition:monicAskeyWilson|monicAskeyWilson]] +* [[Definition:monicBesselPoly|monicBesselPoly]] +* [[Definition:monicbigqJacobi|monicbigqJacobi]] +* [[Definition:monicbigqLaguerre|monicbigqLaguerre]] +* [[Definition:monicbigqLegendre|monicbigqLegendre]] +* [[Definition:monicCharlier|monicCharlier]] +* [[Definition:monicChebyT|monicChebyT]] +* [[Definition:monicChebyU|monicChebyU]] +* [[Definition:monicctsbigqHermite|monicctsbigqHermite]] +* [[Definition:monicctsdualHahn|monicctsdualHahn]] +* [[Definition:monicctsdualqHahn|monicctsdualqHahn]] +* [[Definition:monicctsHahn|monicctsHahn]] +* [[Definition:monicctsqHahn|monicctsqHahn]] +* [[Definition:monicctsqHermite|monicctsqHermite]] +* [[Definition:monicctsqJacobi|monicctsqJacobi]] +* [[Definition:monicctsqLaguerre|monicctsqLaguerre]] +* [[Definition:monicctsqLegendre|monicctsqLegendre]] +* [[Definition:monicctsqUltra|monicctsqUltra]] +* [[Definition:monicdiscrqHermiteI|monicdiscrqHermiteI]] +* [[Definition:monicdiscrqHermiteII|monicdiscrqHermiteII]] +* [[Definition:monicdualHahn|monicdualHahn]] +* [[Definition:monicdualqHahn|monicdualqHahn]] +* [[Definition:monicdualqKrawtchouk|monicdualqKrawtchouk]] +* [[Definition:monicHahn|monicHahn]] +* [[Definition:monicHermite|monicHermite]] +* [[Definition:monicJacobi|monicJacobi]] +* [[Definition:monicKrawtchouk|monicKrawtchouk]] +* [[Definition:monicLaguerre|monicLaguerre]] +* [[Definition:monicLegendrePoly|monicLegendrePoly]] +* [[Definition:moniclittleqJacobi|moniclittleqJacobi]] +* [[Definition:moniclittleqLaguerre|moniclittleqLaguerre]] +* [[Definition:moniclittleqLegendre|moniclittleqLegendre]] +* [[Definition:monicMeixner|monicMeixner]] +* [[Definition:monicMeixnerPollaczek|monicMeixnerPollaczek]] +* [[Definition:monicpseudoJacobi|monicpseudoJacobi]] +* [[Definition:monicqBesselPoly|monicqBesselPoly]] +* [[Definition:monicqCharlier|monicqCharlier]] +* [[Definition:monicqKrawtchouk|monicqKrawtchouk]] +* [[Definition:monicqLaguerre|monicqLaguerre]] +* [[Definition:monicqMeixner|monicqMeixner]] +* [[Definition:monicqMeixnerPollaczek|monicqMeixnerPollaczek]] +* [[Definition:monicqRacah|monicqRacah]] +* [[Definition:monicqtmqKrawtchouk|monicqtmqKrawtchouk]] +* [[Definition:monicRacah|monicRacah]] +* [[Definition:monicStieltjesWigert|monicStieltjesWigert]] +* [[Definition:monicUltra|monicUltra]] +* [[Definition:monicWilson|monicWilson]] +* [[Definition:NeumannFactor|NeumannFactor]] +* [[Definition:normctsdualHahnStilde|normctsdualHahnStilde]] +* [[Definition:normctsHahnptilde|normctsHahnptilde]] +* [[Definition:normJacobiR|normJacobiR]] +* [[Definition:normWilsonWtilde|normWilsonWtilde]] +* [[Definition:poly|poly]] +* [[Definition:qBesselPoly|qBesselPoly]] +* [[Definition:qCharlier|qCharlier]] +* [[Definition:qDigamma|qDigamma]] +* [[Definition:qHyperrWs|qHyperrWs]] +* [[Definition:qExpKLS|qExpKLS]] +* [[Definition:qexpKLS|qexpKLS]] +* [[Definition:qcosKLS|qcosKLS]] +* [[Definition:qMeixner|qMeixner]] +* [[Definition:qKrawtchouk|qKrawtchouk]] +* [[Definition:monicqHahn|monicqHahn]] +* [[Definition:dualqHahn|dualqHahn]] +* [[Definition:dualqKrawtchouk|dualqKrawtchouk]] +* [[Definition:littleqLaguerre|littleqLaguerre]] +* [[Definition:qsinKLS|qsinKLS]] +* [[Definition:qSinKLS|qSinKLS]] +* [[Definition:qCosKLS|qCosKLS]] +* [[Definition:Wilson|Wilson]] +* [[Definition:Racah|Racah]] +* [[Definition:ctsdualHahn|ctsdualHahn]] +* [[Definition:ctsHahn|ctsHahn]] +* [[Definition:Hahn|Hahn]] +* [[Definition:dualHahn|dualHahn]] +* [[Definition:qRacah|qRacah]] +* [[Definition:normctsdualqHahnptilde|normctsdualqHahnptilde]] +* [[Definition:normctsqHahnptilde|normctsqHahnptilde]] +* [[Definition:qHahn|qHahn]] +* [[Definition:AlSalamChihara|AlSalamChihara]] +* [[Definition:qinvAlSalamChihara|qinvAlSalamChihara]] +* [[Definition:monicqinvAlSalamChihara|monicqinvAlSalamChihara]] +* [[Definition:monicAffqKrawtchouk|monicAffqKrawtchouk]] +* [[Definition:qMeixnerPollaczek|qMeixnerPollaczek]] +* [[Definition:qtmqKrawtchouk|qtmqKrawtchouk]] +* [[Definition:qLaguerre|qLaguerre]] +* [[Definition:ctsqHermite|ctsqHermite]] +* [[Definition:StieltjesWigert|StieltjesWigert]] +* [[Definition:discrqHermiteI|discrqHermiteI]] +* [[Definition:discrqHermiteII|discrqHermiteII]] +* [[Definition:StieltjesConstants|StieltjesConstants]] +* [[Definition:PolylogarithmS|PolylogarithmS]] +* [[Definition:HarmonicNumber|HarmonicNumber]] +* [[Definition:LucasL|LucasL]] +* [[Definition:HurwitzLerchPhi|HurwitzLerchPhi]] +* [[Definition:GoldenRatio|GoldenRatio]] +* [[Definition:WhitPsi|WhitPsi]] +* [[Definition:GompertzConstant|GompertzConstant]] +* [[Definition:rabbitConstant|rabbitConstant]] +* [[Definition:FibonacciNumber|FibonacciNumber]] +* [[Definition:Fibonacci|Fibonacci]] +* [[Definition:RegGammaP|RegGammaP]] +* [[Definition:RegGammaQ|RegGammaQ]] +* [[Definition:GaussDistF|GaussDistF]] +* [[Definition:GaussDistQ|GaussDistQ]] +* [[Definition:RamanujanTauTheta|RamanujanTauTheta]] +* [[Definition:RiemannSiegelTheta|RiemannSiegelTheta]] +* [[Definition:sinc|sinc]] +* [[Definition:Binet|Binet]] +
+ += Copyright = + +Pursuant to U.S. Code, Title 17, Chapter 1, Section 105: +
+Copyright protection under this title is not available for any +work of the United States Government, but the United States Government is not +precluded from receiving and holding copyrights transferred to it by assignment, +bequest, or otherwise. +
+the National Institute of Standards and Technology (NIST), United States Department +of Commerce, this website, a work of the United States Government, is in the public +domain. + += Disclaimer = + +While NIST has made every effort to ensure the accuracy and reliability of the +information in the DLMF, the DLMF is expressly provided “AS-IS.” NIST makes NO WARRANTY +OF ANY TYPE, including no warranties of merchantability or fitness for a particular +purpose. NIST makes no warranties or representations as to the correctness, accuracy, +or reliability of the DLMF. As a condition of using the DLMF, you explicitly release +NIST from any and all liabilities for any damage of any type that may result from +errors or omissions in the DLMF. + +Certain products, commercial and otherwise, are mentioned in the DLMF. These mentions +are for informational purposes only, and do not imply recommendation or endorsement by NIST. + += Privacy and Security Notice = + +The information we receive depends upon what you do when visiting our site. We collect +no personally identifying information about you when you visit our site, unless you +choose to provide that information to us. + +''If you visit our site to read or download information, we collect and store'' '''only''' +''the following information:'' + +* The name of the internet domain from which you accessed our site and the Internet Protocol (IP) address or host name which may or may not identify a specific computer. +* The date and time you access our site. +* The pages you visit. +* The Internet address of the website from which you linked directly to our site. + +This information may be preserved in web access logs for an indefinite period of time. +The data are used to prevent security breaches, insure the integrity of data on our +servers, and summarize usage of our systems. We do not collect information through use +of cookies. Other than the information described above which is collected from all +visitors, we do not collect any information online from children. + +''If you identify yourself by sending an E-mail containing personal information:'' + +* You also may decide to send us personally identifying information (for example, your mailing address) in an electronic mail message or web-based form requesting that information or products be mailed to you. Information collected in this manner is used solely for responding to your request unless noted in the specific web page where your request is made. + +'''Note:''' NIST is ''not'' responsible for the privacy practices employed by non-NIST sites that may link to or from the NIST website. +drmf_eof +drmf_bof +'''Definition:AffqKrawtchouk''' +
+
<< [[Definition:Binet|Definition:Binet]]
+
[[Main_Page|Main Page]]
+
[[Definition:AlSalamCarlitzI|Definition:AlSalamCarlitzI]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\AffqKrawtchouk''' represents the Affine q-Krawtchouk polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\AffqKrawtchouk{n}''' produces {\displaystyle \AffqKrawtchouk{n}}
+:'''\AffqKrawtchouk{n}@{q^{-x}}{p}{N}{q}''' produces {\displaystyle \AffqKrawtchouk{n}@{q^{-x}}{p}{N}{q}}
+:'''\AffqKrawtchouk{n}@@{q^{-x}}{p}{N}{q}''' produces {\displaystyle \AffqKrawtchouk{n}@@{q^{-x}}{p}{N}{q}}
+ +These are defined by + +{\displaystyle +\AffqKrawtchouk{n}@{q^{-x}}{p}{N}{q}:=\qHyperrphis{3}{2}@@{q^{-n},0,q^{-x}}{pq,q^{-N}}{q}{q} +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:AffqKrawtchouk {\displaystyle K^{\mathrm{Aff}}_{n}}] : affine {\displaystyle q}-Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:AffqKrawtchouk http://drmf.wmflabs.org/wiki/Definition:AffqKrawtchouk]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:Binet|Definition:Binet]]
+
[[Main_Page|Main Page]]
+
[[Definition:AlSalamCarlitzI|Definition:AlSalamCarlitzI]] >>
+
+drmf_eof +drmf_bof +'''Definition:AlSalamCarlitzI''' +
+
<< [[Definition:AffqKrawtchouk|Definition:AffqKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:AlSalamCarlitzII|Definition:AlSalamCarlitzII]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\AlSalamCarlitzI''' represents the Al-Salam-Carlitz I polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\AlSalamCarlitzI{a}{n}''' produces {\displaystyle \AlSalamCarlitzI{a}{n}}
+:'''\AlSalamCarlitzI{a}{n}@{x}{q}''' produces {\displaystyle \AlSalamCarlitzI{a}{n}@{x}{q}}
+ +These are defined by +{\displaystyle +\AlSalamCarlitzI{a}{n}@{x}{q}:=(-a)^nq^{\binom{n}{2}}\,\qHyperrphis{2}{1}@@{q^{-n},x^{-1}}{0}{q}{\frac{qx}{a}}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzI {\displaystyle U^{(n)}_{\alpha}}] : Al-Salam-Carlitz I polynomial : [http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzI http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzI]
+[http://dlmf.nist.gov/1.2#E1 {\displaystyle \binom{n}{k}}] : binomial coefficient : [http://dlmf.nist.gov/1.2#E1 http://dlmf.nist.gov/1.2#E1] [http://dlmf.nist.gov/26.3#SS1.p1 http://dlmf.nist.gov/26.3#SS1.p1]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:AffqKrawtchouk|Definition:AffqKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:AlSalamCarlitzII|Definition:AlSalamCarlitzII]] >>
+
+drmf_eof +drmf_bof +'''Definition:AlSalamCarlitzII''' +
+
<< [[Definition:AlSalamCarlitzI|Definition:AlSalamCarlitzI]]
+
[[Main_Page|Main Page]]
+
[[Definition:AlSalamIsmail|Definition:AlSalamIsmail]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\AlSalamCarlitzII''' represents the Al-Salam-Carlitz II polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\AlSalamCarlitzII{a}{n}''' produces {\displaystyle \AlSalamCarlitzII{a}{n}}
+:'''\AlSalamCarlitzII{a}{n}@{x}{q}''' produces {\displaystyle \AlSalamCarlitzII{a}{n}@{x}{q}}
+ +These are defined by +{\displaystyle +\AlSalamCarlitzII{a}{n}@{x}{q}:= +(-a)^nq^{-\binom{n}{2}}\,\qHyperrphis{2}{0}@@{q^{-n},x}{-}{q}{\frac{q^n}{a}}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzII {\displaystyle V^{(n)}_{\alpha}}] : Al-Salam-Carlitz II polynomial : [http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzII http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzII]
+[http://dlmf.nist.gov/1.2#E1 {\displaystyle \binom{n}{k}}] : binomial coefficient : [http://dlmf.nist.gov/1.2#E1 http://dlmf.nist.gov/1.2#E1] [http://dlmf.nist.gov/26.3#SS1.p1 http://dlmf.nist.gov/26.3#SS1.p1]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:AlSalamCarlitzI|Definition:AlSalamCarlitzI]]
+
[[Main_Page|Main Page]]
+
[[Definition:AlSalamIsmail|Definition:AlSalamIsmail]] >>
+
+drmf_eof +drmf_bof +'''Definition:AlSalamIsmail''' +
+
<< [[Definition:AlSalamCarlitzII|Definition:AlSalamCarlitzII]]
+
[[Main_Page|Main Page]]
+
[[Definition:AntiDer|Definition:AntiDer]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\AlSalamIsmail''' represents the Al-Salam Ismail q polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\AlSalamIsmail{n}''' produces {\displaystyle \AlSalamIsmail{n}}
+:'''\AlSalamIsmail{n}@{x}{s}{q}''' produces {\displaystyle \AlSalamIsmail{n}@{x}{s}{q}}
+ +These are defined by + +\AlSalamIsmail{2n}@{x^{1/2}}{a}{b}:=q^{n^2-n}(-b)^n +\qHyperrphis{4}{3}@@{q^{-n},-q^{1-n}/a,-aq^n,q^{n+1}} +{-q,q^{1/2},-q^{1/2}} +{q}{\frac{xaq}{b}} +
+ +and + + +\AlSalamIsmail{2n+1}@{x^{1/2}}{a}{b}=q^{n^2-n}\frac{(-b)^n(1+aq^n)(1-q^{n+1})x^{1/2}}{(1-q)} +\qHyperrphis{4}{3}@@{q^{-n},-q^{1-n}/a,-aq^{n+1},q^{n+2}} +{-q,q^{3/2},-q^{3/2}} +{q}{\frac{xaq}{b}}. + +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:AlSalamIsmail {\displaystyle U_{n}}] : Al-Salam Ismail polynomial : [http://drmf.wmflabs.org/wiki/Definition:AlSalamIsmail http://drmf.wmflabs.org/wiki/Definition:AlSalamIsmail]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:AlSalamCarlitzII|Definition:AlSalamCarlitzII]]
+
[[Main_Page|Main Page]]
+
[[Definition:AntiDer|Definition:AntiDer]] >>
+
+drmf_eof +drmf_bof +'''Definition:AntiDer''' +
+
<< [[Definition:AlSalamIsmail|Definition:AlSalamIsmail]]
+
[[Main_Page|Main Page]]
+
[[Definition:BesselPolyIIparam|Definition:BesselPolyIIparam]] >>
+
+ +In the DRMF, the LaTeX semantic macro '''\AntiDer''' represents the anti-derivative notation, +which is defined as follows. + +This macro is in the category of semantic macros. + +In math mode, this macro can be called in the following ways: + +:'''\AntiDer''' produces {\displaystyle \AntiDer}
+:'''\AntiDer@{x}{f(x)}''' produces {\displaystyle \AntiDer@{x}{f(x)}}
+ +These are defined by +{\displaystyle +\AntiDer@{f(x)}{x}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:AntiDer {\displaystyle \int f(x){\mathrm d}\!x}] : semantic antiderivative : [http://drmf.wmflabs.org/wiki/Definition:AntiDer http://drmf.wmflabs.org/wiki/Definition:AntiDer] +
+
<< [[Definition:AlSalamIsmail|Definition:AlSalamIsmail]]
+
[[Main_Page|Main Page]]
+
[[Definition:BesselPolyIIparam|Definition:BesselPolyIIparam]] >>
+
+drmf_eof +drmf_bof +'''Definition:BesselPolyIIparam''' +
+
<< [[Definition:AntiDer|Definition:AntiDer]]
+
[[Main_Page|Main Page]]
+
[[Definition:BesselPolyTheta|Definition:BesselPolyTheta]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\BesselPolyIIparam''' represents the Bessel polynomial with two-parameters. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\BesselPolyIIparam{n}''' produces {\displaystyle \BesselPolyIIparam{n}}
+:'''\BesselPolyIIparam{n}@{x}{a}{b}''' produces {\displaystyle \BesselPolyIIparam{n}@{x}{a}{b}}
+ +These are defined by +{\displaystyle +\BesselPolyIIparam{n}@{x}{a}{b}:=\BesselPoly{n}@{2b^{-1}x}{a} +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/18.34#E1 {\displaystyle y_{n}}] : Bessel polynomial : [http://dlmf.nist.gov/18.34#E1 http://dlmf.nist.gov/18.34#E1]
+[http://drmf.wmflabs.org/wiki/Definition:BesselPolyIIparam {\displaystyle y_{n}}] : Bessel polynomial with two parameters {\displaystyle y_n} : [http://drmf.wmflabs.org/wiki/Definition:BesselPolyIIparam http://drmf.wmflabs.org/wiki/Definition:BesselPolyIIparam] +
+
<< [[Definition:AntiDer|Definition:AntiDer]]
+
[[Main_Page|Main Page]]
+
[[Definition:BesselPolyTheta|Definition:BesselPolyTheta]] >>
+
+drmf_eof +drmf_bof +'''Definition:BesselPolyTheta''' +
+
<< [[Definition:BesselPolyIIparam|Definition:BesselPolyIIparam]]
+
[[Main_Page|Main Page]]
+
[[Definition:bigqJacobiIVparam|Definition:bigqJacobiIVparam]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\BesselPolyTheta''' represents the Bessel polynomial \theta_nwith two-parameters. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\BesselPolyTheta{n}''' produces {\displaystyle \BesselPolyTheta{n}}
+:'''\BesselPolyTheta{n}@{x}{a}{b}''' produces {\displaystyle \BesselPolyTheta{n}@{x}{a}{b}}
+ +These are defined by +{\displaystyle +\BesselPolyTheta{n}@{x}{a}{b}:=x^n\BesselPolyIIparam{n}@{x^{-1}}{a}{b} +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:BesselPolyIIparam {\displaystyle y_{n}}] : Bessel polynomial with two parameters {\displaystyle y_n} : [http://drmf.wmflabs.org/wiki/Definition:BesselPolyIIparam http://drmf.wmflabs.org/wiki/Definition:BesselPolyIIparam]
+[http://drmf.wmflabs.org/wiki/Definition:BesselPolyTheta {\displaystyle \theta_{n}}] : Bessel polynomial with two parameters {\displaystyle \theta_n} : [http://drmf.wmflabs.org/wiki/Definition:BesselPolyTheta http://drmf.wmflabs.org/wiki/Definition:BesselPolyTheta] +
+
<< [[Definition:BesselPolyIIparam|Definition:BesselPolyIIparam]]
+
[[Main_Page|Main Page]]
+
[[Definition:bigqJacobiIVparam|Definition:bigqJacobiIVparam]] >>
+
+drmf_eof +drmf_bof +'''Definition:bigqJacobiIVparam''' +
+
<< [[Definition:BesselPolyTheta|Definition:BesselPolyTheta]]
+
[[Main_Page|Main Page]]
+
[[Definition:bigqLaguerre|Definition:bigqLaguerre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\bigqJacobiIVparam''' represents the Big q-Jacobi polynomial with four-parameters. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\bigqJacobiIVparam{n}''' produces {\displaystyle \bigqJacobiIVparam{n}}
+:'''\bigqJacobiIVparam{n}@{x}{a}{b}{c}{d}{q}''' produces {\displaystyle \bigqJacobiIVparam{n}@{x}{a}{b}{c}{d}{q}}
+ +These are defined by +{\displaystyle +\bigqJacobiIVparam{n}@{x}{a}{b}{c}{d}{q}:=\qHyperrphis{3}{2}@@{q^{-n},abq^{n+1},ac^{-1}qx}{aq,-ac^{-1}dq}{q}{q} +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:bigqJacobiIVparam {\displaystyle P_{n}}] : big {\displaystyle q}-Jacobi polynomial with four parameters : [http://drmf.wmflabs.org/wiki/Definition:bigqJacobiIVparam http://drmf.wmflabs.org/wiki/Definition:bigqJacobiIVparam]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:BesselPolyTheta|Definition:BesselPolyTheta]]
+
[[Main_Page|Main Page]]
+
[[Definition:bigqLaguerre|Definition:bigqLaguerre]] >>
+
+drmf_eof +drmf_bof +'''Definition:bigqLaguerre''' +
+
<< [[Definition:bigqJacobiIVparam|Definition:bigqJacobiIVparam]]
+
[[Main_Page|Main Page]]
+
[[Definition:bigqLegendre|Definition:bigqLegendre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\bigqLaguerre''' represents big q-Laguerre polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\bigqLaguerre{n}''' produces {\displaystyle \bigqLaguerre{n}}
+:'''\bigqLaguerre{n}@{x}{a}{b}{q}''' produces {\displaystyle \bigqLaguerre{n}@{x}{a}{b}{q}}
+ +These are defined by +{\displaystyle +\bigqLaguerre{n}@{x}{a}{b}{q}:=\qHyperrphis{3}{2}@@{q^{-n},0,x}{aq,bq}{q}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:bigqLaguerre {\displaystyle P_{n}}] : big {\displaystyle q}-Laguerre polynomial : [http://drmf.wmflabs.org/wiki/Definition:bigqLaguerre http://drmf.wmflabs.org/wiki/Definition:bigqLaguerre]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:bigqJacobiIVparam|Definition:bigqJacobiIVparam]]
+
[[Main_Page|Main Page]]
+
[[Definition:bigqLegendre|Definition:bigqLegendre]] >>
+
+drmf_eof +drmf_bof +'''Definition:bigqLegendre''' +
+
<< [[Definition:bigqLaguerre|Definition:bigqLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:CiglerqChebyT|Definition:CiglerqChebyT]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\bigqLegendre''' represents the big q-Legendre polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\bigqLegendre{n}''' produces {\displaystyle \bigqLegendre{n}}
+:'''\bigqLegendre{n}@{x}{c}{q}''' produces {\displaystyle \bigqLegendre{n}@{x}{c}{q}}
+ +These are defined by +{\displaystyle +\bigqLegendre{n}@{x}{c}{q}:=\qHyperrphis{3}{2}@@{q^{-n},q^{n+1},x}{q,cq}{q}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:bigqLegendre {\displaystyle P_{n}}] : big {\displaystyle q}-Legendre polynomial : [http://drmf.wmflabs.org/wiki/Definition:bigqLegendre http://drmf.wmflabs.org/wiki/Definition:bigqLegendre]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:bigqLaguerre|Definition:bigqLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:CiglerqChebyT|Definition:CiglerqChebyT]] >>
+
+drmf_eof +drmf_bof +'''Definition:CiglerqChebyT''' +
+
<< [[Definition:bigqLegendre|Definition:bigqLegendre]]
+
[[Main_Page|Main Page]]
+
[[Definition:CiglerqChebyU|Definition:CiglerqChebyU]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\CiglerqChebyT''' represents the Cigler q-Chebyshev polynomial of the first kind. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\CiglerqChebyT{n}''' produces {\displaystyle \CiglerqChebyT{n}}
+:'''\CiglerqChebyT{n}@{x}{s}{q}''' produces {\displaystyle \CiglerqChebyT{n}@{x}{s}{q}}
+ +These are defined by + +{\displaystyle +\CiglerqChebyT{n}@{x}{s}{q}:=(-s)^{\frac12 n} \bigqJacobiIVparam{n}@{(-qs)^{-\frac12} x}{q^{-\frac12}}{q^{-\frac12}}{1}{1}{q}. +} + +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:bigqJacobiIVparam {\displaystyle P_{n}}] : big {\displaystyle q}-Jacobi polynomial with four parameters : [http://drmf.wmflabs.org/wiki/Definition:bigqJacobiIVparam http://drmf.wmflabs.org/wiki/Definition:bigqJacobiIVparam]
+[http://drmf.wmflabs.org/wiki/Definition:CiglerqChebyT {\displaystyle T_{n}}] : Cigler {\displaystyle q}-Chebyshev polynomial {\displaystyle T} : [http://drmf.wmflabs.org/wiki/Definition:CiglerqChebyT http://drmf.wmflabs.org/wiki/Definition:CiglerqChebyT] +
+
<< [[Definition:bigqLegendre|Definition:bigqLegendre]]
+
[[Main_Page|Main Page]]
+
[[Definition:CiglerqChebyU|Definition:CiglerqChebyU]] >>
+
+drmf_eof +drmf_bof +'''Definition:CiglerqChebyU''' +
+
<< [[Definition:CiglerqChebyT|Definition:CiglerqChebyT]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsbigqHermite|Definition:ctsbigqHermite]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\CiglerqChebyU''' represents the Cigler q-Chebyshev polynomial of the second kind. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\CiglerqChebyU{n}''' produces {\displaystyle \CiglerqChebyU{n}}
+:'''\CiglerqChebyU{n}@{x}{s}{q}''' produces {\displaystyle \CiglerqChebyU{n}@{x}{s}{q}}
+ +These are defined by + +{\displaystyle +\CiglerqChebyU{n}@{x}{s}{q}:=(-q^{-2}s)^{\frac12 n} \frac{1-q^{n+1}}{1-q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:CiglerqChebyU {\displaystyle U_{n}}] : Cigler {\displaystyle q}-Chebyshev polynomial {\displaystyle U} : [http://drmf.wmflabs.org/wiki/Definition:CiglerqChebyU http://drmf.wmflabs.org/wiki/Definition:CiglerqChebyU] +
+
<< [[Definition:CiglerqChebyT|Definition:CiglerqChebyT]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsbigqHermite|Definition:ctsbigqHermite]] >>
+
+drmf_eof +drmf_bof +'''Definition:ctsbigqHermite''' +
+
<< [[Definition:CiglerqChebyU|Definition:CiglerqChebyU]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsdualqHahn|Definition:ctsdualqHahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\ctsbigqHermite''' represents continuous big q-Hermite polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\ctsbigqHermite{n}''' produces {\displaystyle \ctsbigqHermite{n}}
+:'''\ctsbigqHermite{n}@{x}{a}{q}''' produces {\displaystyle \ctsbigqHermite{n}@{x}{a}{q}}
+ +These are defined by +{\displaystyle +\ctsbigqHermite{n}@{x}{a}{q}:=a^{-n}\,\qHyperrphis{3}{2}@@{q^{-n},a\expe^{i\theta},a\expe^{-i\theta}}{0,0}{q}{q}. + +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:ctsbigqHermite {\displaystyle H_{n}}] : continuous big {\displaystyle q}-Hermite polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsbigqHermite http://drmf.wmflabs.org/wiki/Definition:ctsbigqHermite]
+[http://dlmf.nist.gov/4.2.E11 {\displaystyle \mathrm{e}}] : the base of the natural logarithm : [http://dlmf.nist.gov/4.2.E11 http://dlmf.nist.gov/4.2.E11]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:CiglerqChebyU|Definition:CiglerqChebyU]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsdualqHahn|Definition:ctsdualqHahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:ctsdualqHahn''' +
+
<< [[Definition:ctsbigqHermite|Definition:ctsbigqHermite]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsqHahn|Definition:ctsqHahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\ctsdualqHahn''' represents the continuous dual q-Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\ctsdualqHahn{n}''' produces {\displaystyle \ctsdualqHahn{n}}
+:'''\ctsdualqHahn{n}@{x}{a}{b}{c}{q}''' produces {\displaystyle \ctsdualqHahn{n}@{x}{a}{b}{c}{q}}
+ +These are defined by + +\frac{a^n\ctsdualqHahn{n}@{x}{a}{b}{c}{q}}{\qPochhammer{ab,ac}{q}{n}} +:=\qHyperrphis{3}{2}@@{q^{-n},a\expe^{i\theta},a\expe^{-i\theta}}{ab,ac}{q}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:ctsdualqHahn {\displaystyle p_{n}}] : continuous dual {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsdualqHahn http://drmf.wmflabs.org/wiki/Definition:ctsdualqHahn]
+[http://dlmf.nist.gov/4.2.E11 {\displaystyle \mathrm{e}}] : the base of the natural logarithm : [http://dlmf.nist.gov/4.2.E11 http://dlmf.nist.gov/4.2.E11]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:ctsbigqHermite|Definition:ctsbigqHermite]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsqHahn|Definition:ctsqHahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:ctsqHahn''' +
+
<< [[Definition:ctsdualqHahn|Definition:ctsdualqHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsqJacobi|Definition:ctsqJacobi]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\ctsqHahn''' represents the continuous q-Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\ctsqHahn{n}''' produces {\displaystyle \ctsqHahn{n}}
+:'''\ctsqHahn{n}@{x}{a}{b}{c}{d}{q}''' produces {\displaystyle \ctsqHahn{n}@{x}{a}{b}{c}{d}{q}}
+ +These are defined by +{\displaystyle +\frac{(a\expe^{i\phi})^n\ctsqHahn{n}@{x}{a}{b}{c}{d}{q}}{\qPochhammer{ab\expe^{2i\phi},ac,ad}{q}{n}} +{}:=\qHyperrphis{4}{3}@@{q^{-n},abcdq^{n-1},a\expe^{i(\theta+2\phi)},a\expe^{-i\theta}}{ab\expe^{2i\phi},ac,ad}{q}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:ctsqHahn {\displaystyle p_{n}}] : continuous {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsqHahn http://drmf.wmflabs.org/wiki/Definition:ctsqHahn]
+[http://dlmf.nist.gov/4.2.E11 {\displaystyle \mathrm{e}}] : the base of the natural logarithm : [http://dlmf.nist.gov/4.2.E11 http://dlmf.nist.gov/4.2.E11]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:ctsdualqHahn|Definition:ctsdualqHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsqJacobi|Definition:ctsqJacobi]] >>
+
+drmf_eof +drmf_bof +'''Definition:ctsqJacobi''' +
+
<< [[Definition:ctsqHahn|Definition:ctsqHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsqLaguerre|Definition:ctsqLaguerre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\ctsqJacobi''' represents the continuous q-Jacobi polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\ctsqJacobi{\alpha}{\beta}{m}''' produces {\displaystyle \ctsqJacobi{\alpha}{\beta}{m}}
+:'''\ctsqJacobi{\alpha}{\beta}{m}@{x}{q}''' produces {\displaystyle \ctsqJacobi{\alpha}{\beta}{m}@{x}{q}}
+ +These are defined by
+ +\ctsqJacobi{\alpha}{\beta}{n}@{x}{q} +:=\frac{\qPochhammer{q^{\alpha+1}}{q}{n}}{\qPochhammer{q}{q}{n}} +\qHyperrphis{4}{3}@@{q^{-n},q^{n+\alpha+\beta+1},q^{\frac{1}{2}\alpha+\frac{1}{4}}\expe^{i\theta},q^{\frac{1}{2}\alpha+\frac{1}{4}}\expe^{-i\theta}} +{q^{\alpha+1},-q^{\frac{1}{2}(\alpha+\beta+1)},-q^{\frac{1}{2}(\alpha+\beta+2)}}{q}{q} + + +with x=\cos@@{\theta}. +
+ +== Symbols List == + +[http://dlmf.nist.gov/4.14#E2 {\displaystyle \mathrm{cos}}] : cosine function : [http://dlmf.nist.gov/4.14#E2 http://dlmf.nist.gov/4.14#E2]
+[http://drmf.wmflabs.org/wiki/Definition:ctsqJacobi {\displaystyle P^{(\alpha,\beta)}_{n}}] : continuous {\displaystyle q}-Jacobi polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsqJacobi http://drmf.wmflabs.org/wiki/Definition:ctsqJacobi]
+[http://dlmf.nist.gov/4.2.E11 {\displaystyle \mathrm{e}}] : the base of the natural logarithm : [http://dlmf.nist.gov/4.2.E11 http://dlmf.nist.gov/4.2.E11]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:ctsqHahn|Definition:ctsqHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsqLaguerre|Definition:ctsqLaguerre]] >>
+
+drmf_eof +drmf_bof +'''Definition:ctsqLaguerre''' +
+
<< [[Definition:ctsqJacobi|Definition:ctsqJacobi]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsqLegendre|Definition:ctsqLegendre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\ctsqLaguerre''' represents the continuous q-Laguerre polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\ctsqLaguerre{\alpha}{n}''' produces {\displaystyle \ctsqLaguerre{\alpha}{n}}
+:'''\ctsqLaguerre{\alpha}{n}@{x}{q}''' produces {\displaystyle \ctsqLaguerre{\alpha}{n}@{x}{q}}
+ +These are defined by +{\displaystyle +\ctsqLaguerre{\alpha}{n}@{x}{q}:=\frac{\qPochhammer{q^{\alpha+1}}{q}{n}}{\qPochhammer{q}{q}{n}}\,\qHyperrphis{3}{2}@@{q^{-n},q^{\frac{1}{2}\alpha+\frac{1}{4}}\expe^{i\theta},q^{\frac{1}{2}\alpha+\frac{1}{4}}\expe^{-i\theta}}{q^{\alpha+1},0}{q}{q}. + +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:ctsqLaguerre {\displaystyle P^{(n)}_{\alpha}}] : continuous {\displaystyle q}-Laguerre polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsqLaguerre http://drmf.wmflabs.org/wiki/Definition:ctsqLaguerre]
+[http://dlmf.nist.gov/4.2.E11 {\displaystyle \mathrm{e}}] : the base of the natural logarithm : [http://dlmf.nist.gov/4.2.E11 http://dlmf.nist.gov/4.2.E11]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:ctsqJacobi|Definition:ctsqJacobi]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsqLegendre|Definition:ctsqLegendre]] >>
+
+drmf_eof +drmf_bof +'''Definition:ctsqLegendre''' +
+
<< [[Definition:ctsqLaguerre|Definition:ctsqLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:f|Definition:f]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\ctsqLegendre''' represents the continuous q-Legendre polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\ctsqLegendre{n}''' produces {\displaystyle \ctsqLegendre{n}}
+:'''\ctsqLegendre{n}@{x}{q}''' produces {\displaystyle \ctsqLegendre{n}@{x}{q}}
+:'''\ctsqLegendre{n}@@{x}{q}''' produces {\displaystyle \ctsqLegendre{n}@@{x}{q}}
+ +These are defined by + +{\displaystyle +\dualqKrawtchouk{n}@{\lambda(x)}{c}{N}{q}:=\qHyperrphis{3}{2}@@{q^{-n},q^{-x},cq^{x-N}}{q^{-N},0}{q}{q} +}. +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:ctsqLegendre {\displaystyle P_{n}}] : continuous {\displaystyle q}-Legendre polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsqLegendre http://drmf.wmflabs.org/wiki/Definition:ctsqLegendre]
+[http://drmf.wmflabs.org/wiki/Definition:dualqKrawtchouk {\displaystyle K_{n}}] : dual {\displaystyle q}-Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:dualqKrawtchouk http://drmf.wmflabs.org/wiki/Definition:dualqKrawtchouk]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:ctsqLaguerre|Definition:ctsqLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:f|Definition:f]] >>
+
+drmf_eof +drmf_bof +'''Definition:f''' +
+
<< [[Definition:ctsqLegendre|Definition:ctsqLegendre]]
+
[[Main_Page|Main Page]]
+
[[Definition:GenHermite|Definition:GenHermite]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\f''' represents Function. + +This macro is in the category of semantic macros. + +In math mode, this macro can be called in the following ways: + +:'''\f{f}''' produces {\displaystyle \f{f}}
+:'''\f{f}@{x}''' produces {\displaystyle \f{f}@{x}}
+ +These are defined by + + +\GenGegenbauer{\alpha}{\beta}{2m}@{x}:={\rm const}\times \Jacobi{\alpha}{\beta}{m}@{2x^2-1}, +
+ + +\GenGegenbauer{\alpha}{\beta}{2m+1}@{x}:={\rm const}\times x\,\Jacobi{\alpha}{\beta+1}{m}@{2x^2-1}. +
+ +Then for \alpha,\beta>-1, we have the orthogonality relation
+ + +\int_{-1}^1 \GenGegenbauer{\alpha}{\beta}{m}@{x}\,\GenGegenbauer{\alpha}{\beta}{n}@{x}\,|x|^{2\beta+1} +(1-x^2)^\alpha\,dx=0, + + +for m\ne n. + +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:f {\displaystyle {f}}] : function : [http://drmf.wmflabs.org/wiki/Definition:f http://drmf.wmflabs.org/wiki/Definition:f]
+[http://drmf.wmflabs.org/wiki/Definition:GenGegenbauer {\displaystyle S^{(\alpha,\beta)}_{n}}] : Generalized Gegenbauer polynomial : [http://drmf.wmflabs.org/wiki/Definition:GenGegenbauer http://drmf.wmflabs.org/wiki/Definition:GenGegenbauer]
+[http://dlmf.nist.gov/1.4#iv {\displaystyle \int}] : integral : [http://dlmf.nist.gov/1.4#iv http://dlmf.nist.gov/1.4#iv]
+[http://dlmf.nist.gov/18.3#T1.t1.r3 {\displaystyle P^{(\alpha,\beta)}_{n}}] : Jacobi polynomial : [http://dlmf.nist.gov/18.3#T1.t1.r3 http://dlmf.nist.gov/18.3#T1.t1.r3] +
+
<< [[Definition:ctsqLegendre|Definition:ctsqLegendre]]
+
[[Main_Page|Main Page]]
+
[[Definition:GenHermite|Definition:GenHermite]] >>
+
+drmf_eof +drmf_bof +'''Definition:GenHermite''' +
+
<< [[Definition:f|Definition:f]]
+
[[Main_Page|Main Page]]
+
[[Definition:GottliebLaguerre|Definition:GottliebLaguerre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\GenHermite''' represents the generalized Hermite polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\GenHermite[\alpha]{n}''' produces {\displaystyle \GenHermite[\alpha]{n}}
+:'''\GenHermite{n}''' produces {\displaystyle \GenHermite{n}}
+:'''\GenHermite[\alpha]{n}@{x}''' produces {\displaystyle \GenHermite[\alpha]{n}@{x}}
+:'''\GenHermite{n}@{x}''' produces {\displaystyle \GenHermite{n}@{x}}
+ +These are defined by + + +\GenHermite[\mu]{2m}@{x}:={\rm const}\times \Laguerre[\mu-\frac12]{m}@{x^2},\qquad +
+ +\GenHermite[\mu]{2m+1}@{x}:={\rm \const}\times x \Laguerre[\mu+\frac12]{m}@{x^2}. + +
+Then for \mu>-\tfrac12 we have orthogonality relation + +\int_{-\infty}^{\infty} \GenHermite[\mu]{m}@{x} \GenHermite[\mu]{n}@{x} |x|^{2\mu}e^{-x^2} dx, +=0 +
+for m\ne n. + +== Bibliography == +
+Page 156 of [[Bibliography#CHI|'''CHI''']]. +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:GenHermite {\displaystyle H_n^{\mu}}] : generalized Hermite polynomial : [http://drmf.wmflabs.org/wiki/Definition:GenHermite http://drmf.wmflabs.org/wiki/Definition:GenHermite]
+[http://dlmf.nist.gov/1.4#iv {\displaystyle \int}] : integral : [http://dlmf.nist.gov/1.4#iv http://dlmf.nist.gov/1.4#iv]
+[http://dlmf.nist.gov/18.3#T1.t1.r27 {\displaystyle L_n^{(\alpha)}}] : Laguerre (or generalized Laguerre) polynomial : [http://dlmf.nist.gov/18.3#T1.t1.r27 http://dlmf.nist.gov/18.3#T1.t1.r27] +
+
<< [[Definition:f|Definition:f]]
+
[[Main_Page|Main Page]]
+
[[Definition:GottliebLaguerre|Definition:GottliebLaguerre]] >>
+
+drmf_eof +drmf_bof +'''Definition:GottliebLaguerre''' +
+
<< [[Definition:GenHermite|Definition:GenHermite]]
+
[[Main_Page|Main Page]]
+
[[Definition:Int|Definition:Int]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\GottliebLaguerre''' represents the Gottlieb-Laguerre polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\GottliebLaguerre{n}''' produces {\displaystyle \GottliebLaguerre{n}}
+:'''\GottliebLaguerre{n}@{x}''' produces {\displaystyle \GottliebLaguerre{n}@{x}}
+ +These are defined by + +{\displaystyle +\GottliebLaguerre{n}@{x}:=e^{-n\la} \Meixner{n}@{x}{1}{e^{-\la}}. +} + +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:GottliebLaguerre {\displaystyle l_{n}}] : Gottlieb-Laguerre polynomial : [http://drmf.wmflabs.org/wiki/Definition:GottliebLaguerre http://drmf.wmflabs.org/wiki/Definition:GottliebLaguerre]
+[http://dlmf.nist.gov/18.19#T1.t1.r9 {\displaystyle M_{n}}] : Meixner polynomial : [http://dlmf.nist.gov/18.19#T1.t1.r9 http://dlmf.nist.gov/18.19#T1.t1.r9] +
+
<< [[Definition:GenHermite|Definition:GenHermite]]
+
[[Main_Page|Main Page]]
+
[[Definition:Int|Definition:Int]] >>
+
+drmf_eof +drmf_bof +'''Definition:Int''' +
+
<< [[Definition:GottliebLaguerre|Definition:GottliebLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:JacksonqBesselII|Definition:JacksonqBesselII]] >>
+
+ +In the DRMF, the LaTeX semantic macro '''\Int''' represents the definite integral notation, +which is defined as follows. + +This macro is in the category of semantic macros. + +In math mode, this macro can be called in the following ways: + +:'''\Int{a}{b}''' produces {\displaystyle \Int{a}{b}}
+:'''\Int{a}{b}@{x}{f(x)}''' produces {\displaystyle \Int{a}{b}@{x}{f(x)}}
+ +These are defined by +{\displaystyle +\JacksonqBesselI{\nu}@{z}{q}:=\frac{\qPochhammer{q^{\nu+1}}{q}{\infty}}{\qPochhammer{q}{q}{\infty}} +\left(\frac{z}{2}\right)^{\nu}\,\qHyperrphis{2}{1}@@{0,0}{q^{\nu+1}}{q}{-\frac{z^2}{4}}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:Int {\displaystyle \int_{a}^{b}f(x){\mathrm d}\!x}] : semantic definite integral : [http://drmf.wmflabs.org/wiki/Definition:Int http://drmf.wmflabs.org/wiki/Definition:Int]
+[http://drmf.wmflabs.org/wiki/Definition:JacksonqBesselI {\displaystyle J^{(1)}_{q}}] : Jackson {\displaystyle q}-Bessel function 1 : [http://drmf.wmflabs.org/wiki/Definition:JacksonqBesselI http://drmf.wmflabs.org/wiki/Definition:JacksonqBesselI]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:GottliebLaguerre|Definition:GottliebLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:JacksonqBesselII|Definition:JacksonqBesselII]] >>
+
+drmf_eof +drmf_bof +'''Definition:JacksonqBesselII''' +
+
<< [[Definition:Int|Definition:Int]]
+
[[Main_Page|Main Page]]
+
[[Definition:JacksonqBesselIII|Definition:JacksonqBesselIII]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\JacksonqBesselII''' represents the Jackson q-Bessel function 2. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\JacksonqBesselII{\nu}''' produces {\displaystyle \JacksonqBesselII{\nu}}
+:'''\JacksonqBesselII{\nu}@{z}{q}''' produces {\displaystyle \JacksonqBesselII{\nu}@{z}{q}}
+ +These are defined by + +{\displaystyle +\JacksonqBesselII{\nu}@{z}{q}:=\frac{\qPochhammer{q^{\nu+1}}{q}{\infty}}{\qPochhammer{q}{q}{\infty}} +\left(\frac{z}{2}\right)^{\nu}\,\qHyperrphis{0}{1}@@{-}{q^{\nu+1}}{q}{-\frac{q^{\nu+1}z^2}{4}}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:JacksonqBesselII {\displaystyle J^{(2)}_{q}}] : Jackson {\displaystyle q}-Bessel function 2 : [http://drmf.wmflabs.org/wiki/Definition:JacksonqBesselII http://drmf.wmflabs.org/wiki/Definition:JacksonqBesselII]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:Int|Definition:Int]]
+
[[Main_Page|Main Page]]
+
[[Definition:JacksonqBesselIII|Definition:JacksonqBesselIII]] >>
+
+drmf_eof +drmf_bof +'''Definition:JacksonqBesselIII''' +
+
<< [[Definition:JacksonqBesselII|Definition:JacksonqBesselII]]
+
[[Main_Page|Main Page]]
+
[[Definition:littleqLegendre|Definition:littleqLegendre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\JacksonqBesselIII''' represents the Jackson q-Bessel function 3. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\JacksonqBesselIII{\nu}''' produces {\displaystyle \JacksonqBesselIII{\nu}}
+:'''\JacksonqBesselIII{\nu}@{z}{q}''' produces {\displaystyle \JacksonqBesselIII{\nu}@{z}{q}}
+ +These are defined by + +{\displaystyle +\littleqLaguerre{n}@{x}{a}{q}:=\qHyperrphis{2}{1}@@{q^{-n},0}{aq}{q}{qx}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:JacksonqBesselIII {\displaystyle J^{(3)}_{q}}] : Jackson/Hahn-Exton {\displaystyle q}-Bessel function 3 : [http://drmf.wmflabs.org/wiki/Definition:JacksonqBesselIII http://drmf.wmflabs.org/wiki/Definition:JacksonqBesselIII]
+[http://drmf.wmflabs.org/wiki/Definition:littleqLaguerre {\displaystyle p_{n}}] : little {\displaystyle q}-Laguerre / Wall polynomial : [http://drmf.wmflabs.org/wiki/Definition:littleqLaguerre http://drmf.wmflabs.org/wiki/Definition:littleqLaguerre]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:JacksonqBesselII|Definition:JacksonqBesselII]]
+
[[Main_Page|Main Page]]
+
[[Definition:littleqLegendre|Definition:littleqLegendre]] >>
+
+drmf_eof +drmf_bof +'''Definition:littleqLegendre''' +
+
<< [[Definition:JacksonqBesselIII|Definition:JacksonqBesselIII]]
+
[[Main_Page|Main Page]]
+
[[Definition:lrselection|Definition:lrselection]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\littleqLegendre''' represents the little q-Legendre polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\littleqLegendre{m}''' produces {\displaystyle \littleqLegendre{m}}
+:'''\littleqLegendre{m}@{x}{q}''' produces {\displaystyle \littleqLegendre{m}@{x}{q}}
+ +These are defined by +{\displaystyle +\littleqLegendre{n}@{x}{q}:=\qHyperrphis{2}{1}@@{q^{-n},q^{n+1}}{q}{q}{qx}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:littleqLegendre {\displaystyle p_{n}}] : little {\displaystyle q}-Legendre polynomial : [http://drmf.wmflabs.org/wiki/Definition:littleqLegendre http://drmf.wmflabs.org/wiki/Definition:littleqLegendre]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:JacksonqBesselIII|Definition:JacksonqBesselIII]]
+
[[Main_Page|Main Page]]
+
[[Definition:lrselection|Definition:lrselection]] >>
+
+drmf_eof +drmf_bof +'''Definition:lrselection''' +
+
<< [[Definition:littleqLegendre|Definition:littleqLegendre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicAlSalamCarlitzI|Definition:monicAlSalamCarlitzI]] >>
+
+ +For the sake of compactness, we use the abbreviated '''\lrselection''' notation in a number of formulas. + +This macro is in the category of semantic macros. + +In math mode, this macro can be called in the following way: + +:'''\lrselection''' produces {\displaystyle \lrselection}
+ +These are defined by + +{\displaystyle +\AffqKrawtchouk{n}@{q^{-x}}{p}{N}{q}=\frac{1}{\qPochhammer{pq,q^{-N}}{q}{n}}\monicAffqKrawtchouk{n}@{q^{-x}}{p}{N}{q}. +} + +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:AffqKrawtchouk {\displaystyle K^{\mathrm{Aff}}_{n}}] : affine {\displaystyle q}-Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:AffqKrawtchouk http://drmf.wmflabs.org/wiki/Definition:AffqKrawtchouk]
+[http://drmf.wmflabs.org/wiki/Definition:Lrselection {\displaystyle \left\{\begin{matrix}x\end{matrix}\right\}}] : bracketed generalization of {\displaystyle \pm} : [http://drmf.wmflabs.org/wiki/Definition:Lrselection http://drmf.wmflabs.org/wiki/Definition:Lrselection]
+[http://drmf.wmflabs.org/wiki/Definition:monicAffqKrawtchouk {\displaystyle \widehat{K}^{\mathrm{Aff}}_{n}}] : monic affine {\displaystyle q}-Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicAffqKrawtchouk http://drmf.wmflabs.org/wiki/Definition:monicAffqKrawtchouk]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:littleqLegendre|Definition:littleqLegendre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicAlSalamCarlitzI|Definition:monicAlSalamCarlitzI]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicAlSalamCarlitzI''' +
+
<< [[Definition:lrselection|Definition:lrselection]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicAlSalamCarlitzII|Definition:monicAlSalamCarlitzII]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicAlSalamCarlitzI''' represents the monic q Al-Salam Carlitz I polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicAlSalamCarlitzI{a}{n}''' produces {\displaystyle \monicAlSalamCarlitzI{a}{n}}
+:'''\monicAlSalamCarlitzI{a}{n}@{x}{q}''' produces {\displaystyle \monicAlSalamCarlitzI{a}{n}@{x}{q}}
+:'''\monicAlSalamCarlitzI{a}{n}@@{x}{q}''' produces {\displaystyle \monicAlSalamCarlitzI{a}{n}@@{x}{q}}
+ +These are defined by + +{\displaystyle +\AlSalamCarlitzI{a}{n}@{x}{q}:=\monicAlSalamCarlitzI{a}{n}@{x}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzI {\displaystyle U^{(n)}_{\alpha}}] : Al-Salam-Carlitz I polynomial : [http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzI http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzI]
+[http://drmf.wmflabs.org/wiki/Definition:monicAlSalamCarlitzI {\displaystyle {\widehat U}^{(\alpha)}_{n}}] : monic Al-Salam-Carlitz I polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicAlSalamCarlitzI http://drmf.wmflabs.org/wiki/Definition:monicAlSalamCarlitzI] +
+
<< [[Definition:lrselection|Definition:lrselection]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicAlSalamCarlitzII|Definition:monicAlSalamCarlitzII]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicAlSalamCarlitzII''' +
+
<< [[Definition:monicAlSalamCarlitzI|Definition:monicAlSalamCarlitzI]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicAlSalamChihara|Definition:monicAlSalamChihara]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicAlSalamCarlitzII''' represents the monic q Al-Salam Carlitz II polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicAlSalamCarlitzII{a}{n}''' produces {\displaystyle \monicAlSalamCarlitzII{a}{n}}
+:'''\monicAlSalamCarlitzII{a}{n}@{x}{q}''' produces {\displaystyle \monicAlSalamCarlitzII{a}{n}@{x}{q}}
+:'''\monicAlSalamCarlitzII{a}{n}@@{x}{q}''' produces {\displaystyle \monicAlSalamCarlitzII{a}{n}@@{x}{q}}
+ +These are defined by + +{\displaystyle +\AlSalamCarlitzII{a}{n}@{x}{q}=:\monicAlSalamCarlitzII{a}{n}@{x}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzII {\displaystyle V^{(n)}_{\alpha}}] : Al-Salam-Carlitz II polynomial : [http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzII http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzII]
+[http://drmf.wmflabs.org/wiki/Definition:monicAlSalamCarlitzII {\displaystyle {\widehat V}^{(n)}_{\alpha}}] : monic Al-Salam-Carlitz II polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicAlSalamCarlitzII http://drmf.wmflabs.org/wiki/Definition:monicAlSalamCarlitzII] +
+
<< [[Definition:monicAlSalamCarlitzI|Definition:monicAlSalamCarlitzI]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicAlSalamChihara|Definition:monicAlSalamChihara]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicAlSalamChihara''' +
+
<< [[Definition:monicAlSalamCarlitzII|Definition:monicAlSalamCarlitzII]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicAskeyWilson|Definition:monicAskeyWilson]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicAlSalamChihara''' represents the monic Al-Salam Chihara q polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicAlSalamChihara{n}''' produces {\displaystyle \monicAlSalamChihara{n}}
+:'''\monicAlSalamChihara{n}@{x}{a}{b}{q}''' produces {\displaystyle \monicAlSalamChihara{n}@{x}{a}{b}{q}}
+:'''\monicAlSalamChihara{n}@@{x}{a}{b}{q}''' produces {\displaystyle \monicAlSalamChihara{n}@@{x}{a}{b}{q}}
+ +These are defined by + +{\displaystyle +\AlSalamChihara{n}@{x}{a}{b}{q}=:2^n\monicAlSalamChihara{n}@{x}{a}{b}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:AlSalamChihara {\displaystyle Q_{n}}] : Al-Salam-Chihara polynomial : [http://drmf.wmflabs.org/wiki/Definition:AlSalamChihara http://drmf.wmflabs.org/wiki/Definition:AlSalamChihara]
+[http://drmf.wmflabs.org/wiki/Definition:monicAlSalamChihara {\displaystyle {\widehat Q}_{n}}] : monic Al-Salam-Chihara polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicAlSalamChihara http://drmf.wmflabs.org/wiki/Definition:monicAlSalamChihara] +
+
<< [[Definition:monicAlSalamCarlitzII|Definition:monicAlSalamCarlitzII]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicAskeyWilson|Definition:monicAskeyWilson]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicAskeyWilson''' +
+
<< [[Definition:monicAlSalamChihara|Definition:monicAlSalamChihara]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicBesselPoly|Definition:monicBesselPoly]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicAskeyWilson''' represents the monic Askey Wilson polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicAskeyWilson{n}''' produces {\displaystyle \monicAskeyWilson{n}}
+:'''\monicAskeyWilson{n}@{x}{a}{b}{c}{d}{q}''' produces {\displaystyle \monicAskeyWilson{n}@{x}{a}{b}{c}{d}{q}}
+:'''\monicAskeyWilson{n}@@{x}{a}{b}{c}{d}{q}''' produces {\displaystyle \monicAskeyWilson{n}@@{x}{a}{b}{c}{d}{q}}
+ +These are defined by + +{\displaystyle +\AskeyWilson{n}@{x}{a}{b}{c}{d}{q}=:2^n\qPochhammer{abcdq^{n-1}}{q}{n}\monicAskeyWilson{n}@{x}{a}{b}{c}{d}{q}. +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/18.28#E1 {\displaystyle p_{n}}] : Askey-Wilson polynomial : [http://dlmf.nist.gov/18.28#E1 http://dlmf.nist.gov/18.28#E1]
+[http://drmf.wmflabs.org/wiki/Definition:monicAskeyWilson {\displaystyle {\widehat p}_{n}}] : monic Askey-Wilson polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicAskeyWilson http://drmf.wmflabs.org/wiki/Definition:monicAskeyWilson]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicAlSalamChihara|Definition:monicAlSalamChihara]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicBesselPoly|Definition:monicBesselPoly]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicBesselPoly''' +
+
<< [[Definition:monicAskeyWilson|Definition:monicAskeyWilson]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicbigqJacobi|Definition:monicbigqJacobi]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicBesselPoly''' represents the monic Bessel polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicBesselPoly{n}''' produces {\displaystyle \monicBesselPoly{n}}
+:'''\monicBesselPoly{n}@{x}{a}''' produces {\displaystyle \monicBesselPoly{n}@{x}{a}}
+:'''\monicBesselPoly{n}@@{x}{a}''' produces {\displaystyle \monicBesselPoly{n}@@{x}{a}}
+ +These are defined by +{\displaystyle +\BesselPoly{n}@{x}{a}=:\frac{\pochhammer{n+a+1}{n}}{2^n}\monicBesselPoly{n}@{x}{a} +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/18.34#E1 {\displaystyle y_{n}}] : Bessel polynomial : [http://dlmf.nist.gov/18.34#E1 http://dlmf.nist.gov/18.34#E1]
+[http://drmf.wmflabs.org/wiki/Definition:monicBesselPoly {\displaystyle {\widehat y}_{n}}] : monic Bessel polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicBesselPoly http://drmf.wmflabs.org/wiki/Definition:monicBesselPoly]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii] +
+
<< [[Definition:monicAskeyWilson|Definition:monicAskeyWilson]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicbigqJacobi|Definition:monicbigqJacobi]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicbigqJacobi''' +
+
<< [[Definition:monicBesselPoly|Definition:monicBesselPoly]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicbigqLaguerre|Definition:monicbigqLaguerre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicbigqJacobi''' represents the monic big q Jacobi polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicbigqJacobi{n}''' produces {\displaystyle \monicbigqJacobi{n}}
+:'''\monicbigqJacobi{n}@{x}{a}{b}{c}{q}''' produces {\displaystyle \monicbigqJacobi{n}@{x}{a}{b}{c}{q}}
+:'''\monicbigqJacobi{n}@@{x}{a}{b}{c}{q}''' produces {\displaystyle \monicbigqJacobi{n}@@{x}{a}{b}{c}{q}}
+ +These are defined by + +{\displaystyle +\bigqJacobi{n}@{x}{a}{b}{c}{q}=:\frac{\qPochhammer{abq^{n+1}}{q}{n}}{\qPochhammer{aq,cq}{q}{n}}\monicbigqJacobi{n}@{x}{a}{b}{c}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:bigqJacobi {\displaystyle P_{n}}] : big {\displaystyle q}-Jacobi polynomial : [http://drmf.wmflabs.org/wiki/Definition:bigqJacobi http://drmf.wmflabs.org/wiki/Definition:bigqJacobi]
+[http://drmf.wmflabs.org/wiki/Definition:monicbigqJacobi {\displaystyle {\widehat P}_{n}}] : monic big {\displaystyle q}-Jacobi polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicbigqJacobi http://drmf.wmflabs.org/wiki/Definition:monicbigqJacobi]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicBesselPoly|Definition:monicBesselPoly]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicbigqLaguerre|Definition:monicbigqLaguerre]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicbigqLaguerre''' +
+
<< [[Definition:monicbigqJacobi|Definition:monicbigqJacobi]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicbigqLegendre|Definition:monicbigqLegendre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicbigqLaguerre''' represents the monic big q Laguerre polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicbigqLaguerre{n}''' produces {\displaystyle \monicbigqLaguerre{n}}
+:'''\monicbigqLaguerre{n}@{x}{a}{b}{q}''' produces {\displaystyle \monicbigqLaguerre{n}@{x}{a}{b}{q}}
+:'''\monicbigqLaguerre{n}@@{x}{a}{b}{q}''' produces {\displaystyle \monicbigqLaguerre{n}@@{x}{a}{b}{q}}
+ +These are defined by + +{\displaystyle +\bigqLaguerre{n}@{x}{a}{b}{q}=:\frac{1}{\qPochhammer{aq,bq}{q}{n}}\monicbigqLaguerre{n}@{x}{a}{b}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:bigqLaguerre {\displaystyle P_{n}}] : big {\displaystyle q}-Laguerre polynomial : [http://drmf.wmflabs.org/wiki/Definition:bigqLaguerre http://drmf.wmflabs.org/wiki/Definition:bigqLaguerre]
+[http://drmf.wmflabs.org/wiki/Definition:monicbigqLaguerre {\displaystyle {\widehat P}_{n}}] : monic big {\displaystyle q}-Laguerre polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicbigqLaguerre http://drmf.wmflabs.org/wiki/Definition:monicbigqLaguerre]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicbigqJacobi|Definition:monicbigqJacobi]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicbigqLegendre|Definition:monicbigqLegendre]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicbigqLegendre''' +
+
<< [[Definition:monicbigqLaguerre|Definition:monicbigqLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicCharlier|Definition:monicCharlier]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicbigqLegendre''' represents the monic big q polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicbigqLegendre{n}''' produces {\displaystyle \monicbigqLegendre{n}}
+:'''\monicbigqLegendre{n}@{x}{c}{q}''' produces {\displaystyle \monicbigqLegendre{n}@{x}{c}{q}}
+:'''\monicbigqLegendre{n}@@{x}{c}{q}''' produces {\displaystyle \monicbigqLegendre{n}@@{x}{c}{q}}
+ +These are defined by + +{\displaystyle +\bigqLegendre{n}@{x}{c}{q}=:\frac{\qPochhammer{q^{n+1}}{q}{n}}{\qPochhammer{q,cq}{q}{n}}\monicbigqLegendre{n}@{x}{c}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:bigqLegendre {\displaystyle P_{n}}] : big {\displaystyle q}-Legendre polynomial : [http://drmf.wmflabs.org/wiki/Definition:bigqLegendre http://drmf.wmflabs.org/wiki/Definition:bigqLegendre]
+[http://drmf.wmflabs.org/wiki/Definition:monicbigqLegendre {\displaystyle {\widehat P}_{n}}] : monic big {\displaystyle q}-Legendre polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicbigqLegendre http://drmf.wmflabs.org/wiki/Definition:monicbigqLegendre]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicbigqLaguerre|Definition:monicbigqLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicCharlier|Definition:monicCharlier]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicCharlier''' +
+
<< [[Definition:monicbigqLegendre|Definition:monicbigqLegendre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicChebyT|Definition:monicChebyT]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicCharlier''' represents the monic Charlier polynomial monic p. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicCharlier{n}''' produces {\displaystyle \monicCharlier{n}}
+:'''\monicCharlier{n}@{x}{a}''' produces {\displaystyle \monicCharlier{n}@{x}{a}}
+:'''\monicCharlier{n}@@{x}{a}''' produces {\displaystyle \monicCharlier{n}@@{x}{a}}
+ +These are defined by + +{\displaystyle +\Charlier{n}@{x}{a}=:\left(-\frac{1}{a}\right)^n\monicCharlier{n}@{x}{a} +} + +
+ +== Symbols List == + +[http://dlmf.nist.gov/18.19#T1.t1.r11 {\displaystyle C_{n}}] : Charlier polynomial : [http://dlmf.nist.gov/18.19#T1.t1.r11 http://dlmf.nist.gov/18.19#T1.t1.r11]
+[http://drmf.wmflabs.org/wiki/Definition:monicCharlier {\displaystyle {\widehat C}_{n}}] : monic Charlier polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicCharlier http://drmf.wmflabs.org/wiki/Definition:monicCharlier] +
+
<< [[Definition:monicbigqLegendre|Definition:monicbigqLegendre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicChebyT|Definition:monicChebyT]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicChebyT''' +
+
<< [[Definition:monicCharlier|Definition:monicCharlier]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicChebyU|Definition:monicChebyU]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicChebyT''' represents the monic monic Chebyshev polynomial first kind. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicChebyT{n}''' produces {\displaystyle \monicChebyT{n}}
+:'''\monicChebyT{n}@{x}''' produces {\displaystyle \monicChebyT{n}@{x}}
+:'''\monicChebyT{n}@@{x}''' produces {\displaystyle \monicChebyT{n}@@{x}}
+ +These are defined by + +{\displaystyle +\ChebyT{n}@{x}:=2^n\monicChebyT{n}@{x} +} +for n\ne 1 and \ChebyT{1}@{x}=\monicChebyT{1}@{x}=x. +
+ +== Symbols List == + +[http://dlmf.nist.gov/18.3#T1.t1.r8 {\displaystyle T_{n}}] : Chebyshev polynomial of the first kind : [http://dlmf.nist.gov/18.3#T1.t1.r8 http://dlmf.nist.gov/18.3#T1.t1.r8]
+[http://drmf.wmflabs.org/wiki/Definition:monicChebyT {\displaystyle {\widehat T}_{n}}] : monic Chebyshev polynomial of the first kind : [http://drmf.wmflabs.org/wiki/Definition:monicChebyT http://drmf.wmflabs.org/wiki/Definition:monicChebyT] +
+
<< [[Definition:monicCharlier|Definition:monicCharlier]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicChebyU|Definition:monicChebyU]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicChebyU''' +
+
<< [[Definition:monicChebyT|Definition:monicChebyT]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsbigqHermite|Definition:monicctsbigqHermite]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicChebyU''' represents the monic Chebyshev polynomial second kind. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicChebyU{n}''' produces {\displaystyle \monicChebyU{n}}
+:'''\monicChebyU{n}@{x}''' produces {\displaystyle \monicChebyU{n}@{x}}
+:'''\monicChebyU{n}@@{x}''' produces {\displaystyle \monicChebyU{n}@@{x}}
+ +These are defined by + +{\displaystyle +\ChebyU{n}@{x}:=2^n\monicChebyU{n}@{x} +}. +
+ +== Symbols List == + +[http://dlmf.nist.gov/18.3#T1.t1.r11 {\displaystyle U_{n}}] : Chebyshev polynomial of the second kind : [http://dlmf.nist.gov/18.3#T1.t1.r11 http://dlmf.nist.gov/18.3#T1.t1.r11]
+[http://drmf.wmflabs.org/wiki/Definition:monicChebyU {\displaystyle {\widehat U}_{n}}] : monic Chebyshev polynomial of the second kind : [http://drmf.wmflabs.org/wiki/Definition:monicChebyU http://drmf.wmflabs.org/wiki/Definition:monicChebyU] +
+
<< [[Definition:monicChebyT|Definition:monicChebyT]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsbigqHermite|Definition:monicctsbigqHermite]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicctsbigqHermite''' +
+
<< [[Definition:monicChebyU|Definition:monicChebyU]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsdualHahn|Definition:monicctsdualHahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicctsbigqHermite''' represents the monic continuous big q polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicctsbigqHermite{n}''' produces {\displaystyle \monicctsbigqHermite{n}}
+:'''\monicctsbigqHermite{n}@{x}{a}{q}''' produces {\displaystyle \monicctsbigqHermite{n}@{x}{a}{q}}
+:'''\monicctsbigqHermite{n}@@{x}{a}{q}''' produces {\displaystyle \monicctsbigqHermite{n}@@{x}{a}{q}}
+ +These are defined by + +{\displaystyle +\ctsbigqHermite{n}@{x}{a}{q}=:2^n\monicctsbigqHermite{n}@{x}{a}{q} +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:ctsbigqHermite {\displaystyle H_{n}}] : continuous big {\displaystyle q}-Hermite polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsbigqHermite http://drmf.wmflabs.org/wiki/Definition:ctsbigqHermite]
+[http://drmf.wmflabs.org/wiki/Definition:monicctsbigqHermite {\displaystyle {\widehat H}_{n}}] : monic continuous big {\displaystyle q}-Hermite polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicctsbigqHermite http://drmf.wmflabs.org/wiki/Definition:monicctsbigqHermite] +
+
<< [[Definition:monicChebyU|Definition:monicChebyU]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsdualHahn|Definition:monicctsdualHahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicctsdualHahn''' +
+
<< [[Definition:monicctsbigqHermite|Definition:monicctsbigqHermite]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsdualqHahn|Definition:monicctsdualqHahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicctsdualHahn''' represents the monic continuous dual Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicctsdualHahn{n}''' produces {\displaystyle \monicctsdualHahn{n}}
+:'''\monicctsdualHahn{n}@{x^2}{a}{b}{c}{d}''' produces {\displaystyle \monicctsdualHahn{n}@{x^2}{a}{b}{c}{d}}
+:'''\monicctsdualHahn{n}@@{x^2}{a}{b}{c}{d}''' produces {\displaystyle \monicctsdualHahn{n}@@{x^2}{a}{b}{c}{d}}
+ +These are defined by + +{\displaystyle +\ctsdualHahn{n}@{x^2}{a}{b}{c}=:(-1)^n\monicctsdualHahn{n}@{x^2}{a}{b}{c} +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/18.25#T1.t1.r3 {\displaystyle S_{n}}] : continuous dual Hahn polynomial : [http://dlmf.nist.gov/18.25#T1.t1.r3 http://dlmf.nist.gov/18.25#T1.t1.r3]
+[http://drmf.wmflabs.org/wiki/Definition:monicctsdualHahn {\displaystyle {\widehat S}_{n}}] : monic continuous dual Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicctsdualHahn http://drmf.wmflabs.org/wiki/Definition:monicctsdualHahn] +
+
<< [[Definition:monicctsbigqHermite|Definition:monicctsbigqHermite]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsdualqHahn|Definition:monicctsdualqHahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicctsdualqHahn''' +
+
<< [[Definition:monicctsdualHahn|Definition:monicctsdualHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsHahn|Definition:monicctsHahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicctsdualqHahn''' represents the monic continuous dual q Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicctsdualqHahn{n}''' produces {\displaystyle \monicctsdualqHahn{n}}
+:'''\monicctsdualqHahn{n}@{x^2}{a}{b}{c}''' produces {\displaystyle \monicctsdualqHahn{n}@{x^2}{a}{b}{c}}
+:'''\monicctsdualqHahn{n}@@{x^2}{a}{b}{c}''' produces {\displaystyle \monicctsdualqHahn{n}@@{x^2}{a}{b}{c}}
+ +These are defined by + +{\displaystyle +\ctsdualqHahn{n}@{x}{a}{b}{c}{q}=:2^n\monicctsdualqHahn{n}@{x}{a}{b}{c}{q} +} +
+
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:ctsdualqHahn {\displaystyle p_{n}}] : continuous dual {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsdualqHahn http://drmf.wmflabs.org/wiki/Definition:ctsdualqHahn]
+[http://drmf.wmflabs.org/wiki/Definition:monicctsdualqHahn {\displaystyle {\widehat p}_{n}}] : monic continuous dual {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicctsdualqHahn http://drmf.wmflabs.org/wiki/Definition:monicctsdualqHahn] +
+
<< [[Definition:monicctsdualHahn|Definition:monicctsdualHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsHahn|Definition:monicctsHahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicctsHahn''' +
+
<< [[Definition:monicctsdualqHahn|Definition:monicctsdualqHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsqHahn|Definition:monicctsqHahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicctsHahn''' represents the monic continuous Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicctsHahn{n}''' produces {\displaystyle \monicctsHahn{n}}
+:'''\monicctsHahn{n}@{x}{a}{b}{c}{d}''' produces {\displaystyle \monicctsHahn{n}@{x}{a}{b}{c}{d}}
+:'''\monicctsHahn{n}@@{x}{a}{b}{c}{d}''' produces {\displaystyle \monicctsHahn{n}@@{x}{a}{b}{c}{d}}
+ +These are defined by + +{\displaystyle +\ctsHahn{n}@{x}{a}{b}{c}{d}=:\frac{\pochhammer{n+a+b+c+d-1}{n}}{n!}\monicctsHahn{n}@{x}{a}{b}{c}{d} +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/18.19#P2.p1 {\displaystyle p_{n}}] : continuous Hahn polynomial : [http://dlmf.nist.gov/18.19#P2.p1 http://dlmf.nist.gov/18.19#P2.p1]
+[http://drmf.wmflabs.org/wiki/Definition:monicctsHahn {\displaystyle {\widehat p}_{n}}] : monic continuous Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicctsHahn http://drmf.wmflabs.org/wiki/Definition:monicctsHahn]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii] +
+
<< [[Definition:monicctsdualqHahn|Definition:monicctsdualqHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsqHahn|Definition:monicctsqHahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicctsqHahn''' +
+
<< [[Definition:monicctsHahn|Definition:monicctsHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsqHermite|Definition:monicctsqHermite]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicctsqHahn''' represents the monic continuous q Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicctsqHahn{n}''' produces {\displaystyle \monicctsqHahn{n}}
+:'''\monicctsqHahn{n}@{x}{a}{b}{c}{d}{q}''' produces {\displaystyle \monicctsqHahn{n}@{x}{a}{b}{c}{d}{q}}
+:'''\monicctsqHahn{n}@@{x}{a}{b}{c}{d}{q}''' produces {\displaystyle \monicctsqHahn{n}@@{x}{a}{b}{c}{d}{q}}
+ +These are defined by + +{\displaystyle +\ctsqHahn{n}@{x}{a}{b}{c}{d}{q}=:2^n\qPochhammer{abcdq^{n-1}}{q}{n}\monicctsqHahn{n}@{x}{a}{b}{c}{d}{q} +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:ctsqHahn {\displaystyle p_{n}}] : continuous {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsqHahn http://drmf.wmflabs.org/wiki/Definition:ctsqHahn]
+[http://drmf.wmflabs.org/wiki/Definition:monicctsqHahn {\displaystyle {\widehat p}_{n}}] : monic continuous {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicctsqHahn http://drmf.wmflabs.org/wiki/Definition:monicctsqHahn]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicctsHahn|Definition:monicctsHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsqHermite|Definition:monicctsqHermite]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicctsqHermite''' +
+
<< [[Definition:monicctsqHahn|Definition:monicctsqHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsqJacobi|Definition:monicctsqJacobi]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicctsqHermite''' represents the monic continuous q Hermite polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicctsqHermite{n}''' produces {\displaystyle \monicctsqHermite{n}}
+:'''\monicctsqHermite{n}@{x}{q}''' produces {\displaystyle \monicctsqHermite{n}@{x}{q}}
+:'''\monicctsqHermite{n}@@{x}{q}''' produces {\displaystyle \monicctsqHermite{n}@@{x}{q}}
+ +These are defined by + +{\displaystyle +\ctsqHermite{n}@{x}{q}=:2^n\monicctsqHermite{n}@{x}{q} +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:ctsqHermite {\displaystyle H_{n}}] : continuous {\displaystyle q}-Hermite polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsqHermite http://drmf.wmflabs.org/wiki/Definition:ctsqHermite]
+[http://drmf.wmflabs.org/wiki/Definition:monicctsqHermite {\displaystyle {\widehat H}_{n}}] : monic continuous {\displaystyle q}-Hermite polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicctsqHermite http://drmf.wmflabs.org/wiki/Definition:monicctsqHermite] +
+
<< [[Definition:monicctsqHahn|Definition:monicctsqHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsqJacobi|Definition:monicctsqJacobi]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicctsqJacobi''' +
+
<< [[Definition:monicctsqHermite|Definition:monicctsqHermite]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsqLaguerre|Definition:monicctsqLaguerre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicctsqJacobi''' represents the monic continous q Jacobi polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicctsqJacobi{n}''' produces {\displaystyle \monicctsqJacobi{n}}
+:'''\monicctsqJacobi{n}@{x}{q}''' produces {\displaystyle \monicctsqJacobi{n}@{x}{q}}
+:'''\monicctsqJacobi{n}@@{x}{q}''' produces {\displaystyle \monicctsqJacobi{n}@@{x}{q}}
+ +These are defined by +{\displaystyle +\ctsqJacobi{\alpha}{\beta}{n}@{x}{q}=:\frac{2^nq^{(\frac{1}{2}\alpha+\frac{1}{4})n}\qPochhammer{q^{n+\alpha+\beta+1}}{q}{n}} +{\qPochhammer{q,-q^{\frac{1}{2}(\alpha+\beta+1)},-q^{\frac{1}{2}(\alpha+\beta+2)}}{q}{n}}\monicctsqJacobi{\alpha}{\beta}{n}@@{x}{q}. + +
+
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:ctsqJacobi {\displaystyle P^{(\alpha,\beta)}_{n}}] : continuous {\displaystyle q}-Jacobi polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsqJacobi http://drmf.wmflabs.org/wiki/Definition:ctsqJacobi]
+[http://drmf.wmflabs.org/wiki/Definition:monicctsqJacobi {\displaystyle {\widehat P}^{(\alpha,\beta)}_{n}}] : monic continuous {\displaystyle q}-Jacobi polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicctsqJacobi http://drmf.wmflabs.org/wiki/Definition:monicctsqJacobi]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicctsqHermite|Definition:monicctsqHermite]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsqLaguerre|Definition:monicctsqLaguerre]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicctsqLaguerre''' +
+
<< [[Definition:monicctsqJacobi|Definition:monicctsqJacobi]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsqLegendre|Definition:monicctsqLegendre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicctsqLaguerre''' represents the monic continuous q Laguerre polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicctsqLaguerre{n}''' produces {\displaystyle \monicctsqLaguerre{n}}
+:'''\monicctsqLaguerre{n}@{x}{q}''' produces {\displaystyle \monicctsqLaguerre{n}@{x}{q}}
+:'''\monicctsqLaguerre{n}@@{x}{q}''' produces {\displaystyle \monicctsqLaguerre{n}@@{x}{q}}
+ +These are defined by + +{\displaystyle +\ctsqLaguerre{\alpha}{n}@{x}{q}=:\frac{2^nq^{(\frac{1}{2}\alpha+\frac{1}{4})n}}{\qPochhammer{q}{q}{n}}\monicctsqLaguerre{\alpha}{n}@@{x}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:ctsqLaguerre {\displaystyle P^{(n)}_{\alpha}}] : continuous {\displaystyle q}-Laguerre polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsqLaguerre http://drmf.wmflabs.org/wiki/Definition:ctsqLaguerre]
+[http://drmf.wmflabs.org/wiki/Definition:monicctsqLaguerre {\displaystyle {\widehat P}^{(\alpha)}_{n}}] : monic continuous {\displaystyle q}-Laguerre polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicctsqLaguerre http://drmf.wmflabs.org/wiki/Definition:monicctsqLaguerre]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicctsqJacobi|Definition:monicctsqJacobi]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsqLegendre|Definition:monicctsqLegendre]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicctsqLegendre''' +
+
<< [[Definition:monicctsqLaguerre|Definition:monicctsqLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsqUltra|Definition:monicctsqUltra]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicctsqLegendre''' represents the monic continuous q Legendre polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicctsqLegendre{n}''' produces {\displaystyle \monicctsqLegendre{n}}
+:'''\monicctsqLegendre{n}@{x}{q}''' produces {\displaystyle \monicctsqLegendre{n}@{x}{q}}
+:'''\monicctsqLegendre{n}@@{x}{q}''' produces {\displaystyle \monicctsqLegendre{n}@@{x}{q}}
+ +These are defined by + +{\displaystyle +\ctsqLegendre{n}@{x}{q}=:\frac{2^nq^{\frac{1}{4}n}\qPochhammer{q^{\frac{1}{2}}}{q}{n}}{\qPochhammer{q}{q}{n}}\monicctsqLegendre{n}@@{x}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:ctsqLegendre {\displaystyle P_{n}}] : continuous {\displaystyle q}-Legendre polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsqLegendre http://drmf.wmflabs.org/wiki/Definition:ctsqLegendre]
+[http://drmf.wmflabs.org/wiki/Definition:monicctsqLegendre {\displaystyle {\widehat P}_{n}}] : monic continuous {\displaystyle q}-Legendre polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicctsqLegendre http://drmf.wmflabs.org/wiki/Definition:monicctsqLegendre]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicctsqLaguerre|Definition:monicctsqLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicctsqUltra|Definition:monicctsqUltra]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicctsqUltra''' +
+
<< [[Definition:monicctsqLegendre|Definition:monicctsqLegendre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicdiscrqHermiteI|Definition:monicdiscrqHermiteI]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicctsqUltra''' represents the monic continuous q ultraspherical Rogers polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicctsqUltra{n}''' produces {\displaystyle \monicctsqUltra{n}}
+:'''\monicctsqUltra{n}@{x}{\beta}{q}''' produces {\displaystyle \monicctsqUltra{n}@{x}{\beta}{q}}
+:'''\monicctsqUltra{n}@@{x}{\beta}{q}''' produces {\displaystyle \monicctsqUltra{n}@@{x}{\beta}{q}}
+ +These are defined by + +{\displaystyle +\ctsqUltra{n}@{x}{\beta}{q}=:\frac{2^n\qPochhammer{\beta}{q}{n}}{\qPochhammer{q}{q}{n}}\monicctsqUltra{n}@@{x}{\beta}{q}. +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/18.28#E13 {\displaystyle C_{n}}] : continuous {\displaystyle q}-ultraspherical/Rogers polynomial : [http://dlmf.nist.gov/18.28#E13 http://dlmf.nist.gov/18.28#E13]
+[http://drmf.wmflabs.org/wiki/Definition:monicctsqUltra {\displaystyle {\widehat C}_{n}}] : monic continuous {\displaystyle q}-ultraspherical/Rogers polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicctsqUltra http://drmf.wmflabs.org/wiki/Definition:monicctsqUltra]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicctsqLegendre|Definition:monicctsqLegendre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicdiscrqHermiteI|Definition:monicdiscrqHermiteI]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicdiscrqHermiteI''' +
+
<< [[Definition:monicctsqUltra|Definition:monicctsqUltra]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicdiscrqHermiteII|Definition:monicdiscrqHermiteII]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicdiscrqHermiteI''' represents the monic discrete q Hermite polynomial I. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicdiscrqHermiteI{n}''' produces {\displaystyle \monicdiscrqHermiteI{n}}
+:'''\monicdiscrqHermiteI{n}@{x}{q}''' produces {\displaystyle \monicdiscrqHermiteI{n}@{x}{q}}
+:'''\monicdiscrqHermiteI{n}@@{x}{q}''' produces {\displaystyle \monicdiscrqHermiteI{n}@@{x}{q}}
+ +These are defined by + +{\displaystyle +\discrqHermiteI{n}@{x}{q}=:\monicdiscrqHermiteI{n}@{x}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:discrqHermiteI {\displaystyle h_{n}}] : discrete {\displaystyle q}-Hermite I polynomial : [http://drmf.wmflabs.org/wiki/Definition:discrqHermiteI http://drmf.wmflabs.org/wiki/Definition:discrqHermiteI]
+[http://drmf.wmflabs.org/wiki/Definition:monicdiscrqHermiteI {\displaystyle {\widehat h}_{n}}] : monic discrete {\displaystyle q}-Hermite I polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicdiscrqHermiteI http://drmf.wmflabs.org/wiki/Definition:monicdiscrqHermiteI] +
+
<< [[Definition:monicctsqUltra|Definition:monicctsqUltra]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicdiscrqHermiteII|Definition:monicdiscrqHermiteII]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicdiscrqHermiteII''' +
+
<< [[Definition:monicdiscrqHermiteI|Definition:monicdiscrqHermiteI]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicdualHahn|Definition:monicdualHahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicdiscrqHermiteII''' represents the monic discrete q Hermite polynomial II. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicdiscrqHermiteII{n}''' produces {\displaystyle \monicdiscrqHermiteII{n}}
+:'''\monicdiscrqHermiteII{n}@{x}{q}''' produces {\displaystyle \monicdiscrqHermiteII{n}@{x}{q}}
+:'''\monicdiscrqHermiteII{n}@@{x}{q}''' produces {\displaystyle \monicdiscrqHermiteII{n}@@{x}{q}}
+ +These are defined by + +{\displaystyle +\discrqHermiteII{n}@{x}{q}=:\monicdiscrqHermiteII{n}@@{x}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:discrqHermiteII {\displaystyle \tilde{h}_{n}}] : discrete {\displaystyle q}-Hermite II polynomial : [http://drmf.wmflabs.org/wiki/Definition:discrqHermiteII http://drmf.wmflabs.org/wiki/Definition:discrqHermiteII]
+[http://drmf.wmflabs.org/wiki/Definition:monicdiscrqHermiteII {\displaystyle {\widehat \tilde{p}_{n}}}] : monic discrete {\displaystyle q}-Hermite II polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicdiscrqHermiteII http://drmf.wmflabs.org/wiki/Definition:monicdiscrqHermiteII] +
+
<< [[Definition:monicdiscrqHermiteI|Definition:monicdiscrqHermiteI]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicdualHahn|Definition:monicdualHahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicdualHahn''' +
+
<< [[Definition:monicdiscrqHermiteII|Definition:monicdiscrqHermiteII]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicdualqHahn|Definition:monicdualqHahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicdualHahn''' represents the monic dual Hahn. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicdualHahn{n}''' produces {\displaystyle \monicdualHahn{n}}
+:'''\monicdualHahn{n}@{\lambda(x)}{\gamma}{\delta}{N}''' produces {\displaystyle \monicdualHahn{n}@{\lambda(x)}{\gamma}{\delta}{N}}
+:'''\monicdualHahn{n}@@{\lambda(x)}{\gamma}{\delta}{N}''' produces {\displaystyle \monicdualHahn{n}@@{\lambda(x)}{\gamma}{\delta}{N}}
+ +These are defined by + +{\displaystyle +\dualHahn{n}@{\lambda(x)}{\gamma}{\delta}{N}=:\frac{1}{\pochhammer{\gamma+1}{n}\pochhammer{-N}{n}}\monicdualHahn{n}@{\lambda(x}{\gamma}{\delta}{N}) +} + +
+ +== Symbols List == + +[http://dlmf.nist.gov/18.25#T1.t1.r5 {\displaystyle R_{n}}] : dual Hahn polynomial : [http://dlmf.nist.gov/18.25#T1.t1.r5 http://dlmf.nist.gov/18.25#T1.t1.r5]
+[http://drmf.wmflabs.org/wiki/Definition:monicdualHahn {\displaystyle {\widehat R}_{n}}] : monic dual Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicdualHahn http://drmf.wmflabs.org/wiki/Definition:monicdualHahn]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii] +
+
<< [[Definition:monicdiscrqHermiteII|Definition:monicdiscrqHermiteII]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicdualqHahn|Definition:monicdualqHahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicdualqHahn''' +
+
<< [[Definition:monicdualHahn|Definition:monicdualHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicdualqKrawtchouk|Definition:monicdualqKrawtchouk]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicdualqHahn''' represents the monic dual q Hahn. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicdualqHahn{n}''' produces {\displaystyle \monicdualqHahn{n}}
+:'''\monicdualqHahn{n}@{\mu(x)}{\gamma}{\delta}{N}{q}''' produces {\displaystyle \monicdualqHahn{n}@{\mu(x)}{\gamma}{\delta}{N}{q}}
+:'''\monicdualqHahn{n}@@{\mu(x)}{\gamma}{\delta}{N}{q}''' produces {\displaystyle \monicdualqHahn{n}@@{\mu(x)}{\gamma}{\delta}{N}{q}}
+ +These are defined by + +{\displaystyle +\dualqHahn{n}@{\mu(x)}{\gamma}{\delta}{N}{q}=:\frac{1}{\qPochhammer{\gamma q,q^{-N}}{q}{n}}\monicdualqHahn{n}@@{\mu(x}{\gamma}{\delta}{N}). +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:dualqHahn {\displaystyle R_{n}}] : dual {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:dualqHahn http://drmf.wmflabs.org/wiki/Definition:dualqHahn]
+[http://drmf.wmflabs.org/wiki/Definition:monicdualqHahn {\displaystyle {\widehat R}_{n}}] : monic dual {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicdualqHahn http://drmf.wmflabs.org/wiki/Definition:monicdualqHahn]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicdualHahn|Definition:monicdualHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicdualqKrawtchouk|Definition:monicdualqKrawtchouk]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicdualqKrawtchouk''' +
+
<< [[Definition:monicdualqHahn|Definition:monicdualqHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicHahn|Definition:monicHahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicdualqKrawtchouk''' represents the monic dual q Krawtchouk polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicdualqKrawtchouk{n}''' produces {\displaystyle \monicdualqKrawtchouk{n}}
+:'''\monicdualqKrawtchouk{n}@{\lambda(x)}{c}{N}{q}''' produces {\displaystyle \monicdualqKrawtchouk{n}@{\lambda(x)}{c}{N}{q}}
+:'''\monicdualqKrawtchouk{n}@@{\lambda(x)}{c}{N}{q}''' produces {\displaystyle \monicdualqKrawtchouk{n}@@{\lambda(x)}{c}{N}{q}}
+ +These are defined by + +{\displaystyle +\dualqKrawtchouk{n}@{\lambda(x)}{c}{N}{q}=:\frac{1}{\qPochhammer{q^{-N}}{q}{n}}\monicdualqKrawtchouk{n}@@{\lambda(x}{c}{N}{q}). +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:dualqKrawtchouk {\displaystyle K_{n}}] : dual {\displaystyle q}-Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:dualqKrawtchouk http://drmf.wmflabs.org/wiki/Definition:dualqKrawtchouk]
+[http://drmf.wmflabs.org/wiki/Definition:monicdualqKrawtchouk {\displaystyle {\widehat K}_{n}}] : monic dual {\displaystyle q}-Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicdualqKrawtchouk http://drmf.wmflabs.org/wiki/Definition:monicdualqKrawtchouk]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicdualqHahn|Definition:monicdualqHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicHahn|Definition:monicHahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicHahn''' +
+
<< [[Definition:monicdualqKrawtchouk|Definition:monicdualqKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicHermite|Definition:monicHermite]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicHahn''' represents the monic Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicHahn{n}''' produces {\displaystyle \monicHahn{n}}
+:'''\monicHahn{n}@{x}{\alpha}{\beta}{N}''' produces {\displaystyle \monicHahn{n}@{x}{\alpha}{\beta}{N}}
+:'''\monicHahn{n}@@{x}{\alpha}{\beta}{N}''' produces {\displaystyle \monicHahn{n}@@{x}{\alpha}{\beta}{N}}
+ +These are defined by + +{\displaystyle +\Hahn{n}@{x}{\alpha}{\beta}{N}=:\frac{\pochhammer{n+\alpha+\beta+1}{n}}{\pochhammer{\alpha+1}{n}\pochhammer{-N}{n}}\monicHahn{n}@{x}{\alpha}{\beta}{N} +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/18.19#T1.t1.r3 {\displaystyle Q_{n}}] : Hahn polynomial : [http://dlmf.nist.gov/18.19#T1.t1.r3 http://dlmf.nist.gov/18.19#T1.t1.r3]
+[http://drmf.wmflabs.org/wiki/Definition:monicHahn {\displaystyle {\widehat Q}_{n}}] : monic Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicHahn http://drmf.wmflabs.org/wiki/Definition:monicHahn]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii] +
+
<< [[Definition:monicdualqKrawtchouk|Definition:monicdualqKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicHermite|Definition:monicHermite]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicHermite''' +
+
<< [[Definition:monicHahn|Definition:monicHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicJacobi|Definition:monicJacobi]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicHermite''' represents the monic Hermite polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicHermite{n}''' produces {\displaystyle \monicHermite{n}}
+:'''\monicHermite{n}@{x}''' produces {\displaystyle \monicHermite{n}@{x}}
+:'''\monicHermite{n}@@{x}''' produces {\displaystyle \monicHermite{n}@@{x}}
+ +These are defined by + +{\displaystyle +\Hermite{n}@{x}=:2^n\monicHermite{n}@{x}. +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/18.3#T1.t1.r28 {\displaystyle H_{n}}] : Hermite polynomial {\displaystyle H_n} : [http://dlmf.nist.gov/18.3#T1.t1.r28 http://dlmf.nist.gov/18.3#T1.t1.r28]
+[http://drmf.wmflabs.org/wiki/Definition:monicHermite {\displaystyle {\widehat H}_{n}}] : monic Hermite polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicHermite http://drmf.wmflabs.org/wiki/Definition:monicHermite] +
+
<< [[Definition:monicHahn|Definition:monicHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicJacobi|Definition:monicJacobi]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicJacobi''' +
+
<< [[Definition:monicHermite|Definition:monicHermite]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicKrawtchouk|Definition:monicKrawtchouk]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicJacobi''' represents the monic Jacobi polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicJacobi{n}''' produces {\displaystyle \monicJacobi{n}}
+:'''\monicJacobi{n}@{x}''' produces {\displaystyle \monicJacobi{n}@{x}}
+:'''\monicJacobi{n}@@{x}''' produces {\displaystyle \monicJacobi{n}@@{x}}
+ +These are defined by + +{\displaystyle +\Jacobi{\alpha}{\beta}{n}@{x}=:\frac{\pochhammer{n+\alpha+\beta+1}{n}}{2^nn!}\monicJacobi{\alpha}{\beta}{n}@{x} +} +
+
+ +== Symbols List == + +[http://dlmf.nist.gov/18.3#T1.t1.r3 {\displaystyle P^{(\alpha,\beta)}_{n}}] : Jacobi polynomial : [http://dlmf.nist.gov/18.3#T1.t1.r3 http://dlmf.nist.gov/18.3#T1.t1.r3]
+[http://drmf.wmflabs.org/wiki/Definition:monicJacobi {\displaystyle {\widehat P}^{(\alpha,\beta)}_{n}}] : monic Jacobi polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicJacobi http://drmf.wmflabs.org/wiki/Definition:monicJacobi]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii] +
+
<< [[Definition:monicHermite|Definition:monicHermite]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicKrawtchouk|Definition:monicKrawtchouk]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicKrawtchouk''' +
+
<< [[Definition:monicJacobi|Definition:monicJacobi]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicLaguerre|Definition:monicLaguerre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicKrawtchouk''' represents the monic Krawtchouk polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicKrawtchouk{n}''' produces {\displaystyle \monicKrawtchouk{n}}
+:'''\monicKrawtchouk{n}@{q^{-x}}{p}{N}{q}''' produces {\displaystyle \monicKrawtchouk{n}@{q^{-x}}{p}{N}{q}}
+:'''\monicKrawtchouk{n}@@{q^{-x}}{p}{N}{q}''' produces {\displaystyle \monicKrawtchouk{n}@@{q^{-x}}{p}{N}{q}}
+ +These are defined by + +{\displaystyle +\Krawtchouk{n}@{x}{p}{N}=:\frac{1}{\pochhammer{-N}{n}p^n}\monicKrawtchouk{n}@{x}{p}{N}. +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/18.19#T1.t1.r6 {\displaystyle K_{n}}] : Krawtchouk polynomial : [http://dlmf.nist.gov/18.19#T1.t1.r6 http://dlmf.nist.gov/18.19#T1.t1.r6]
+[http://drmf.wmflabs.org/wiki/Definition:monicKrawtchouk {\displaystyle {\widehat K}_{n}}] : monic Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicKrawtchouk http://drmf.wmflabs.org/wiki/Definition:monicKrawtchouk]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii] +
+
<< [[Definition:monicJacobi|Definition:monicJacobi]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicLaguerre|Definition:monicLaguerre]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicLaguerre''' +
+
<< [[Definition:monicKrawtchouk|Definition:monicKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicLegendrePoly|Definition:monicLegendrePoly]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicLaguerre''' represents the monic generalized Laguerre polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicLaguerre{n}''' produces {\displaystyle \monicLaguerre{n}}
+:'''\monicLaguerre{n}@{x}''' produces {\displaystyle \monicLaguerre{n}@{x}}
+:'''\monicLaguerre{n}@@{x}''' produces {\displaystyle \monicLaguerre{n}@@{x}}
+ +These are defined by + +{\displaystyle +\Laguerre[\alpha]{n}@{x}=:\frac{(-1)^n}{n!}\monicLaguerre[\alpha]{n}@{x}. +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/18.3#T1.t1.r27 {\displaystyle L_n^{(\alpha)}}] : Laguerre (or generalized Laguerre) polynomial : [http://dlmf.nist.gov/18.3#T1.t1.r27 http://dlmf.nist.gov/18.3#T1.t1.r27]
+[http://drmf.wmflabs.org/wiki/Definition:monicLaguerre {\displaystyle {\widehat L}^{\alpha}_n}] : monic Laguerre polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicLaguerre http://drmf.wmflabs.org/wiki/Definition:monicLaguerre] +
+
<< [[Definition:monicKrawtchouk|Definition:monicKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicLegendrePoly|Definition:monicLegendrePoly]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicLegendrePoly''' +
+
<< [[Definition:monicLaguerre|Definition:monicLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:moniclittleqJacobi|Definition:moniclittleqJacobi]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicLegendrePoly''' represents the monic Legendre spherical polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicLegendrePoly{n}''' produces {\displaystyle \monicLegendrePoly{n}}
+:'''\monicLegendrePoly{n}@{x}''' produces {\displaystyle \monicLegendrePoly{n}@{x}}
+:'''\monicLegendrePoly{n}@@{x}''' produces {\displaystyle \monicLegendrePoly{n}@@{x}}
+ +These are defined by + +{\displaystyle +\LegendrePoly{n}@{x}=:\binomial{2n}{n}\frac{1}{2^n}\monicLegendrePoly{n}@{x}. +} + +
+ +== Symbols List == + +[http://dlmf.nist.gov/1.2#E1 {\displaystyle \binom{n}{k}}] : binomial coefficient : [http://dlmf.nist.gov/1.2#E1 http://dlmf.nist.gov/1.2#E1] [http://dlmf.nist.gov/26.3#SS1.p1 http://dlmf.nist.gov/26.3#SS1.p1]
+[http://dlmf.nist.gov/18.3#T1.t1.r25 {\displaystyle P_{n}}] : Legendre polynomial : [http://dlmf.nist.gov/18.3#T1.t1.r25 http://dlmf.nist.gov/18.3#T1.t1.r25]
+[http://drmf.wmflabs.org/wiki/Definition:monicLegendrePoly {\displaystyle {\widehat P}_{n}}] : monic Legendre polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicLegendrePoly http://drmf.wmflabs.org/wiki/Definition:monicLegendrePoly] +
+
<< [[Definition:monicLaguerre|Definition:monicLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:moniclittleqJacobi|Definition:moniclittleqJacobi]] >>
+
+drmf_eof +drmf_bof +'''Definition:moniclittleqJacobi''' +
+
<< [[Definition:monicLegendrePoly|Definition:monicLegendrePoly]]
+
[[Main_Page|Main Page]]
+
[[Definition:moniclittleqLaguerre|Definition:moniclittleqLaguerre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\moniclittleqJacobi''' represents the monic little q Jacobi polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\moniclittleqJacobi{n}''' produces {\displaystyle \moniclittleqJacobi{n}}
+:'''\moniclittleqJacobi{n}@{x}{a}{b}{q}''' produces {\displaystyle \moniclittleqJacobi{n}@{x}{a}{b}{q}}
+:'''\moniclittleqJacobi{n}@@{x}{a}{b}{q}''' produces {\displaystyle \moniclittleqJacobi{n}@@{x}{a}{b}{q}}
+ +These are defined by + +{\displaystyle +\littleqJacobi{n}@{x}{a}{b}{q}=:\frac{(-1)^nq^{-\binomial{n}{2}}\qPochhammer{abq^{n+1}}{q}{n}}{\qPochhammer{aq}{q}{n}}\moniclittleqJacobi{n}@@{x}{a}{b}{q}. +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/1.2#E1 {\displaystyle \binom{n}{k}}] : binomial coefficient : [http://dlmf.nist.gov/1.2#E1 http://dlmf.nist.gov/1.2#E1] [http://dlmf.nist.gov/26.3#SS1.p1 http://dlmf.nist.gov/26.3#SS1.p1]
+[http://drmf.wmflabs.org/wiki/Definition:littleqJacobi {\displaystyle p_{n}}] : little {\displaystyle q}-Jacobi polynomial : [http://drmf.wmflabs.org/wiki/Definition:littleqJacobi http://drmf.wmflabs.org/wiki/Definition:littleqJacobi]
+[http://drmf.wmflabs.org/wiki/Definition:moniclittleqJacobi {\displaystyle {\widehat p}_{n}}] : monic little {\displaystyle q}-Jacobi polynomial : [http://drmf.wmflabs.org/wiki/Definition:moniclittleqJacobi http://drmf.wmflabs.org/wiki/Definition:moniclittleqJacobi]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicLegendrePoly|Definition:monicLegendrePoly]]
+
[[Main_Page|Main Page]]
+
[[Definition:moniclittleqLaguerre|Definition:moniclittleqLaguerre]] >>
+
+drmf_eof +drmf_bof +'''Definition:moniclittleqLaguerre''' +
+
<< [[Definition:moniclittleqJacobi|Definition:moniclittleqJacobi]]
+
[[Main_Page|Main Page]]
+
[[Definition:moniclittleqLegendre|Definition:moniclittleqLegendre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\moniclittleqLaguerre''' represents the monic little q Laguerre Wall polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\moniclittleqLaguerre{n}''' produces {\displaystyle \moniclittleqLaguerre{n}}
+:'''\moniclittleqLaguerre{n}@{x}{a}{q}''' produces {\displaystyle \moniclittleqLaguerre{n}@{x}{a}{q}}
+:'''\moniclittleqLaguerre{n}@@{x}{a}{q}''' produces {\displaystyle \moniclittleqLaguerre{n}@@{x}{a}{q}}
+ +These are defined by +
+ +\littleqLaguerre{n}@{x}{a}{q}=:\frac{(-1)^nq^{-\binomial{n}{2}}}{\qPochhammer{aq}{q}{n}}\moniclittleqLaguerre{n}@@{x}{a}{q}. + + +== Symbols List == + +[http://dlmf.nist.gov/1.2#E1 {\displaystyle \binom{n}{k}}] : binomial coefficient : [http://dlmf.nist.gov/1.2#E1 http://dlmf.nist.gov/1.2#E1] [http://dlmf.nist.gov/26.3#SS1.p1 http://dlmf.nist.gov/26.3#SS1.p1]
+[http://drmf.wmflabs.org/wiki/Definition:littleqLaguerre {\displaystyle p_{n}}] : little {\displaystyle q}-Laguerre / Wall polynomial : [http://drmf.wmflabs.org/wiki/Definition:littleqLaguerre http://drmf.wmflabs.org/wiki/Definition:littleqLaguerre]
+[http://drmf.wmflabs.org/wiki/Definition:moniclittleqLaguerre {\displaystyle {\widehat p}_{n}}] : monic little {\displaystyle q}-Laguerre/Wall polynomial : [http://drmf.wmflabs.org/wiki/Definition:moniclittleqLaguerre http://drmf.wmflabs.org/wiki/Definition:moniclittleqLaguerre]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:moniclittleqJacobi|Definition:moniclittleqJacobi]]
+
[[Main_Page|Main Page]]
+
[[Definition:moniclittleqLegendre|Definition:moniclittleqLegendre]] >>
+
+drmf_eof +drmf_bof +'''Definition:moniclittleqLegendre''' +
+
<< [[Definition:moniclittleqLaguerre|Definition:moniclittleqLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicMeixner|Definition:monicMeixner]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\moniclittleqLegendre''' represents the monic little q Legendre polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\moniclittleqLegendre{n}''' produces {\displaystyle \moniclittleqLegendre{n}}
+:'''\moniclittleqLegendre{n}@{x}{q}''' produces {\displaystyle \moniclittleqLegendre{n}@{x}{q}}
+:'''\moniclittleqLegendre{n}@@{x}{q}''' produces {\displaystyle \moniclittleqLegendre{n}@@{x}{q}}
+ +These are defined by + +{\displaystyle +\littleqLegendre{n}@{x}{q}=:\frac{(-1)^nq^{-\binomial{n}{2}}\qPochhammer{q^{n+1}}{q}{n}}{\qPochhammer{q}{q}{n}}\moniclittleqLegendre{n}@@{x}{q}. +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/1.2#E1 {\displaystyle \binom{n}{k}}] : binomial coefficient : [http://dlmf.nist.gov/1.2#E1 http://dlmf.nist.gov/1.2#E1] [http://dlmf.nist.gov/26.3#SS1.p1 http://dlmf.nist.gov/26.3#SS1.p1]
+[http://drmf.wmflabs.org/wiki/Definition:littleqLegendre {\displaystyle p_{n}}] : little {\displaystyle q}-Legendre polynomial : [http://drmf.wmflabs.org/wiki/Definition:littleqLegendre http://drmf.wmflabs.org/wiki/Definition:littleqLegendre]
+[http://drmf.wmflabs.org/wiki/Definition:moniclittleqLegendre {\displaystyle {\widehat p}_{n}}] : monic little {\displaystyle q}-Legendre polynomial : [http://drmf.wmflabs.org/wiki/Definition:moniclittleqLegendre http://drmf.wmflabs.org/wiki/Definition:moniclittleqLegendre]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:moniclittleqLaguerre|Definition:moniclittleqLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicMeixner|Definition:monicMeixner]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicMeixner''' +
+
<< [[Definition:moniclittleqLegendre|Definition:moniclittleqLegendre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicMeixnerPollaczek|Definition:monicMeixnerPollaczek]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicMeixner''' represents the monic Meixner polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicMeixner{n}''' produces {\displaystyle \monicMeixner{n}}
+:'''\monicMeixner{n}@{x}{\beta}{c}''' produces {\displaystyle \monicMeixner{n}@{x}{\beta}{c}}
+:'''\monicMeixner{n}@@{x}{\beta}{c}''' produces {\displaystyle \monicMeixner{n}@@{x}{\beta}{c}}
+ +These are defined by + +{\displaystyle +\Meixner{n}@{x}{\beta}{c}=:\frac{1}{\pochhammer{\beta}{n}}\left(\frac{c-1}{c}\right)^n\monicMeixner{n}@@{x}{\beta}{c}. +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/18.19#T1.t1.r9 {\displaystyle M_{n}}] : Meixner polynomial : [http://dlmf.nist.gov/18.19#T1.t1.r9 http://dlmf.nist.gov/18.19#T1.t1.r9]
+[http://drmf.wmflabs.org/wiki/Definition:monicMeixner {\displaystyle {\widehat M}_{n}}] : monic Meixner polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicMeixner http://drmf.wmflabs.org/wiki/Definition:monicMeixner]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii] +
+
<< [[Definition:moniclittleqLegendre|Definition:moniclittleqLegendre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicMeixnerPollaczek|Definition:monicMeixnerPollaczek]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicMeixnerPollaczek''' +
+
<< [[Definition:monicMeixner|Definition:monicMeixner]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicpseudoJacobi|Definition:monicpseudoJacobi]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicMeixnerPollaczek''' represents the monic Meixner Pollaczek polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicMeixnerPollaczek{\lambda}{n}''' produces {\displaystyle \monicMeixnerPollaczek{\lambda}{n}}
+:'''\monicMeixnerPollaczek{\lambda}{n}@{x}{\phi}''' produces {\displaystyle \monicMeixnerPollaczek{\lambda}{n}@{x}{\phi}}
+:'''\monicMeixnerPollaczek{\lambda}{n}@@{x}{\phi}''' produces {\displaystyle \monicMeixnerPollaczek{\lambda}{n}@@{x}{\phi}}
+ +These are defined by + +{\displaystyle +\MeixnerPollaczek{\lambda}{n}@{x}{\phi}=:\frac{(2\sin@@{\phi})^n}{n!}\monicMeixnerPollaczek{\lambda}{n}@@{x}{\phi}. +} +
+
+ +== Symbols List == + +[http://dlmf.nist.gov/18.19#P3.p1 {\displaystyle P^{(\alpha)}_{n}}] : Meixner-Pollaczek polynomial : [http://dlmf.nist.gov/18.19#P3.p1 http://dlmf.nist.gov/18.19#P3.p1]
+[http://drmf.wmflabs.org/wiki/Definition:monicMeixnerPollaczek {\displaystyle {\widehat P}^{(\alpha)}_{n}}] : monic Meixner-Pollaczek polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicMeixnerPollaczek http://drmf.wmflabs.org/wiki/Definition:monicMeixnerPollaczek]
+[http://dlmf.nist.gov/4.14#E1 {\displaystyle \mathrm{sin}}] : sine function : [http://dlmf.nist.gov/4.14#E1 http://dlmf.nist.gov/4.14#E1] +
+
<< [[Definition:monicMeixner|Definition:monicMeixner]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicpseudoJacobi|Definition:monicpseudoJacobi]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicpseudoJacobi''' +
+
<< [[Definition:monicMeixnerPollaczek|Definition:monicMeixnerPollaczek]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqBesselPoly|Definition:monicqBesselPoly]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicpseudoJacobi''' represents the monic pseudo Jacobi polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicpseudoJacobi{n}''' produces {\displaystyle \monicpseudoJacobi{n}}
+:'''\monicpseudoJacobi{n}@{x}{\nu}{N}''' produces {\displaystyle \monicpseudoJacobi{n}@{x}{\nu}{N}}
+:'''\monicpseudoJacobi{n}@@{x}{\nu}{N}''' produces {\displaystyle \monicpseudoJacobi{n}@@{x}{\nu}{N}}
+ +These are defined by + +{\displaystyle +\pseudoJacobi{n}@{x}{\nu}{N}=:\monicpseudoJacobi{n}@@{x}{\nu}{N}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:monicpseudoJacobi {\displaystyle {\widehat P}_{n}}] : monic pseudo-Jacobi polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicpseudoJacobi http://drmf.wmflabs.org/wiki/Definition:monicpseudoJacobi]
+[http://drmf.wmflabs.org/wiki/Definition:pseudoJacobi {\displaystyle P_{n}}] : pseudo Jacobi polynomial : [http://drmf.wmflabs.org/wiki/Definition:pseudoJacobi http://drmf.wmflabs.org/wiki/Definition:pseudoJacobi] +
+
<< [[Definition:monicMeixnerPollaczek|Definition:monicMeixnerPollaczek]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqBesselPoly|Definition:monicqBesselPoly]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicqBesselPoly''' +
+
<< [[Definition:monicpseudoJacobi|Definition:monicpseudoJacobi]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqCharlier|Definition:monicqCharlier]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicqBesselPoly''' represents the monic q Bessel polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicqBesselPoly{n}''' produces {\displaystyle \monicqBesselPoly{n}}
+:'''\monicqBesselPoly{n}@{x}{a}{q}''' produces {\displaystyle \monicqBesselPoly{n}@{x}{a}{q}}
+:'''\monicqBesselPoly{n}@@{x}{a}{q}''' produces {\displaystyle \monicqBesselPoly{n}@@{x}{a}{q}}
+ +These are defined by + +{\displaystyle +\qBesselPoly{n}@{x}{a}{q}=:(-1)^nq^{-\binomial{n}{2}}\qPochhammer{-aq^n}{q}{n}\monicqBesselPoly{n}@@{x}{a}{q}. +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/1.2#E1 {\displaystyle \binom{n}{k}}] : binomial coefficient : [http://dlmf.nist.gov/1.2#E1 http://dlmf.nist.gov/1.2#E1] [http://dlmf.nist.gov/26.3#SS1.p1 http://dlmf.nist.gov/26.3#SS1.p1]
+[http://drmf.wmflabs.org/wiki/Definition:monicqBessel {\displaystyle {\widehat y}_{n}}] : monic {\displaystyle q}-Bessel polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicqBessel http://drmf.wmflabs.org/wiki/Definition:monicqBessel]
+[http://drmf.wmflabs.org/wiki/Definition:qBessel {\displaystyle y_{n}}] : {\displaystyle q}-Bessel polynomial : [http://drmf.wmflabs.org/wiki/Definition:qBessel http://drmf.wmflabs.org/wiki/Definition:qBessel]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicpseudoJacobi|Definition:monicpseudoJacobi]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqCharlier|Definition:monicqCharlier]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicqCharlier''' +
+
<< [[Definition:monicqBesselPoly|Definition:monicqBesselPoly]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqKrawtchouk|Definition:monicqKrawtchouk]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicqCharlier''' represents the monic q Charlier polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicqCharlier{n}''' produces {\displaystyle \monicqCharlier{n}}
+:'''\monicqCharlier{n}@{q^{-x}}{a}{q}''' produces {\displaystyle \monicqCharlier{n}@{q^{-x}}{a}{q}}
+:'''\monicqCharlier{n}@@{q^{-x}}{a}{q}''' produces {\displaystyle \monicqCharlier{n}@@{q^{-x}}{a}{q}}
+ +These are defined by + +{\displaystyle +\qHahn{n}@{q^{-x}}{\alpha}{\beta}{N}{q}=: +\frac{\qPochhammer{\alpha\beta q^{n+1}}{q}{n}}{\qPochhammer{\alpha q,q^{-N}}{q}{n}}\monicqHahn{n}@@{q^{-x}}{\alpha}{\beta}{N}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:monicqCharlier {\displaystyle {\widehat C}_{n}}] : monic {\displaystyle q}-Charlier polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicqCharlier http://drmf.wmflabs.org/wiki/Definition:monicqCharlier]
+[http://drmf.wmflabs.org/wiki/Definition:monicqHahn {\displaystyle {\widehat Q}_{n}}] : monic {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicqHahn http://drmf.wmflabs.org/wiki/Definition:monicqHahn]
+[http://drmf.wmflabs.org/wiki/Definition:qHahn {\displaystyle Q_{n}}] : {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:qHahn http://drmf.wmflabs.org/wiki/Definition:qHahn]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicqBesselPoly|Definition:monicqBesselPoly]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqKrawtchouk|Definition:monicqKrawtchouk]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicqKrawtchouk''' +
+
<< [[Definition:monicqCharlier|Definition:monicqCharlier]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqLaguerre|Definition:monicqLaguerre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicqKrawtchouk''' represents the monic q Krawtchouk polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicqKrawtchouk{n}''' produces {\displaystyle \monicqKrawtchouk{n}}
+:'''\monicqKrawtchouk{n}@{q^{-x}}{p}{N}{q}''' produces {\displaystyle \monicqKrawtchouk{n}@{q^{-x}}{p}{N}{q}}
+:'''\monicqKrawtchouk{n}@@{q^{-x}}{p}{N}{q}''' produces {\displaystyle \monicqKrawtchouk{n}@@{q^{-x}}{p}{N}{q}}
+ +These are defined by + +{\displaystyle +\qKrawtchouk{n}@{q^{-x}}{p}{N}{q}=:\frac{\qPochhammer{-pq^n}{q}{n}}{\qPochhammer{q^{-N}}{q}{n}}\monicqKrawtchouk{n}@@{q^{-x}}{p}{N}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:monicqKrawtchouk {\displaystyle {\widehat K}_{n}}] : monic {\displaystyle q}-Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicqKrawtchouk http://drmf.wmflabs.org/wiki/Definition:monicqKrawtchouk]
+[http://drmf.wmflabs.org/wiki/Definition:qKrawtchouk {\displaystyle K_{n}}] : {\displaystyle q}-Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:qKrawtchouk http://drmf.wmflabs.org/wiki/Definition:qKrawtchouk]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicqCharlier|Definition:monicqCharlier]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqLaguerre|Definition:monicqLaguerre]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicqLaguerre''' +
+
<< [[Definition:monicqKrawtchouk|Definition:monicqKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqMeixner|Definition:monicqMeixner]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicqLaguerre''' represents the monic q Laguerre polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicqLaguerre{n}''' produces {\displaystyle \monicqLaguerre{n}}
+:'''\monicqLaguerre{n}@{x}{q}''' produces {\displaystyle \monicqLaguerre{n}@{x}{q}}
+:'''\monicqLaguerre{n}@@{x}{q}''' produces {\displaystyle \monicqLaguerre{n}@@{x}{q}}
+ +These are defined by + +{\displaystyle +\qLaguerre[\alpha]{n}@{x}{q}=:\frac{(-1)^nq^{n(n+\alpha)}}{\qPochhammer{q}{q}{n}}\monicqLaguerre[\alpha]{n}@@{x}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:monicqLaguerre {\displaystyle {\widehat L}^{(\alpha)}_{n}}] : monic {\displaystyle q}-Laguerre polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicqLaguerre http://drmf.wmflabs.org/wiki/Definition:monicqLaguerre]
+[http://drmf.wmflabs.org/wiki/Definition:qLaguerre {\displaystyle L_n^{(\alpha)}}] : {\displaystyle q}-Laguerre polynomial : [http://drmf.wmflabs.org/wiki/Definition:qLaguerre http://drmf.wmflabs.org/wiki/Definition:qLaguerre]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicqKrawtchouk|Definition:monicqKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqMeixner|Definition:monicqMeixner]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicqMeixner''' +
+
<< [[Definition:monicqLaguerre|Definition:monicqLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqMeixnerPollaczek|Definition:monicqMeixnerPollaczek]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicqMeixner''' represents the monic q Meixner polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicqMeixner{n}''' produces {\displaystyle \monicqMeixner{n}}
+:'''\monicqMeixner{n}@{q^{-x}}{b}{c}{q}''' produces {\displaystyle \monicqMeixner{n}@{q^{-x}}{b}{c}{q}}
+:'''\monicqMeixner{n}@@{q^{-x}}{b}{c}{q}''' produces {\displaystyle \monicqMeixner{n}@@{q^{-x}}{b}{c}{q}}
+ +These are defined by +{\displaystyle +\qMeixner{n}@{q^{-x}}{b}{c}{q}=:\frac{(-1)^nq^{n^2}}{\qPochhammer{bq}{q}{n}c^n}\monicqMeixner{n}@@{q^{-x}}{b}{c}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:monicqMeixner {\displaystyle {\widehat M}_{n}}] : monic {\displaystyle q}-Meixner polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicqMeixner http://drmf.wmflabs.org/wiki/Definition:monicqMeixner]
+[http://drmf.wmflabs.org/wiki/Definition:qMeixner {\displaystyle M_{n}}] : {\displaystyle q}-Meixner polynomial : [http://drmf.wmflabs.org/wiki/Definition:qMeixner http://drmf.wmflabs.org/wiki/Definition:qMeixner]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicqLaguerre|Definition:monicqLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqMeixnerPollaczek|Definition:monicqMeixnerPollaczek]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicqMeixnerPollaczek''' +
+
<< [[Definition:monicqMeixner|Definition:monicqMeixner]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqRacah|Definition:monicqRacah]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicqMeixnerPollaczek''' represents the monic q Meixner Pollaczek polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicqMeixnerPollaczek{n}''' produces {\displaystyle \monicqMeixnerPollaczek{n}}
+:'''\monicqMeixnerPollaczek{n}@{x}{a}{q}''' produces {\displaystyle \monicqMeixnerPollaczek{n}@{x}{a}{q}}
+:'''\monicqMeixnerPollaczek{n}@@{x}{a}{q}''' produces {\displaystyle \monicqMeixnerPollaczek{n}@@{x}{a}{q}}
+ +These are defined by + +{\displaystyle +\qMeixnerPollaczek{n}@{x}{a}{q}=:\frac{2^n}{\qPochhammer{q}{q}{n}}\monicqMeixnerPollaczek{n}@@{x}{a}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:monicqMeixnerPollaczek {\displaystyle {\widehat P}_{n}}] : monic {\displaystyle q}-Meixner-Pollaczek polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicqMeixnerPollaczek http://drmf.wmflabs.org/wiki/Definition:monicqMeixnerPollaczek]
+[http://drmf.wmflabs.org/wiki/Definition:qMeixnerPollaczek {\displaystyle P_{n}}] : {\displaystyle q}-Meixner-Pollaczek polynomial : [http://drmf.wmflabs.org/wiki/Definition:qMeixnerPollaczek http://drmf.wmflabs.org/wiki/Definition:qMeixnerPollaczek]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicqMeixner|Definition:monicqMeixner]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqRacah|Definition:monicqRacah]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicqRacah''' +
+
<< [[Definition:monicqMeixnerPollaczek|Definition:monicqMeixnerPollaczek]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqtmqKrawtchouk|Definition:monicqtmqKrawtchouk]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicqRacah''' represents the monic q Racah polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicqRacah{n}''' produces {\displaystyle \monicqRacah{n}}
+:'''\monicqRacah{n}@{\mu(x)}{\alpha}{\beta}{\gamma}{\delta}{q}''' produces {\displaystyle \monicqRacah{n}@{\mu(x)}{\alpha}{\beta}{\gamma}{\delta}{q}}
+:'''\monicqRacah{n}@@{\mu(x)}{\alpha}{\beta}{\gamma}{\delta}{q}''' produces {\displaystyle \monicqRacah{n}@@{\mu(x)}{\alpha}{\beta}{\gamma}{\delta}{q}}
+ +These are defined by + +{\displaystyle +\qRacah{n}@{\mu(x)}{\alpha}{\beta}{\gamma}{\delta}{q}=: +\frac{\qPochhammer{\alpha\beta q^{n+1}}{q}{n}}{\qPochhammer{\alpha q,\beta\delta q,\gamma q}{q}{n}}\monicqRacah{n}@@{\mu(x)}{\alpha}{\beta}{\gamma}{\delta}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:monicqRacah {\displaystyle {\widehat R}_{n}}] : monic {\displaystyle q}-Racah polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicqRacah http://drmf.wmflabs.org/wiki/Definition:monicqRacah]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1]
+[http://dlmf.nist.gov/18.28#E19 {\displaystyle R_{n}}] : {\displaystyle q}-Racah polynomial : [http://dlmf.nist.gov/18.28#E19 http://dlmf.nist.gov/18.28#E19] +
+
<< [[Definition:monicqMeixnerPollaczek|Definition:monicqMeixnerPollaczek]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqtmqKrawtchouk|Definition:monicqtmqKrawtchouk]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicqtmqKrawtchouk''' +
+
<< [[Definition:monicqRacah|Definition:monicqRacah]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicRacah|Definition:monicRacah]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicqtmqKrawtchouk''' represents the monic quantum q Krawtchouk polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicqtmqKrawtchouk{n}''' produces {\displaystyle \monicqtmqKrawtchouk{n}}
+:'''\monicqtmqKrawtchouk{n}@{q^{-x}}{p}{N}{q}''' produces {\displaystyle \monicqtmqKrawtchouk{n}@{q^{-x}}{p}{N}{q}}
+:'''\monicqtmqKrawtchouk{n}@@{q^{-x}}{p}{N}{q}''' produces {\displaystyle \monicqtmqKrawtchouk{n}@@{q^{-x}}{p}{N}{q}}
+ +These are defined by + +{\displaystyle +\qtmqKrawtchouk{n}@{q^{-x}}{p}{N}{q}=:\frac{p^nq^{n^2}}{\qPochhammer{q^{-N}}{q}{n}}\monicqtmqKrawtchouk{n}@@{q^{-x}}{p}{N}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:monicqtmqKrawtchouk {\displaystyle {\widehat K^{\mathrm{qtm}}}_{n}}] : monic quantum {\displaystyle q}-Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicqtmqKrawtchouk http://drmf.wmflabs.org/wiki/Definition:monicqtmqKrawtchouk]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1]
+[http://drmf.wmflabs.org/wiki/Definition:qtmqKrawtchouk {\displaystyle K^{\mathrm{qtm}}_{n}}] : quantum {\displaystyle q}-Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:qtmqKrawtchouk http://drmf.wmflabs.org/wiki/Definition:qtmqKrawtchouk] +
+
<< [[Definition:monicqRacah|Definition:monicqRacah]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicRacah|Definition:monicRacah]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicRacah''' +
+
<< [[Definition:monicqtmqKrawtchouk|Definition:monicqtmqKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicStieltjesWigert|Definition:monicStieltjesWigert]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicRacah''' represents the monic Racah polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicRacah{n}''' produces {\displaystyle \monicRacah{n}}
+:'''\monicRacah{n}@{\lambda(x)}{\alpha}{\beta}{\gamma}{\delta}''' produces {\displaystyle \monicRacah{n}@{\lambda(x)}{\alpha}{\beta}{\gamma}{\delta}}
+:'''\monicRacah{n}@@{\lambda(x)}{\alpha}{\beta}{\gamma}{\delta}''' produces {\displaystyle \monicRacah{n}@@{\lambda(x)}{\alpha}{\beta}{\gamma}{\delta}}
+ +These are defined by + +{\displaystyle +\Racah{n}@{\lambda(x)}{\alpha}{\beta}{\gamma}{\delta}=: +\frac{\pochhammer{n+\alpha+\beta+1}{n}}{\pochhammer{\alpha+1}{n}\pochhammer{\beta+\delta+1}{n}\pochhammer{\gamma+1}{n}}\monicRacah{n}@@{\lambda(x)}{\alpha}{\beta}{\gamma}{\delta}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:monicRacah {\displaystyle {\widehat R}_{n}}] : monic Racah polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicRacah http://drmf.wmflabs.org/wiki/Definition:monicRacah]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii]
+[http://dlmf.nist.gov/18.25#T1.t1.r4 {\displaystyle R_{n}}] : Racah polynomial : [http://dlmf.nist.gov/18.25#T1.t1.r4 http://dlmf.nist.gov/18.25#T1.t1.r4] +
+
<< [[Definition:monicqtmqKrawtchouk|Definition:monicqtmqKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicStieltjesWigert|Definition:monicStieltjesWigert]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicStieltjesWigert''' +
+
<< [[Definition:monicRacah|Definition:monicRacah]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicUltra|Definition:monicUltra]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicStieltjesWigert''' represents the monic Stieltjes Wigert polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicStieltjesWigert{n}''' produces {\displaystyle \monicStieltjesWigert{n}}
+:'''\monicStieltjesWigert{n}@{x}{q}''' produces {\displaystyle \monicStieltjesWigert{n}@{x}{q}}
+:'''\monicStieltjesWigert{n}@@{x}{q}''' produces {\displaystyle \monicStieltjesWigert{n}@@{x}{q}}
+ +These are defined by + +{\displaystyle +\StieltjesWigert{n}@{x}{q}=:\frac{(-1)^nq^{n^2}}{\qPochhammer{q}{q}{n}}\monicStieltjesWigert{n}@@{x}{q}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:monicStieltjesWigert {\displaystyle {\widehat S}_{n}}] : monic Stieltjes-Wigert polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicStieltjesWigert http://drmf.wmflabs.org/wiki/Definition:monicStieltjesWigert]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1]
+[http://drmf.wmflabs.org/wiki/Definition:StieltjesWigert {\displaystyle S_{n}}] : Stieltjes-Wigert polynomial : [http://drmf.wmflabs.org/wiki/Definition:StieltjesWigert http://drmf.wmflabs.org/wiki/Definition:StieltjesWigert] +
+
<< [[Definition:monicRacah|Definition:monicRacah]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicUltra|Definition:monicUltra]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicUltra''' +
+
<< [[Definition:monicStieltjesWigert|Definition:monicStieltjesWigert]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicWilson|Definition:monicWilson]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicUltra''' represents the monic ultraspherical Gegenbauer polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicUltra{n}''' produces {\displaystyle \monicUltra{n}}
+:'''\monicUltra{n}@{x}''' produces {\displaystyle \monicUltra{n}@{x}}
+:'''\monicUltra{n}@@{x}''' produces {\displaystyle \monicUltra{n}@@{x}}
+ +These are defined by + +{\displaystyle +\Ultra{\lambda}{n}@{x}=:\frac{2^n\pochhammer{\lambda}{n}}{n!}\monicUltra{\lambda}{n}@@{x}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:monicUltra {\displaystyle {\widehat C}^{\mu}_{n}}] : monic ultraspherical/Gegenbauer polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicUltra http://drmf.wmflabs.org/wiki/Definition:monicUltra]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii]
+[http://dlmf.nist.gov/18.3#T1.t1.r5 {\displaystyle C^{\mu}_{n}}] : ultraspherical/Gegenbauer polynomial : [http://dlmf.nist.gov/18.3#T1.t1.r5 http://dlmf.nist.gov/18.3#T1.t1.r5] +
+
<< [[Definition:monicStieltjesWigert|Definition:monicStieltjesWigert]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicWilson|Definition:monicWilson]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicWilson''' +
+
<< [[Definition:monicUltra|Definition:monicUltra]]
+
[[Main_Page|Main Page]]
+
[[Definition:NeumannFactor|Definition:NeumannFactor]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicWilson''' represents the monic Wilson polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicWilson{n}''' produces {\displaystyle \monicWilson{n}}
+:'''\monicWilson{n}@{x^2}{a}{b}{c}{d}''' produces {\displaystyle \monicWilson{n}@{x^2}{a}{b}{c}{d}}
+:'''\monicWilson{n}@@{x^2}{a}{b}{c}{d}''' produces {\displaystyle \monicWilson{n}@@{x^2}{a}{b}{c}{d}}
+ +These are defined by + +{\displaystyle +\Wilson{n}@{x^2}{a}{b}{c}{d}=:(-1)^n\pochhammer{n+a+b+c+d-1}{n}\monicWilson{n}@@{x^2}{a}{b}{c}{d}. +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:monicWilson {\displaystyle {\widehat W}_{n}}] : monic Wilson polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicWilson http://drmf.wmflabs.org/wiki/Definition:monicWilson]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii]
+[http://dlmf.nist.gov/18.25#T1.t1.r2 {\displaystyle W_{n}}] : Wilson polynomial : [http://dlmf.nist.gov/18.25#T1.t1.r2 http://dlmf.nist.gov/18.25#T1.t1.r2] +
+
<< [[Definition:monicUltra|Definition:monicUltra]]
+
[[Main_Page|Main Page]]
+
[[Definition:NeumannFactor|Definition:NeumannFactor]] >>
+
+drmf_eof +drmf_bof +'''Definition:NeumannFactor''' +
+
<< [[Definition:monicWilson|Definition:monicWilson]]
+
[[Main_Page|Main Page]]
+
[[Definition:normctsdualHahnStilde|Definition:normctsdualHahnStilde]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\NeumannFactor''' represents the Neumann factor. + +This macro is in the category of integer valued functions. + +In math mode, this macro can be called in the following way: + +:'''\NeumannFactor{n}''' produces {\displaystyle \NeumannFactor{n}}
+ +These are defined by + +\NeumannFactor{n}:=2-\Kronecker{n}{0}. + + +== Symbols List == + +[http://dlmf.nist.gov/front/introduction#Sx4.p1.t1.r4 {\displaystyle \delta_{m,n}}] : Kronecker delta : [http://dlmf.nist.gov/front/introduction#Sx4.p1.t1.r4 http://dlmf.nist.gov/front/introduction#Sx4.p1.t1.r4]
+[http://drmf.wmflabs.org/wiki/Definition:NeumannFactor {\displaystyle \epsilon_{m}}] : Neumann factor : [http://drmf.wmflabs.org/wiki/Definition:NeumannFactor http://drmf.wmflabs.org/wiki/Definition:NeumannFactor] +
+
<< [[Definition:monicWilson|Definition:monicWilson]]
+
[[Main_Page|Main Page]]
+
[[Definition:normctsdualHahnStilde|Definition:normctsdualHahnStilde]] >>
+
+drmf_eof +drmf_bof +'''Definition:normctsdualHahnStilde''' +
+
<< [[Definition:NeumannFactor|Definition:NeumannFactor]]
+
[[Main_Page|Main Page]]
+
[[Definition:normctsHahnptilde|Definition:normctsHahnptilde]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\normctsdualHahnStilde''' represents the normalized continuous dual Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\normctsdualHahnStilde{n}@{x^2}{a}{b}{c}{d}''' produces {\displaystyle \normctsdualHahnStilde{n}@{x^2}{a}{b}{c}{d}}
+:'''\normctsdualHahnStilde{n}@@{x^2}{a}{b}{c}{d}''' produces {\displaystyle \normctsdualHahnStilde{n}@@{x^2}{a}{b}{c}{d}}
+ +These are defined by + +\normctsdualHahnStilde{n}@@{x^2}{a}{b}{c}:=\normctsdualHahnStilde{n}@{x^2}{a}{b}{c}=\frac{\ctsdualHahn{n}@{x^2}{a}{b}{c}}{\pochhammer{a+b}{n}\pochhammer{a+c}{n}}. + + +== Symbols List == + +[http://dlmf.nist.gov/18.25#T1.t1.r3 {\displaystyle S_{n}}] : continuous dual Hahn polynomial : [http://dlmf.nist.gov/18.25#T1.t1.r3 http://dlmf.nist.gov/18.25#T1.t1.r3]
+[http://drmf.wmflabs.org/wiki/Definition:normctsdualHahnStilde {\displaystyle {\tilde S}_{n}}] : normalized continuous dual Hahn polynomial {\displaystyle {\tilde S}} : [http://drmf.wmflabs.org/wiki/Definition:normctsdualHahnStilde http://drmf.wmflabs.org/wiki/Definition:normctsdualHahnStilde]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii] +
+
<< [[Definition:NeumannFactor|Definition:NeumannFactor]]
+
[[Main_Page|Main Page]]
+
[[Definition:normctsHahnptilde|Definition:normctsHahnptilde]] >>
+
+drmf_eof +drmf_bof +'''Definition:normctsHahnptilde''' +
+
<< [[Definition:normctsdualHahnStilde|Definition:normctsdualHahnStilde]]
+
[[Main_Page|Main Page]]
+
[[Definition:normJacobiR|Definition:normJacobiR]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\normctsHahnptilde''' represents the normalized continuous Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\normctsHahnptilde{n}''' produces {\displaystyle \normctsHahnptilde{n}}
+:'''\normctsHahnptilde{n}@{x}{a}{b}{c}{d}''' produces {\displaystyle \normctsHahnptilde{n}@{x}{a}{b}{c}{d}}
+:'''\normctsHahnptilde{n}@@{x}{a}{b}{c}{d}''' produces {\displaystyle \normctsHahnptilde{n}@@{x}{a}{b}{c}{d}}
+ +These are defined by + +\normctsHahnptilde{n}@@{x}{a}{b}{c}{d}:=\normctsHahnptilde{n}@{x}{a}{b}{c}{d}=\frac{n!}{i^n\pochhammer{a+c}{n}\pochhammer{a+d}{n}}\ctsHahn{n}@{x}{a}{b}{c}{d}. + + +== Symbols List == + +[http://dlmf.nist.gov/18.19#P2.p1 {\displaystyle p_{n}}] : continuous Hahn polynomial : [http://dlmf.nist.gov/18.19#P2.p1 http://dlmf.nist.gov/18.19#P2.p1]
+[http://drmf.wmflabs.org/wiki/Definition:normctsHahnptilde {\displaystyle {\tilde p}_{n}}] : normalized continuous Hahn polynomial {\displaystyle {\tilde p}} : [http://drmf.wmflabs.org/wiki/Definition:normctsHahnptilde http://drmf.wmflabs.org/wiki/Definition:normctsHahnptilde]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii] +
+
<< [[Definition:normctsdualHahnStilde|Definition:normctsdualHahnStilde]]
+
[[Main_Page|Main Page]]
+
[[Definition:normJacobiR|Definition:normJacobiR]] >>
+
+drmf_eof +drmf_bof +'''Definition:normJacobiR''' +
+
<< [[Definition:normctsHahnptilde|Definition:normctsHahnptilde]]
+
[[Main_Page|Main Page]]
+
[[Definition:normWilsonWtilde|Definition:normWilsonWtilde]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\normJacobiR''' represents the normalized Jacobi polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\normJacobiR{\alpha}{\beta}{n}''' produces {\displaystyle \normJacobiR{\alpha}{\beta}{n}}
+:'''\normJacobiR{\alpha}{\beta}{n}@{x}''' produces {\displaystyle \normJacobiR{\alpha}{\beta}{n}@{x}}
+ +These are defined by + +{\displaystyle \normJacobiR{\alpha}{\beta}{n}@{x}:= +\frac{\Jacobi{\alpha}{\beta}{n}@{x}}{ +\Jacobi{\alpha}{\beta}{n}@{1}},} + +where + +{\displaystyle \Jacobi{\alpha}{\beta}{n}@1=\frac{\pochhammer{\alpha+1}{n}}{n!}.} + + +== Symbols List == + +[http://dlmf.nist.gov/18.3#T1.t1.r3 {\displaystyle P^{(\alpha,\beta)}_{n}}] : Jacobi polynomial : [http://dlmf.nist.gov/18.3#T1.t1.r3 http://dlmf.nist.gov/18.3#T1.t1.r3]
+[http://drmf.wmflabs.org/wiki/Definition:normJacobiR {\displaystyle R^{(\alpha,\beta)}_{n}}] : normalized Jacobi polynomial : [http://drmf.wmflabs.org/wiki/Definition:normJacobiR http://drmf.wmflabs.org/wiki/Definition:normJacobiR]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii] +
+
<< [[Definition:normctsHahnptilde|Definition:normctsHahnptilde]]
+
[[Main_Page|Main Page]]
+
[[Definition:normWilsonWtilde|Definition:normWilsonWtilde]] >>
+
+drmf_eof +drmf_bof +'''Definition:normWilsonWtilde''' +
+
<< [[Definition:normJacobiR|Definition:normJacobiR]]
+
[[Main_Page|Main Page]]
+
[[Definition:poly|Definition:poly]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\normWilsonWtilde''' represents the normalized Wilson polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\normWilsonWtilde{n}''' produces {\displaystyle \normWilsonWtilde{n}}
+:'''\normWilsonWtilde{n}@{x^2}{a}{b}{c}{d}''' produces {\displaystyle \normWilsonWtilde{n}@{x^2}{a}{b}{c}{d}}
+:'''\normWilsonWtilde{n}@@{x^2}{a}{b}{c}{d}''' produces {\displaystyle \normWilsonWtilde{n}@@{x^2}{a}{b}{c}{d}}
+ +These are defined by + + +{\displaystyle +\normWilsonWtilde{n}@{x^2}{a}{b}{c}{d}:=\frac{\Wilson{n}@{x^2}{a}{b}{c}{d}}{\pochhammer{a+b}{n}\pochhammer{a+c}{n}\pochhammer{a+d}{n}} +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:normWilsonWtilde {\displaystyle {\tilde W}_{n}}] : normalized Wilson polynomial {\displaystyle {\tilde W}} : [http://drmf.wmflabs.org/wiki/Definition:normWilsonWtilde http://drmf.wmflabs.org/wiki/Definition:normWilsonWtilde]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii]
+[http://dlmf.nist.gov/18.25#T1.t1.r2 {\displaystyle W_{n}}] : Wilson polynomial : [http://dlmf.nist.gov/18.25#T1.t1.r2 http://dlmf.nist.gov/18.25#T1.t1.r2] +
+
<< [[Definition:normJacobiR|Definition:normJacobiR]]
+
[[Main_Page|Main Page]]
+
[[Definition:poly|Definition:poly]] >>
+
+drmf_eof +drmf_bof +'''Definition:poly''' +
+
<< [[Definition:normWilsonWtilde|Definition:normWilsonWtilde]]
+
[[Main_Page|Main Page]]
+
[[Definition:qBesselPoly|Definition:qBesselPoly]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\poly''' represents the semantic polynomial. + +This macro is in the category of semantic macros. + +In math mode, this macro can be called in the following ways: + +:'''\poly{p}{n}''' produces {\displaystyle \poly{p}{n}}
+:'''\poly{p}{n}@{x}''' produces {\displaystyle \poly{p}{n}@{x}}
+ +These are defined by +{\displaystyle +\pseudoJacobi{n}@{x}{\nu}{N}:=\frac{(-2i)^n\pochhammer{-N+i\nu}{n}}{\pochhammer{n-2N-1}{n}}\,\HyperpFq{2}{1}@@{-n,n-2N-1}{-N+i\nu}{\frac{1-ix}{2}} + + +
+ +== Symbols List == + +[http://dlmf.nist.gov/16.2#E1 {\displaystyle {{}_{p}F_{q}}}] : generalized hypergeometric function : [http://dlmf.nist.gov/16.2#E1 http://dlmf.nist.gov/16.2#E1]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii]
+[http://drmf.wmflabs.org/wiki/Definition:poly {\displaystyle {p}_{n}}] : polynomial : [http://drmf.wmflabs.org/wiki/Definition:poly http://drmf.wmflabs.org/wiki/Definition:poly]
+[http://drmf.wmflabs.org/wiki/Definition:pseudoJacobi {\displaystyle P_{n}}] : pseudo Jacobi polynomial : [http://drmf.wmflabs.org/wiki/Definition:pseudoJacobi http://drmf.wmflabs.org/wiki/Definition:pseudoJacobi] +
+
<< [[Definition:normWilsonWtilde|Definition:normWilsonWtilde]]
+
[[Main_Page|Main Page]]
+
[[Definition:qBesselPoly|Definition:qBesselPoly]] >>
+
+drmf_eof +drmf_bof +'''Definition:qBesselPoly''' +
+
<< [[Definition:poly|Definition:poly]]
+
[[Main_Page|Main Page]]
+
[[Definition:qCharlier|Definition:qCharlier]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qBesselPoly''' represents the q-Bessel polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\qBesselPoly{n}''' produces {\displaystyle \qBesselPoly{n}}
+:'''\qBesselPoly{n}@{x}{b}{q}''' produces {\displaystyle \qBesselPoly{n}@{x}{b}{q}}
+ +These are defined by +{\displaystyle +\qBesselPoly{n}@{x}{a}{q}:=\qHyperrphis{2}{1}@@{q^{-n},-aq^n}{0}{q}{qx} + +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:qBessel {\displaystyle y_{n}}] : {\displaystyle q}-Bessel polynomial : [http://drmf.wmflabs.org/wiki/Definition:qBessel http://drmf.wmflabs.org/wiki/Definition:qBessel]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:poly|Definition:poly]]
+
[[Main_Page|Main Page]]
+
[[Definition:qCharlier|Definition:qCharlier]] >>
+
+drmf_eof +drmf_bof +'''Definition:qCharlier''' +
+
<< [[Definition:qBesselPoly|Definition:qBesselPoly]]
+
[[Main_Page|Main Page]]
+
[[Definition:qDigamma|Definition:qDigamma]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qCharlier''' represents the q-Charlier polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\qCharlier{n}''' produces {\displaystyle \qCharlier{n}}
+:'''\qCharlier{n}@{x}{c}{q}''' produces {\displaystyle \qCharlier{n}@{x}{c}{q}}
+ +These are defined by +{\displaystyle +\qCharlier{n}@{q^{-x}}{a}{q}:=\qHyperrphis{2}{1}@@{q^{-n},q^{-x}}{0}{q}{-\frac{q^{n+1}}{a}} +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:qCharlier {\displaystyle C_{n}}] : {\displaystyle q}-Charlier polynomial : [http://drmf.wmflabs.org/wiki/Definition:qCharlier http://drmf.wmflabs.org/wiki/Definition:qCharlier]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:qBesselPoly|Definition:qBesselPoly]]
+
[[Main_Page|Main Page]]
+
[[Definition:qDigamma|Definition:qDigamma]] >>
+
+drmf_eof +drmf_bof +'''Definition:qDigamma''' +
+
<< [[Definition:qCharlier|Definition:qCharlier]]
+
[[Main_Page|Main Page]]
+
[[Definition:qHyperrWs|Definition:qHyperrWs]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qDigamma''' represents the q-gamma function. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\qDigamma{q}''' produces {\displaystyle \qDigamma{q}}
+:'''\qDigamma{q}@{z}''' produces {\displaystyle \qDigamma{q}@{z}}
+ +These are defined by +{\displaystyle +\qDigamma{q}@{z} = \qGamma{q}'@{z} / \qGamma{q}@{z} +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:qDigamma {\displaystyle \psi_{q}}] : {\displaystyle q}-digamma function : [http://drmf.wmflabs.org/wiki/Definition:qDigamma http://drmf.wmflabs.org/wiki/Definition:qDigamma]
+[http://dlmf.nist.gov/5.18#E4 {\displaystyle \Gamma_{q}}] : {\displaystyle q}-gamma function : [http://dlmf.nist.gov/5.18#E4 http://dlmf.nist.gov/5.18#E4] +
+
<< [[Definition:qCharlier|Definition:qCharlier]]
+
[[Main_Page|Main Page]]
+
[[Definition:qHyperrWs|Definition:qHyperrWs]] >>
+
+drmf_eof +drmf_bof +'''Definition:qHyperrWs''' +
+
<< [[Definition:qDigamma|Definition:qDigamma]]
+
[[Main_Page|Main Page]]
+
[[Definition:qExpKLS|Definition:qExpKLS]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qHyperrWs''' represents the q-hypergeometric series. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\qHyperrWs{r}{r+1}''' produces {\displaystyle \qHyperrWs{r}{r+1}}
+:'''\qHyperrWs{r}{r+1}@{a_1}{a_4,a_5,...,a_{r+1}}{q}{z}''' produces {\displaystyle \qHyperrWs{r}{r+1}@{a_1}{a_4,a_5,...,a_{r+1}}{q}{z}}
+:'''\qHyperrWs{r}{r+1}@@{a_1}{a_4,a_5,...,a_{r+1}}{q}{z}''' produces {\displaystyle \qHyperrWs{r}{r+1}@@{a_1}{a_4,a_5,...,a_{r+1}}{q}{z}}
+:'''\qHyperrWs{r}{r+1}@@@{a_1}{a_4,a_5,...,a_{r+1}}{q}{z}''' produces {\displaystyle \qHyperrWs{r}{r+1}@@@{a_1}{a_4,a_5,...,a_{r+1}}{q}{z}}
+ +These are defined by + +\qHyperrWs{r+1}r@ +{a_1}{a_4,a_5,\ldots,a_{r+1}}qz:= +\qHyperrphis{r+1}r@@{a_1,qa_1^\frac12,-qa_1^\frac12,a_4,\ldots,a_{r+1}} +{a_1^\frac12,-a_1^\frac12,qa_1/a_4,\ldots,qa_1/a_{r+1}}qz. + +
+ +== Bibliography == + +Equation (2.1.11) of [[Bibliography#GaR|'''GaR''']]. + +== Symbols List == + +[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://drmf.wmflabs.org/wiki/Definition:qHyperrWs {\displaystyle {{}_{r+1}W_{r}}}] : very-well-poised basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://drmf.wmflabs.org/wiki/Definition:qHyperrWs http://drmf.wmflabs.org/wiki/Definition:qHyperrWs] +
+
<< [[Definition:qDigamma|Definition:qDigamma]]
+
[[Main_Page|Main Page]]
+
[[Definition:qExpKLS|Definition:qExpKLS]] >>
+
+drmf_eof +drmf_bof +'''Definition:qExpKLS''' +
+
<< [[Definition:qHyperrWs|Definition:qHyperrWs]]
+
[[Main_Page|Main Page]]
+
[[Definition:qexpKLS|Definition:qexpKLS]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qExpKLS''' represents a q-analogue of the +\exp function: \qExpKLS{q}. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\qExpKLS{q}''' produces {\displaystyle \qExpKLS{q}}
+:'''\qExpKLS{q}@{z}''' produces {\displaystyle \qExpKLS{q}@{z}}
+:'''\qExpKLS{q}@@{z}''' produces {\displaystyle \qExpKLS{q}@@{z}}
+ +These are defined by +{\displaystyle +\qExpKLS{q}@{z}:=\qHyperrphis{0}{0}@@{-}{-}{q}{-z}:= +\sum_{n=0}^{\infty}\frac{q^{\binom{n}{2}}}{\qPochhammer{q}{q}{n}}z^n=\qPochhammer{-z}{q}{\infty},\quad 0<|q|<1. +} + +== Symbols List == + +[http://dlmf.nist.gov/1.2#E1 {\displaystyle \binom{n}{k}}] : binomial coefficient : [http://dlmf.nist.gov/1.2#E1 http://dlmf.nist.gov/1.2#E1] [http://dlmf.nist.gov/26.3#SS1.p1 http://dlmf.nist.gov/26.3#SS1.p1]
+[http://dlmf.nist.gov/4.2#E19 {\displaystyle \mathrm{exp}}] : exponential function : [http://dlmf.nist.gov/4.2#E19 http://dlmf.nist.gov/4.2#E19]
+[http://drmf.wmflabs.org/wiki/Definition:qExpKLS {\displaystyle \mathrm{E}_{q}}] : {\displaystyle q}-analogue of the {\displaystyle \exp} function used in KLS: {\displaystyle \mathrm{E}_{q}} : [http://drmf.wmflabs.org/wiki/Definition:qExpKLS http://drmf.wmflabs.org/wiki/Definition:qExpKLS]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1]
+[http://drmf.wmflabs.org/wiki/Definition:sum {\displaystyle \Sigma}] : sum : [http://drmf.wmflabs.org/wiki/Definition:sum http://drmf.wmflabs.org/wiki/Definition:sum] +
+
<< [[Definition:qHyperrWs|Definition:qHyperrWs]]
+
[[Main_Page|Main Page]]
+
[[Definition:qexpKLS|Definition:qexpKLS]] >>
+
+drmf_eof +drmf_bof +'''Definition:qexpKLS''' +
+
<< [[Definition:qExpKLS|Definition:qExpKLS]]
+
[[Main_Page|Main Page]]
+
[[Definition:qcosKLS|Definition:qcosKLS]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qexpKLS''' represents a q-analogue of the +\exp function: \qexpKLS{q}. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\qexpKLS{q}''' produces {\displaystyle \qexpKLS{q}}
+:'''\qexpKLS{q}@{z}''' produces {\displaystyle \qexpKLS{q}@{z}}
+:'''\qexpKLS{q}@@{z}''' produces {\displaystyle \qexpKLS{q}@@{z}}
+ +These are defined by +{\displaystyle +\qexpKLS{q}@{z}:=\qHyperrphis{1}{0}@@{0}{-}{q}{z}:=\sum_{n=0}^{\infty}\frac{z^n}{\qPochhammer{q}{q}{n}} +=\frac{1}{\qPochhammer{z}{q}{\infty}},\quad 0<|q|<1 +} + +== Symbols List == + +[http://dlmf.nist.gov/4.2#E19 {\displaystyle \mathrm{exp}}] : exponential function : [http://dlmf.nist.gov/4.2#E19 http://dlmf.nist.gov/4.2#E19]
+[http://drmf.wmflabs.org/wiki/Definition:qexpKLS {\displaystyle \mathrm{e}_{q}}] : {\displaystyle q}-analogue of the {\displaystyle \exp} function used in KLS: {\displaystyle \mathrm{e}_{q}} : [http://drmf.wmflabs.org/wiki/Definition:qexpKLS http://drmf.wmflabs.org/wiki/Definition:qexpKLS]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1]
+[http://drmf.wmflabs.org/wiki/Definition:sum {\displaystyle \Sigma}] : sum : [http://drmf.wmflabs.org/wiki/Definition:sum http://drmf.wmflabs.org/wiki/Definition:sum] +
+
<< [[Definition:qExpKLS|Definition:qExpKLS]]
+
[[Main_Page|Main Page]]
+
[[Definition:qcosKLS|Definition:qcosKLS]] >>
+
+drmf_eof +drmf_bof +'''Definition:qcosKLS''' +
+
<< [[Definition:qexpKLS|Definition:qexpKLS]]
+
[[Main_Page|Main Page]]
+
[[Definition:qMeixner|Definition:qMeixner]] >>
+
+The LaTeX DLMF and DRMF macro '''\qcosKLS''' represents a q-analogue of the +\cos function:~\qcosKLS{q}. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\qcosKLS{q}''' produces {\displaystyle \qcosKLS{q}}
+:'''\qcosKLS{q}@{z}''' produces {\displaystyle \qcosKLS{q}@{z}}
+:'''\qcosKLS{q}@@{z}''' produces {\displaystyle \qcosKLS{q}@@{z}}
+ +These are defined by +{\displaystyle +\qcosKLS{q}@{z}:=\frac{\qexpKLS{q}@{iz)+{\mathrm e}_q(-iz}}{2}= +\sum_{n=0}^{\infty}\frac{(-1)^nz^{2n}}{\qPochhammer{q}{q}{2n}} +} + +== Symbols List == + +[http://dlmf.nist.gov/4.14#E2 {\displaystyle \mathrm{cos}}] : cosine function : [http://dlmf.nist.gov/4.14#E2 http://dlmf.nist.gov/4.14#E2]
+[http://drmf.wmflabs.org/wiki/Definition:qcosKLS {\displaystyle \mathrm{cos}_{q}}] : {\displaystyle q}-analogue of the {\displaystyle \cos} function used in KLS: {\displaystyle \cos_q} : [http://drmf.wmflabs.org/wiki/Definition:qcosKLS http://drmf.wmflabs.org/wiki/Definition:qcosKLS]
+[http://drmf.wmflabs.org/wiki/Definition:qexpKLS {\displaystyle \mathrm{e}_{q}}] : {\displaystyle q}-analogue of the {\displaystyle \exp} function used in KLS: {\displaystyle \mathrm{e}_{q}} : [http://drmf.wmflabs.org/wiki/Definition:qexpKLS http://drmf.wmflabs.org/wiki/Definition:qexpKLS]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1]
+[http://drmf.wmflabs.org/wiki/Definition:sum {\displaystyle \Sigma}] : sum : [http://drmf.wmflabs.org/wiki/Definition:sum http://drmf.wmflabs.org/wiki/Definition:sum] +
+
<< [[Definition:qexpKLS|Definition:qexpKLS]]
+
[[Main_Page|Main Page]]
+
[[Definition:qMeixner|Definition:qMeixner]] >>
+
+drmf_eof +drmf_bof +'''Definition:qMeixner''' +
+
<< [[Definition:qcosKLS|Definition:qcosKLS]]
+
[[Main_Page|Main Page]]
+
[[Definition:qKrawtchouk|Definition:qKrawtchouk]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qMeixner''' represents the q-Meixner polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\qMeixner{n}''' produces {\displaystyle \qMeixner{n}}
+:'''\qMeixner{n}@{x}{b}{c}{q}''' produces {\displaystyle \qMeixner{n}@{x}{b}{c}{q}}
+ +These are defined by + +\qMeixner{n}@{q^{-x}}{b}{c}{q}:=\qHyperrphis{2}{1}@@{q^{-n},q^{-x}}{bq}{q}{-\frac{q^{n+1}}{c}}. + + +== Symbols List == + +[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://drmf.wmflabs.org/wiki/Definition:qMeixner {\displaystyle M_{n}}] : {\displaystyle q}-Meixner polynomial : [http://drmf.wmflabs.org/wiki/Definition:qMeixner http://drmf.wmflabs.org/wiki/Definition:qMeixner] +
+
<< [[Definition:qcosKLS|Definition:qcosKLS]]
+
[[Main_Page|Main Page]]
+
[[Definition:qKrawtchouk|Definition:qKrawtchouk]] >>
+
+drmf_eof +drmf_bof +'''Definition:qKrawtchouk''' +
+
<< [[Definition:qMeixner|Definition:qMeixner]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqHahn|Definition:monicqHahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qKrawtchouk''' represents the q-Krawtchouk polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\qKrawtchouk{n}''' produces {\displaystyle \qKrawtchouk{n}}
+:'''\qKrawtchouk{n}@{q^{-x}}{p}{N}{q}''' produces {\displaystyle \qKrawtchouk{n}@{q^{-x}}{p}{N}{q}}
+:'''\qKrawtchouk{n}@@{q^{-x}}{p}{N}{q}''' produces {\displaystyle \qKrawtchouk{n}@@{q^{-x}}{p}{N}{q}}
+ +These are defined by + +\qKrawtchouk{n}@{q^{-x}}{p}{N}{q}:=\qHyperrphis{3}{2}@@{q^{-n},q^{-x},-pq^n}{q^{-N},0}{q}{q}. +\end{equation} + + +== Symbols List == + +[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://drmf.wmflabs.org/wiki/Definition:qKrawtchouk {\displaystyle K_{n}}] : {\displaystyle q}-Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:qKrawtchouk http://drmf.wmflabs.org/wiki/Definition:qKrawtchouk] +
+
<< [[Definition:qMeixner|Definition:qMeixner]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqHahn|Definition:monicqHahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicqHahn''' +
+
<< [[Definition:qKrawtchouk|Definition:qKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:dualqHahn|Definition:dualqHahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicqHahn''' represents the monic q Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicqHahn{n}''' produces {\displaystyle \monicqHahn{n}}
+:'''\monicqHahn{n}@{q^{-x}}{\alpha}{\beta}{N}''' produces {\displaystyle \monicqHahn{n}@{q^{-x}}{\alpha}{\beta}{N}}
+:'''\monicqHahn{n}@@{q^{-x}}{\alpha}{\beta}{N}''' produces {\displaystyle \monicqHahn{n}@@{q^{-x}}{\alpha}{\beta}{N}}
+ +These are defined by + +{\displaystyle +\qHahn{n}@{q^{-x}}{\alpha}{\beta}{N}{q}=: +\frac{\qPochhammer{\alpha\beta q^{n+1}}{q}{n}}{\qPochhammer{\alpha q,q^{-N}}{q}{n}}\monicqHahn{n}@@{q^{-x}}{\alpha}{\beta}{N}. +} + +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:monicqHahn {\displaystyle {\widehat Q}_{n}}] : monic {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicqHahn http://drmf.wmflabs.org/wiki/Definition:monicqHahn]
+[http://drmf.wmflabs.org/wiki/Definition:qHahn {\displaystyle Q_{n}}] : {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:qHahn http://drmf.wmflabs.org/wiki/Definition:qHahn]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:qKrawtchouk|Definition:qKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:dualqHahn|Definition:dualqHahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:dualqHahn''' +
+
<< [[Definition:monicqHahn|Definition:monicqHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:dualqKrawtchouk|Definition:dualqKrawtchouk]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\dualqHahn''' represents the dual q-Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\dualqHahn{n}''' produces {\displaystyle \dualqHahn{n}}
+:'''\dualqHahn{n}@{\mu(x)}{\gamma}{\delta}{N}{q}''' produces {\displaystyle \dualqHahn{n}@{\mu(x)}{\gamma}{\delta}{N}{q}}
+:'''\dualqHahn{n}@@{\mu(x)}{\gamma}{\delta}{N}{q}''' produces {\displaystyle \dualqHahn{n}@@{\mu(x)}{\gamma}{\delta}{N}{q}}
+ +These are defined by + +\dualqHahn{n}@{\mu(x)}{\gamma}{\delta}{N}{q}:= +\qHyperrphis32@@{q^{-n},q^{-x},\gamma\delta q^{x+1}} +{\gamma q,q^{-N}}qq, + + +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:dualqHahn {\displaystyle R_{n}}] : dual {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:dualqHahn http://drmf.wmflabs.org/wiki/Definition:dualqHahn]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:monicqHahn|Definition:monicqHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:dualqKrawtchouk|Definition:dualqKrawtchouk]] >>
+
+drmf_eof +drmf_bof +'''Definition:dualqKrawtchouk''' +
+
<< [[Definition:dualqHahn|Definition:dualqHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:littleqLaguerre|Definition:littleqLaguerre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\dualqKrawtchouk''' represents the dual q-Krawtchouk. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\dualqKrawtchouk{n}''' produces {\displaystyle \dualqKrawtchouk{n}}
+:'''\dualqKrawtchouk{n}@{\lambda(x)}{c}{N}{q}''' produces {\displaystyle \dualqKrawtchouk{n}@{\lambda(x)}{c}{N}{q}}
+:'''\dualqKrawtchouk{n}@@{\lambda(x)}{c}{N}{q}''' produces {\displaystyle \dualqKrawtchouk{n}@@{\lambda(x)}{c}{N}{q}}
+ +These are defined by +{\displaystyle +\dualqKrawtchouk{n}@{\lambda(x)}{c}{N}{q}:=\qHyperrphis{3}{2}@@{q^{-n},q^{-x},cq^{x-N}}{q^{-N},0}{q}{q} +} + +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:dualqKrawtchouk {\displaystyle K_{n}}] : dual {\displaystyle q}-Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:dualqKrawtchouk http://drmf.wmflabs.org/wiki/Definition:dualqKrawtchouk]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:dualqHahn|Definition:dualqHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:littleqLaguerre|Definition:littleqLaguerre]] >>
+
+drmf_eof +drmf_bof +'''Definition:littleqLaguerre''' +
+
<< [[Definition:dualqKrawtchouk|Definition:dualqKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:qsinKLS|Definition:qsinKLS]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\littleqLaguerre''' represents the little q-Laguerre / Wall polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\littleqLaguerre{n}''' produces {\displaystyle \littleqLaguerre{n}}
+:'''\littleqLaguerre{n}@{x}{a}{q}''' produces {\displaystyle \littleqLaguerre{n}@{x}{a}{q}}
+ +These are defined by +{\displaystyle +\littleqLaguerre{n}@{x}{a}{q}:=\qHyperrphis{2}{1}@@{q^{-n},0}{aq}{q}{qx}. +} + +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:littleqLaguerre {\displaystyle p_{n}}] : little {\displaystyle q}-Laguerre / Wall polynomial : [http://drmf.wmflabs.org/wiki/Definition:littleqLaguerre http://drmf.wmflabs.org/wiki/Definition:littleqLaguerre]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:dualqKrawtchouk|Definition:dualqKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:qsinKLS|Definition:qsinKLS]] >>
+
+drmf_eof +drmf_bof +'''Definition:qsinKLS''' +
+
<< [[Definition:littleqLaguerre|Definition:littleqLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:qSinKLS|Definition:qSinKLS]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qsinKLS''' represents a q-analogue of the \sin +function: \qsinKLS{q}. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\qsinKLS{q}''' produces {\displaystyle \qsinKLS{q}}
+:'''\qsinKLS{q}@{z}''' produces {\displaystyle \qsinKLS{q}@{z}}
+:'''\qsinKLS{q}@@{z}''' produces {\displaystyle \qsinKLS{q}@@{z}}
+ +These are defined by +{\displaystyle +\qsinKLS{q}@{z}:=\frac{\qexpKLS{q}@{\iunit z)-{\mathrm e}_q(-\iunit z}}{2\iunit}= +\sum_{n=0}^{\infty}\frac{(-1)^nz^{2n+1}}{\qPochhammer{q}{q}{2n+1}} +} + +== Symbols List == + +[http://dlmf.nist.gov/1.9.i {\displaystyle \mathrm{i}}] : imaginary unit : [http://dlmf.nist.gov/1.9.i http://dlmf.nist.gov/1.9.i]
+[http://drmf.wmflabs.org/wiki/Definition:qexpKLS {\displaystyle \mathrm{e}_{q}}] : {\displaystyle q}-analogue of the {\displaystyle \exp} function used in KLS: {\displaystyle \mathrm{e}_{q}} : [http://drmf.wmflabs.org/wiki/Definition:qexpKLS http://drmf.wmflabs.org/wiki/Definition:qexpKLS]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1]
+[http://drmf.wmflabs.org/wiki/Definition:qsinKLS {\displaystyle \mathrm{sin}_{q}}] : {\displaystyle q}-analogue of the {\displaystyle \sin} function used in KLS: {\displaystyle \sin_q} : [http://drmf.wmflabs.org/wiki/Definition:qsinKLS http://drmf.wmflabs.org/wiki/Definition:qsinKLS]
+[http://dlmf.nist.gov/4.14#E1 {\displaystyle \mathrm{sin}}] : sine function : [http://dlmf.nist.gov/4.14#E1 http://dlmf.nist.gov/4.14#E1]
+[http://drmf.wmflabs.org/wiki/Definition:sum {\displaystyle \Sigma}] : sum : [http://drmf.wmflabs.org/wiki/Definition:sum http://drmf.wmflabs.org/wiki/Definition:sum] +
+
<< [[Definition:littleqLaguerre|Definition:littleqLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:qSinKLS|Definition:qSinKLS]] >>
+
+drmf_eof +drmf_bof +'''Definition:qSinKLS''' +
+
<< [[Definition:qsinKLS|Definition:qsinKLS]]
+
[[Main_Page|Main Page]]
+
[[Definition:qCosKLS|Definition:qCosKLS]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qSinKLS''' represents a q-analogue of the +\sin function: \qSinKLS{q}. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\qSinKLS{q}''' produces {\displaystyle \qSinKLS{q}}
+:'''\qSinKLS{q}@{z}''' produces {\displaystyle \qSinKLS{q}@{z}}
+:'''\qSinKLS{q}@@{z}''' produces {\displaystyle \qSinKLS{q}@@{z}}
+ +These are defined by +{\displaystyle +\qSinKLS{q}@{z}:=\frac{\qExpKLS{q}@{\iunit z}-\qExpKLS{q}@{-\iunit z}}{2\iunit} +=\sum_{n=0}^{\infty}\frac{(-1)^nq^{\binomial{2n+1}{2}}z^{2n+1}}{\qPochhammer{q}{q}{2n+1}} +} + +== Symbols List == + +[http://dlmf.nist.gov/1.2#E1 {\displaystyle \binom{n}{k}}] : binomial coefficient : [http://dlmf.nist.gov/1.2#E1 http://dlmf.nist.gov/1.2#E1] [http://dlmf.nist.gov/26.3#SS1.p1 http://dlmf.nist.gov/26.3#SS1.p1]
+[http://dlmf.nist.gov/1.9.i {\displaystyle \mathrm{i}}] : imaginary unit : [http://dlmf.nist.gov/1.9.i http://dlmf.nist.gov/1.9.i]
+[http://drmf.wmflabs.org/wiki/Definition:qExpKLS {\displaystyle \mathrm{E}_{q}}] : {\displaystyle q}-analogue of the {\displaystyle \exp} function used in KLS: {\displaystyle \mathrm{E}_{q}} : [http://drmf.wmflabs.org/wiki/Definition:qExpKLS http://drmf.wmflabs.org/wiki/Definition:qExpKLS]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1]
+[http://drmf.wmflabs.org/wiki/Definition:qSinKLS {\displaystyle \mathrm{Sin}_{q}}] : {\displaystyle q}-analogue of the {\displaystyle \sin} function used in KLS: {\displaystyle \mathrm{Sin}_q} : [http://drmf.wmflabs.org/wiki/Definition:qSinKLS http://drmf.wmflabs.org/wiki/Definition:qSinKLS]
+[http://dlmf.nist.gov/4.14#E1 {\displaystyle \mathrm{sin}}] : sine function : [http://dlmf.nist.gov/4.14#E1 http://dlmf.nist.gov/4.14#E1]
+[http://drmf.wmflabs.org/wiki/Definition:sum {\displaystyle \Sigma}] : sum : [http://drmf.wmflabs.org/wiki/Definition:sum http://drmf.wmflabs.org/wiki/Definition:sum] +
+
<< [[Definition:qsinKLS|Definition:qsinKLS]]
+
[[Main_Page|Main Page]]
+
[[Definition:qCosKLS|Definition:qCosKLS]] >>
+
+drmf_eof +drmf_bof +'''Definition:qCosKLS''' +
+
<< [[Definition:qSinKLS|Definition:qSinKLS]]
+
[[Main_Page|Main Page]]
+
[[Definition:Wilson|Definition:Wilson]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qCosKLS''' represents a q-analogue of the +\cos function: \qCosKLS{q}. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\qCosKLS{q}''' produces {\displaystyle \qCosKLS{q}}
+:'''\qCosKLS{q}@{z}''' produces {\displaystyle \qCosKLS{q}@{z}}
+:'''\qCosKLS{q}@@{z}''' produces {\displaystyle \qCosKLS{q}@@{z}}
+ +These are defined by +{\displaystyle +\qCosKLS{q}@{z}:=\frac{\qExpKLS{q}@{\iunit z}+\qExpKLS{q}@{-\iunit z}}{2} +=\sum_{n=0}^{\infty}\frac{(-1)^nq^{\binomial{2n}{2}}z^{2n}}{\qPochhammer{q}{q}{2n}} +} + +== Symbols List == + +[http://dlmf.nist.gov/1.2#E1 {\displaystyle \binom{n}{k}}] : binomial coefficient : [http://dlmf.nist.gov/1.2#E1 http://dlmf.nist.gov/1.2#E1] [http://dlmf.nist.gov/26.3#SS1.p1 http://dlmf.nist.gov/26.3#SS1.p1]
+[http://dlmf.nist.gov/4.14#E2 {\displaystyle \mathrm{cos}}] : cosine function : [http://dlmf.nist.gov/4.14#E2 http://dlmf.nist.gov/4.14#E2]
+[http://dlmf.nist.gov/1.9.i {\displaystyle \mathrm{i}}] : imaginary unit : [http://dlmf.nist.gov/1.9.i http://dlmf.nist.gov/1.9.i]
+[http://drmf.wmflabs.org/wiki/Definition:qCosKLS {\displaystyle \mathrm{Cos}_{q}}] : {\displaystyle q}-analogue of the {\displaystyle \cos} function used in KLS: {\displaystyle \mathrm{Cos}_{q}} : [http://drmf.wmflabs.org/wiki/Definition:qCosKLS http://drmf.wmflabs.org/wiki/Definition:qCosKLS]
+[http://drmf.wmflabs.org/wiki/Definition:qExpKLS {\displaystyle \mathrm{E}_{q}}] : {\displaystyle q}-analogue of the {\displaystyle \exp} function used in KLS: {\displaystyle \mathrm{E}_{q}} : [http://drmf.wmflabs.org/wiki/Definition:qExpKLS http://drmf.wmflabs.org/wiki/Definition:qExpKLS]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1]
+[http://drmf.wmflabs.org/wiki/Definition:sum {\displaystyle \Sigma}] : sum : [http://drmf.wmflabs.org/wiki/Definition:sum http://drmf.wmflabs.org/wiki/Definition:sum] +
+
<< [[Definition:qSinKLS|Definition:qSinKLS]]
+
[[Main_Page|Main Page]]
+
[[Definition:Wilson|Definition:Wilson]] >>
+
+drmf_eof +drmf_bof +'''Definition:Wilson''' +
+
<< [[Definition:qCosKLS|Definition:qCosKLS]]
+
[[Main_Page|Main Page]]
+
[[Definition:Racah|Definition:Racah]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\Wilson''' represents the Wilson polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\Wilson{n}''' produces {\displaystyle \Wilson{n}}
+:'''\Wilson{n}@{x}{a}{b}{c}{d}''' produces {\displaystyle \Wilson{n}@{x}{a}{b}{c}{d}}
+ +These are defined by +{\displaystyle +\frac{\Wilson{n}@{x^2}{a}{b}{c}{d}}{\pochhammer{a+b}{n}\pochhammer{a+c}{n}\pochhammer{a+d}{n}} +{}:=\HyperpFq{4}{3}@@{-n,n+a+b+c+d-1,a+ix,a-ix}{a+b,a+c,a+d}{1} +} + +== Symbols List == + +[http://dlmf.nist.gov/16.2#E1 {\displaystyle {{}_{p}F_{q}}}] : generalized hypergeometric function : [http://dlmf.nist.gov/16.2#E1 http://dlmf.nist.gov/16.2#E1]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii]
+[http://dlmf.nist.gov/18.25#T1.t1.r2 {\displaystyle W_{n}}] : Wilson polynomial : [http://dlmf.nist.gov/18.25#T1.t1.r2 http://dlmf.nist.gov/18.25#T1.t1.r2] +
+
<< [[Definition:qCosKLS|Definition:qCosKLS]]
+
[[Main_Page|Main Page]]
+
[[Definition:Racah|Definition:Racah]] >>
+
+drmf_eof +drmf_bof +'''Definition:Racah''' +
+
<< [[Definition:Wilson|Definition:Wilson]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsdualHahn|Definition:ctsdualHahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\Racah''' represents the Racah polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\Racah{n}''' produces {\displaystyle \Racah{n}}
+:'''\Racah{n}@{x}{\alpha}{\beta}{\gamma}{\delta}''' produces {\displaystyle \Racah{n}@{x}{\alpha}{\beta}{\gamma}{\delta}}
+ +These are defined by +{\displaystyle +\Racah{n}@{\lambda(x)}{\alpha}{\beta}{\gamma}{\delta} +{}:=\HyperpFq{4}{3}@@{-n,n+\alpha+\beta+1,-x,x+\gamma+\delta+1}{\alpha+1,\beta+\delta+1,\gamma+1}{1}, +} + +where {\displaystyle \lambda(x)=x(x+\gamma+\delta+1), } +and \alpha+1=-N or \beta+\delta+1=-N or \gamma+1=-N +with N a nonnegative integer. + +== Symbols List == + +[http://dlmf.nist.gov/16.2#E1 {\displaystyle {{}_{p}F_{q}}}] : generalized hypergeometric function : [http://dlmf.nist.gov/16.2#E1 http://dlmf.nist.gov/16.2#E1]
+[http://dlmf.nist.gov/18.25#T1.t1.r4 {\displaystyle R_{n}}] : Racah polynomial : [http://dlmf.nist.gov/18.25#T1.t1.r4 http://dlmf.nist.gov/18.25#T1.t1.r4] +
+
<< [[Definition:Wilson|Definition:Wilson]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsdualHahn|Definition:ctsdualHahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:ctsdualHahn''' +
+
<< [[Definition:Racah|Definition:Racah]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsHahn|Definition:ctsHahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\ctsdualHahn''' represents the Continuous Dual Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\ctsdualHahn{n}''' produces {\displaystyle \ctsdualHahn{n}}
+:'''\ctsdualHahn{n}@{x^2}{a}{b}{c}''' produces {\displaystyle \ctsdualHahn{n}@{x^2}{a}{b}{c}}
+:'''\ctsdualHahn{n}@@{x^2}{a}{b}{c}''' produces {\displaystyle \ctsdualHahn{n}@@{x^2}{a}{b}{c}}
+ +These are defined by +{\displaystyle +\frac{\ctsdualHahn{n}@{x^2}{a}{b}{c}}{\pochhammer{a+b}{n}\pochhammer{a+c}{n}}:=\HyperpFq{3}{2}@@{-n,a+ix,a-ix}{a+b,a+c}{1} +} + +== Symbols List == + +[http://dlmf.nist.gov/18.25#T1.t1.r3 {\displaystyle S_{n}}] : continuous dual Hahn polynomial : [http://dlmf.nist.gov/18.25#T1.t1.r3 http://dlmf.nist.gov/18.25#T1.t1.r3]
+[http://dlmf.nist.gov/16.2#E1 {\displaystyle {{}_{p}F_{q}}}] : generalized hypergeometric function : [http://dlmf.nist.gov/16.2#E1 http://dlmf.nist.gov/16.2#E1]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii] +
+
<< [[Definition:Racah|Definition:Racah]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsHahn|Definition:ctsHahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:ctsHahn''' +
+
<< [[Definition:ctsdualHahn|Definition:ctsdualHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:Hahn|Definition:Hahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\ctsHahn''' represents the Continuous Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\ctsHahn{n}''' produces {\displaystyle \ctsHahn{n}}
+:'''\ctsHahn{n}@{x}{a}{b}{c}{d}''' produces {\displaystyle \ctsHahn{n}@{x}{a}{b}{c}{d}}
+:'''\ctsHahn{n}@@{x}{a}{b}{c}{d}''' produces {\displaystyle \ctsHahn{n}@@{x}{a}{b}{c}{d}}
+ +These are defined by +{\displaystyle +\ctsHahn{n}@{x}{a}{b}{c}{d} +{}:=i^n\frac{\pochhammer{a+c}{n}\pochhammer{a+d}{n}}{n!}\,\HyperpFq{3}{2}@@{-n,n+a+b+c+d-1,a+ix}{a+c,a+d}{1} +} + +== Symbols List == + +[http://dlmf.nist.gov/18.19#P2.p1 {\displaystyle p_{n}}] : continuous Hahn polynomial : [http://dlmf.nist.gov/18.19#P2.p1 http://dlmf.nist.gov/18.19#P2.p1]
+[http://dlmf.nist.gov/16.2#E1 {\displaystyle {{}_{p}F_{q}}}] : generalized hypergeometric function : [http://dlmf.nist.gov/16.2#E1 http://dlmf.nist.gov/16.2#E1]
+[http://dlmf.nist.gov/5.2#iii {\displaystyle (a)_n}] : Pochhammer symbol : [http://dlmf.nist.gov/5.2#iii http://dlmf.nist.gov/5.2#iii] +
+
<< [[Definition:ctsdualHahn|Definition:ctsdualHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:Hahn|Definition:Hahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:Hahn''' +
+
<< [[Definition:ctsHahn|Definition:ctsHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:dualHahn|Definition:dualHahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\Hahn''' represents the Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\Hahn{n}''' produces {\displaystyle \Hahn{n}}
+:'''\Hahn{n}@{x}{\alpha}{\beta}{N}''' produces {\displaystyle \Hahn{n}@{x}{\alpha}{\beta}{N}}
+ +These are defined by +{\displaystyle +\Hahn{n}@{x}{\alpha}{\beta}{N}:=\HyperpFq{3}{2}@@{-n,n+\alpha+\beta+1,-x}{\alpha+1,-N}{1} +} + +== Symbols List == + +[http://dlmf.nist.gov/18.19#T1.t1.r3 {\displaystyle Q_{n}}] : Hahn polynomial : [http://dlmf.nist.gov/18.19#T1.t1.r3 http://dlmf.nist.gov/18.19#T1.t1.r3]
+[http://dlmf.nist.gov/16.2#E1 {\displaystyle {{}_{p}F_{q}}}] : generalized hypergeometric function : [http://dlmf.nist.gov/16.2#E1 http://dlmf.nist.gov/16.2#E1] +
+
<< [[Definition:ctsHahn|Definition:ctsHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:dualHahn|Definition:dualHahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:dualHahn''' +
+
<< [[Definition:Hahn|Definition:Hahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:qRacah|Definition:qRacah]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\dualHahn''' represents the Dual Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\dualHahn{n}''' produces {\displaystyle \dualHahn{n}}
+:'''\dualHahn{n}@{\lambda(x)}{\gamma}{\delta}{N}''' produces {\displaystyle \dualHahn{n}@{\lambda(x)}{\gamma}{\delta}{N}}
+:'''\dualHahn{n}@@{\lambda(x)}{\gamma}{\delta}{N}''' produces {\displaystyle \dualHahn{n}@@{\lambda(x)}{\gamma}{\delta}{N}}
+ +These are defined by +{\displaystyle +\dualHahn{n}@{\lambda(x)}{\gamma}{\delta}{N}:= +\HyperpFq{3}{2}@@{-n,-x,x+\gamma+\delta+1}{\gamma+1,-N}{1} +} + +== Symbols List == + +[http://dlmf.nist.gov/18.25#T1.t1.r5 {\displaystyle R_{n}}] : dual Hahn polynomial : [http://dlmf.nist.gov/18.25#T1.t1.r5 http://dlmf.nist.gov/18.25#T1.t1.r5]
+[http://dlmf.nist.gov/16.2#E1 {\displaystyle {{}_{p}F_{q}}}] : generalized hypergeometric function : [http://dlmf.nist.gov/16.2#E1 http://dlmf.nist.gov/16.2#E1] +
+
<< [[Definition:Hahn|Definition:Hahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:qRacah|Definition:qRacah]] >>
+
+drmf_eof +drmf_bof +'''Definition:qRacah''' +
+
<< [[Definition:dualHahn|Definition:dualHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:normctsdualqHahnptilde|Definition:normctsdualqHahnptilde]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qRacah''' represents the q-Racah polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\qRacah{n}''' produces {\displaystyle \qRacah{n}}
+:'''\qRacah{n}@{x}{\alpha}{\beta}{\gamma}{\delta}{q}''' produces {\displaystyle \qRacah{n}@{x}{\alpha}{\beta}{\gamma}{\delta}{q}}
+ +These are defined by +{\displaystyle +\qRacah{n}@{\mu(x)}{\alpha}{\beta}{\gamma}{\delta}{q} +{}:=\qHyperrphis{4}{3}@@{q^{-n},\alpha\beta q^{n+1},q^{-x},\gamma\delta q^{x+1}}{\alpha q,\beta\delta q,\gamm +} + +== Symbols List == + +[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://dlmf.nist.gov/18.28#E19 {\displaystyle R_{n}}] : {\displaystyle q}-Racah polynomial : [http://dlmf.nist.gov/18.28#E19 http://dlmf.nist.gov/18.28#E19] +
+
<< [[Definition:dualHahn|Definition:dualHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:normctsdualqHahnptilde|Definition:normctsdualqHahnptilde]] >>
+
+drmf_eof +drmf_bof +'''Definition:normctsdualqHahnptilde''' +
+
<< [[Definition:qRacah|Definition:qRacah]]
+
[[Main_Page|Main Page]]
+
[[Definition:normctsqHahnptilde|Definition:normctsqHahnptilde]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\normctsdualqHahnptilde''' represents the normalized continuous dual q-Hahn tilde polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\normctsdualqHahnptilde{n}''' produces {\displaystyle \normctsdualqHahnptilde{n}}
+:'''\normctsdualqHahnptilde{n}@{x}{a}{b}{c}{q}''' produces {\displaystyle \normctsdualqHahnptilde{n}@{x}{a}{b}{c}{q}}
+:'''\normctsdualqHahnptilde{n}@@{x}{a}{b}{c}{q}''' produces {\displaystyle \normctsdualqHahnptilde{n}@@{x}{a}{b}{c}{q}}
+ +These are defined by +{\displaystyle +{\tilde p}_n(x):=\normctsdualqHahnptilde{n}@{x}{a}{b}{c}{q}=\frac{a^n\ctsdualqHahn{n}@{x}{a}{b}{c}{q}}{\qPochhammer{ab,ac}{q}{n}} +} + +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:ctsdualqHahn {\displaystyle p_{n}}] : continuous dual {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsdualqHahn http://drmf.wmflabs.org/wiki/Definition:ctsdualqHahn]
+[http://drmf.wmflabs.org/wiki/Definition:normctsdualqHahnptilde {\displaystyle {\tilde p}_{n}}] : normalized continuous dual {\displaystyle q}-Hahn polynomial {\displaystyle {\tilde p}} : [http://drmf.wmflabs.org/wiki/Definition:normctsdualqHahnptilde http://drmf.wmflabs.org/wiki/Definition:normctsdualqHahnptilde]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:qRacah|Definition:qRacah]]
+
[[Main_Page|Main Page]]
+
[[Definition:normctsqHahnptilde|Definition:normctsqHahnptilde]] >>
+
+drmf_eof +drmf_bof +'''Definition:normctsqHahnptilde''' +
+
<< [[Definition:normctsdualqHahnptilde|Definition:normctsdualqHahnptilde]]
+
[[Main_Page|Main Page]]
+
[[Definition:qHahn|Definition:qHahn]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\normctsqHahnptilde''' represents the normalized continuous q-Hahn tilde polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\normctsqHahnptilde{n}''' produces {\displaystyle \normctsqHahnptilde{n}}
+:'''\normctsqHahnptilde{n}@{x}{a}{b}{c}{d}{q}''' produces {\displaystyle \normctsqHahnptilde{n}@{x}{a}{b}{c}{d}{q}}
+:'''\normctsqHahnptilde{n}@@{x}{a}{b}{c}{d}{q}''' produces {\displaystyle \normctsqHahnptilde{n}@@{x}{a}{b}{c}{d}{q}}
+ +These are defined by +{\displaystyle +{\tilde p}_n(x):=\normctsqHahnptilde{n}@{x}{a}{b}{c}{d}{q}=\frac{(a\expe^{i\phi})^n\ctsqHahn{n}@{x}{a}{b}{c}{d}{q}}{\qPochhammer{ab\expe^{2i\phi},ac,ad}{q}{n}} + +} + +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:ctsqHahn {\displaystyle p_{n}}] : continuous {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsqHahn http://drmf.wmflabs.org/wiki/Definition:ctsqHahn]
+[http://dlmf.nist.gov/4.2.E11 {\displaystyle \mathrm{e}}] : the base of the natural logarithm : [http://dlmf.nist.gov/4.2.E11 http://dlmf.nist.gov/4.2.E11]
+[http://drmf.wmflabs.org/wiki/Definition:normctsqHahnptilde {\displaystyle {\tilde p}_{n}}] : normalized continuous {\displaystyle q}-Hahn polynomial {\displaystyle {\tilde p}} : [http://drmf.wmflabs.org/wiki/Definition:normctsqHahnptilde http://drmf.wmflabs.org/wiki/Definition:normctsqHahnptilde]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:normctsdualqHahnptilde|Definition:normctsdualqHahnptilde]]
+
[[Main_Page|Main Page]]
+
[[Definition:qHahn|Definition:qHahn]] >>
+
+drmf_eof +drmf_bof +'''Definition:qHahn''' +
+
<< [[Definition:normctsqHahnptilde|Definition:normctsqHahnptilde]]
+
[[Main_Page|Main Page]]
+
[[Definition:AlSalamChihara|Definition:AlSalamChihara]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qHahn''' represents the q-Hahn polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\qHahn{n}@{q^{-x}}{\alpha}{\beta}{N}''' produces {\displaystyle \qHahn{n}@{q^{-x}}{\alpha}{\beta}{N}}
+:'''\qHahn{n}@@{q^{-x}}{\alpha}{\beta}{N}''' produces {\displaystyle \qHahn{n}@@{q^{-x}}{\alpha}{\beta}{N}}
+ +These are defined by +{\displaystyle +\qHahn{n}@{q^{-x}}{\alpha}{\beta}{N}{q}:=\qHyperrphis{3}{2}@@{q^{-n},\alpha\beta q^{n+1},q^{-x}}{\alpha q,q^{-N}}{q}{q} +} + +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:qHahn {\displaystyle Q_{n}}] : {\displaystyle q}-Hahn polynomial : [http://drmf.wmflabs.org/wiki/Definition:qHahn http://drmf.wmflabs.org/wiki/Definition:qHahn]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:normctsqHahnptilde|Definition:normctsqHahnptilde]]
+
[[Main_Page|Main Page]]
+
[[Definition:AlSalamChihara|Definition:AlSalamChihara]] >>
+
+drmf_eof +drmf_bof +'''Definition:AlSalamChihara''' +
+
<< [[Definition:qHahn|Definition:qHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:qinvAlSalamChihara|Definition:qinvAlSalamChihara]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\AlSalamChihara''' represents the Al-Salam Chihara polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\AlSalamChihara{n}''' produces {\displaystyle \AlSalamChihara{n}}
+:'''\AlSalamChihara{n}@{x}{a}{b}{q}''' produces {\displaystyle \AlSalamChihara{n}@{x}{a}{b}{q}}
+:'''\AlSalamChihara{n}@@{x}{a}{b}{q}''' produces {\displaystyle \AlSalamChihara{n}@@{x}{a}{b}{q}}
+ +These are defined by +{\displaystyle +\AlSalamChihara{n}@{x}{a}{b}{q}:=\frac{\qPochhammer{ab}{q}{n}}{a^n}\, +\qHyperrphis{3}{2}@@{q^{-n},a\expe^{i\theta},a\expe^{-i\theta}}{ab,0}{q}{q} +} + +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:AlSalamChihara {\displaystyle Q_{n}}] : Al-Salam-Chihara polynomial : [http://drmf.wmflabs.org/wiki/Definition:AlSalamChihara http://drmf.wmflabs.org/wiki/Definition:AlSalamChihara]
+[http://dlmf.nist.gov/4.2.E11 {\displaystyle \mathrm{e}}] : the base of the natural logarithm : [http://dlmf.nist.gov/4.2.E11 http://dlmf.nist.gov/4.2.E11]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:qHahn|Definition:qHahn]]
+
[[Main_Page|Main Page]]
+
[[Definition:qinvAlSalamChihara|Definition:qinvAlSalamChihara]] >>
+
+drmf_eof +drmf_bof +'''Definition:qinvAlSalamChihara''' +
+
<< [[Definition:AlSalamChihara|Definition:AlSalamChihara]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqinvAlSalamChihara|Definition:monicqinvAlSalamChihara]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qinvAlSalamChihara''' represents the q-inverse of the Al-Salam Chihara polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\qinvAlSalamChihara{n}''' produces {\displaystyle \qinvAlSalamChihara{n}}
+:'''\qinvAlSalamChihara{n}@{x}{a}{b}{q^{-1}}''' produces {\displaystyle \qinvAlSalamChihara{n}@{x}{a}{b}{q^{-1}}}
+ +These are defined by +{\displaystyle +\qinvAlSalamChihara{n}@{\thalf(aq^{-x}+a^{-1}q^x)}{a}{b }{q^{-1}}:= +(-1)^n b^n q^{-\half n(n-1)}\qPochhammer{(ab)^{-1}}{q}{n} +\qHyperrphis{3}{1}@@{q^{-n},q^{-x},a^{-2}q^x}{(ab)^{-1}}{q}{q^nab^{-1}} +} + +== Symbols List == + +[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://dlmf.nist.gov/23.1 {\displaystyle Q_{n}}] : {\displaystyle q}-inverse Al-Salam-Chihara polynomial : [http://dlmf.nist.gov/23.1 http://dlmf.nist.gov/23.1]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:AlSalamChihara|Definition:AlSalamChihara]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicqinvAlSalamChihara|Definition:monicqinvAlSalamChihara]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicqinvAlSalamChihara''' +
+
<< [[Definition:qinvAlSalamChihara|Definition:qinvAlSalamChihara]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicAffqKrawtchouk|Definition:monicAffqKrawtchouk]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicqinvAlSalamChihara''' represents the monic q-inverse of the Al-Salam Chihara polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicqinvAlSalamChihara{n}''' produces {\displaystyle \monicqinvAlSalamChihara{n}}
+:'''\monicqinvAlSalamChihara{n}@{x}{a}{b}{q^{-1}}''' produces {\displaystyle \monicqinvAlSalamChihara{n}@{x}{a}{b}{q^{-1}}}
+ +These are defined by +{\displaystyle +x\monicqinvAlSalamChihara{n}@@{x}{a}{b}{q^{-1}=:\monicqinvAlSalamChihara{n+1}@@{x}{a}{b}{q^{-1}+\thalf(a+b)q^{-n} \monicqinvAlSalamChihara{n}@@{x}{a}{b}{q^{-1}+ +\tfrac14(q^{-n}-1)(abq^{-n+1}-1)\monicqinvAlSalamChihara{n-1}@@{x}{a}{b}{q^{-1} +} + +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:monicqinvAlSalamChihara {\displaystyle {\widehat Q}_{n}}] : monic {\displaystyle q}-inverse Al-Salam-Chihara polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicqinvAlSalamChihara http://drmf.wmflabs.org/wiki/Definition:monicqinvAlSalamChihara] +
+
<< [[Definition:qinvAlSalamChihara|Definition:qinvAlSalamChihara]]
+
[[Main_Page|Main Page]]
+
[[Definition:monicAffqKrawtchouk|Definition:monicAffqKrawtchouk]] >>
+
+drmf_eof +drmf_bof +'''Definition:monicAffqKrawtchouk''' +
+
<< [[Definition:monicqinvAlSalamChihara|Definition:monicqinvAlSalamChihara]]
+
[[Main_Page|Main Page]]
+
[[Definition:qMeixnerPollaczek|Definition:qMeixnerPollaczek]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\monicAffqKrawtchouk''' represents the Affine q Krawtchouk polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\monicAffqKrawtchouk{n}''' produces {\displaystyle \monicAffqKrawtchouk{n}}
+:'''\monicAffqKrawtchouk{n}@{q^{-x}}{p}{N}{q}''' produces {\displaystyle \monicAffqKrawtchouk{n}@{q^{-x}}{p}{N}{q}}
+:'''\monicAffqKrawtchouk{n}@@{q^{-x}}{p}{N}{q}''' produces {\displaystyle \monicAffqKrawtchouk{n}@@{q^{-x}}{p}{N}{q}}
+ +These are defined by + +{\displaystyle +\AffqKrawtchouk{n}@{q^{-x}}{p}{N}{q}=:\frac{1}{\qPochhammer{pq,q^{-N}}{q}{n}}\monicAffqKrawtchouk{n}@{q^{-x}}{p}{N}{q}. +} + +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:AffqKrawtchouk {\displaystyle K^{\mathrm{Aff}}_{n}}] : affine {\displaystyle q}-Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:AffqKrawtchouk http://drmf.wmflabs.org/wiki/Definition:AffqKrawtchouk]
+[http://drmf.wmflabs.org/wiki/Definition:monicAffqKrawtchouk {\displaystyle \widehat{K}^{\mathrm{Aff}}_{n}}] : monic affine {\displaystyle q}-Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:monicAffqKrawtchouk http://drmf.wmflabs.org/wiki/Definition:monicAffqKrawtchouk]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicqinvAlSalamChihara|Definition:monicqinvAlSalamChihara]]
+
[[Main_Page|Main Page]]
+
[[Definition:qMeixnerPollaczek|Definition:qMeixnerPollaczek]] >>
+
+drmf_eof +drmf_bof +'''Definition:qMeixnerPollaczek''' +
+
<< [[Definition:monicAffqKrawtchouk|Definition:monicAffqKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:qtmqKrawtchouk|Definition:qtmqKrawtchouk]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qMeixnerPollaczek''' represents the q-Meixner Pollaczek polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\qMeixnerPollaczek{n}''' produces {\displaystyle \qMeixnerPollaczek{n}}
+:'''\qMeixnerPollaczek{n}@{x}{a}{q}''' produces {\displaystyle \qMeixnerPollaczek{n}@{x}{a}{q}}
+ +These are defined by +{\displaystyle +\qMeixnerPollaczek{n}@{x}{a}{q}:=a^{-n}\expe^{-in\phi}\frac{\qPochhammer{a^2}{q}{n}}{\qPochhammer{q}{q}{n}}\, +\qHyperrphis{3}{2}@@{q^{-n},a\expe^{i(\theta+2\phi)},a\expe^{-i\theta}}{a^2,0}{q}{q} +} + +== Symbols List == + +[http://dlmf.nist.gov/4.2.E11 {\displaystyle \mathrm{e}}] : the base of the natural logarithm : [http://dlmf.nist.gov/4.2.E11 http://dlmf.nist.gov/4.2.E11]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://drmf.wmflabs.org/wiki/Definition:qMeixnerPollaczek {\displaystyle P_{n}}] : {\displaystyle q}-Meixner-Pollaczek polynomial : [http://drmf.wmflabs.org/wiki/Definition:qMeixnerPollaczek http://drmf.wmflabs.org/wiki/Definition:qMeixnerPollaczek]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:monicAffqKrawtchouk|Definition:monicAffqKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:qtmqKrawtchouk|Definition:qtmqKrawtchouk]] >>
+
+drmf_eof +drmf_bof +'''Definition:qtmqKrawtchouk''' +
+
<< [[Definition:qMeixnerPollaczek|Definition:qMeixnerPollaczek]]
+
[[Main_Page|Main Page]]
+
[[Definition:qLaguerre|Definition:qLaguerre]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qtmqKrawtchouk''' represents the quantum q-Krawtchouk polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\qtmqKrawtchouk{n}''' produces {\displaystyle \qtmqKrawtchouk{n}}
+:'''\qtmqKrawtchouk{n}@{q^{-x}}{p}{N}{q}''' produces {\displaystyle \qtmqKrawtchouk{n}@{q^{-x}}{p}{N}{q}}
+:'''\qtmqKrawtchouk{n}@@{q^{-x}}{p}{N}{q}''' produces {\displaystyle \qtmqKrawtchouk{n}@@{q^{-x}}{p}{N}{q}}
+ +These are defined by +{\displaystyle +\qtmqKrawtchouk{n}@{q^{-x}}{p}{N}{q}:= +\qHyperrphis{2}{1}@@{q^{-n},q^{-x}}{q^{-N}}{q}{pq^{n+1}} +} + +== Symbols List == + +[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://drmf.wmflabs.org/wiki/Definition:qtmqKrawtchouk {\displaystyle K^{\mathrm{qtm}}_{n}}] : quantum {\displaystyle q}-Krawtchouk polynomial : [http://drmf.wmflabs.org/wiki/Definition:qtmqKrawtchouk http://drmf.wmflabs.org/wiki/Definition:qtmqKrawtchouk] +
+
<< [[Definition:qMeixnerPollaczek|Definition:qMeixnerPollaczek]]
+
[[Main_Page|Main Page]]
+
[[Definition:qLaguerre|Definition:qLaguerre]] >>
+
+drmf_eof +drmf_bof +'''Definition:qLaguerre''' +
+
<< [[Definition:qtmqKrawtchouk|Definition:qtmqKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsqHermite|Definition:ctsqHermite]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\qLaguerre''' represents the q-Laguerre polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\qLaguerre{n}''' produces {\displaystyle \qLaguerre{n}}
+:'''\qLaguerre[\alpha]{n}''' produces {\displaystyle \qLaguerre[\alpha]{n}}
+:'''\qLaguerre{n}@{x}{q}''' produces {\displaystyle \qLaguerre{n}@{x}{q}}
+:'''\qLaguerre[\alpha]{n}@{x}{q}''' produces {\displaystyle \qLaguerre[\alpha]{n}@{x}{q}}
+:'''\qLaguerre{n}@@{x}{q}''' produces {\displaystyle \qLaguerre{n}@@{x}{q}}
+:'''\qLaguerre[\alpha]{n}@@{x}{q}''' produces {\displaystyle \qLaguerre[\alpha]{n}@@{x}{q}}
+ +These are defined by +{\displaystyle +\qLaguerre[\alpha]{n}@{x}{q}:=\frac{\qPochhammer{q^{\alpha+1}}{q}{n}}{\qPochhammer{q}{q}{n}}\, +\qHyperrphis{1}{1}@@{q^{-n}}{q^{\alpha+1}}{q}{-q^{n+\alpha+1}x} +} + +== Symbols List == + +[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://drmf.wmflabs.org/wiki/Definition:qLaguerre {\displaystyle L_n^{(\alpha)}}] : {\displaystyle q}-Laguerre polynomial : [http://drmf.wmflabs.org/wiki/Definition:qLaguerre http://drmf.wmflabs.org/wiki/Definition:qLaguerre]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1] +
+
<< [[Definition:qtmqKrawtchouk|Definition:qtmqKrawtchouk]]
+
[[Main_Page|Main Page]]
+
[[Definition:ctsqHermite|Definition:ctsqHermite]] >>
+
+drmf_eof +drmf_bof +'''Definition:ctsqHermite''' +
+
<< [[Definition:qLaguerre|Definition:qLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:StieltjesWigert|Definition:StieltjesWigert]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\ctsqHermite''' represents the continuous q-Hermite polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\ctsqHermite{n}''' produces {\displaystyle \ctsqHermite{n}}
+:'''\ctsqHermite{n}@{x}{q}''' produces {\displaystyle \ctsqHermite{n}@{x}{q}}
+:'''\ctsqHermite{n}@@{x}{q}''' produces {\displaystyle \ctsqHermite{n}@@{x}{q}}
+ +These are defined by +{\displaystyle +\ctsqHermite{n}@{x}{q}:=\expe^{in\theta}\,\qHyperrphis{2}{0}@@{q^{-n},0}{-}{q}{q^n\expe^{-2i\theta}} +} + +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:ctsqHermite {\displaystyle H_{n}}] : continuous {\displaystyle q}-Hermite polynomial : [http://drmf.wmflabs.org/wiki/Definition:ctsqHermite http://drmf.wmflabs.org/wiki/Definition:ctsqHermite]
+[http://dlmf.nist.gov/4.2.E11 {\displaystyle \mathrm{e}}] : the base of the natural logarithm : [http://dlmf.nist.gov/4.2.E11 http://dlmf.nist.gov/4.2.E11]
+[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1] +
+
<< [[Definition:qLaguerre|Definition:qLaguerre]]
+
[[Main_Page|Main Page]]
+
[[Definition:StieltjesWigert|Definition:StieltjesWigert]] >>
+
+drmf_eof +drmf_bof +'''Definition:StieltjesWigert''' +
+
<< [[Definition:ctsqHermite|Definition:ctsqHermite]]
+
[[Main_Page|Main Page]]
+
[[Definition:discrqHermiteI|Definition:discrqHermiteI]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\StieltjesWigert''' represents the Stieltjes Wigert polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\StieltjesWigert{n}''' produces {\displaystyle \StieltjesWigert{n}}
+:'''\StieltjesWigert{n}@{x}{q}''' produces {\displaystyle \StieltjesWigert{n}@{x}{q}}
+:'''\StieltjesWigert{n}@@{x}{q}''' produces {\displaystyle \StieltjesWigert{n}@@{x}{q}}
+ +These are defined by +{\displaystyle +\StieltjesWigert{n}@{x}{q}:=\frac{1}{\qPochhammer{q}{q}{n}}\,\qHyperrphis{1}{1}@@{q^{-n}}{0}{q}{-q^{n+1}x} +} + +== Symbols List == + +[http://dlmf.nist.gov/17.4#E1 {\displaystyle {{}_{r}\phi_{s}}}] : basic hypergeometric (or {\displaystyle q}-hypergeometric) function : [http://dlmf.nist.gov/17.4#E1 http://dlmf.nist.gov/17.4#E1]
+[http://dlmf.nist.gov/5.18#i {\displaystyle (a;q)_n}] : {\displaystyle q}-Pochhammer symbol : [http://dlmf.nist.gov/5.18#i http://dlmf.nist.gov/5.18#i] [http://dlmf.nist.gov/17.2#SS1.p1 http://dlmf.nist.gov/17.2#SS1.p1]
+[http://drmf.wmflabs.org/wiki/Definition:StieltjesWigert {\displaystyle S_{n}}] : Stieltjes-Wigert polynomial : [http://drmf.wmflabs.org/wiki/Definition:StieltjesWigert http://drmf.wmflabs.org/wiki/Definition:StieltjesWigert] +
+
<< [[Definition:ctsqHermite|Definition:ctsqHermite]]
+
[[Main_Page|Main Page]]
+
[[Definition:discrqHermiteI|Definition:discrqHermiteI]] >>
+
+drmf_eof +drmf_bof +'''Definition:discrqHermiteI''' +
+
<< [[Definition:StieltjesWigert|Definition:StieltjesWigert]]
+
[[Main_Page|Main Page]]
+
[[Definition:discrqHermiteII|Definition:discrqHermiteII]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\discrqHermiteI''' represents the first discrete q Hermite polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\discrqHermiteI{n}''' produces {\displaystyle \discrqHermiteI{n}}
+:'''\discrqHermiteI{n}@{x}{q}''' produces {\displaystyle \discrqHermiteI{n}@{x}{q}}
+:'''\discrqHermiteI{n}@@{x}{q}''' produces {\displaystyle \discrqHermiteI{n}@@{x}{q}}
+ +These are defined by +{\displaystyle +\discrqHermiteI{n}@{x}{q}:=\AlSalamCarlitzI{-1}{n}@{x}{q} +} + +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzI {\displaystyle U^{(n)}_{\alpha}}] : Al-Salam-Carlitz I polynomial : [http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzI http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzI]
+[http://drmf.wmflabs.org/wiki/Definition:discrqHermiteI {\displaystyle h_{n}}] : discrete {\displaystyle q}-Hermite I polynomial : [http://drmf.wmflabs.org/wiki/Definition:discrqHermiteI http://drmf.wmflabs.org/wiki/Definition:discrqHermiteI] +
+
<< [[Definition:StieltjesWigert|Definition:StieltjesWigert]]
+
[[Main_Page|Main Page]]
+
[[Definition:discrqHermiteII|Definition:discrqHermiteII]] >>
+
+drmf_eof +drmf_bof +'''Definition:discrqHermiteII''' +
+
<< [[Definition:discrqHermiteI|Definition:discrqHermiteI]]
+
[[Main_Page|Main Page]]
+
[[Definition:StieltjesConstants|Definition:StieltjesConstants]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\discrqHermiteII''' represents the second discrete q Hermite polynomial. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\discrqHermiteII{n}''' produces {\displaystyle \discrqHermiteII{n}}
+:'''\discrqHermiteII{n}@{x}{q}''' produces {\displaystyle \discrqHermiteII{n}@{x}{q}}
+:'''\discrqHermiteII{n}@@{x}{q}''' produces {\displaystyle \discrqHermiteII{n}@@{x}{q}}
+ +These are defined by +{\displaystyle +\discrqHermiteII{n}@{x}{q}:=i^{-n}\AlSalamCarlitzII{-1}{n}@{ix}{q} +} + +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzII {\displaystyle V^{(n)}_{\alpha}}] : Al-Salam-Carlitz II polynomial : [http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzII http://drmf.wmflabs.org/wiki/Definition:AlSalamCarlitzII]
+[http://drmf.wmflabs.org/wiki/Definition:discrqHermiteII {\displaystyle \tilde{h}_{n}}] : discrete {\displaystyle q}-Hermite II polynomial : [http://drmf.wmflabs.org/wiki/Definition:discrqHermiteII http://drmf.wmflabs.org/wiki/Definition:discrqHermiteII] +
+
<< [[Definition:discrqHermiteI|Definition:discrqHermiteI]]
+
[[Main_Page|Main Page]]
+
[[Definition:StieltjesConstants|Definition:StieltjesConstants]] >>
+
+drmf_eof +drmf_bof +'''Definition:StieltjesConstants''' +
+
<< [[Definition:discrqHermiteII|Definition:discrqHermiteII]]
+
[[Main_Page|Main Page]]
+
[[Definition:PolylogarithmS|Definition:PolylogarithmS]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\StieltjesConstants''' represents the Stiltjes constants +\StieltjesConstants{n}. + +This macro is in the category of constants. + +In math mode, this macro can be called in the following way: + +:'''\StieltjesConstants{n}''' produces {\displaystyle \StieltjesConstants{n}}
+ +These are defined by +{\displaystyle \StieltjesConstants{n} := \lim_{m \to \infty} \left( \sum_{k=1}^m +\frac{(\ln@@{k})^n}{k} - \frac{(\ln@@{m})^{n+1}}{n+1} \right). +} + +The Stieltjes constant \StieltjesConstants{0}=0.57721\;56649\;01532\;86... equals \EulerConstant the Euler-Mascheroni constant.
+ +== Bibliography == +Equation (2), Section 2.21 of [[Bibliography#FI|'''FI''']]. + +== URL links == +[http://en.wikipedia.org/wiki/Stieltjes_constants http://en.wikipedia.org/wiki/Stieltjes_constants] + +== Symbols List == + +[http://dlmf.nist.gov/5.2#E3 {\displaystyle \gamma}] : Euler's (Euler-Mascheroni) constant : [http://dlmf.nist.gov/5.2#E3 http://dlmf.nist.gov/5.2#E3]
+[http://dlmf.nist.gov/4.2#E2 {\displaystyle \mathrm{ln}}] : principal branch of logarithm function : [http://dlmf.nist.gov/4.2#E2 http://dlmf.nist.gov/4.2#E2]
+[http://drmf.wmflabs.org/wiki/Definition:StieltjesConstants {\displaystyle \gamma_{n}}] : Stieltjes constants : [http://drmf.wmflabs.org/wiki/Definition:StieltjesConstants http://drmf.wmflabs.org/wiki/Definition:StieltjesConstants]
+[http://drmf.wmflabs.org/wiki/Definition:sum {\displaystyle \Sigma}] : sum : [http://drmf.wmflabs.org/wiki/Definition:sum http://drmf.wmflabs.org/wiki/Definition:sum] +
+
<< [[Definition:discrqHermiteII|Definition:discrqHermiteII]]
+
[[Main_Page|Main Page]]
+
[[Definition:PolylogarithmS|Definition:PolylogarithmS]] >>
+
+drmf_eof +drmf_bof +'''Definition:PolylogarithmS''' +
+
<< [[Definition:StieltjesConstants|Definition:StieltjesConstants]]
+
[[Main_Page|Main Page]]
+
[[Definition:HarmonicNumber|Definition:HarmonicNumber]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\PolylogarithmS''' represents the PolylogarithmS. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\PolylogarithmS{n}{p}''' produces {\displaystyle \PolylogarithmS{n}{p}}
+:'''\PolylogarithmS{n}{p}@{z}''' produces {\displaystyle \PolylogarithmS{n}{p}@{z}}
+ +These are defined by + + +{\displaystyle +\PolylogarithmS{n}{p}@{z}:=\frac{(-1)^{n+p-1}}{(n-1)!p!}\int_0^1 \frac{(\ln{t})^{n-1}[\ln(1-zt)]^p}{t}\,dt +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/1.4#iv {\displaystyle \int}] : integral : [http://dlmf.nist.gov/1.4#iv http://dlmf.nist.gov/1.4#iv]
+[http://dlmf.nist.gov/4.2#E2 {\displaystyle \mathrm{ln}}] : principal branch of logarithm function : [http://dlmf.nist.gov/4.2#E2 http://dlmf.nist.gov/4.2#E2]
+[http://drmf.wmflabs.org/wiki/Definition:PolylogarithmS {\displaystyle S_{n}] : Nielsen generalized polylogarithm function : [http://drmf.wmflabs.org/wiki/Definition:PolylogarithmS http://drmf.wmflabs.org/wiki/Definition:PolylogarithmS] +
+
<< [[Definition:StieltjesConstants|Definition:StieltjesConstants]]
+
[[Main_Page|Main Page]]
+
[[Definition:HarmonicNumber|Definition:HarmonicNumber]] >>
+
+drmf_eof +drmf_bof +'''Definition:HarmonicNumber''' +
+
<< [[Definition:PolylogarithmS|Definition:PolylogarithmS]]
+
[[Main_Page|Main Page]]
+
[[Definition:LucasL|Definition:LucasL]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\HarmonicNumber''' represents the HarmonicNumber. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\HarmonicNumber{n}''' produces {\displaystyle \HarmonicNumber{n}}
+:'''\HarmonicNumber[r]{n}''' produces {\displaystyle \HarmonicNumber[r]{n}}
+:'''\HarmonicNumber{n}''' produces {\displaystyle \HarmonicNumber{n}}
+ +These are defined by + + +{\displaystyle +\HarmonicNumber[r]{n}:=\sum_{k=1}^n \frac{1}{k^r} +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:HarmonicNumber {\displaystyle H_{n}^{r}}] : Harmonic number : [http://drmf.wmflabs.org/wiki/Definition:HarmonicNumber http://drmf.wmflabs.org/wiki/Definition:HarmonicNumber]
+[http://drmf.wmflabs.org/wiki/Definition:sum {\displaystyle \Sigma}] : sum : [http://drmf.wmflabs.org/wiki/Definition:sum http://drmf.wmflabs.org/wiki/Definition:sum] +
+
<< [[Definition:PolylogarithmS|Definition:PolylogarithmS]]
+
[[Main_Page|Main Page]]
+
[[Definition:LucasL|Definition:LucasL]] >>
+
+drmf_eof +drmf_bof +'''Definition:LucasL''' +
+
<< [[Definition:HarmonicNumber|Definition:HarmonicNumber]]
+
[[Main_Page|Main Page]]
+
[[Definition:HurwitzLerchPhi|Definition:HurwitzLerchPhi]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\LucasL''' represents the LucasL. + +This macro is in the category of polynomials. + +In math mode, this macro can be called in the following ways: + +:'''\LucasL{n}''' produces {\displaystyle \LucasL{n}}
+:'''\LucasL{n}@{x}''' produces {\displaystyle \LucasL{n}@{x}}
+ +These are defined by + + +{\displaystyle +\LucasL{n}@{x}:=2^{-n}\left[\left(x-\sqrt{x^2+4}\right)^n+\left(x+\sqrt{x^2+4}\right)^n\right] +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:LucasL {\displaystyle L_{n}}] : Lucas polynomial : [http://drmf.wmflabs.org/wiki/Definition:LucasL http://drmf.wmflabs.org/wiki/Definition:LucasL] +
+
<< [[Definition:HarmonicNumber|Definition:HarmonicNumber]]
+
[[Main_Page|Main Page]]
+
[[Definition:HurwitzLerchPhi|Definition:HurwitzLerchPhi]] >>
+
+drmf_eof +drmf_bof +'''Definition:HurwitzLerchPhi''' +
+
<< [[Definition:LucasL|Definition:LucasL]]
+
[[Main_Page|Main Page]]
+
[[Definition:GoldenRatio|Definition:GoldenRatio]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\HurwitzLerchPhi''' represents the HurwitzLerchPhi. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\HurwitzLerchPhi''' produces {\displaystyle \HurwitzLerchPhi}
+:'''\HurwitzLerchPhi@{z}{s}{a}''' produces {\displaystyle \HurwitzLerchPhi@{z}{s}{a}}
+ +These are defined by + + +{\displaystyle +\HurwitzLerchPhi@{z}{s}{a}:=\sum_{k=0}^\infty \frac{z^k}{(a+k)^{s}} +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:HurwitzLerchPhi {\displaystyle \Phi}] : Hurwitz-Lerch's transcendent : [http://drmf.wmflabs.org/wiki/Definition:HurwitzLerchPhi http://drmf.wmflabs.org/wiki/Definition:HurwitzLerchPhi]
+[http://drmf.wmflabs.org/wiki/Definition:sum {\displaystyle \Sigma}] : sum : [http://drmf.wmflabs.org/wiki/Definition:sum http://drmf.wmflabs.org/wiki/Definition:sum] +
+
<< [[Definition:LucasL|Definition:LucasL]]
+
[[Main_Page|Main Page]]
+
[[Definition:GoldenRatio|Definition:GoldenRatio]] >>
+
+drmf_eof +drmf_bof +'''Definition:GoldenRatio''' +
+
<< [[Definition:HurwitzLerchPhi|Definition:HurwitzLerchPhi]]
+
[[Main_Page|Main Page]]
+
[[Definition:WhitPsi|Definition:WhitPsi]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\GoldenRatio''' represents the GoldenRatio. + +This macro is in the category of constants. + +In math mode, this macro can be called in the following way: + +:'''\GoldenRatio''' produces {\displaystyle \GoldenRatio}
+ +These are defined by + + +{\displaystyle +\GoldenRatio:=\frac{1}{2}\left(1+\sqrt{5}\right) +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:GoldenRatio {\displaystyle \phi}] : The golden ratio : [http://drmf.wmflabs.org/wiki/Definition:GoldenRatio http://drmf.wmflabs.org/wiki/Definition:GoldenRatio] +
+
<< [[Definition:HurwitzLerchPhi|Definition:HurwitzLerchPhi]]
+
[[Main_Page|Main Page]]
+
[[Definition:WhitPsi|Definition:WhitPsi]] >>
+
+drmf_eof +drmf_bof +'''Definition:WhitPsi''' +
+
<< [[Definition:GoldenRatio|Definition:GoldenRatio]]
+
[[Main_Page|Main Page]]
+
[[Definition:GompertzConstant|Definition:GompertzConstant]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\WhitPsi''' represents the WhitPsi. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\WhitPsi{\alpha}{\beta}''' produces {\displaystyle \WhitPsi{\alpha}{\beta}}
+:'''\WhitPsi{\alpha}{\beta}@{z}''' produces {\displaystyle \WhitPsi{\alpha}{\beta}@{z}}
+ +These are defined by + + +{\displaystyle +\WhitPsi{\alpha}{\beta}@{z}:=z^{\frac{\alpha+\beta}{2}-1}e^\frac{z}{2}\WhitW{-\frac{\alpha+\beta}{2}}{\frac{\beta-\alpha}{2}}@{z} +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:WhitPsi {\displaystyle \Psi_{\alpha,\beta}}] : Whittaker function {\displaystyle \Psi_{\alpha;\beta}} : [http://drmf.wmflabs.org/wiki/Definition:WhitPsi http://drmf.wmflabs.org/wiki/Definition:WhitPsi]
+[http://dlmf.nist.gov/13.14#E3 {\displaystyle W_{\kappa,\mu}}] : Whittaker function {\displaystyle W_{\kappa;\mu}} : [http://dlmf.nist.gov/13.14#E3 http://dlmf.nist.gov/13.14#E3] +
+
<< [[Definition:GoldenRatio|Definition:GoldenRatio]]
+
[[Main_Page|Main Page]]
+
[[Definition:GompertzConstant|Definition:GompertzConstant]] >>
+
+drmf_eof +drmf_bof +'''Definition:GompertzConstant''' +
+
<< [[Definition:WhitPsi|Definition:WhitPsi]]
+
[[Main_Page|Main Page]]
+
[[Definition:rabbitConstant|Definition:rabbitConstant]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\GompertzConstant''' represents the GompertzConstant. + +This macro is in the category of constants. + +In math mode, this macro can be called in the following way: + +:'''\GompertzConstant''' produces {\displaystyle \GompertzConstant}
+ +These are defined by + + +{\displaystyle +\GompertzConstant:=\int_0^\infty \frac{e^{-u}}{1+u}\,du +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:GompertzConstant {\displaystyle G}] : Gompertz's constant : [http://drmf.wmflabs.org/wiki/Definition:GompertzConstant http://drmf.wmflabs.org/wiki/Definition:GompertzConstant]
+[http://dlmf.nist.gov/1.4#iv {\displaystyle \int}] : integral : [http://dlmf.nist.gov/1.4#iv http://dlmf.nist.gov/1.4#iv] +
+
<< [[Definition:WhitPsi|Definition:WhitPsi]]
+
[[Main_Page|Main Page]]
+
[[Definition:rabbitConstant|Definition:rabbitConstant]] >>
+
+drmf_eof +drmf_bof +'''Definition:rabbitConstant''' +
+
<< [[Definition:GompertzConstant|Definition:GompertzConstant]]
+
[[Main_Page|Main Page]]
+
[[Definition:FibonacciNumber|Definition:FibonacciNumber]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\rabbitConstant''' represents the rabbitConstant. + +This macro is in the category of constants. + +In math mode, this macro can be called in the following way: + +:'''\rabbitConstant''' produces {\displaystyle \rabbitConstant}
+ +These are defined by + + +{\displaystyle +\rabbitConstant:=\sum_{i=1}^\infty 2^{-\floor{i\GoldenRatio}} +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/front/introduction#Sx4.p1.t1.r16 {\displaystyle \left\lfloor a\right\rfloor}] : floor : [http://dlmf.nist.gov/front/introduction#Sx4.p1.t1.r16 http://dlmf.nist.gov/front/introduction#Sx4.p1.t1.r16]
+[http://drmf.wmflabs.org/wiki/Definition:GoldenRatio {\displaystyle \phi}] : The golden ratio : [http://drmf.wmflabs.org/wiki/Definition:GoldenRatio http://drmf.wmflabs.org/wiki/Definition:GoldenRatio]
+[http://drmf.wmflabs.org/wiki/Definition:RabbitConstant {\displaystyle \rho}] : rabbit constant : [http://drmf.wmflabs.org/wiki/Definition:RabbitConstant http://drmf.wmflabs.org/wiki/Definition:RabbitConstant]
+[http://drmf.wmflabs.org/wiki/Definition:sum {\displaystyle \Sigma}] : sum : [http://drmf.wmflabs.org/wiki/Definition:sum http://drmf.wmflabs.org/wiki/Definition:sum] +
+
<< [[Definition:GompertzConstant|Definition:GompertzConstant]]
+
[[Main_Page|Main Page]]
+
[[Definition:FibonacciNumber|Definition:FibonacciNumber]] >>
+
+drmf_eof +drmf_bof +'''Definition:FibonacciNumber''' +
+
<< [[Definition:rabbitConstant|Definition:rabbitConstant]]
+
[[Main_Page|Main Page]]
+
[[Definition:Fibonacci|Definition:Fibonacci]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\FibonacciNumber''' represents the FibonacciNumber. + +This macro is in the category of integer valued functions. + +In math mode, this macro can be called in the following way: + +:'''\FibonacciNumber{n}''' produces {\displaystyle \FibonacciNumber{n}}
+ +These are defined by + + +{\displaystyle +\FibonacciNumber{n}:=\frac{\left(1+\sqrt{5}\right)^n-\left(1-\sqrt{5}\right)^n}{2^n\sqrt{5}} +} +
+ +== Symbols List == + +[http://dlmf.nist.gov/26.11#E5 {\displaystyle F_{n}}] : Fibonacci number : [http://dlmf.nist.gov/26.11#E5 http://dlmf.nist.gov/26.11#E5] +
+
<< [[Definition:rabbitConstant|Definition:rabbitConstant]]
+
[[Main_Page|Main Page]]
+
[[Definition:Fibonacci|Definition:Fibonacci]] >>
+
+drmf_eof +drmf_bof +'''Definition:Fibonacci''' +
+
<< [[Definition:FibonacciNumber|Definition:FibonacciNumber]]
+
[[Main_Page|Main Page]]
+
[[Definition:RegGammaP|Definition:RegGammaP]] >>
+
+ +The LaTeX DLMF and DRMF macro '''\Fibonacci''' represents the Fibonacci. + +This macro is in the category of integer valued functions. + +In math mode, this macro can be called in the following way: + +:'''\Fibonacci{n}''' produces {\displaystyle \Fibonacci{n}}
+ +These are defined by + + +{\displaystyle +\Fibonacci{n}@{x}:=\frac{\left(x+\sqrt{x^2+4}\right)^n-\left(x-\sqrt{x^2+4}\right)^n}{2^n\sqrt{x^2+4}} +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:Fibonacci {\displaystyle F_{n}{(x)}}] : Fibonacci polynomial : [http://drmf.wmflabs.org/wiki/Definition:Fibonacci http://drmf.wmflabs.org/wiki/Definition:Fibonacci] +
+
<< [[Definition:FibonacciNumber|Definition:FibonacciNumber]]
+
[[Main_Page|Main Page]]
+
[[Definition:RegGammaP|Definition:RegGammaP]] >>
+
+drmf_eof +drmf_bof +'''Definition:RegGammaP''' +
+
<< [[Definition:Fibonacci|Definition:Fibonacci]]
+
[[Main_Page|Main Page]]
+
[[Definition:RegGammaQ|Definition:RegGammaQ]] >>
+
+The LaTeX DLMF and DRMF macro '''\RegGammaP''' represents the RegGammaP. + +This macro is in the category of integer valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\RegGammaP''' produces {\displaystyle \RegGammaP}
+:'''\RegGammaP@{x}{\alpha}{\theta}''' produces {\displaystyle \RegGammaP@{x}{\alpha}{\theta}}
+ +These are defined by + + + +{\displaystyle + +\RegGammaP@{x}{\alpha}{\theta}:=\frac{\incgamma@{\alpha}{\frac{x}{\theta}}}{\EulerGamma@{\alpha}} + +} + +
+ +== Symbols List == + +[http://dlmf.nist.gov/5.2#E1 {\displaystyle \Gamma}] : Euler's gamma function : [http://dlmf.nist.gov/5.2#E1 http://dlmf.nist.gov/5.2#E1]
+[http://dlmf.nist.gov/8.2#E1 {\displaystyle \gamma}] : incomplete gamma function {\displaystyle \gamma} : [http://dlmf.nist.gov/8.2#E1 http://dlmf.nist.gov/8.2#E1]
+[http://drmf.wmflabs.org/wiki/Definition:RegGamma {\displaystyle P\left(x;\alpha}] : Regularized gamma function of incomplete gamma function : [http://drmf.wmflabs.org/wiki/Definition:RegGamma http://drmf.wmflabs.org/wiki/Definition:RegGamma] +
+
<< [[Definition:Fibonacci|Definition:Fibonacci]]
+
[[Main_Page|Main Page]]
+
[[Definition:RegGammaQ|Definition:RegGammaQ]] >>
+
+drmf_eof +drmf_bof +'''Definition:RegGammaQ''' +
+
<< [[Definition:RegGammaP|Definition:RegGammaP]]
+
[[Main_Page|Main Page]]
+
[[Definition:GaussDistF|Definition:GaussDistF]] >>
+
+The LaTeX DLMF and DRMF macro '''\RegGammaQ''' represents the RegGammaQ. + +This macro is in the category of integer valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\RegGammaQ''' produces {\displaystyle \RegGammaQ}
+:'''\RegGammaQ@{x}{\alpha}{\theta}''' produces {\displaystyle \RegGammaQ@{x}{\alpha}{\theta}}
+ +These are defined by + + + +{\displaystyle + +\RegGammaQ@{x}{\alpha}{\theta}:=\frac{\IncGamma@{\alpha}{\frac{x}{\theta}}}{\EulerGamma@{\alpha}} + +} + +
+ +== Symbols List == + +[http://dlmf.nist.gov/5.2#E1 {\displaystyle \Gamma}] : Euler's gamma function : [http://dlmf.nist.gov/5.2#E1 http://dlmf.nist.gov/5.2#E1]
+[http://dlmf.nist.gov/8.2#E2 {\displaystyle \Gamma}] : incomplete gamma function {\displaystyle \Gamma} : [http://dlmf.nist.gov/8.2#E2 http://dlmf.nist.gov/8.2#E2]
+[http://drmf.wmflabs.org/wiki/Definition:RegGamma {\displaystyle Q\left(x;\alpha}] : Regularized gamma function of complementary incomplete gamma function : [http://drmf.wmflabs.org/wiki/Definition:RegGamma http://drmf.wmflabs.org/wiki/Definition:RegGamma] +
+
<< [[Definition:RegGammaP|Definition:RegGammaP]]
+
[[Main_Page|Main Page]]
+
[[Definition:GaussDistF|Definition:GaussDistF]] >>
+
+drmf_eof +drmf_bof +'''Definition:GaussDistF''' +
+
<< [[Definition:RegGammaQ|Definition:RegGammaQ]]
+
[[Main_Page|Main Page]]
+
[[Definition:GaussDistQ|Definition:GaussDistQ]] >>
+
+The LaTeX DLMF and DRMF macro '''\GaussDistF''' represents the GaussDistF. + +This macro is in the category of integer valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\GaussDistF''' produces {\displaystyle \GaussDistF}
+:'''\GaussDistF@{x}''' produces {\displaystyle \GaussDistF@{x}}
+ +These are defined by + + + +{\displaystyle + +\GaussDistF@{x}:=\frac{1}{2}\left(1+\erf@{\frac{x}{\sqrt{2}}}\right) + +} + +
+ +== Symbols List == + +[http://dlmf.nist.gov/7.2#E1 {\displaystyle \mathrm{erf}}] : error function : [http://dlmf.nist.gov/7.2#E1 http://dlmf.nist.gov/7.2#E1]
+[http://drmf.wmflabs.org/wiki/Definition:GaussDist {\displaystyle F\left(x}] : Gaussian distribution : [http://drmf.wmflabs.org/wiki/Definition:GaussDist http://drmf.wmflabs.org/wiki/Definition:GaussDist] +
+
<< [[Definition:RegGammaQ|Definition:RegGammaQ]]
+
[[Main_Page|Main Page]]
+
[[Definition:GaussDistQ|Definition:GaussDistQ]] >>
+
+drmf_eof +drmf_bof +'''Definition:GaussDistQ''' +
+
<< [[Definition:GaussDistF|Definition:GaussDistF]]
+
[[Main_Page|Main Page]]
+
[[Definition:RamanujanTauTheta|Definition:RamanujanTauTheta]] >>
+
+The LaTeX DLMF and DRMF macro '''\GaussDistQ''' represents the GaussDistQ. + +This macro is in the category of integer valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\GaussDistQ''' produces {\displaystyle \GaussDistQ}
+:'''\GaussDistQ@{x}''' produces {\displaystyle \GaussDistQ@{x}}
+ +These are defined by + + + +{\displaystyle + +\GaussDistQ@{x}:=\frac{1}{2}\erfc@{\frac{x}{\sqrt{2}}} + +} + +
+ +== Symbols List == + +[http://dlmf.nist.gov/7.2#E2 {\displaystyle \mathrm{erfc}}] : complementary error function : [http://dlmf.nist.gov/7.2#E2 http://dlmf.nist.gov/7.2#E2]
+[http://drmf.wmflabs.org/wiki/Definition:GaussDist {\displaystyle Q\left(x}] : Related to Gaussian distribution : [http://drmf.wmflabs.org/wiki/Definition:GaussDist http://drmf.wmflabs.org/wiki/Definition:GaussDist] +
+
<< [[Definition:GaussDistF|Definition:GaussDistF]]
+
[[Main_Page|Main Page]]
+
[[Definition:RamanujanTauTheta|Definition:RamanujanTauTheta]] >>
+
+drmf_eof +drmf_bof +'''Definition:RamanujanTauTheta''' +
+
<< [[Definition:GaussDistQ|Definition:GaussDistQ]]
+
[[Main_Page|Main Page]]
+
[[Definition:RiemannSiegelTheta|Definition:RiemannSiegelTheta]] >>
+
+The LaTeX DLMF and DRMF macro '''\RamanujanTauTheta''' represents the RamanujanTauTheta. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\RamanujanTauTheta''' produces {\displaystyle \RamanujanTauTheta}
+:'''\RamanujanTauTheta@{z}''' produces {\displaystyle \RamanujanTauTheta@{z}}
+ +These are defined by + + + +{\displaystyle + +\RamanujanTauTheta@{z}:=-\log\left(2\pi\right)z-\frac{i}{2}\left(\log\EulerGamma@{6+iz}-\log{\EulerGamma@{6-iz}}\right) + +} + +
+ +== Symbols List == + +[http://dlmf.nist.gov/5.2#E1 {\displaystyle \Gamma}] : Euler's gamma function : [http://dlmf.nist.gov/5.2#E1 http://dlmf.nist.gov/5.2#E1]
+[http://dlmf.nist.gov/4.2#E2 {\displaystyle \mathrm{log}}] : principle branch of natural logarithm : [http://dlmf.nist.gov/4.2#E2 http://dlmf.nist.gov/4.2#E2]
+[http://drmf.wmflabs.org/wiki/Definition:RamanujanTauTheta {\displaystyle \tau\theta{z}}] : Ramanujan tau theta function : [http://drmf.wmflabs.org/wiki/Definition:RamanujanTauTheta http://drmf.wmflabs.org/wiki/Definition:RamanujanTauTheta] +
+
<< [[Definition:GaussDistQ|Definition:GaussDistQ]]
+
[[Main_Page|Main Page]]
+
[[Definition:RiemannSiegelTheta|Definition:RiemannSiegelTheta]] >>
+
+drmf_eof +drmf_bof +'''Definition:RiemannSiegelTheta''' +
+
<< [[Definition:RamanujanTauTheta|Definition:RamanujanTauTheta]]
+
[[Main_Page|Main Page]]
+
[[Definition:sinc|Definition:sinc]] >>
+
+The LaTeX DLMF and DRMF macro '''\RiemannSiegelTheta''' represents the RiemannSiegelTheta. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\RiemannSiegelTheta''' produces {\displaystyle \RiemannSiegelTheta}
+:'''\RiemannSiegelTheta@{t}''' produces {\displaystyle \RiemannSiegelTheta@{t}}
+ +These are defined by + + + +{\displaystyle + +\RiemannSiegelTheta@{t}:=\arg\left[\EulerGamma@{\frac{1}{4}+\frac{1}{2}it}\right]-\frac{1}{2}t\ln\pi + +} + +
+ +== Symbols List == + +[http://dlmf.nist.gov/5.2#E1 {\displaystyle \Gamma}] : Euler's gamma function : [http://dlmf.nist.gov/5.2#E1 http://dlmf.nist.gov/5.2#E1]
+[http://dlmf.nist.gov/4.2#E2 {\displaystyle \mathrm{ln}}] : principal branch of logarithm function : [http://dlmf.nist.gov/4.2#E2 http://dlmf.nist.gov/4.2#E2]
+[http://drmf.wmflabs.org/wiki/Definition:RiemannSiegelTheta {\displaystyle \vartheta{t}}] : Riemann-Siegel theta function : [http://drmf.wmflabs.org/wiki/Definition:RiemannSiegelTheta http://drmf.wmflabs.org/wiki/Definition:RiemannSiegelTheta] +
+
<< [[Definition:RamanujanTauTheta|Definition:RamanujanTauTheta]]
+
[[Main_Page|Main Page]]
+
[[Definition:sinc|Definition:sinc]] >>
+
+drmf_eof +drmf_bof +'''Definition:sinc''' +
+
<< [[Definition:RiemannSiegelTheta|Definition:RiemannSiegelTheta]]
+
[[Main_Page|Main Page]]
+
[[Definition:Binet|Definition:Binet]] >>
+
+The LaTeX DLMF and DRMF macro '''\sinc''' represents the sinc. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\sinc''' produces {\displaystyle \sinc}
+:'''\sinc@{x}''' produces {\displaystyle \sinc@{x}}
+ +These are defined by + + + +{\displaystyle + +\sinc@{x}:= +\begin{cases} + \hfill 1 \hfill & \text{ for $x = 0$} \\ + \hfill \frac{\sin{x}}{x} \hfill & \text{ otherwise,} \\ +\end{cases} + +} + +
+ +== Symbols List == + +[http://dlmf.nist.gov/4.14#E1 {\displaystyle \mathrm{sin}}] : sine function : [http://dlmf.nist.gov/4.14#E1 http://dlmf.nist.gov/4.14#E1]
+[http://drmf.wmflabs.org/wiki/Definition:Sinc {\displaystyle \mathrm{sinc}{x}}] : sine cardinal function : [http://drmf.wmflabs.org/wiki/Definition:Sinc http://drmf.wmflabs.org/wiki/Definition:Sinc] +
+
<< [[Definition:RiemannSiegelTheta|Definition:RiemannSiegelTheta]]
+
[[Main_Page|Main Page]]
+
[[Definition:Binet|Definition:Binet]] >>
+
+drmf_eof +drmf_bof +'''Definition:Binet''' +
+
<< [[Definition:sinc|Definition:sinc]]
+
[[Main_Page|Main Page]]
+
[[Definition:AffqKrawtchouk|Definition:AffqKrawtchouk]] >>
+
+The LaTeX DLMF and DRMF macro '''\Binet''' represents the Binet. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\Binet''' produces {\displaystyle \Binet}
+:'''\Binet@{z}''' produces {\displaystyle \Binet@{z}}
+ +These are defined by +{\displaystyle +\Binet@{z}:=\ln@{\EulerGamma@{z}}-\left(z-\frac{1}{2}\right)\ln@{z}+z-\ln@{\sqrt{2\cpi}} +} +
+ +== Symbols List == + +[http://drmf.wmflabs.org/wiki/Definition:Binet {\displaystyle J\left(x\right)}] : Binet function : [http://drmf.wmflabs.org/wiki/Definition:Binet http://drmf.wmflabs.org/wiki/Definition:Binet]
+[http://dlmf.nist.gov/5.19.E4 {\displaystyle \pi}] : ratio of a circle's circumference to its diameter : [http://dlmf.nist.gov/5.19.E4 http://dlmf.nist.gov/5.19.E4]
+[http://dlmf.nist.gov/5.2#E1 {\displaystyle \Gamma}] : Euler's gamma function : [http://dlmf.nist.gov/5.2#E1 http://dlmf.nist.gov/5.2#E1]
+[http://dlmf.nist.gov/4.2#E2 {\displaystyle \mathrm{ln}}] : principal branch of logarithm function : [http://dlmf.nist.gov/4.2#E2 http://dlmf.nist.gov/4.2#E2] +
+
<< [[Definition:sinc|Definition:sinc]]
+
[[Main_Page|Main Page]]
+
[[Definition:AffqKrawtchouk|Definition:AffqKrawtchouk]] >>
+
+drmf_eof diff --git a/main_page/src/__init__.py b/main_page/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/main_page/src/add_definition.py b/main_page/src/add_definition.py new file mode 100644 index 0000000..2d0bb5e --- /dev/null +++ b/main_page/src/add_definition.py @@ -0,0 +1,22 @@ +__author__ = "Joon Bang" +__status__ = "Development" + + +def main(): + macro_name = raw_input("Macro name: ") + definition = raw_input("LaTeX definition: ") + + result = "drmf_bof\n" + \ + "'''Definition:" + macro_name + "'''\n" + \ + "The LaTeX DLMF and DRMF macro '''\\" + macro_name + "''' represents the " + macro_name + ".\n\n" + \ + "These are defined by \n" + \ + "{\\displaystyle\n" + definition + "\n}\n
\n\ndrmf_eof\n" + + with open("main_page/main_page.mmd", "a") as main_page: + main_page.write("\n" + result) + + print "\n" + result + + +if __name__ == '__main__': + main() diff --git a/main_page/src/functions.py b/main_page/src/functions.py new file mode 100644 index 0000000..618eb8a --- /dev/null +++ b/main_page/src/functions.py @@ -0,0 +1,313 @@ +__author__ = "Joon Bang" +__status__ = "Development" + +import csv + +GLOSSARY_LOCATION = "main_page/new.Glossary.csv" + + +def generate_html(tag_name, options, text, spacing=True): + # (str, str, str(, bool)) -> str + """Generates an html tag, with optional html parameters.""" + result = "<" + tag_name + if options != "": + result += " " + options + result += ">\n" + text + "\n\n" + + if not spacing: + return result.replace("\n", " ")[:-1] + "\n" + + return result + + +def get_macro_name(macro): + # (str) -> str + """Obtains the macro name.""" + macro_name = "" + for ch in macro: + if ch.isalpha() or ch == "\\": + macro_name += ch + elif ch in ["@", "{", "["]: + break + + return macro_name + + +def find_all(pattern, string): + # (str, str) -> generator + """Finds all instances of pattern in string.""" + + i = string.find(pattern) + while i != -1: + yield i + i = string.find(pattern, i + 1) + + +def remove_optional_params(string): + # (str) -> str + """Removes optional parameters from a LaTeX semantic macro.""" + parse = True + text = "" + for ch in string: + if parse and ch == "[": + parse = False + elif parse: + text += ch + else: + if ch == "]": + parse = True + + return text + + +def get_all_variants(entry): + # (str) -> str + """Returns string containing info on all variants of a macro.""" + macro = entry[0] + category = entry[3].split("|", 1)[0] + keys = entry[3].split("|", 1)[1].split(":") + result = [] + + for key in keys: + if key in ["F", "FO", "O", "O1"]: + result.append(macro.split("@", 1)[0]) + if macro.count("@") > 0 and key == "O": + result.append(macro) + + if key == "FnO": # remove optional parameters + string = macro + if macro.count("@") > 0: + string = string[:string.find("@")] + result.append(remove_optional_params(string)) + + if key in ["P", "PO", "PnO"]: + result.append(macro.replace("@@", "@")) + + if key == "PnO": # remove optional parameters + result[-1] = remove_optional_params(result[-1]) + + if key in ["nP", "nPO", "PS", "O2"]: + result.append(macro) + + if key == "nPnO": # remove optional paramters + result.append(remove_optional_params(macro)) + + if "fo" in key: + result.append(macro.replace("@@@", "@" * int(key[2]))) + + return sorted(result, key=lambda x: x.count("@")), category + + +def macro_match(macro, entry): + # (str, str) -> bool + """Determines whether the entry refers to the macro.""" + return macro in entry and (len(macro) == len(entry) or not entry[len(macro)].isalpha()) + + +def update_macro_list(text): + # (str) -> str + """Updates the list of macros found in the main page of main_page.mmd.""" + lines = text.split("\n") + definitions = list() + + for line in lines: + if "'''Definition:" in line: + macro = line.split("'''")[1][11:] + element = "* [[Definition:" + macro + "|" + macro + "]]" + definitions.append(element) + + def_contents = generate_html("div", "style=\"-moz-column-count:2; column-count:2;-webkit-column-count:2\"", + "\n".join(definitions)) + + start = text.find("== Definition Pages ==") + end = text.find("= Copyright =") + + return text[:start + 23] + "\n" + def_contents + "\n" + text[end:], definitions + + +def update_headers(text, definitions): + # (str, list) -> str + """Updates the headers used for navigation for every page.""" + pages = text.split("drmf_eof")[:-1] + + macros = list() + formatted = list() + for definition in definitions: + macros.append("Definition:" + definition.split("|")[1][:-2]) + formatted.append("[[" + macros[-1].replace(" ", "_") + "|" + macros[-1] + "]]") + + output = "" + + i = 0 + for page in pages: + if "'''Definition:" not in page: + output += page + "drmf_eof\n" + continue + + # remove drmf_bof and definition header to prevent redundancy + page = page[page.find(macros[i]) + len(macros[i]) + 3:] + + if "
" in page: + page = page[page.find(">>
\n") + len(">> \n"):] + + if "
" in page: + page = page[:page.find("
")] + + nav_section = generate_html("div", "id=\"alignleft\"", "<< " + formatted[i - 1], spacing=False) + \ + generate_html("div", "id=\"aligncenter\"", "[[Main_Page|Main Page]]", spacing=False) + \ + generate_html("div", "id=\"alignright\"", formatted[(i + 1) % len(formatted)] + " >>", + spacing=False)[:-1] + + header = generate_html("div", "id=\"drmf_head\"", nav_section)[:-1] + footer = generate_html("div", "id=\"drmf_foot\"", nav_section)[:-1] + + output += "drmf_bof\n" + "'''" + macros[i] + "'''\n" + header + page[:-1] + footer + "\ndrmf_eof\n" + + i += 1 + + return output + + +def get_symbols(text, glossary): + # (str, dict) -> str + """Generates span text based on symbols present in text.""" + symbols = set() + + for keyword in glossary: + for index in find_all(keyword, text): + # if the macro is present in the text + if index != -1: + index += len(keyword) # now index of next character + + if index >= len(text) or not text[index].isalpha(): + symbols.add(keyword) + + span_text = "" + for symbol in sorted(symbols, key=str.lower): + links = list() + for cell in glossary[symbol]: + if "http://" in cell or "https://" in cell: + links.append(cell) + + id_link = links[0] + links = ["[" + link + " " + link + "]" for link in links] + + meaning = list(glossary[symbol][1]) + + count = 0 + for i, ch in enumerate(meaning): + if ch == "$" and count % 2 == 0: + meaning[i] = "{\\displaystyle " + count += 1 + elif ch == "$": + meaning[i] = "}" + count += 1 + + appearance = glossary[symbol][4].strip("$") + + span_text += "[" + id_link + " {\\displaystyle " + appearance + \ + "}] : " + ''.join(meaning) + " : " + " ".join(links) + "
\n" + + return span_text[:-7] # slice off the extra br and endline + + +def add_symbols_data(data, glossary_location=GLOSSARY_LOCATION): + # (str(, str)) -> str + """Adds list of symbols present in page under symbols list section.""" + glossary = dict() + with open(glossary_location, "rb") as csv_file: + glossary_file = csv.reader(csv_file, delimiter=',', quotechar='\"') + for row in glossary_file: + glossary[get_macro_name(row[0])] = row + + pages = data[data.find("drmf_bof"):].split("drmf_eof")[:-1] + + result = "" + for page in pages: + # skip over non-definition pages + if "'''Definition:" not in page: + result += page + "drmf_eof\n" + continue + + page = page.replace("drmf_bof", "").strip("\n") + add_spacing = False + # remove data (to be regenerated later) + if "== Symbols List ==" in page: + to_write = page.split("== Symbols List ==")[0] + page = to_write + else: + add_spacing = True + if page.find("drmf_foot") == -1: + to_write = page + else: + to_write = page.split("
")[0].rstrip("\n") + page = to_write + + to_write = "drmf_bof\n" + to_write + if add_spacing: + to_write += "\n\n" + + to_write += "== Symbols List ==\n\n" + to_write += get_symbols(page, glossary) + to_write += "\n
\ndrmf_eof\n" + result += to_write + + return result + + +def add_usage(lines, glossary_location=GLOSSARY_LOCATION): + # (str(, str)) -> str + """Adds the macro category information and calling sequences.""" + with open("main_page/categories.txt") as cats: + categories = cats.readlines() + + to_write = "" + i = 0 + + while True: + n = lines.find("'''Definition:", i) + if n == -1: + break + + macro_name = lines[n:].split("'''")[1][11:] + left = lines.find("'''\\", n) + right = lines.find("'''", left + len("'''\\")) + + if lines[left:right].find("{") != -1: + lines = lines[:left] + "'''\\" + macro_name + lines[right:] + + if lines.find("\nThis macro is in the category of", n) < lines.find("'''Definition:", n + len( + "'''Definition:") + 1) and lines.find("\nThis macro is in the category of", n) != -1: + p = lines.find("\nThis macro is in the category of", n) + else: + p = lines.find(".\n", n) + 1 + + to_write += lines[i:p].rstrip() + "\n\n" + + calls = [] + glossary = csv.reader(open(glossary_location, 'rb'), delimiter=',', quotechar='\"') + for entry in glossary: + if macro_match("\\" + macro_name, entry[0]): + macro_calls, category = get_all_variants(entry) + calls += macro_calls + + for line in categories: + key, meaning = line.split(" - ") + if key == category: + category_text = "This macro is in the category of " + meaning + break + else: + category_text = "This macro is in the category of integer valued functions.\n" + + text = category_text + "\nIn math mode, this macro can be called in the following way" + "s" * ( + len(calls) > 1) + ":\n\n" + + for call in calls: + text += ":'''" + call + "'''" + " produces {\\displaystyle " + call + "}
\n" + + # Now add the multiple ways \macroname{n}@... produces \macroname{n}@... + print text + to_write += text + "\n" + i = lines.find("These are defined by", p) + + return to_write + lines[i:] diff --git a/main_page/src/main.py b/main_page/src/main.py new file mode 100644 index 0000000..096b4db --- /dev/null +++ b/main_page/src/main.py @@ -0,0 +1,38 @@ +__author__ = "Azeem Mohammed" +__status__ = "Development" +__credits__ = ["Joon Bang", "Azeem Mohammed"] + +import time +import functions + + +def create_backup(): + with open("main_page/main_page.mmd") as current: + local_time = time.asctime(time.localtime(time.time())).split() + local_time = "_" + '_'.join(local_time[1:3] + local_time[3:][::-1]) + with open("main_page/backups/main_page" + local_time + ".mmd.bak", "w") as backup: + backup.write(current.read()) + + +def main(): + if raw_input("Update main page? (y/n): ") == "n": + return + + # read contents + with open("main_page/main_page.mmd") as main_page: + text = main_page.read() + + text, definitions = functions.update_macro_list(text) + text = functions.add_symbols_data(text) + text = functions.update_headers(text, definitions) + text = functions.add_usage(text) + + # only create backup if program did not crash + create_backup() + + with open("main_page/main_page.mmd", "w") as main_page: + main_page.write(text) + + +if __name__ == '__main__': + main() diff --git a/main_page/test/__init__.py b/main_page/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/main_page/test/add_symbols_data_tests/exp.1.txt b/main_page/test/add_symbols_data_tests/exp.1.txt new file mode 100644 index 0000000..aba079a --- /dev/null +++ b/main_page/test/add_symbols_data_tests/exp.1.txt @@ -0,0 +1,26 @@ +drmf_bof +'''Main Page''' +drmf_eof +drmf_bof +'''Definition:DefinitionOne''' + +\DefinitionOne@{x}:=\DefinitionTwo@{x}+1 + +== Symbols List == + +drmf_eof +drmf_bof +'''Definition:DefinitionTwo''' + +\DefinitionTwo@{x}:=\frac{6}{127} + +
+
+ +drmf_eof +drmf_bof +'''Definition:DefinitionTwoTwo''' + +\DefinitionTwoTwo:=22 + +drmf_eof diff --git a/main_page/test/add_symbols_data_tests/res.1.txt b/main_page/test/add_symbols_data_tests/res.1.txt new file mode 100644 index 0000000..a494846 --- /dev/null +++ b/main_page/test/add_symbols_data_tests/res.1.txt @@ -0,0 +1,34 @@ +drmf_bof +'''Main Page''' +drmf_eof +drmf_bof +'''Definition:DefinitionOne''' + +\DefinitionOne@{x}:=\DefinitionTwo@{x}+1 + +== Symbols List == + +[http://fake-hyperlink.com/Definition1 {\displaystyle \mathrm{Def1}{x}}] : sample definition 1 : [http://fake-hyperlink.com/Definition1 http://fake-hyperlink.com/Definition1]
+[http://fake-hyperlink.com/Definition2 {\displaystyle \mathrm{Def2}{x}}] : sample definition 2 : [http://fake-hyperlink.com/Definition2 http://fake-hyperlink.com/Definition2] +
+drmf_eof +drmf_bof +'''Definition:DefinitionTwo''' + +\DefinitionTwo@{x}:=\frac{6}{127} + +== Symbols List == + +[http://fake-hyperlink.com/Definition2 {\displaystyle \mathrm{Def2}{x}}] : sample definition 2 : [http://fake-hyperlink.com/Definition2 http://fake-hyperlink.com/Definition2] +
+drmf_eof +drmf_bof +'''Definition:DefinitionTwoTwo''' + +\DefinitionTwoTwo:=22 + +== Symbols List == + +[http://fake-hyperlink.com/Definition22 {\displaystyle \mathrm{twenty two}}] : sample definition 22 : [http://fake-hyperlink.com/Definition22 http://fake-hyperlink.com/Definition22] +
+drmf_eof diff --git a/main_page/test/add_usage_tests/exp.1.txt b/main_page/test/add_usage_tests/exp.1.txt new file mode 100644 index 0000000..ad1e151 --- /dev/null +++ b/main_page/test/add_usage_tests/exp.1.txt @@ -0,0 +1,45 @@ +drmf_bof +'''Main Page''' +drmf_eof +drmf_bof +'''Definition:DefinitionOne''' +The LaTeX DLMF and DRMF macro '''\DefinitionOne''' represents the DefinitionOne. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following way: + +:'''\DefinitionOne@{x}''' produces {\displaystyle \DefinitionOne@{x}}
+ +These are defined by +\displaystyle{ +\DefinitionOne@{x}:=\DefinitionTwo@{x}+1 +} +
+drmf_eof +drmf_bof +'''Definition:DefinitionTwo''' +The LaTeX DLMF and DRMF macro '''\DefinitionTwo''' represents the DefinitionTwo. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following way: + +:'''\DefinitionTwo@{x}''' produces {\displaystyle \DefinitionTwo@{x}}
+ +These are defined by +\displaystyle{ +\DefinitionTwo@{x}:=\frac{6}{127} +} +
+drmf_eof +drmf_bof +'''Definition:DefinitionTwoTwo''' +The LaTeX DLMF and DRMF macro '''\DefinitionTwoTwo''' represents the DefinitionTwoTwo. + +These are defined by +\displaystyle{ +\DefinitionTwoTwo:=22 +
+ +drmf_eof diff --git a/main_page/test/add_usage_tests/res.1.txt b/main_page/test/add_usage_tests/res.1.txt new file mode 100644 index 0000000..b4d2586 --- /dev/null +++ b/main_page/test/add_usage_tests/res.1.txt @@ -0,0 +1,55 @@ +drmf_bof +'''Main Page''' +drmf_eof +drmf_bof +'''Definition:DefinitionOne''' +The LaTeX DLMF and DRMF macro '''\DefinitionOne''' represents the DefinitionOne. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\DefinitionOne''' produces {\displaystyle \DefinitionOne}
+:'''\DefinitionOne@{x}''' produces {\displaystyle \DefinitionOne@{x}}
+:'''\DefinitionOne@{x}''' produces {\displaystyle \DefinitionOne@{x}}
+ +These are defined by +\displaystyle{ +\DefinitionOne@{x}:=\DefinitionTwo@{x}+1 +} +
+drmf_eof +drmf_bof +'''Definition:DefinitionTwo''' +The LaTeX DLMF and DRMF macro '''\DefinitionTwo''' represents the DefinitionTwo. + +This macro is in the category of real or complex valued functions. + +In math mode, this macro can be called in the following ways: + +:'''\DefinitionTwo''' produces {\displaystyle \DefinitionTwo}
+:'''\DefinitionTwo@{x}''' produces {\displaystyle \DefinitionTwo@{x}}
+:'''\DefinitionTwo@{x}''' produces {\displaystyle \DefinitionTwo@{x}}
+ +These are defined by +\displaystyle{ +\DefinitionTwo@{x}:=\frac{6}{127} +} +
+drmf_eof +drmf_bof +'''Definition:DefinitionTwoTwo''' +The LaTeX DLMF and DRMF macro '''\DefinitionTwoTwo''' represents the DefinitionTwoTwo. + +This macro is in the category of constants. + +In math mode, this macro can be called in the following way: + +:'''\DefinitionTwoTwo''' produces {\displaystyle \DefinitionTwoTwo}
+ +These are defined by +\displaystyle{ +\DefinitionTwoTwo:=22 +
+ +drmf_eof diff --git a/main_page/test/fake.Glossary.csv b/main_page/test/fake.Glossary.csv new file mode 100644 index 0000000..3e367dd --- /dev/null +++ b/main_page/test/fake.Glossary.csv @@ -0,0 +1,3 @@ +\DefinitionOne@{x},sample definition 1,sample-definition-1,F|F:P:nP,$\mathrm{Def1}{x}$,http://fake-hyperlink.com/Definition1, +\DefinitionTwo@{x},sample definition 2,sample-definition-2,F|FnO:PnO:nPnO,$\mathrm{Def2}{x}$,http://fake-hyperlink.com/Definition2, +\DefinitionTwoTwo,sample definition 22,sample-definition-22,C|P,$\mathrm{twenty two}$,http://fake-hyperlink.com/Definition22, \ No newline at end of file diff --git a/main_page/test/macro_list_tests/exp.1.txt b/main_page/test/macro_list_tests/exp.1.txt new file mode 100644 index 0000000..89f50fe --- /dev/null +++ b/main_page/test/macro_list_tests/exp.1.txt @@ -0,0 +1,13 @@ +drmf_bof + +== Definition Pages == + += Copyright = + +drmf_eof +drmf_bof +'''Definition:Definition1''' +drmf_eof +drmf_bof +'''Definition:Definition2''' +drmf_eof diff --git a/main_page/test/macro_list_tests/res.1.txt b/main_page/test/macro_list_tests/res.1.txt new file mode 100644 index 0000000..bfd0dbc --- /dev/null +++ b/main_page/test/macro_list_tests/res.1.txt @@ -0,0 +1,18 @@ +drmf_bof + +== Definition Pages == + +
+* [[Definition:Definition1|Definition1]] +* [[Definition:Definition2|Definition2]] +
+ += Copyright = + +drmf_eof +drmf_bof +'''Definition:Definition1''' +drmf_eof +drmf_bof +'''Definition:Definition2''' +drmf_eof diff --git a/main_page/test/test_functions.py b/main_page/test/test_functions.py new file mode 100644 index 0000000..7e712f5 --- /dev/null +++ b/main_page/test/test_functions.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python + +__author__ = "Joon Bang" +__status__ = "Development" + +from unittest import TestCase +import src.functions as m + +update_macro_list_test_cases = [ + { + "exp": open("main_page/test/macro_list_tests/exp.1.txt").read(), + "res": ( + open("main_page/test/macro_list_tests/res.1.txt").read(), + ["* [[Definition:Definition1|Definition1]]", "* [[Definition:Definition2|Definition2]]"] + ) + } +] + +update_headers_test_cases = [ + { + "exp": open("main_page/test/update_headers_tests/exp.1.txt").read(), + "def": ["* [[Definition:Definition1|Definition1]]", "* [[Definition:Definition2|Definition2]]", + "* [[Definition:Definition3|Definition3]]"], + "res": open("main_page/test/update_headers_tests/res.1.txt").read() + } +] + +add_symbols_data_test_cases = [ + { + "exp": open("main_page/test/add_symbols_data_tests/exp.1.txt").read(), + "res": open("main_page/test/add_symbols_data_tests/res.1.txt").read() + } +] + +add_usage_test_cases = [ + { + "exp": open("main_page/test/add_usage_tests/exp.1.txt").read(), + "res": open("main_page/test/add_usage_tests/res.1.txt").read() + } +] + + +class TestUpdateMacroList(TestCase): + def test_update_macro_list(self): + for case in update_macro_list_test_cases: + self.assertEqual(m.update_macro_list(case["exp"]), case["res"]) + + +class TestUpdateHeaders(TestCase): + def test_update_headers(self): + for case in update_headers_test_cases: + self.assertEqual(m.update_headers(case["exp"], case["def"]), case["res"]) + + +class TestAddSymbolsData(TestCase): + def test_add_symbols_data(self): + for case in add_symbols_data_test_cases: + self.assertEqual(m.add_symbols_data(case["exp"], glossary_location="main_page/test/fake.Glossary.csv"), + case["res"]) + + +class TestAddUsage(TestCase): + def test_add_usage(self): + for case in add_usage_test_cases: + self.assertEqual(m.add_usage(case["exp"], glossary_location="main_page/test/fake.Glossary.csv"), + case["res"]) diff --git a/main_page/test/update_headers_tests/exp.1.txt b/main_page/test/update_headers_tests/exp.1.txt new file mode 100644 index 0000000..09cfcb8 --- /dev/null +++ b/main_page/test/update_headers_tests/exp.1.txt @@ -0,0 +1,28 @@ +drmf_bof +'''Main Page''' +drmf_eof +drmf_bof +'''Definition:Definition1''' +
+
>>
+
+Definition1 Text. +
+
+
+drmf_eof +drmf_bof +'''Definition:Definition2''' +
+
>>
+
+Definition2 Text. +
+
+
+drmf_eof +drmf_bof +'''Definition:Definition3''' +Definition3 Text. +
+drmf_eof diff --git a/main_page/test/update_headers_tests/res.1.txt b/main_page/test/update_headers_tests/res.1.txt new file mode 100644 index 0000000..ea47d21 --- /dev/null +++ b/main_page/test/update_headers_tests/res.1.txt @@ -0,0 +1,45 @@ +drmf_bof +'''Main Page''' +drmf_eof +drmf_bof +'''Definition:Definition1''' +
+
<< [[Definition:Definition3|Definition:Definition3]]
+
[[Main_Page|Main Page]]
+
[[Definition:Definition2|Definition:Definition2]] >>
+
+Definition1 Text. +
+
<< [[Definition:Definition3|Definition:Definition3]]
+
[[Main_Page|Main Page]]
+
[[Definition:Definition2|Definition:Definition2]] >>
+
+drmf_eof +drmf_bof +'''Definition:Definition2''' +
+
<< [[Definition:Definition1|Definition:Definition1]]
+
[[Main_Page|Main Page]]
+
[[Definition:Definition3|Definition:Definition3]] >>
+
+Definition2 Text. +
+
<< [[Definition:Definition1|Definition:Definition1]]
+
[[Main_Page|Main Page]]
+
[[Definition:Definition3|Definition:Definition3]] >>
+
+drmf_eof +drmf_bof +'''Definition:Definition3''' +
+
<< [[Definition:Definition2|Definition:Definition2]]
+
[[Main_Page|Main Page]]
+
[[Definition:Definition1|Definition:Definition1]] >>
+
+Definition3 Text. +
+
<< [[Definition:Definition2|Definition:Definition2]]
+
[[Main_Page|Main Page]]
+
[[Definition:Definition1|Definition:Definition1]] >>
+
+drmf_eof diff --git a/maple2latex/.gitignore b/maple2latex/.gitignore new file mode 100644 index 0000000..1beb704 --- /dev/null +++ b/maple2latex/.gitignore @@ -0,0 +1,5 @@ +functions/ +out/ +notes.txt +resources/ +.DS_Store diff --git a/maple2latex/README.md b/maple2latex/README.md new file mode 100644 index 0000000..5fe9d94 --- /dev/null +++ b/maple2latex/README.md @@ -0,0 +1,19 @@ +# Maple CFSF Seeding Project +This project uses Python to convert the continued fractions for special functions library, written in Maple, into LaTeX. + +## Prerequisites +This program requires Python 2.6+ to run. + +## Usage +To run the program, ensure that you are in the directory where maple2latex is located. Then, run the command `python maple2latex/src/main.py`. + +Currently, the program translates only the CFSF library of functions. In the future, support will be added for +translating individual .mpl files. + +## Code Explanation +There are three files, `main.py`, `maple_tokenize.py`, and `translator.py`. The bulk of the code is located in `translator.py.` + +The program works by parsing through "tokens," which are created by running the `tokenize` function on a string. +It then goes through the tokens, joining them when necessary. It initially joins terms grouped in parentheses, starting from +the innermost set of parentheses and working its way outwards. It has separate functions handling translation of mathematical +functions, and basic operations (addition, multiplication, division, etc.). diff --git a/maple2latex/data/keys.json b/maple2latex/data/keys.json new file mode 100644 index 0000000..06412fa --- /dev/null +++ b/maple2latex/data/keys.json @@ -0,0 +1,566 @@ +{ + "functions": { + "sin": [ + { + "args": 1, + "repr": ["\\sin@{", "}"] + } + ], + + "cos": [ + { + "args": 1, + "repr": ["\\cos@{", "}"] + } + ], + + "tan": [ + { + "args": 1, + "repr": ["\\tan@{", "}"] + } + ], + + "arccos": [ + { + "args": 1, + "repr": ["\\acos@{", "}"] + } + ], + + "arccosh": [ + { + "args": 1, + "repr": ["\\acosh@{", "}"] + } + ], + + "arcsin": [ + { + "args": 1, + "repr": ["\\asin@{", "}"] + } + ], + + "arcsinh": [ + { + "args": 1, + "repr": ["\\asinh@{", "}"] + } + ], + + "arctan": [ + { + "args": 1, + "repr": ["\\atan@{", "}"] + } + ], + + "arctanh": [ + { + "args": 1, + "repr": ["\\atanh@{", "}"] + } + ], + + "sinh": [ + { + "args": 1, + "repr": ["\\sinh@{", "}"] + } + ], + + "cosh": [ + { + "args": 1, + "repr": ["\\cosh@{", "}"] + } + ], + + "coth": [ + { + "args": 1, + "repr": ["\\coth@{", "}"] + } + ], + + "tanh": [ + { + "args": 1, + "repr": ["\\tanh@{", "}"] + } + ], + + "erfc": [ + { + "args": 1, + "repr": ["\\erfc@{", "}"] + } + ], + + "erf": [ + { + "args": 1, + "repr": ["\\erf@{", "}"] + } + ], + + "log": [ + { + "args": 1, + "repr": ["\\log@{", "}"] + }, + + { + "args": 2, + "repr": ["\\log_{", "}@{", "}"] + } + ], + + "ln": [ + { + "args": 1, + "repr": ["\\ln@{", "}"] + } + ], + + "cerf": [ + { + "args": 1, + "repr": ["\\erfw@{", "}"] + } + ], + + "Ein": [ + { + "args": 1, + "repr": ["\\ExpIntEin@{", "}"] + } + ], + + "erfcI": [ + { + "args": 2, + "repr": ["I^{", "} \\erfc@{", "}"] + } + ], + + "sqrt": [ + { + "args": 1, + "repr": ["\\sqrt{", "}"] + } + ], + + "abs": [ + { + "args": 1, + "repr": ["\\abs{", "}"] + } + ], + + "exp": [ + { + "args": 1, + "repr": ["\\expe^{", "}"] + } + ], + + "floor": [ + { + "args": 1, + "repr": ["\\floor{", "}"] + } + ], + + "sum": [ + { + "args": 3, + "repr": ["\\sum_{", "}^{", "} (", ")"] + } + ], + + "GAMMA": [ + { + "args": 1, + "repr": ["\\EulerGamma@{", "}"] + } + ], + + "bernoulli": [ + { + "args": 1, + "repr": ["\\BernoulliB{", "}"] + } + ], + + "BesselI": [ + { + "args": 2, + "repr": ["\\BesselI{", "}@{", "}"] + } + ], + + "BesselJ": [ + { + "args": 2, + "repr": ["\\BesselJ{", "}@{", "}"] + } + ], + + "BesselK": [ + { + "args": 2, + "repr": ["\\BesselK{", "}@{", "}"] + } + ], + + "BesselY": [ + { + "args": 2, + "repr": ["\\BesselY{", "}@{", "}"] + } + ], + + "dawson": [ + { + "args": 1, + "repr": ["\\DawsonsInt@{", "}"] + } + ], + + "Ei": [ + { + "args": 2, + "repr": ["\\ExpIntn{", "}@{", "}"] + }, + + { + "args": 1, + "repr": ["\\ExpInt@{", "}"] + } + ], + + "FresnelC": [ + { + "args": 1, + "repr": ["\\FresnelCos@{", "}"] + } + ], + + "FresnelS": [ + { + "args": 1, + "repr": ["\\FresnelSin@{", "}"] + } + ], + + "HankelH1": [ + { + "args": 2, + "repr": ["\\HankelHi{", "}@{", "}"] + } + ], + + "KummerU": [ + { + "args": 3, + "repr": ["\\KummerU@{", "}{", "}{", "}"] + } + ], + + "CylinderU": [ + { + "args": 2, + "repr": ["\\ParabolicU@{", "}{", "}"] + } + ], + + "Psi": [ + { + "args": 2, + "repr": ["\\polygamma{", "}@{", "}"] + }, + + { + "args": 1, + "repr": ["\\digamma@{", "}"] + } + ], + + "special-trigamma": [ + { + "args": 1, + "repr": ["\\digamma'@{", "}"] + } + ], + + "WhittakerW": [ + { + "args": 3, + "repr": ["\\WhitW{", "}{", "}@{", "}"] + } + ], + + "Zeta": [ + { + "args": 1, + "repr": ["\\RiemannZeta@{", "}"] + } + ], + + "Re": [ + { + "args": 1, + "repr": ["\\Re(", ")"] + } + ], + + "Im": [ + { + "args": 1, + "repr": ["\\Im(", ")"] + } + ], + + "doublefactorial": [ + { + "args": 1, + "repr": ["(", ")!!"] + } + ], + + "hypergeom": [ + { + "args": 5, + "repr": ["\\HyperpFq{", "}{", "}@@{", "}{", "}{", "}"] + } + ], + + "pochhammer": [ + { + "args": 2, + "repr": ["\\pochhammer{", "}{", "}"] + } + ], + + "Besseli": [ + { + "args": 2, + "repr": ["\\SphBesselIi{", "}@{", "}"] + } + ], + + "Besselj": [ + { + "args": 2, + "repr": ["\\SphBesselJ{", "}@{", "}"] + } + ], + + "hankelsymb": [ + { + "args": 2, + "repr": ["\\HankelSym{", "}{", "}"] + } + ], + + "lincgamma": [ + { + "args": 2, + "repr": ["\\incgamma@{", "}{", "}"] + } + ], + + "qhyper": [ + { + "args": 6, + "repr": ["\\qHyperrphis{", "}{", "}@@{", "}{", "}{", "}{", "}"] + } + ], + + "uincgamma": [ + { + "args": 2, + "repr": ["\\IncGamma@{", "}{", "}"] + } + ], + + "WhittakerPsi": [ + { + "args": 3, + "repr": ["\\WhitPsi{", "}{", "}@{", "}"] + } + ], + + "goldenratio": [ + { + "args": 0, + "repr": ["\\GoldenRatio"] + } + ], + + "Gompertz": [ + { + "args": 0, + "repr": ["\\GompertzConstant"] + } + ], + + "rabbit": [ + { + "args": 0, + "repr": ["\\rabbitConstant"] + } + ], + + "combinatfibonacci": [ + { + "args": 1, + "repr": ["\\FibonacciNumber{", "}"] + } + ], + + "argument": [ + { + "args": 1, + "repr": ["\\arg@{", "}"] + } + ], + + "RealRange": [ + { + "args": 2, + "repr": ["(", ", ", ")"] + } + ], + + "Open": [ + { + "args": 1, + "repr": ["(", ")"] + } + ], + + "regincBeta": [ + { + "args": 3, + "repr": ["\\IncI{", "}@{", "}{", "}"] + } + ], + + "Beta": [ + { + "args": 2, + "repr": ["\\EulerBeta@{", "}{", "}"] + } + ], + + "cnormalI": [ + { + "args": 2, + "repr": ["\\RepInterfc{", "}@{", "}"] + } + ], + + "Mills": [ + { + "args": 1, + "repr": ["\\Mills@{", "}"] + } + ], + + "gammacdf": [ + { + "args": 3, + "repr": ["\\RegGammaP@{", "}{", "}{", "}"] + } + ], + + "cgammacdf": [ + { + "args": 3, + "repr": ["\\RegGammaQ@{", "}{", "}{", "}"] + } + ], + + "normaldcdf": [ + { + "args": 1, + "repr": ["\\GaussDistF@{", "}"] + } + ], + + "cnormaldcdf": [ + { + "args": 1, + "repr": ["\\GaussDistQ@{", "}"] + } + ], + + "not": [ + { + "args": 1, + "repr": ["", ""] + } + ], + + "Binet": [ + { + "args": 1, + "repr": ["\\Binet@{", "}"] + } + ] + }, + + "symbols": { + "alpha": "n", + "beta": "\\beta", + "gamma": "\\gamma", + "delta": "\\delta", + "epsilon": "\\epsilon", + "zeta": "\\zeta", + "eta": "\\eta", + "theta": "\\theta", + "iota": "\\iota", + "kappa": "\\kappa", + "lambda": "\\lambda", + "mu": "\\mu", + "nu": "\\nu", + "xi": "\\xi", + "pi": "\\cpi", + "rho": "\\rho", + "sigma": "\\sigma", + "tau": "\\tau", + "upsilon": "\\upsilon", + "phi": "\\phi", + "chi": "\\chi", + "psi": "\\psi", + "omega": "\\omega", + "Pi": "\\pi", + "Catalan": "\\CatalansConstant", + "infinity": "\\infty", + "Delian": "\\sqrt[\\leftroot{-2}\\uproot{2} 3]{2}", + "Theodorus": "\\sqrt{3}", + "integer": "\\mathbb{Z}", + "or": "\\lor ", + "and": "\\wedge ", + "realcons": "\\RR", + "I": "\\iunit" + }, + + "constraints": { + "Not(negint)": "\\CC\\backslash\\ZZ^-", + "Not(nonposint)": "\\CC\\backslash\\ZZ_0^-", + "Not(posint)": "\\CC\\backslash\\ZZ^+", + "::Not(positive)": "< 0", + "Not(integer)": "\\CC\\backslash\\ZZ", + "posint": "\\mathbb{Z^+}", + "nonnegint": "\\ZZ\\backslash\\ZZ^-", + "::positive": "> 0", + "::nonnegative": "\\geq 0", + "::nonneg": "\\geq 0", + "::": "\\in ", + "<>": "\\neq " + } +} \ No newline at end of file diff --git a/maple2latex/data/section_names b/maple2latex/data/section_names new file mode 100644 index 0000000..6873835 --- /dev/null +++ b/maple2latex/data/section_names @@ -0,0 +1,75 @@ +%Not updated for newer formulas +BS : Bessel functions +bessel : Bessel functions +modbessel : Modified Bessel functions + +CH : Confluent hypergeometric functions +confluent : Confluent hypergeometric series $_2F_0$ +confluentlimit : Confluent hypergeometric limit function +kummer : Kummer functions +parabolic : Parabolic cylinder functions +whittaker : Whittaker functions + +CN : Mathematical constants +apery : Ap\'{e}ry's constant, $\RiemannZeta@{3}$ +archimedes : Archimedes' constant, symbol $\pi$ +catalan : Catalan's constant, symbol $\CatalansConstant$ +delian : Delian +eulersconstant : Euler's constant, symbol $\gamma$ +eulersnumber : Euler's number, base of the natural logarithm +goldenratio : Golden ratio, symbol $\GoldenRatio$ +gompertz : Gompertz' constant, symbol $\GompertzConstant$ +naturallogarithm : The natural logarithm, $\ln(2)$ +powerandroot : Regular continued fractions +pythagoras : Pythagoras' constant, the square root of two +rabbit : The rabbit constant, symbol $\rabbitConstant$ +theodorus : Theodorus +zeta2 : zeta2, $\RiemannZeta@{2}$ +zeta4 : zeta4, $\RiemannZeta@{4}$ + +EF : Elementary functions +arccos : Inverse trigonometric functions +arccosh : Inverse hyperbolic functions +arcsin : Inverse trigonometric functions +arcsinh : Inverse hyperbolic functions +arctan : Inverse trigonometric functions +arctanh : Inverse hyperbolic functions +cos : Trigonometric functions +cosh : Hyperbolic functions +coth : Hyperbolic functions +exp : The exponential function +ln : The natural logarithm +pow : The power function +sin : Trigonometric functions +sinh : Hyperbolic functions +tan : Trigonometric functions +tanh : Hyperbolic functions + +ER : Error function and related integrals +error : Error function and Dawson's integral +comperror : Complementary and complex error function +repint : Repeated integrals +fresnel : Fresnel integrals + +EX : Exponential integrals and related functions +expintegrals : Exponential integrals +related : Related functions + +GA : Gamma function and related functions +binet : Binet function +incompletegamma : Incomplete gamma functions +polygamma : Polygamma functions +tetragamma : Tetragamma function +trigamma : Trigamma function + +HY : Hypergeometric functions +hypergeometric : Hypergeometric functions + +QH : q-Hypergeometric function +qhyper : q-Hypergeometric function + +SM : Probability functions +beta_f_t : Beta, F- and Student's $t$-distributions +gamma_chisquare : Gamma and chi-square distribution +normal : Normal and log-normal distributions +repeated : Repeated integrals diff --git a/maple2latex/src/__init__.py b/maple2latex/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/maple2latex/src/main.py b/maple2latex/src/main.py new file mode 100644 index 0000000..36fe1df --- /dev/null +++ b/maple2latex/src/main.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python + +__author__ = "Joon Bang" +__status__ = "Development" + +import os +from translator import MapleEquation, LatexEquation + +TABLE = dict() # stores meaning of folder names +with open("maple2latex/data/section_names") as name_info: + for line in name_info.read().split("\n"): + if line != "" and "%" not in line: + key, value = line.split(" : ") + TABLE[key] = value + +FILES = [ + "bessel", "modbessel", + "confluent", "confluentlimit", "kummer", "parabolic", "whittaker", + "apery", "archimedes", "catalan", "delian", "eulersconstant", "eulersnumber", "goldenratio", "gompertz", + "naturallogarithm", "powerandroot", "pythagoras", "rabbit", "theodorus", "zeta2", "zeta4", + "arccos", "arccosh", "arcsin", "arcsinh", "arctan", "arctanh", "cos", "cosh", "coth", + "exp", "ln", "pow", "sin", "sinh", "tan", "tanh", + "comperror", "error", "fresnel", "repint", + "expintegrals", "related", + "binet", "incompletegamma", "polygamma", "tetragamma", "trigamma", + "hypergeometric", + "qhyper", + "beta_f_t", "gamma_chisquare", "normal", "repeated" +] # files to be translated + + +class MapleFile(object): + def __init__(self, filename): + self.filename = filename + self.formulae = self.obtain_formulae() + + def obtain_formulae(self): + contents = open(self.filename).read() + + return [MapleEquation(piece.split("\n")) for piece in contents.split("create(") + if "):" in piece or ");" in piece] + + def __str__(self): + return "MapleFile of " + self.filename + + +def get_sections_data(dirs, root_depth=0): + # type: (list(, int)) -> dict + """Obtain data from the functions/ directory.""" + sections = dict() + + for info in dirs: # search through directories + depth = info[0].count("/") + + if depth == root_depth: # section + section = TABLE[info[0].split("/")[-1]] + sections[section] = dict() + + for file_name in info[2]: + folder = ''.join(file_name.split(".")[:-1]) + if folder in FILES: + # generate equation code, sorted by equation number + subsection = TABLE[folder] + formulae = map(LatexEquation.from_maple, MapleFile(info[0] + "/" + file_name).formulae) + formulae = sorted(formulae, key=LatexEquation.get_sortable_label) + + repr_label = formulae[len(formulae) / 2].label + + if subsection in sections[section]: + sections[section][subsection][1] += "\n".join(map(str, formulae)) + else: + sections[section][subsection] = [repr_label, "\n".join(map(str, formulae))] + + return sections + + +def translate_files(root_directory, output_file): + # type: () + """Generates and writes the results of traversing the root directory, and translating all files in FILES.""" + + root_depth = len(root_directory.split("/")) + + dirs = [d for d in os.walk(root_directory) if d[0].count("/") == root_depth] + + sections = get_sections_data(dirs, root_depth=root_depth) + + # generate subsection headers + for section, subsections in sections.iteritems(): + keys = sorted(subsections.keys(), key=lambda x: subsections[x][0]) + + text = "" + for subsection in keys: + text += "\n\\subsection{" + subsection + "}\n" + text += subsections[subsection][1] + + sections[section] = text + + # generate section headers + result = "" + for section, section_data in sections.iteritems(): + result += "\\section{" + section + "}\n" + section_data + "\n\n\n" + + # write output to file + with open(output_file, "w") as test: + with open("maple2latex/out/primer") as primer: + test.write(primer.read() + result + "\n\\end{document}\n") + +if __name__ == '__main__': + translate_files("maple2latex/functions", "maple2latex/out/test.tex") diff --git a/maple2latex/src/maple_tokenize.py b/maple2latex/src/maple_tokenize.py new file mode 100644 index 0000000..7561fce --- /dev/null +++ b/maple2latex/src/maple_tokenize.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python + +__author__ = "Joon Bang" +__status__ = "Development" + +symbols = [ + "+", + "-", + "*", + "/", + "^", + "!", + "=", + "<", + ">", + "@", + "$", + ",", + "~", + "(", + ")", + "{", + "}", + "[", + "]", + "\'", + "\"", + "|", + "&", + "_", + "%", + "\\", + "#", + "?" +] + + +def tokenize(string): + for symbol in symbols: + string = string.replace(symbol, " " + symbol + " ") + + return string.split() \ No newline at end of file diff --git a/maple2latex/src/translator.py b/maple2latex/src/translator.py new file mode 100644 index 0000000..8fa3e7f --- /dev/null +++ b/maple2latex/src/translator.py @@ -0,0 +1,459 @@ +#!/usr/bin/env python + +__author__ = "Joon Bang" +__status__ = "Development" + +import copy +import json +import sys +from string import ascii_lowercase +from maple_tokenize import tokenize + +INFO = json.loads(open("maple2latex/data/keys.json").read()) + +FUNCTIONS = INFO["functions"] +SYMBOLS = INFO["symbols"] +CONSTRAINTS = INFO["constraints"] + +SPECIAL = {"(": "\\left(", ")": "\\right)", "+-": "-", "\\subplus-": "-", "^{1}": "", "\\inNot": "\\notin"} + +MULTI_ARGS = ["sin", "cos", "tan", "arccos", "arccosh", "arcsin", "arcsinh", "arctanh", "sinh", "cosh", "coth", "tanh", + "erfc", "erf", "log", "ln"] + + +class MapleEquation(object): + def __init__(self, inp): + # creates a dictionary called "fields", containing all the Maple fields + self.fields = {"category": "", "constraints": "", "begin": "", "factor": "", "front": "", "parameters": "", + "type": inp.pop(0).split("'")[1]} + + # read data from the Maple create() statement + for i, line in enumerate(inp): + line = line.split(" = ", 1) + + if len(line) > 1: + line[0] = line[0].strip() + + if line[0] in ["category"]: + line[1] = line[1].strip()[1:-1].strip() + + elif line[0] == "begin" and "proc (x) [1, x] end proc" in line[1]: + temp = [[1, int(d)] for d in inp[i + 2].split(",")] + if len(temp) > 10: + temp = temp[:10] + line[1] = str(temp)[1:-1] + + elif line[0] in ["booklabelv1", "booklabelv2", "general", "constraints", "begin", "parameters"]: + line[1] = line[1].strip()[1:-2].strip() + + elif line[0] in ["lhs", "factor", "front", "even", "odd"]: + if line[1].strip()[-1] == ",": + line[1] = line[1].strip()[:-1] + line[1] = line[1].strip() + self.fields[line[0]] = line[1] + + # assign fields containing information about the equation + self.eq_type = self.fields["type"] + self.category = self.fields["category"] + self.label = self.fields["booklabelv1"] + self.lhs = self.fields["lhs"] + self.factor = self.fields["factor"] + self.front = self.fields["front"] + self.begin = self.fields["begin"] + self.constraints = self.fields["constraints"] + self.parameters = self.fields["parameters"] + + # even-odd case handling + if "general" in self.fields: + self.general = self.fields["general"] + elif "even" in self.fields and "odd" in self.fields: + self.general = [self.fields["even"], self.fields["odd"]] + + +class LatexEquation(object): + def __init__(self, label, equation, metadata): + self.label = label + self.equation = equation + self.metadata = metadata + + @classmethod + def from_maple(cls, eq): + # (List[MapleEquation]) -> LatexEquation + # modify fields + eq.lhs = translate(eq.lhs) + eq.factor = translate(eq.fields["factor"]) + eq.front = translate(eq.fields["front"]) + eq.begin = parse_brackets(eq.begin) + + if eq.factor == "1": + eq.factor = "" + + equation = eq.lhs + "\n = " + metadata = dict() + + # translates the Maple information (with spacing) + if eq.eq_type == "series": + # add factor and front with accompanying symbols, if they exist + equation += evaluate(eq.factor + " ", eq.factor) + evaluate(eq.front + "+", eq.front) + equation += "\\sum_{k=0}^\\infty " + + eq.general = translate(eq.general) + + if eq.category == "power series": + equation += eq.general + elif eq.category == "asymptotic series": # make sure to fix asymptotic series + equation += "(" + eq.general + ")" + + elif eq.eq_type == "contfrac": + # obtain data from eq.general + try: + pieces = parse_brackets(eq.general) + except AttributeError: # in form of even, odd + pieces = list() + for piece in eq.general: + pieces += parse_brackets(piece) + + # if there are multiple forms (requires substitution) + if len(pieces) > 1: + metadata["substitution"] = ','.join(perform_substitution(eq, pieces)) + pieces = ["s_m", "1"] + else: + pieces = pieces[0] + + start = 1 # in case the value of start isn't assigned + + # add terms before general + equation += evaluate(eq.front + "+", eq.front) + + for piece in eq.begin: + equation += make_frac(piece) + " \\subplus " + start += 1 + + if eq.factor == "-1": + equation += "-" + else: + equation += evaluate(eq.factor + " ", eq.factor) + + # trim unnecessary parentheses + for i, element in enumerate(pieces): + pieces[i] = trim_parens(translate(element)) + + if pieces != ["0", "1"]: + equation += "\\CFK{m}{" + str(start) + "}{\\infty}@@{" + pieces[0] + "}{" + pieces[1] + "}" + else: + equation += "\\dots" + + metadata["constraint"] = translate(eq.constraints) + metadata["category"] = eq.category + metadata["mapletag"] = eq.label + + return cls(eq.label, replace_strings(equation, SPECIAL), metadata) + + @staticmethod + def get_sortable_label(equation): + if equation.label == "": + return [sys.maxsize, sys.maxsize, sys.maxsize] + + label = copy.copy(equation.label) + for i, ch in enumerate(ascii_lowercase): + if label[-1] == ch: + label = label[:-1] + "." + str(i + 1) + + return map(int, filter(lambda x: x != "", label.split("."))) + + def __str__(self): + metadata = "" + for data_type, data in self.metadata.iteritems(): + if data == "": + continue + + if data_type in ["constraint", "substitution"]: # mathmode + metadata += " % \\" + data_type + "{$" + replace_strings(data, SPECIAL) + "$}\n" + else: + metadata += " % \\" + data_type + "{" + data + "}\n"\ + + return "\\begin{equation}\n " + self.equation + "\n" + metadata + "\\end{equation}\n" + + +def evaluate(data, key): + # (Any, bool) -> Any + """ + Will return data as long as key is not False. + If key is False, returns 0 or blank string, depending on type(data). + Used as replacement for "if data != "": ...", and similar statements. + """ + return data * bool(key) + + +def replace_strings(string, keys): + # type: (str, dict) -> str + """Replaces key strings with their mapped value.""" + for key in list(keys): + string = string.replace(key, keys[key]) + + return string + + +def parse_brackets(string): + # type: (str) -> List[str] + """Obtains the contents from data encapsulated in square brackets.""" + + if not string: + return "" + + exp = string[1:-1].split(",") + for i, e in enumerate(exp): + exp[i] = replace_strings(e, {"[": "", "]": ""}).strip() + + i = 0 + while i + 1 < len(exp): + exp[i] = [exp[i], exp.pop(i+1)] + i += 1 + + return exp + + +def trim_parens(exp): + # type: (str/List[str]) -> str + """Removes unnecessary parentheses.""" + + if type(exp) in [unicode, str] and exp == "": + return "" + elif type(exp) == list and exp == []: + return [] + + # checks whether the outer set of parentheses are necessary + if exp[0] == "(" and exp[-1] == ")": + test = exp[1:-1] + + # validate whether test is correct (in terms of parentheses) + s = list() # stack + for ch in test: + if ch == "(": + s.append(ch) + elif ch == ")": + if len(s) == 0: + return exp + else: + s.pop() + + return test + + return exp + + +def make_frac(parts): + # type: (List[str]) -> str + """Generate a LaTeX fraction from its numerator and denominator.""" + + return translate("(" + parts[0] + ") / (" + parts[1] + ")") + + +def basic_translate(exp): + # type: (List[str]) -> str + """Translates basic mathematical operations.""" + + # translates operations in place + for order in range(3): # order of operations + i = 0 + while i < len(exp): + modified = False + + # factorial + if exp[i] == "!" and order == 0: + exp[i - 1] += "!" + modified = True + + # power + elif exp[i] == "^" and order == 0: + power = trim_parens(exp.pop(i + 1)) + exp[i - 1] += "^{" + power + "}" + modified = True + + # multiplication + elif exp[i] == "*" and order == 1: + # adds spacing when necessary + if exp[i - 1][-1] not in "}]" and "\\" in exp[i - 1] and exp[i + 1][0] != "\\": + exp[i - 1] += " " + + exp[i - 1] += exp.pop(i + 1) + modified = True + + # division + elif exp[i] == "/" and order == 1: + # remove extra parentheses + for index in [i - 1, i + 1]: + exp[index] = trim_parens(exp[index]) + exp[i - 1] = "\\frac{" + exp[i - 1] + "}{" + exp.pop(i + 1) + "}" + modified = True + + # removes extra characters + if modified: + exp.pop(i) + i -= 1 + else: + i += 1 + + return ''.join(exp) + + +def perform_substitution(eq, forms): + # (MapleEquation, List[str]) -> List[str] + """Performs variable substitutions on the strings in eq.general.""" + + replacements = list() + if len(eq.general) == 2: + replacements = ["2j", "2j+1"] + elif forms: + for i, _ in enumerate(forms): + replacement = str(len(forms)) + "j" + if i < len(forms) - 1: + replacement += "-" + str(len(forms) - i - 1) + + replacements.append(replacement) + + for i, form in enumerate(forms): + for j, half in enumerate(form): + half = tokenize(half) + for k, ch in enumerate(half): + if ch == "m": + half[k] = "(" + replacements[i] + ")" + + form[j] = ' '.join(half) + + forms[i] = "s_{" + replacements[i] + "} = " + make_frac(form) + + return forms + + +def get_arguments(function_name, arg_string): + # type: (str, List[str]) -> (List[str], List[str]) + """Generates the function pieces and the arguments.""" + + parens_mod = False + + # no arguments + if not arg_string: # arg_string == [] + args = [] + + # handling for not + elif function_name == "not": + inversion = {"<": "\\geq ", ">": "\\leq ", "\\in": "\\notin "} + + for i, ch in enumerate(arg_string): + if ch in inversion: + arg_string[i] = inversion[ch] + + args = [basic_translate(arg_string)] + + # handling for ranges (constraints) + elif function_name == "RealRange": + for i, piece in enumerate(arg_string): + if trim_parens(piece) != piece: + arg_string[i] = trim_parens(piece) + + args = basic_translate(arg_string).split(",") + + # handling for trigamma + elif function_name == "Psi" and arg_string[0] == "1": + function_name = "special-trigamma" + args = [basic_translate(arg_string[2])] + + # handling for hypergeometric, q-hypergeometric functions + elif function_name in ["hypergeom", "qhyper"]: + args = list() + for s in ' '.join(arg_string).split("] , "): + args.append(basic_translate(replace_strings(s, {"[": "", "]": ""}).split())) + + if function_name == "qhyper": + args += args.pop(2).split(",") + + for p, i in enumerate([1, 0]): + arg_count = evaluate(args[i + p].count(",") + 1, args[i + p]) + args.insert(0, str(arg_count)) + + # handling for sums + elif function_name == "sum": + args = basic_translate(arg_string).split(",") + args = args.pop(1).split("..") + [args[0]] + if args[1] == "infinity": + args[1] = "\\infty" + + # handling for function in case it has optional parentheses + elif function_name in MULTI_ARGS and len(arg_string) == 1: + parens_mod = True + args = basic_translate(arg_string).split(",") + + else: + args = basic_translate(arg_string).split(",") + + result = list() + for function in FUNCTIONS: + for variant in FUNCTIONS[function]: + if function_name == function and len(args) == variant["args"]: + result = copy.copy(variant["repr"]) + + # modify macro to form without parentheses + if parens_mod: + result[0] = result[0].replace("@", "@@") + + return [result, args] + + +def generate_function(name, args): + # type: (str, List[str]) -> str + """Generate a function with the provided function name and arguments.""" + + result, args = get_arguments(name, args) + + # places arguments between shell of function + for n in range(1, len(result)): + result.insert(2 * n - 1, args[n - 1]) + + return ''.join(result) + + +def translate(exp): + # type: (str) -> str + """Format Maple code as LaTeX.""" + + if exp == "": + return "" + + # initial formatting of input string + exp = replace_strings(exp.strip(), CONSTRAINTS) + exp = replace_strings(exp, {"functions:-": ""}) + exp = tokenize(exp) + + for i, s in enumerate(exp): + if exp[i] in SYMBOLS: + exp[i] = SYMBOLS[s] + + i = len(exp) - 1 + while i >= 0: + if exp[i] == "(": # handle contents between parentheses + r = i + exp[i:].index(")") + piece = exp[i:r + 1] + + if exp[i - 1] == "]": # for logarithm function + sq = i - 2 - exp[:i - 1][::-1].index("[") + piece = [piece[0]] + exp[sq + 1:i - 1] + [","] + piece[1:] + i = sq + + if exp[i - 1] in FUNCTIONS: # handling for functions + i -= 1 + piece = generate_function(exp[i], trim_parens(piece)) + + else: + piece = basic_translate(piece) + + # remove unnecessary parentheses around fractions + if "frac" in replace_strings(piece, {"(": ""})[:6] and (r + 2 > len(exp) or exp[r + 1] != "^"): + while piece != trim_parens(piece): + piece = trim_parens(piece) + + exp = exp[0:i] + [piece] + exp[r + 1:] + + i -= 1 + + return basic_translate(exp) diff --git a/maple2latex/test/__init__.py b/maple2latex/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/maple2latex/test/test_cases.json b/maple2latex/test/test_cases.json new file mode 100644 index 0000000..85881ee --- /dev/null +++ b/maple2latex/test/test_cases.json @@ -0,0 +1,242 @@ +{ + "translator": { + "parse_brackets": [ + { + "exp": "[1,2, 3]", + "res": [["1", "2"], "3"] + }, + + { + "exp": "[1]", + "res": ["1"] + } + ], + + "trim_parens": [ + { + "exp": "(1 + 2)", + "res": "1 + 2" + }, + + { + "exp": "(3)(4)", + "res": "(3)(4)" + }, + + { + "exp": "((1 + 2))", + "res": "(1 + 2)" + }, + + { + "exp": "", + "res": "" + }, + + { + "exp": [], + "res": [] + } + ], + + "basic_translate": [ + { + "exp": ["1", "+", "2", "/", "(3)", "*", "4", "-", "5", "!", "^", "-6"], + "res": "1+\\frac{2}{3}4-5!^{-6}" + }, + + { + "exp": ["\\cpi", "*", "3"], + "res": "\\cpi 3" + } + ], + + "get_arguments": [ + { + "function": "rabbit", + "arg_string": [], + "res": [["\\rabbitConstant"], []] + }, + + { + "function": "hypergeom", + "arg_string": ["[1", ",", "2]", ",", "[]", ",", "4"], + "res": [["\\HyperpFq{", "}{", "}@@{", "}{", "}{", "}"], ["2", "0", "1,2", "", "4"]] + }, + + { + "function": "qhyper", + "arg_string": ["[1", ",", "2", ",", "3]", ",", "[4", ",", "5]", ",", "6", ",", "7"], + "res": [["\\qHyperrphis{", "}{", "}@@{", "}{", "}{", "}{", "}"], ["3", "2", "1,2,3", "4,5", "6", "7"]] + }, + + { + "function": "sum", + "arg_string": ["m", ",", "1..infinity"], + "res": [["\\sum_{", "}^{", "} (", ")"], ["1", "\\infty", "m"]] + }, + + { + "function": "BesselJ", + "arg_string": ["\\nu", ",", "z"], + "res": [["\\BesselJ{", "}@{", "}"], ["\\nu", "z"]] + }, + + { + "function": "RealRange", + "arg_string": ["0", ",", "(1)"], + "res": [["(", ", ", ")"], ["0", "1"]] + }, + + { + "function": "Psi", + "arg_string": ["1", ",", "x"], + "res": [["\\digamma'@{", "}"], ["x"]] + }, + + { + "function": "not", + "arg_string": ["x", "<", "3"], + "res": [["", ""], ["x\\geq 3"]] + } + ], + + "translate": [ + { + "exp": "sin(x)", + "res": "\\sin@@{x}" + }, + + { + "exp": "log[beta](nu)", + "res": "\\log_{\\beta}@{\\nu}" + } + ], + + "from_maple": [ + { + "eq": [ + "create( 'series',", + "booklabelv1 = \"0.0.0\",", + "category = \"power series\"", + "lhs = n,", + "factor = 4/5,", + "general = [ 2 * k - 3 ],", + "constraints = { k::integer }," + ], + "res": "\\begin{equation}\n n\n = \\frac{4}{5} \\sum_{k=0}^\\infty 2k-3\n % \\category{power series}\n % \\mapletag{0.0.0}\n % \\constraint{$k\\in\\mathbb{Z}$}\n\\end{equation}\n" + }, + + { + "eq": [ + "create( 'series',", + "booklabelv1 = \"0.0.0\",", + "category = \"asymptotic series\"", + "lhs = p,", + "front = 17,", + "general = [ k / 2 ]," + ], + "res": "\\begin{equation}\n p\n = 17+\\sum_{k=0}^\\infty \\left(\\frac{k}{2}\\right)\n % \\category{asymptotic series}\n % \\mapletag{0.0.0}\n\\end{equation}\n" + }, + + { + "eq": [ + "create( 'contfrac', ", + "booklabelv1 = \"0.0.0\",", + "category = \"test_data\"", + "lhs = zeta,", + "factor = 15,", + "general = [ [3, 5] ]," + ], + "res": "\\begin{equation}\n \\zeta\n = 15 \\CFK{m}{1}{\\infty}@@{3}{5}\n % \\category{test_data}\n % \\mapletag{0.0.0}\n\\end{equation}\n" + }, + + { + "eq": [ + "create( 'contfrac', ", + "booklabelv1 = \"0.0.0\",", + "category = \"test_data\"", + "lhs = zeta,", + "begin = map(proc (x) [1, x] end proc,", + "[", + "1,2,3,4,5,6,7,8,9,10,11", + "]),", + "front = 3,", + "factor = 1,", + "general = [[0, 1]]," + ], + "res": "\\begin{equation}\n \\zeta\n = 3+\\frac{1}{1} \\subplus \\frac{1}{2} \\subplus \\frac{1}{3} \\subplus \\frac{1}{4} \\subplus \\frac{1}{5} \\subplus \\frac{1}{6} \\subplus \\frac{1}{7} \\subplus \\frac{1}{8} \\subplus \\frac{1}{9} \\subplus \\frac{1}{10} \\subplus \\dots\n % \\category{test_data}\n % \\mapletag{0.0.0}\n\\end{equation}\n" + }, + + { + "eq": [ + "create( 'contfrac', ", + "booklabelv1 = \"\",", + "category = \"test_data\"", + "lhs = zeta,", + "begin = [[1,2]],", + "factor = 3,", + "front = 4,", + "even = [[0, 1]],", + "odd = [[2, 3]]," + ], + "res": "\\begin{equation}\n \\zeta\n = 4+\\frac{1}{2} \\subplus 3 \\CFK{m}{2}{\\infty}@@{s_m}{1}\n % \\category{test_data}\n % \\substitution{$s_{2j} = \\frac{0}{1},s_{2j+1} = \\frac{2}{3}$}\n\\end{equation}\n" + }, + + { + "eq": [ + "create( 'contfrac', ", + "booklabelv1 = \"\",", + "category = \"test_data\"", + "lhs = zeta,", + "begin = [[1,2]],", + "factor = -1,", + "front = 4,", + "general = [[m, 2], [2, 3], [3, 4]]," + ], + "res": "\\begin{equation}\n \\zeta\n = 4+\\frac{1}{2} \\subplus -\\CFK{m}{2}{\\infty}@@{s_m}{1}\n % \\category{test_data}\n % \\substitution{$s_{3j-2} = \\frac{\\left(3j-2\\right)}{2},s_{3j-1} = \\frac{2}{3},s_{3j} = \\frac{3}{4}$}\n\\end{equation}\n" + } + ], + + "get_sortable_label": [ + { + "eq": [ + "create( 'contfrac', ", + "booklabelv1 = \"\",", + "category = \"test_data\"", + "lhs = zeta,", + "begin = [[1,2]],", + "factor = 3,", + "front = 4,", + "even = [[0, 1]],", + "odd = [[2, 3]]," + ], + "res": [9223372036854775807, 9223372036854775807, 9223372036854775807] + }, + + { + "eq": [ + "create( 'contfrac', ", + "booklabelv1 = \"3.4.5a\",", + "category = \"test_data\"", + "lhs = zeta,", + "factor = 15,", + "general = [ [3, 5] ]," + ], + "res": [3, 4, 5, 1] + }, + + { + "eq": [ + "create( 'contfrac', ", + "booklabelv1 = \"3.4.5.\",", + "category = \"test_data\"", + "lhs = zeta,", + "factor = 15,", + "general = [ [3, 5] ]," + ], + "res": [3, 4, 5] + } + ] + } +} \ No newline at end of file diff --git a/maple2latex/test/test_translator.py b/maple2latex/test/test_translator.py new file mode 100644 index 0000000..c0a09c2 --- /dev/null +++ b/maple2latex/test/test_translator.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python + +__author__ = "Joon Bang" +__status__ = "Development" + +import json +from unittest import TestCase +import src.translator as t + +TEST_CASES = json.loads(open("maple2latex/test/test_cases.json").read())["translator"] + +parse_brackets_test_cases = TEST_CASES["parse_brackets"] +trim_parens_test_cases = TEST_CASES["trim_parens"] +basic_translate_test_cases = TEST_CASES["basic_translate"] +get_arguments_test_cases = TEST_CASES["get_arguments"] +translate_test_cases = TEST_CASES["translate"] +from_maple_test_cases = TEST_CASES["from_maple"] +get_sortable_label_test_cases = TEST_CASES["get_sortable_label"] + + +class TestParseBrackets(TestCase): + def test_parse_brackets(self): + for case in parse_brackets_test_cases: + self.assertEqual(t.parse_brackets(case["exp"]), case["res"]) + + +class TestTrimParens(TestCase): + def test_trim_parens(self): + for case in trim_parens_test_cases: + self.assertEqual(t.trim_parens(case["exp"]), case["res"]) + + +class TestBasicTranslate(TestCase): + def test_basic_translate(self): + for case in basic_translate_test_cases: + self.assertEqual(t.basic_translate(case["exp"]), case["res"]) + + +class TestGetArguments(TestCase): + def test_get_arguments(self): + for case in get_arguments_test_cases: + self.assertEqual(t.get_arguments(case["function"], case["arg_string"]), case["res"]) + + +class TestTranslate(TestCase): + def test_translate(self): + for case in translate_test_cases: + self.assertEqual(t.translate(case["exp"]), case["res"]) + + +class TestFromMaple(TestCase): + def test_from_maple(self): + for case in from_maple_test_cases: + self.assertEqual(str(t.LatexEquation.from_maple(t.MapleEquation(case["eq"]))), case["res"]) + + +class TestGetSortableLabel(TestCase): + def test_get_sortable_label(self): + for case in get_sortable_label_test_cases: + self.assertEqual(t.LatexEquation.get_sortable_label(t.MapleEquation(case["eq"])), case["res"]) diff --git a/testdata/llinks b/testdata/llinks new file mode 100644 index 0000000..72ed132 --- /dev/null +++ b/testdata/llinks @@ -0,0 +1 @@ +eq:EF.EX.TM => DLMF:/4.9#E4 \ No newline at end of file diff --git a/tex2wiki/.gitignore b/tex2wiki/.gitignore new file mode 100644 index 0000000..1fea6f9 --- /dev/null +++ b/tex2wiki/.gitignore @@ -0,0 +1,6 @@ +AzeemOldCode/ +*Glossary.csv* +*.mmd +*.bak +*.tex +data/* \ No newline at end of file diff --git a/tex2wiki/README.md b/tex2wiki/README.md new file mode 100644 index 0000000..3ae558d --- /dev/null +++ b/tex2wiki/README.md @@ -0,0 +1,8 @@ +# tex2Wiki + +## Azeem Mohammed, Joon Bang + +WIP code + + +This code is meant to convert LaTeX code into WikiText for DRMF. \ No newline at end of file diff --git a/tex2wiki/src/__init__.py b/tex2wiki/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tex2wiki/src/compare_files.py b/tex2wiki/src/compare_files.py new file mode 100644 index 0000000..982644f --- /dev/null +++ b/tex2wiki/src/compare_files.py @@ -0,0 +1,12 @@ +import os + + +def compare(output_file, number=0): + commands = [ + "TYPE %s.mmd | FIND /V \"\" > %s.frmt" % (output_file, output_file), + "TYPE %s.mmd.bak | FIND /V \"\" > %s.bak.frmt" % (output_file, output_file), + "fc /N %s.frmt %s.bak.frmt > tex2wiki\\data\\output%s.txt" % (output_file, output_file, str(number)) + ] + + for command in commands: + os.system(command) diff --git a/tex2wiki/src/tex2wiki.py b/tex2wiki/src/tex2wiki.py new file mode 100644 index 0000000..7fb06a3 --- /dev/null +++ b/tex2wiki/src/tex2wiki.py @@ -0,0 +1,592 @@ +__author__ = "Joon Bang" +__status__ = "Development" + +import copy +import compare_files +import csv +import sys + +GLOSSARY_LOCATION = "tex2wiki/data/new.Glossary.csv" +METADATA_TYPES = ["substitution", "constraint"] +METADATA_MEANING = {"substitution": "Substitution(s)", "constraint": "Constraint(s)"} + +# TODO: Fix bugs with the special cases formula formatting; causes issues with math id="...", spantext +# TODO: Notes about bugs of old (Azeem) output: +# TODO: 09.25:27 (headers are bugged) +# TODO: 09.07:07 (misses \iunit) +# TODO: 09.07:19 (misses \cos@@) +# TODO: 09.08:19 (headers are bugged) +# TODO: 09.15:17 (misses \HyperpFq) +# TODO: 09.15:19 (misses \cos@@) + + +class LatexEquation(object): + def __init__(self, label, raw_label, equation, metadata): + self.label = label + self.raw_label = raw_label + self.equation = equation + self.metadata = metadata + + def __str__(self): + return self.label + "\n" + self.equation + "\n" + str(self.metadata) + + @staticmethod + def make_from_raw(raw): + equations = raw[:-1] + for i, equation in enumerate(equations): + # formula stuff + try: + raw_formula, formula = format_formula(get_data_str(equation, latex="\\formula")) + except IndexError: # there is no formula. + break + + equation = equation.split("\n") + + # get metadata + raw_metadata = "" + + j = 0 + while j < len(equation): + if "%" in equation[j]: + raw_metadata += equation.pop(j)[1:].strip().strip("\n") + "\n" + else: + j += 1 + + metadata = dict() + for data_type in METADATA_TYPES: + temp = format_metadata(get_data_str(raw_metadata, latex="\\" + data_type)).split("\n") + for k, line in enumerate(temp): + if line.rstrip().endswith("&"): + temp[k] = line.rstrip() + "
" + + metadata[data_type] = "\n".join(temp) + + equations[i] = LatexEquation(formula, raw_formula, '\n'.join(equation), metadata) + + return equations + + +class DataUnit(object): + def __init__(self, title, subunits): + self.title = title + self.subunits = subunits + + def __str__(self): + result = self.title + "\n" + + if type(self.subunits) == list and len(self.subunits) and type(self.subunits[0]) == DataUnit: + for sub in self.subunits: + result += str(sub) + "\n" + else: + result += str("\n".join([str(eq) for eq in self.subunits])) + "\n" + + return result + + +def generate_html(tag_name, text, options=None, spacing=2): + # type: (str, str(, dict, bool)) -> str + """ + Generates an html tag, with optional html parameters. + When spacing = 0, there should be no spacing. + When spacing = 1, the tag, text, and end tag are padded with spaces. + When spacing = 2, the tag, text, and end tag are padded with newlines. + """ + if options is None: + options = {} + + option_text = [key + "=\"" + value + "\"" for key, value in options.iteritems()] + result = "<" + tag_name + " " * (option_text != []) + ", ".join(option_text) + ">" + + if spacing == 2: + result += "\n" + text + "\n\n" + elif spacing == 1: + result += " " + text + " " + else: + result += text + "" + + return result + + +def generate_math_html(text, options=None, spacing=2): + # type: (str(, dict, int)) -> str + """Special case of generate_html, where the tag is "".""" + if options is None: + options = {} + + option_text = [key + "=\"" + value + "\"" for key, value in options.iteritems()] + result = "" + + if spacing == 2: + result += "{\\displaystyle \n" + text + "\n}\n" + elif spacing == 1: + result += "{\\displaystyle " + text + "}\n" + else: + result += "{\\displaystyle " + text + "}" + + return result + + +def generate_link(left, right=""): + # type: (str(, str)) -> str + """Generates a MediaWiki link.""" + if right == "": + return "[[" + left + "|" + left + "]]" + + return "[[" + left + "|" + right + "]]" + + +def multi_split(s, seps): + # type: (str, list) -> list + """Splits a string on multiple characters, specified in "seps".""" + res = [s] + for sep in seps: + s, res = res, [] + for seq in s: + res += seq.split(sep) + + return res + + +def convert_dollar_signs(string): + # type: (str) -> str + """Converts dollar signs to html for math mode.""" + count = 0 + result = "" + for i, ch in enumerate(string): + if ch == "$": + if count % 2 == 0: + result += "{\\displaystyle " + else: + result += "}" + count += 1 + else: + result += ch + + return result + + +def format_formula(formula): + # (list) -> list + """Obtain the raw formula (the numerical values), as well as the formatted version.""" + if formula[0] == ":": # handling for Jacobi special stuff + return [str(int(formula[1:]))], formula[1:].zfill(2) + + formula = multi_split(formula.split("Formula:", 1)[1], [".", ":"]) + + for j in [-1, -2, -3]: + formula[j] = formula[j].zfill(2) + + raw = copy.deepcopy(formula) + + # remove any text from the raw equation + i = 0 + while i < len(raw): + if not raw[i].isdigit(): + raw.pop(i) + else: + raw[i] = str(int(raw[i])) # removes any 0s that are present from left end. + i += 1 + + if len(formula) == 3: + formula = formula[0] + "." + formula[1] + ":" + formula[2] + else: + formula = ":".join(formula[:-3]) + ":" + formula[-3] + "." + formula[-2] + ":" + formula[-1] + + return raw, formula + + +def format_metadata(string): + # type: (str) -> str + """Formats the metadata of an equation.""" + if string == "": + return "" + + # modified convert_dollar_sign algorithm + dollar_count = 0 + result = "" + for i, ch in enumerate(string): + if ch == "$": + if dollar_count % 2 == 1: + result += "}" + elif dollar_count > 1: + result = result[:-1] + "
\n{\\displaystyle " + else: + result += "{\\displaystyle " + dollar_count += 1 + else: + result += ch + + return result.strip() + + +def find_end(text, left_delimiter, right_delimiter, start=0): + # type: (str, str, str(, int)) -> int + """A .find that accounts for nested delimiters.""" + net = 0 # left delimiters encountered - right delimiters encountered + for i, ch in enumerate(text[start:]): + if ch == left_delimiter: + net += 1 + elif ch == right_delimiter: + if net == 1: + return i + start + else: + net -= 1 + + return -1 + + +def get_data_str(text, latex=""): + # type: (str(, str)) -> str + """Gets the string in between curly brackets.""" + start = text.find(latex + "{") + + if start == -1: + return "" + + return text[start + len(latex + "{"):find_end(text, "{", "}", start)] + + +def generate_nav_bar(info): + # type: (list) -> list + """Generates the navigation bar code for a page.""" + links = list() + for link, text in info: + link = link.replace("''", "") + text = text.replace("''", "") + links.append(generate_link(link, text)) + + nav_section = generate_html("div", "<< " + links[0], options={"id": "alignleft"}, spacing=1) + "\n" + \ + generate_html("div", links[1], options={"id": "aligncenter"}, spacing=1) + "\n" + \ + generate_html("div", links[2] + " >>", options={"id": "alignright"}, spacing=1) + + header = generate_html("div", nav_section, options={"id": "drmf_head"}) + footer = generate_html("div", nav_section, options={"id": "drmf_foot"}) + + return header, footer + + +def get_macro_name(macro): + # type: (str) -> str + """Obtains the macro name.""" + macro_name = "" + for ch in macro: + if ch.isalpha() or ch == "\\": + macro_name += ch + elif ch in ["@", "{", "["]: + break + + return macro_name + + +def find_all(pattern, string): + # type: (str, str) -> generator + """Finds all instances of pattern in string.""" + + i = string.find(pattern) + while i != -1: + yield i + i = string.find(pattern, i + 1) + + +def get_symbols(text, glossary): + # type: (str, dict) -> str + """Generates span text based on symbols present in text. Equivalent of old symbols_list module.""" + symbols = list() + + special_cases = {"&": "& : logical and
"} + acknowledged = dict() + for case in special_cases: + acknowledged[case] = False + + for keyword in glossary: + for index in find_all(keyword, text): + # if the macro is present in the text + if index != -1: + index += len(keyword) # now index of next character + if index >= len(text) or not text[index].isalpha(): + symbols.append([keyword, index]) + break + + span_text = "" + + # code to handle special cases + for keyword in special_cases: + for index in find_all(keyword, text): + if index != -1 and not acknowledged[keyword]: + span_text += special_cases[keyword] + "\n" + acknowledged[keyword] = True # to prevent duplicates + + for symbol in sorted(symbols, key=lambda l: l[1]): # sort by list index. + symbol = symbol[0] + links = list() + for cell in glossary[symbol]: + if "http://" in cell or "https://" in cell: + links.append(cell) + + id_link = links[0] + links = ["[" + link + " " + link + "]" for link in links] + + meaning = list(glossary[symbol][1]) + + count = 0 + for i, ch in enumerate(meaning): + if ch == "$" and count % 2 == 0: + meaning[i] = "{\\displaystyle " + count += 1 + elif ch == "$": + meaning[i] = "}" + count += 1 + + appearance = glossary[symbol][4].strip("$") + + span_text += "[" + id_link + " {\\displaystyle " + appearance + \ + "}] : " + ''.join(meaning) + " : " + " ".join(links) + "
\n" + + return remove_break(span_text) # slice off the extra br and endline + + +def create_general_pages(data, title_string=""): + # type: (DataUnit(, str)) -> str + """Creates the 'index' pages for each section. Corrected for use of DataUnit.""" + ret = "" + + section_names = [title_string] + [unit.title for unit in data.subunits] + [title_string] + + # deep down, subunits is a list of LatexEquation(s) + for i, section in enumerate(data.subunits): + result = "drmf_bof\n'''" + section.title.replace("''", "") + "'''\n{{DISPLAYTITLE:" + section.title + "}}\n" + + # get header and footer + center_text = (title_string + "#").replace(" ", "_") + section.title + link_info = [[section_names[i], section_names[i]], [center_text, section_names[i + 1]], + [section_names[i + 2], section_names[i + 2]]] + header, footer = generate_nav_bar(link_info) + + result += header + "\n" + equation_list_format(section)[0].rstrip("\n") + "\n" + footer + "\n" + "drmf_eof\n" + + ret += result + + # some post-processing + ret = ret.replace("\n\n\n", "\n") + + return ret + + +def equation_list_format(data, depth=0): + # type: (DataUnit(, str)) -> str + """Format the equations in a section into a list style.""" + + border = "=" * (2 + int(depth >= 2)) # '==' when depth < 2; '===' when depth >= 2 + text = "%s %s %s\n\n" % (border, data.title, border) + + contains_deeper_depth = False + metadata = list() + for i, unit in enumerate(data.subunits): + if type(unit) == LatexEquation: + equation = generate_math_html(unit.equation, options={"id": unit.label}) + metadata = list() + for data_type in sorted(unit.metadata.keys()): + if unit.metadata[data_type] != "": + metadata.append( + generate_html("div", METADATA_MEANING[data_type] + ": " + unit.metadata[data_type], + options={"align": "right"}, spacing=0) + ) + + text += equation.rstrip("\n") + "\n" * bool(len(metadata)) + "
\n".join(metadata) + "
\n" + else: + contains_deeper_depth = True + temp = equation_list_format(unit, depth + 1) + text = text.rstrip("\n") + "\n\n" + temp[0] + + if depth + 1 >= 2 and i == len(data.subunits) - 1 and temp[1]: + text = remove_break(text) + + if depth < 2 and metadata == list() and not contains_deeper_depth: + text = remove_break(text) + + return text, metadata == list() + + +def create_specific_pages(data, glossary, title_string): + # type: (DataUnit, dict) -> str + """Creates specific pages for each formula. Corrected for use with DataUnit.""" + + formulae = [title_string] + make_formula_list(data)[0][:-1] + [title_string] + + i = 0 + pages = list() + for j, unit in enumerate(data.subunits): + res, i = equation_page_format(unit, unit.title, formulae, glossary, i) + pages += res + i += 1 + + return "\n".join(pages) + "\n" + + +def make_formula_list(info, depth=0): + # (str(, int)) -> (str, int) + """Generates the list of formulae contained in the file. Used for generating headers & footers.""" + + formulae = list() + if len(info.subunits) and type(info.subunits[0]) != DataUnit: + for eq in info.subunits: + formulae.append("Formula:" + eq.label) + else: + for subunit in info.subunits: + formulae += make_formula_list(subunit, depth + 1)[0] + + if depth < 2: + formulae.append(info.title) + + return formulae, depth + + +def equation_page_format(info, title, formulae, glossary, i=0): + # (DataUnit, str, list, dict(, int)) -> (str, int) + """Formats equations into individual MediaWiki pages.""" + pages = list() + + if len(info.subunits) and type(info.subunits[0]) != DataUnit: + for eq in info.subunits: + # get header and footer + center_text = (title + "#" + eq.label).replace(" ", "_") + middle = "formula in " + title + + last_index = i + 2 + int("Formula" not in formulae[i + 2]) # sets the index for the "next" link + + link_info = [[formulae[i].replace(" ", "_"), formulae[i]], [center_text, middle], + [formulae[last_index].replace(" ", "_"), formulae[last_index]]] + header, footer = generate_nav_bar(link_info) + + # add title of page, navigation headers + result = "drmf_bof\n'''Formula:" + eq.label + "'''\n{{DISPLAYTITLE:Formula:" + eq.label + "}}\n" + header \ + + "\n
" + + # add formula + result += generate_html("div", generate_math_html(eq.equation)[:-1], options={"align": "center"}, + spacing=0) + "\n\n" + + # add metadata + for data_type, info in eq.metadata.iteritems(): + if info != "": + result += "== " + METADATA_MEANING[data_type] + " ==\n\n" + result += generate_html("div", info, options={"align": "left"}, spacing=0) + "
\n\n" + + # proof section + result += "== Proof ==\n\nWe ask users to provide proof(s), reference(s) to proof(s), or further " \ + "clarification on the proof(s) in this space.\n\n" + + # symbols list section + result += "== Symbols List ==\n\n" + result += get_symbols(result, glossary) + "\n
\n\n" + + # bibliography section + result += "== Bibliography==\n\n" # TODO: Fix typo after feature parity has been met + result += "" \ + "[http://homepage.tudelft.nl/11r49/askey/contents.html " \ + "Equation in Section " + \ + ".".join(eq.raw_label[:2]) + \ + "] of [[Bibliography#KLS|'''KLS''']].\n\n" # Meaning? Need to check validity of this. + + # url links placeholder + result += "== URL links ==\n\nWe ask users to provide relevant URL links in this space.\n\n" + + # end of page + result += "
" + footer + "\ndrmf_eof" + pages.append(result) + + i += 1 + else: + for subunit in info.subunits: + res = equation_page_format(subunit, title, formulae, glossary, i) + pages += res[0] + i = res[1] + + return pages, i + + +def remove_break(string): + # (str) -> str + """Removes
from the end of a string.""" + + while string.rstrip("\n").endswith("
"): + string = string.rstrip("\n")[:-6] + + return string + + +def section_split(string, sub=0): + # type: (str) -> DataUnit + """Split string into DataTree objects.""" + + string = string.split("\\" + sub * "sub" + "section") + + # base case; when depth too far + if len(string) == 1: + title = get_data_str(string[0]).replace("$", "''") + + equations = string[0].split("\\end{equation}") + for i, equation in enumerate(equations[:-1]): + equations[i] = equation.split("\\begin{equation}", 1)[1].strip() + + equations = LatexEquation.make_from_raw(equations) + + return DataUnit(title, equations) + + chunk_data = list() # list of DataSection + + for chunk in string[1:]: + chunk_data.append(section_split(chunk, sub + 1)) + + title = get_data_str(string[0]).replace("$", "''") + + return DataUnit(title, chunk_data) + + +def usage(): + """Prints usage of program.""" + + print "Usage: python tex2wiki.py filename1 filename2 ...\nNote: filename(s) should NOT include the extension." + sys.exit(0) + + +def main(input_file, output_file, title): + # (str, str, str) -> None + """Converts a .tex file to MediaWiki page(s).""" + + with open(input_file) as f: + text = f.read() + + glossary = dict() + with open(GLOSSARY_LOCATION, "rb") as csv_file: + glossary_file = csv.reader(csv_file, delimiter=',', quotechar='\"') + for row in glossary_file: + glossary[get_macro_name(row[0])] = row + + text = text.split("\\begin{document}", 1)[1] + + info = section_split(text) # creates tree, split into section, subsection, subsubsection, etc. + + output = create_general_pages(info, title) + create_specific_pages(info, glossary, title) + output = output.replace("

", "
") + + with open(output_file, "w") as f: + f.write(output) + + +if __name__ == '__main__': + if len(sys.argv) < 2: + usage() + + for i, filename in enumerate(sys.argv[1:]): + main( + input_file=filename + ".tex", + output_file=filename + ".mmd", + title="Orthogonal Polynomials" + ) + + print "Complete. Now comparing files..." + + compare_files.compare(filename.replace("/", "\\"), i) # only works for Windows + + print "File comparison successful." diff --git a/wikidata/Documentation.md b/wikidata/Documentation.md new file mode 100644 index 0000000..4baabd2 --- /dev/null +++ b/wikidata/Documentation.md @@ -0,0 +1,2 @@ +The relevant pages to manually create, and list semantic properties are availible from +http://wikidata-drmf2016.wmflabs.org/wiki/Special:SpecialPages#Wikibase