Rxiv-Maker includes a comprehensive validation system that checks your manuscript for errors, missing references, citation issues, and LaTeX compilation problems before generating PDFs. This helps catch issues early and provides actionable feedback.
# Basic validation
make validate
# Custom manuscript path
make validate MANUSCRIPT_PATH=MY_PAPER
# Detailed validation with suggestions
python src/py/scripts/validate_manuscript.py --detailed MANUSCRIPT
# Advanced validation options
python src/py/commands/validate.py MANUSCRIPT --verbose --output detailedWhat it checks:
- Required files (
00_CONFIG.yml,01_MAIN.md,03_REFERENCES.bib) - Optional files (
02_SUPPLEMENTARY_INFO.md) - Directory structure (
FIGURES/, etc.) - File readability and basic format validation
Example issues caught:
- Missing configuration file
- Empty manuscript content
- Malformed YAML syntax
- Invalid BibTeX entries
What it checks:
- Citation syntax (
@citation,[@cite1;@cite2]) - Citation keys against bibliography file
- Undefined citations
- Unused bibliography entries
Example issues caught:
ERROR: Citation 'smith2023' not found in bibliography
SUGGESTION: Add the reference to 03_REFERENCES.bib or check spelling
What it checks:
- Figure references (
@fig:label,@sfig:label) - Table references (
@tbl:label,@stable:label) - Equation references (
@eq:label) - Supplementary note references (
@snote:label) - Label definitions against references
Example issues caught:
ERROR: Reference @fig:nonexistent used but label not defined
SUGGESTION: Add {#fig:nonexistent} to a figure or check reference spelling
What it checks:
- Figure file existence and accessibility
- Figure syntax and attributes
- Python script validity for generated figures
- Mermaid diagram syntax
- Image format compatibility
Example issues caught:
ERROR: Figure file FIGURES/missing.png not found
SUGGESTION: Create the figure file or update the figure path
What it checks:
- LaTeX math syntax (
$...$,$$...$$) - Balanced delimiters and braces
- Valid LaTeX commands
- Equation label format
- Math environment syntax
Example issues caught:
ERROR: Unbalanced braces in math expression: $E = mc^{2$
SUGGESTION: Close the brace: $E = mc^{2}$
What it checks:
- Markdown syntax compliance
- Special rxiv-maker elements
- Text formatting consistency
- List structure
- Code block syntax
- HTML element processing
Example issues caught:
WARNING: Unclosed bold formatting detected
SUGGESTION: Ensure all ** bold markers are properly paired
What it checks:
- LaTeX compilation log parsing
- Common error pattern recognition
- User-friendly error translation
- Build failure diagnosis
Example issues caught:
ERROR: LaTeX compilation failed - Unknown command \unknowncommand
SUGGESTION: Check if you need to include a package or fix the command spelling
# Quick validation check
make validate
# Validate specific manuscript
make validate MANUSCRIPT_PATH=PROJECT_A
# Validate before PDF generation (recommended workflow)
make validate && make pdf# Basic validation
python src/py/scripts/validate_manuscript.py MANUSCRIPT
# Detailed validation with context and suggestions
python src/py/scripts/validate_manuscript.py --detailed MANUSCRIPT
# Quiet mode (errors only)
python src/py/scripts/validate_manuscript.py --quiet MANUSCRIPT
# Verbose mode (all details)
python src/py/scripts/validate_manuscript.py --verbose MANUSCRIPT# Comprehensive validation with rich output
python src/py/commands/validate.py MANUSCRIPT
# Different output formats
python src/py/commands/validate.py MANUSCRIPT --output basic
python src/py/commands/validate.py MANUSCRIPT --output detailed
python src/py/commands/validate.py MANUSCRIPT --output verbose
# Focus on specific validation types
python src/py/commands/validate.py MANUSCRIPT --validators citation,reference
python src/py/commands/validate.py MANUSCRIPT --skip-validators latex- ERROR (π΄): Critical issues that will prevent PDF generation
- WARNING (π‘): Issues that might cause problems or affect quality
- INFO (π΅): Informational messages and statistics
ERROR: Short description of the problem
File: /path/to/file.md:42:15
Context: > Relevant line of content where error occurred
Suggestion: Specific action to fix the issue
STATISTICS:
Citations found: 15 (12 valid, 3 undefined)
Figures referenced: 8 (7 found, 1 missing)
Math expressions: 23 (all valid)
0: Validation passed (no errors, may have warnings)1: Validation failed (has errors that need fixing)
Validation is automatically integrated into the PDF generation process:
# Validation runs automatically before PDF generation
make pdf
# Manual control over validation
make validate # Check first
make pdf # Generate PDF if validation passesThe validation system works seamlessly with GitHub Actions:
# Validation runs automatically in CI/CD
- name: Validate manuscript
run: make validate
- name: Generate PDF
run: make pdf# Check if your new manuscript has proper structure
make validate MANUSCRIPT_PATH=NEW_PROJECT
# Expected output for valid setup:
# β All required files found
# β Configuration valid
# β No citation or reference errors# Check citation problems
python src/py/commands/validate.py MANUSCRIPT --validators citation
# Common fixes:
# - Add missing references to 03_REFERENCES.bib
# - Fix citation key spelling
# - Check citation syntax [@key] vs @key# Check figure-related issues
python src/py/commands/validate.py MANUSCRIPT --validators figure
# Common fixes:
# - Create missing figure files
# - Fix figure paths
# - Update Python scripts for figure generation# Check LaTeX-specific issues after a failed build
python src/py/commands/validate.py MANUSCRIPT --validators latex
# Common fixes based on log analysis:
# - Fix special character escaping
# - Add missing LaTeX packages
# - Correct mathematical syntaxThe validation system uses a modular architecture with specialized validators:
- BaseValidator: Common validation infrastructure
- CitationValidator: Citation syntax and bibliography checking
- ReferenceValidator: Cross-reference validation
- FigureValidator: Figure file and syntax validation
- MathValidator: Mathematical expression validation
- SyntaxValidator: General syntax and formatting validation
- LaTeXErrorParser: LaTeX compilation error analysis
The validation system respects the same content protection used in the conversion pipeline:
- Math expressions are protected during validation
- Code blocks are handled specially
- Table content is validated carefully
- Multi-stage restoration maintains content integrity
# Run validation after significant changes
make validate
# Include validation in your development workflow
alias build="make validate && make pdf"# Get comprehensive feedback when troubleshooting
python src/py/scripts/validate_manuscript.py --detailed MANUSCRIPT- Address ERROR level issues first (prevent build failures)
- Then tackle WARNING level issues (improve quality)
- INFO level messages provide useful statistics
Each validation error includes specific suggestions:
ERROR: Citation 'smith2023' not found in bibliography
SUGGESTION: Add the reference to 03_REFERENCES.bib or check spelling
# In your GitHub Actions or other CI systems
make validate # Fails fast if there are errors
make pdf # Only runs if validation passes# If you get "command not found" errors
python -m src.py.scripts.validate_manuscript MANUSCRIPT# Ensure you're in the rxiv-maker root directory
cd /path/to/rxiv-maker
python src/py/scripts/validate_manuscript.py MANUSCRIPT# Check file permissions
ls -la MANUSCRIPT/
chmod 644 MANUSCRIPT/*.md MANUSCRIPT/*.yml MANUSCRIPT/*.bib- Basic validation is fast (< 1 second for typical manuscripts)
- Detailed validation with LaTeX log parsing may take 2-5 seconds
- Figure validation time depends on number of figure files
- Large bibliographies may increase citation validation time
The validation system is extensible. You can create custom validators by:
- Inheriting from
BaseValidator - Implementing the
validate()method - Returning
ValidationResultwith errors/warnings - Adding to the validation pipeline
# Add to .git/hooks/pre-commit
#!/bin/bash
make validate || {
echo "Validation failed! Please fix errors before committing."
exit 1
}{
"label": "Validate Manuscript",
"type": "shell",
"command": "make validate",
"group": "build",
"presentation": {
"echo": true,
"reveal": "always"
}
}This validation system helps ensure high-quality, error-free manuscripts while providing clear guidance for fixing any issues that arise. For more information, see the User Guide and API Reference.