LOADING...
$body$
\endRTL \enddocument pandoc \ --from markdown+yaml_metadata_block \ --template=templates/arabic.tex \ --pdf-engine=xelatex \ --toc \ --metadata title="دليل نظام XYZ" \ --output output/system_xyz_ar.pdf \ draft/system_ar.md Explanation of flags
\documentclass[12pt]article \usepackagefontspec \usepackagepolyglossia \setmainlanguagearabic \setotherlanguageenglish \newfontfamily\arabicfont[Script=Arabic]Noto Sans Arabic \newfontfamily\englishfontLatin Modern Roman ktab my system mtrjm llrbyt pdf
| Flag | Meaning | |------|---------| | --from markdown+yaml_metadata_block | Accepts front‑matter for title, author, date, etc. | | --template=... | Our custom RTL LaTeX template. | | --pdf-engine=xelatex | XeLaTeX understands Unicode & modern fonts. | | --toc | Auto‑generates a table of contents (Arabic page numbers). | | --metadata title="..." | Sets the Arabic title that appears on the cover page. | | QC Item | How to verify | |---------|----------------| | Spelling & grammar | Use LanguageTool (Arabic mode) or Microsoft Editor . | | RTL rendering | Open PDF in Acrobat Reader → check that paragraphs start on the right and that bullet points point left. | | Clickable TOC | Verify that each entry jumps to the right page. | | Figures | Captions are Arabic, numbers are right‑aligned. | | Code blocks | Still left‑to‑right, monospaced, no broken characters. | | Accessibility | Run pdfinfo or Acrobat’s “Read Out Loud” to ensure Arabic text is selectable (not rasterized). |
# macOS (Homebrew) brew install pandoc brew install --cask mactex-no-gui # includes XeLaTeX | | --pdf-engine=xelatex | XeLaTeX understands Unicode &
# Restore code blocks for key, block in placeholders.items(): translated = translated.replace(key, block)
translator = DeepLTranslator(api_key='YOUR_DEEPL_API_KEY', source='EN', target='AR') text = src.read_text(encoding='utf-8') | | QC Item | How to verify
(“ktab my system mtrjm llrbyt pdf” → “Write my system, translate it to Arabic, and export as PDF”) 1️⃣ What This Guide Covers | Step | What you’ll achieve | |------|---------------------| | 1. Gather & organize source material | All the text, diagrams, code snippets, etc. that describe your system. | | 2. Choose a translation workflow | Machine‑only, human‑only, or hybrid (machine + post‑editing). | | 3. Prepare the document for RTL (right‑to‑left) layout | Use a format that supports Arabic styling (Markdown → Pandoc, LaTeX, Word, etc.). | | 4. Translate the content | Tools, glossaries, and best‑practice tips. | | 5. Polish the Arabic version | Font selection, justification, headings, tables, figures, and code blocks. | | 6. Convert to PDF | One‑click export or command‑line pipeline. | | 7. Quality‑check (QC) & distribute | Proofread, test accessibility, and share the final PDF. | 2️⃣ Step‑by‑Step Workflow 2.1 Gather & Structure Your Source Docs | Action | Tips | |--------|------| | Collect everything in one folder (e.g., system-doc/ ). | Keep subfolders: src/ , images/ , code/ , draft/ . | | Use a markup language (Markdown .md , reStructuredText .rst , or LaTeX .tex ). | These formats are easy to convert and keep formatting separate from content. | | Create a table of contents (TOC) early – it will be auto‑generated later. | Example in Markdown: # Table of Contents → [[TOC]] (Pandoc) or \tableofcontents (LaTeX). | | Mark up special blocks (code, tables, notes). | for code fences, | for tables, >! for warnings, etc. | Result: A clean, version‑controlled source (Git repo) that can be re‑used for multiple languages. 2.2 Choose a Translation Strategy | Strategy | When to use | Pros | Cons | |----------|-------------|------|------| | Pure Machine Translation (MT) | Quick drafts, low‑stakes docs. | Fast, cheap. | May mis‑translate technical terms. | | Human Translation | High‑quality manuals, legal/medical content. | Accurate, consistent terminology. | Time‑consuming, higher cost. | | Hybrid (MT + Post‑Editing) | Medium‑budget projects needing decent quality. | Faster than pure human, better than raw MT. | Requires a skilled editor. |
Optional: Add a ( openssl ) if the document must be tamper‑proof.
openssl dgst -sha256 -sign private_key.pem -out system_xyz_ar.pdf.sig output/system_xyz_ar.pdf | Command | What it does | |---------|--------------| | git init && git add . && git commit -m "init" | Version‑control the source docs. | | pandoc -s src.md -o src.pdf | Test a simple PDF export (English). | | python translate.py | Run the MT + placeholder script (see 2.4.1). | | pandoc --template=arabic.tex --pdf-engine=xelatex -o final.pdf arabic.md | Produce the final Arabic PDF. | | pdftotext final.pdf - | grep -q "[\x0600-\x06FF]" && echo OK | Verify Arabic text is real, not an image. | 4️⃣ Common Pitfalls & How to Avoid Them | Pitfall | Fix | |---------|-----| | Arabic letters appear disconnected | Use a Unicode‑aware engine (XeLaTeX) and a proper Arabic font (Noto Sans Arabic). |