Contributing

Thank you for your interest in contributing to tikz-feyn! This document provides guidelines for contributing to the project.

Ways to Contribute

There are many ways to contribute to tikz-feyn:

  • Report bugs - If you find a bug, please report it on the issue tracker

  • Suggest features - We welcome feature requests and ideas for improvement

  • Improve documentation - Help make the documentation clearer and more comprehensive

  • Submit code - Fix bugs or implement new features

  • Share examples - Contribute example diagrams to help other users

Getting Started

Setting Up Development Environment

  1. Fork the repository on GitHub

  2. Clone your fork:

    git clone https://github.com/YOUR_USERNAME/tikz-feyn.git
    cd tikz-feyn
    
  3. Create a feature branch:

    git checkout -b feature/my-new-feature
    

Building Documentation Locally

To build the examples:

pdflatex tikz-feyn.tex

To build the test suite:

pdflatex test-suite.tex

To build the Sphinx documentation:

cd docs
pip install -r requirements.txt
make html

Reporting Bugs

Before Reporting

  • Check the issue tracker to see if the bug has already been reported

  • Verify the bug exists in the latest version

  • Try to create a minimal example that reproduces the bug

Bug Report Template

When reporting a bug, please include:

  1. Description: Clear description of the bug

  2. Minimal Example: Minimal LaTeX code that reproduces the issue

  3. Expected Behavior: What you expected to happen

  4. Actual Behavior: What actually happened

  5. Environment: - LaTeX distribution and version (e.g., TeXLive 2023) - tikz-feyn version - Operating system

Example:

**Bug**: Vertex positioning incorrect with negative offsets

**Minimal Example**:
```latex
\\begin{tfeyn}
  \\tfcol(0, -1cm){a, b}
  \\tfcol{c, d}
  \\tf[f]{a, c}
\\end{tfeyn}
```

**Expected**: Column shifted down by 1cm
**Actual**: Column shifted up instead

**Environment**:
- TeXLive 2023
- tikz-feyn 1.0
- Ubuntu 22.04

Suggesting Features

Feature requests are welcome! Please:

  1. Check if the feature has already been requested

  2. Provide a clear use case for the feature

  3. Include example code showing how you’d like it to work

  4. Consider whether it could be implemented using existing TikZ features

Submitting Pull Requests

Code Guidelines

  • Follow the existing code style

  • Add comments explaining complex logic

  • Update documentation for new features

  • Include examples demonstrating new features

Testing Requirements

Before submitting a pull request:

  1. Ensure all examples compile without errors:

    pdflatex tikz-feyn.tex
    pdflatex test-suite.tex
    
  2. Add tests to test-suite.tex for new features

  3. Verify backward compatibility with existing diagrams

  4. Test with both pdfLaTeX and XeLaTeX if possible

Pull Request Process

  1. Create a feature branch from develop

  2. Make your changes

  3. Test thoroughly

  4. Commit with clear, descriptive messages

  5. Push to your fork

  6. Open a pull request against the develop branch

Pull Request Template

Your pull request should include:

  • Description: What does this PR do?

  • Motivation: Why is this change needed?

  • Testing: How was this tested?

  • Documentation: Are docs updated?

  • Examples: Include example usage if applicable

Documentation Contributions

Documentation improvements are always welcome! This includes:

  • Fixing typos and grammar

  • Clarifying confusing sections

  • Adding examples

  • Improving organization

  • Translating documentation

To contribute documentation:

  1. Edit the relevant .rst files in docs/source/

  2. Build locally to verify formatting:

    cd docs
    make html
    # Open docs/build/html/index.html in browser
    
  3. Submit a pull request

Code Style

LaTeX Package Code

  • Use meaningful macro names

  • Add comments for non-obvious code

  • Use consistent indentation (2 spaces)

  • Group related functionality

  • Include error checking where appropriate

Documentation

  • Use proper reStructuredText formatting

  • Include code examples for all features

  • Provide both simple and advanced examples

  • Cross-reference related sections

  • Use consistent terminology

Commit Messages

Write clear commit messages:

Short summary (50 chars or less)

More detailed explanation if needed. Wrap at 72 characters.
Explain what and why, not how.

- Bullet points are okay
- Use present tense ("Add feature" not "Added feature")
- Reference issues: "Fixes #123"

Examples:

  • Good: Add support for curved propagators

  • Good: Fix vertex positioning with negative offsets (fixes #42)

  • Bad: fixed stuff

  • Bad: WIP

Branching Model

  • main/master - Stable releases only

  • develop - Main development branch

  • feature/* - New features

  • fix/* - Bug fixes

  • docs/* - Documentation updates

Release Process

Releases are managed by maintainers:

  1. Update version in tikz-feyn.sty

  2. Update CHANGES.md

  3. Merge to main/master

  4. Tag release: git tag v1.0

  5. Push tag: git push origin v1.0

  6. GitHub Actions automatically creates release

Community Guidelines

  • Be respectful and constructive

  • Welcome newcomers

  • Provide helpful feedback on pull requests

  • Focus on the issue, not the person

  • Assume good intentions

License

By contributing to tikz-feyn, you agree that your contributions will be licensed under the same license as the project (see LICENSE.txt).

Getting Help

If you need help contributing:

  • Open an issue with your question

  • Tag it with the question label

  • Be specific about what you’re trying to do

Thank You!

Every contribution, no matter how small, is appreciated and helps make tikz-feyn better for everyone.