-
-
Notifications
You must be signed in to change notification settings - Fork 6
Troubleshooting
Common issues and solutions when using Apex.
Error: cmake: command not found
Solution:
- macOS:
brew install cmake - Ubuntu/Debian:
sudo apt-get install cmake - Fedora:
sudo dnf install cmake
Error: Compiler not found or incompatible
Solution:
- macOS: Install Xcode Command Line Tools:
xcode-select --install - Linux: Install build essentials:
sudo apt-get install build-essential
Error: undefined reference to apex_*
Solution:
- Ensure library is built:
makein build directory - Check library path:
LD_LIBRARY_PATH(Linux) orDYLD_LIBRARY_PATH(macOS) - Verify linking:
-lapexflag is present
Problem: Tables appear as code or plain text
Solutions:
- Ensure tables are enabled: Don't use
--no-tables - Check mode: Some modes disable tables
- Verify table syntax: Requires proper pipe alignment
Problem: Headers don't have id attributes
Solutions:
- Check if IDs are disabled: Remove
--no-idsflag - Verify mode: All modes generate IDs by default
- Check manual ID syntax: May be incorrectly formatted
Problem: Math appears as plain text
Solutions:
- Ensure math is enabled: Don't use
--no-math - Check mode: CommonMark and GFM modes disable math
- Verify MathJax/KaTeX: Apex outputs HTML, you need a math renderer
Problem: Wiki links appear as plain text
Solutions:
- Enable wiki links: Use
--wikilinksflag (disabled by default in all modes) - Check syntax:
[[Page]]not[Page] - Example:
apex document.md --wikilinks
Problem: Include syntax not processed
Solutions:
- Enable includes: Use
--includesflag (enabled by default in unified mode) - Check file paths: Relative to document or use
base_directoryin API - Verify syntax:
<<[file.md]or{{file.md}}
Problem: Command produces no output
Solutions:
- Check input: Verify file exists or stdin has content
- Check errors: Run with verbose output if available
- Verify mode: Some modes may filter content
Problem: HTML is all on one line
Solutions:
- Use
--prettyflag for formatted output - Check if pretty printing is disabled in options
Problem: Standalone document has no styling
Solutions:
- Add stylesheet:
--style styles.css - Use inline styles: Apex includes basic default styles
- Check CSS path: Ensure file exists and path is correct
Problem: Syntax feature doesn't work
Solutions:
- Check mode: Feature may not be available in current mode
- Switch to unified mode:
--mode unifiedhas all features - See Modes for feature availability
Problem: Header IDs don't match expected format
Solutions:
- Check mode: Each mode has its own ID format
- Override format: Use
--id-formatin unified mode - See Header IDs for format details
Problem: Application memory usage grows
Solutions:
- Free all strings: Always call
apex_free_string()on returned strings - Check for NULL: Don't free NULL pointers (safe, but unnecessary)
- Reuse options: Create options once, reuse for multiple conversions
Problem: Crashes or incorrect output in multi-threaded code
Solutions:
- Use separate options: Each thread needs its own
apex_options - Don't share nodes: Document nodes are not thread-safe
- See C API for thread safety details
Problem: Apex.framework not found at runtime
Solutions:
- Embed framework: Set to "Embed & Sign" in Xcode
- Check search paths: Verify framework search paths
- Verify architecture: Ensure framework matches app architecture
Problem: Conversion takes too long
Solutions:
- Disable unused features: Turn off extensions you don't need
- Check input size: Large documents take longer
- Profile: Use profiling tools to identify bottlenecks
You can also enable Apex's built-in profiling output with environment variables: setting APEX_PROFILE=1 (or yes/true) will print per-phase timings from the core converter (e.g. metadata, citations, autolinks) to stderr, while APEX_PROFILE_PLUGINS=1 enables detailed timing for plugin execution, including a total time for each plugin phase (pre_parse and post_render) and individual timings for every discovered plugin; this is especially useful for tracking down slow external handlers or regex plugins—run commands like APEX_PROFILE_PLUGINS=1 apex --plugins input.md > /dev/null to capture just the timing lines.
Problem: Application uses too much memory
Solutions:
- Free strings promptly: Don't keep HTML strings longer than needed
- Process in chunks: For very large documents, consider splitting
- Check for leaks: Use memory profiling tools
If you encounter issues not covered here:
- Check the Syntax page for correct syntax
- Review Modes to ensure feature is available
- See Command Line Options for flag usage
- Check C API for programmatic issues
- Installation - Build and installation issues
- Usage - Usage examples
- C API - API-specific troubleshooting
Copyright 2025 Brett Terpstra, All Rights Reserved | MIT License
- Getting Started - Your first steps with Apex
- Installation - How to build and install Apex
- Usage - Basic usage examples
- Syntax - Complete syntax reference for unified mode
- Callouts - All supported callout formats and flag requirements
- Tables - Complete table syntax reference including rowspan, colspan, alignment, and captions
- Inline Attribute Lists - IALs and ALDs guide with examples
- Modes - Understanding processor modes
-
Quarto Mode - Pandoc/Quarto markdown (
--mode quarto) - Command Line Options - All CLI flags explained
-
Rendering Markdown in the Terminal - Terminal output formats (
-t terminal,-t terminal256),--width,--theme, and theming -
Generating Man Pages - Generate man pages from Markdown using
apex -t man -
Multi-file Documents - Combining multiple files with
--combine,--mmd-merge, and includes - Citations - Citations and bibliography guide
- Indices - Index generation with mmark and TextIndex syntax
-
Metadata Transforms - Transform metadata values with
[%key:transform] - Integrating with Pandoc - Use Apex with Pandoc for DOCX, PDF, and more
- Using Apex with Jekyll - Use the apex-ruby gem as Jekyll’s Markdown converter (untested; feedback welcome)
- Header IDs - How header IDs are generated
- C API - Programmatic API documentation
- Writing Tests - How to add tests for new features
- Xcode Integration - Using Apex in Xcode projects
- Examples - Practical usage examples
- Plugins - Plugin system, examples, and recipes
- Filters - AST filters (Pandoc-style JSON), examples, and usage
- Troubleshooting - Common issues and solutions
- Credits - Acknowledgments and links to related projects