BHCexam.cls

Automated Exam Typesetting Infrastructure

Stop formatting manually. BHCexam.cls handles the tedious LaTeX internals—MCQ alignment, dual-version generation, and grading counters—so you can focus purely on the content.
tlmgr install bhcexam

Powering the Mathcrowd Problem Database

BHCexam.cls is the core typesetting engine behind Mathcrowd, generating professional exam PDFs for massive question banks.
Maintaining excellence in automated exam typesetting for over 13 years (since 2011).
Visit Open Problem Database

The Old Way vs. The BHCexam Way

Traditional LaTeX

Manually calculating space for fill-in-the-blanks; fighting with tabular to align A/B/C/D options; maintaining two separate .tex files for students and teachers.

BHCexam.cls

Modularized Functions: Content entry is decoupled from formatting logic.
Automated Layout: Algorithms handle the spacing and alignment instantly.
Efficiency: Write once, export anywhere.

Core Features

Intelligent Layout Engine

Forget about manual spacing. BHCexam makes your layout look professional automatically.
Auto-Aligned MCQ Options
Automatically detects option lengths and aligns them to a grid (one, two, or four columns).
Smart Fill-in-the-Blank
The underline width automatically adjusts based on the length of the answer content.
Flexible Page Layouts
Native support for A3 double-column (exam standard) and A4 single-column formats.

Dual-Version Workflow

Manage your question bank with a "Single Source of Truth".
One File, Two Outputs
Generate a Teacher Version (with answers, analysis, and marks) and a Student Version (clean layout) from the same .tex source.
Answer Visibility Control
Globally toggle the visibility of answers and scores with a simple config.
Space Reservation
Automatically reserve blank space for subjective questions in the student version.

Structured Question Management

Built for complex exams, not just simple quizzes.
Automated Scoring
Handles point distribution, displaying or hiding marks per question group.
Nested Logic
Supports sub-questions and even nested sub-questions within short-answer problems.
Numbering Control
Choose to restart numbering for each section or use continuous global numbering.
Alignment Modes
Support alignment by question number or by decorative dot (.).

Frequently Asked Questions

Find the answers you need

Didn't find what you need?

View Full Documentation

OpenSource Community & Compatibility

  • License

    LaTeX Project Public License 1.3c (Open Source & Free)

  • Compatibility

    Works with standard TeX Live distributions and Overleaf

  • User Group

    Join the user QQ group to discuss with other users

  • Issue Tracker

    Submit issues or feature requests on GitHub

Acknowledgment

logo
logo