https://github.com/freakwill/pylatex_ext
🔌extension of pylatex
https://github.com/freakwill/pylatex_ext
latex pylatex
Last synced: 2 months ago
JSON representation
🔌extension of pylatex
- Host: GitHub
- URL: https://github.com/freakwill/pylatex_ext
- Owner: Freakwill
- Created: 2018-06-18T11:12:43.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-28T08:55:29.000Z (about 5 years ago)
- Last Synced: 2025-07-30T05:24:12.554Z (11 months ago)
- Topics: latex, pylatex
- Language: Python
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pylatex_ext
🔌Extension of pylatex
## Download
It has not been uploaded to pypi, download it from github.
## What am I proud of?
```python
class Slash:
"""Shorthand for Command.
Make defining command more eazy.
"""
escape = False
def __getattr__(self, command):
def f(*args, **kwargs):
args = Arguments(*args)
args.escape = self.escape
return Command(command, arguments=args, **kwargs)
return f
__ = Slash() # __.frac('x', 'y').dumps() == '\frac{x}{y}'
def diff(y, x='x'):
r"""Generate Latex code r'\frac{d y}{d x}'.
Arguments:
y {str} -- dependent variable
Keyword Arguments:
x {str} -- independent variable (default: {'x'})
Returns:
Command
"""
return __.frac(
(__.mathrm('d').dumps()) + y, (__.mathrm('d').dumps()) + x)
```
## Application
I make a system to produce exam paper (with or without answer) with `pylatex_ext`