A simple library to create latex exam in python
Project description
pytexexam
A simple library for writing and printing exam in Python.
Installation
pip install pytexexam
How to use
import pytexexam.latexexamutil as util
from pytexexam import LatexExamBuilder, ExamExportType
# Create exam builder
builder = LatexExamBuilder()
# You can add preamble here
builder.preamble = util.ams_math_package()
# Exam header
builder.header = "This is a simple header"
# Exam footer
builder.footer = "This is a simple footer"
# You can export exam in tex file or pdf file (need Latex installed)
builder.export_type = ExamExportType.PDF
# Add question
builder.add_question(
question="This is a simple question",
# Answers: This package auto add A, B, C, D ... in answers
answer=["Answer 1", "Answer 2", "Answer 3", "Answer 4"],
# True answer key
true_answer="A",
# present answer in multiple column
answer_column=4,
# Solution of this question
solution="This is solution for this question",
)
# Creste exam, answer and solution!
builder.create_exam("exam1")
builder.create_answer("answer1")
builder.create_solution("solution1")
All package API.
If you want to see all the functions included in this library, you can find the pytexexam.pdf file in the docs directory
Contribution.
Contribution are welcome. Create a pull request.
Buy me a coffee.
If you find this project useful, you can buy me coffee through Flattr
License
Apache License, Version 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytexexam-2.0.0.tar.gz
(6.1 kB
view hashes)
Built Distribution
pytexexam-2.0.0-py3-none-any.whl
(12.6 kB
view hashes)
Close
Hashes for pytexexam-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3639fb7594044ecd31ef8421db65031ac3943fec8f2c9a4705b21886a69cfe8 |
|
MD5 | 169cf2cfcd340140ea1889c6535cf782 |
|
BLAKE2b-256 | 2b1ca44d1716c62886399ed63991f9708739b4428142810020ae819c15cb2e46 |