{"id":24655157,"url":"https://github.com/xtenzq/latex-pdfjs-viewer","last_synced_at":"2026-05-06T21:43:09.533Z","repository":{"id":115828592,"uuid":"415542550","full_name":"xtenzQ/latex-pdfjs-viewer","owner":"xtenzQ","description":"Build LaTeX into PDF and deploy it to GitHub Pages + PDF.js","archived":false,"fork":false,"pushed_at":"2022-03-20T15:59:51.000Z","size":8903,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-25T22:40:05.880Z","etag":null,"topics":["cv-latex","github-actions","github-actions-latex","latex-to-gh-pages","latex-to-github-pages","latex-to-pdf","pdfjs"],"latest_commit_sha":null,"homepage":"https://rusetskii.dev/latex-pdfjs-viewer/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xtenzQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-10-10T09:39:59.000Z","updated_at":"2024-04-29T09:39:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"ced26310-6a37-4253-b669-aec4c9ceead2","html_url":"https://github.com/xtenzQ/latex-pdfjs-viewer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtenzQ%2Flatex-pdfjs-viewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtenzQ%2Flatex-pdfjs-viewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtenzQ%2Flatex-pdfjs-viewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtenzQ%2Flatex-pdfjs-viewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtenzQ","download_url":"https://codeload.github.com/xtenzQ/latex-pdfjs-viewer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244722744,"owners_count":20499154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cv-latex","github-actions","github-actions-latex","latex-to-gh-pages","latex-to-github-pages","latex-to-pdf","pdfjs"],"created_at":"2025-01-25T22:36:17.383Z","updated_at":"2026-05-06T21:43:09.496Z","avatar_url":"https://github.com/xtenzQ.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LaTeX-to-PDF with GitHub Pages + PDF.js\n\n[![CI](https://github.com/xtenzQ/latex-pdfjs-viewer/actions/workflows/blank.yml/badge.svg)](https://github.com/xtenzQ/latex-pdfjs-viewer/actions/workflows/blank.yml) [![pages-build-deployment](https://github.com/xtenzQ/latex-pdfjs-viewer/actions/workflows/pages/pages-build-deployment/badge.svg?branch=gh-pages)](https://github.com/xtenzQ/latex-pdfjs-viewer/actions/workflows/pages/pages-build-deployment)\n\nBuilds LaTeX doc into PDF and then publishes it on GitHub Pages so we can now embed our PDF with the following link:\n```\nhttps://\u003cusername\u003e.github.io/\u003crepo\u003e/\n```\n**[Example](https://rusetskii.dev/latex-pdfjs-viewer/)**\n\n## Structure\n\n- `pdfjs` - contains PDF.js viewer built from sources\n- `doc.tex` - the LaTeX document to be published\n\n## Deployment\n\nUsing GitHub Actions, LaTeX document is converted into PDF and deployed to GitHub Pages together with PDF.js viewer.\n\n## Building from scratch\n\nWant to build your own converter with viewer?\n1. Clone PDF.JS\n```\n$ git clone https://github.com/mozilla/pdf.js.git\n$ cd pdf.js\n```\n2. Install dependencies\n```\n$ npm install\n```\n3. Build from sources\n```\n$ gulp generic\n```\n4. Copy built sources to your repo's `pdfjs` folder\n```\n$ cp -r build/generic \u003cyour repo\u003e/pdfjs\n```\n5. Create `index.html` in your repo on the path `\u003cyour repo\u003e/pdfjs`\n```HTML\n\u003c!DOCTYPE html\u003e\n\u003chtml dir=\"ltr\" mozdisallowselectionprint\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1\"\u003e\n    \u003cmeta name=\"google\" content=\"notranslate\"\u003e\n  \u003c/head\u003e\n  \u003cbody style=\"height: 100%; width: 100%; overflow: hidden; margin:0px; background-color: rgb(82, 86, 89);\"\u003e\n    \u003ciframe src=\"web/viewer.html\" title=\"CV\" frameBorder=\"0\" style=\"position:absolute; left: 0; top: 0;\" width=\"100%\" height=\"100%\"\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n6. Put your LaTeX file in the root of your repo and rename it to `doc.tex`.\n7. Create GitHub Actions workflow `build.yml` on the path `.github\\workflows`:\n```YML\nname: LaTeX-to-PDF\n\n# Controls when the workflow will run\non:\n  # Triggers the workflow on push or pull request events but only for the main branch\n  push:\n    branches: [ main ]\n    paths:\n      - 'doc.tex'\n      - 'pdfjs/**'\n      - '.github/workflows/blank.yml'\n  pull_request:\n    branches: [ main ]\n    paths:\n      - 'doc.tex'\n\n  # Allows you to run this workflow manually from the Actions tab\n  workflow_dispatch:\n\n# A workflow run is made up of one or more jobs that can run sequentially or in parallel\njobs:\n  build_latex:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Set up Git repository\n        uses: actions/checkout@v2\n        \n      - name: Compile LaTeX document\n        uses: xu-cheng/latex-action@v2\n        with:\n          root_file: doc.tex\n          \n      - name: Copy file\n        run: |\n          sudo mv doc.pdf pdfjs\n\n      - name: Deploy to gh-pages\n        uses: s0/git-publish-subdir-action@develop\n        env:\n          REPO: self\n          BRANCH: gh-pages\n          FOLDER: pdfjs\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          MESSAGE: \"deploy website\"\n```\n8. Set your GitHub Pages in Settings to the branch `gh-pages`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtenzq%2Flatex-pdfjs-viewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtenzq%2Flatex-pdfjs-viewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtenzq%2Flatex-pdfjs-viewer/lists"}