{"id":50970485,"url":"https://github.com/sht/md2pdf","last_synced_at":"2026-06-19T01:37:05.073Z","repository":{"id":340785859,"uuid":"1167592087","full_name":"sht/md2pdf","owner":"sht","description":"Convert Markdown to professional PDFs using Pandoc + XeLaTeX. Left-aligned tables, Inter font, optimized spacing. One command: ./md2pdf.sh file.m","archived":false,"fork":false,"pushed_at":"2026-03-01T18:45:25.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-19T01:37:03.892Z","etag":null,"topics":["documentation","latex","macos","markdown-converter","markdown-to-pdf","md-to-pdf","pandoc","pdf-generator","shell-script","xelatex"],"latest_commit_sha":null,"homepage":"https://github.com/sht/md2pdf","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sht.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-26T13:17:44.000Z","updated_at":"2026-03-01T18:45:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sht/md2pdf","commit_stats":null,"previous_names":["sht/md2pdf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sht/md2pdf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sht%2Fmd2pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sht%2Fmd2pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sht%2Fmd2pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sht%2Fmd2pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sht","download_url":"https://codeload.github.com/sht/md2pdf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sht%2Fmd2pdf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34514282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["documentation","latex","macos","markdown-converter","markdown-to-pdf","md-to-pdf","pandoc","pdf-generator","shell-script","xelatex"],"created_at":"2026-06-19T01:37:04.255Z","updated_at":"2026-06-19T01:37:05.065Z","avatar_url":"https://github.com/sht.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# md2pdf\n\nA simple shell script to convert Markdown files to professional-looking PDFs using Pandoc and XeLaTeX.\n\n**Features:**\n- Left-aligned tables (not centered like default Pandoc)\n- Inter font (modern, highly readable)\n- Optimized spacing for headings, paragraphs, lists, and tables\n- Support for centered titles and page breaks\n- Single command conversion\n\n## Quick Start\n\n```bash\n# Clone the repo\ngit clone https://github.com/sht/md2pdf.git\ncd md2pdf\n\n# Make executable\nchmod +x md2pdf.sh\n\n# Convert your markdown\n./md2pdf.sh document.md\n```\n\n## Usage\n\n```bash\n./md2pdf.sh input.md                  # Output: input.pdf\n./md2pdf.sh input.md custom_name.pdf  # Output: custom_name.pdf\n```\n\n## Special Formatting Syntax\n\n### Center-Aligned Title\n\nUse raw LaTeX to center a title:\n\n```markdown\n\\begin{center}\n\\LARGE\\textbf{YOUR TITLE HERE}\n\\end{center}\n```\n\n**Note:** Don't use `#` heading inside `\\begin{center}` - use `\\LARGE\\textbf{}` instead.\n\n### Text Sizing and Formatting\n\nWhen using LaTeX commands for text formatting, you can control text size and style:\n\n**Text Sizes (use lowercase for LaTeX commands):**\n```markdown\n\\tiny{Very small text}\n\\small{Small text}\n\\normalsize{Normal size text}\n\\large{Large text}\n\\Large{Larger text}\n\\LARGE{Very large text}\n\\huge{Huge text}\n```\n\n**Text Formatting:**\n```markdown\n\\textbf{Bold text}           # Bold\n\\textnormal{Normal text}     # Remove bold, use normal weight\n\\textit{Italic text}         # Italic\n```\n\n**Example with multiple sizes:**\n```markdown\n\\begin{center}\n\\LARGE\\textbf{Main Title}\\\\\n\\normalsize\\textnormal{Subtitle or author name}\n\\end{center}\n```\n\n**Common Mistakes:**\n- ❌ `\\SMALL` (uppercase) - Not a valid command\n- ❌ `\\plain` - Not a valid command\n- ✅ `\\small` (lowercase) - Correct\n- ✅ `\\normalsize` - Correct for normal size\n- Always use `\\\\` to create line breaks inside `\\begin{center}...\\end{center}`\n\n### Page Break\n\nInsert a page break anywhere in your document:\n\n```markdown\n\\newpage\n```\n\nOr:\n\n```markdown\n\\pagebreak\n```\n\n## Supported Markdown Features\n\n| Feature | Syntax | Example |\n|---------|--------|---------|\n| Heading 1 | `# Title` | `# Main Title` |\n| Heading 2 | `## Title` | `## Section` |\n| Heading 3 | `### Title` | `### Subsection` |\n| Bold | `**text**` | `**important**` |\n| Italic | `*text*` | `*emphasis*` |\n| Bullet list | `- item` | `- First item` |\n| Numbered list | `1. item` | `1. Step one` |\n| Table | `\\| Col1 \\| Col2 \\|` | See below |\n| Horizontal rule | `---` | `---` |\n\n### Table Example\n\n```markdown\n| Field | Value |\n|:------|:------|\n| Name | John Doe |\n| Email | john@example.com |\n```\n\n## PDF Settings\n\n- **Font:** Inter\n- **Margins:** 1 inch\n- **Tables:** Left-aligned\n- **Table row height:** 1.3x\n- **Paragraph spacing:** 1em\n- **Bullet/List spacing:** 0.2em\n\n## Installation (macOS)\n\n### 1. Install Homebrew (if not installed)\n```bash\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n```\n\n### 2. Install Pandoc\n```bash\nbrew install pandoc\n```\n\n### 3. Install MacTeX (LaTeX distribution with XeLaTeX)\n```bash\nbrew install --cask mactex\n```\n\nAfter installation, restart your terminal or run:\n```bash\neval \"$(/usr/libexec/path_helper)\"\n```\n\n### 4. Install Inter Font\n```bash\nbrew install --cask font-inter\n```\n\n### 5. Verify Installation\n```bash\npandoc --version\nxelatex --version\nfc-list | grep -i inter\n```\n\n## Requirements Summary\n\n| Dependency | Install Command | Purpose |\n|------------|-----------------|---------|\n| Pandoc | `brew install pandoc` | Markdown converter |\n| MacTeX | `brew install --cask mactex` | PDF generation (XeLaTeX) |\n| Inter Font | `brew install --cask font-inter` | Document font |\n\n## Why This Exists\n\nPandoc's default PDF output has some issues:\n- Tables are centered (looks unprofessional for documents)\n- Tight list spacing (hard to read)\n- Default fonts aren't great\n\nThis script fixes all of that with carefully tuned LaTeX settings.\n\n## License\n\nMIT\n\n## Contributing\n\nPRs welcome! If you have improvements to spacing, font choices, or additional features, feel free to contribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsht%2Fmd2pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsht%2Fmd2pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsht%2Fmd2pdf/lists"}