{"id":13475876,"url":"https://github.com/arxiv-vanity/engrafo","last_synced_at":"2025-05-16T09:03:09.473Z","repository":{"id":26313558,"uuid":"98542918","full_name":"arxiv-vanity/engrafo","owner":"arxiv-vanity","description":"Convert LaTeX documents into beautiful responsive web pages using LaTeXML.","archived":false,"fork":false,"pushed_at":"2024-01-03T09:53:43.000Z","size":22668,"stargazers_count":1088,"open_issues_count":137,"forks_count":89,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-09T03:11:45.103Z","etag":null,"topics":["academic-publishing","arxiv","latex","latexml","science"],"latest_commit_sha":null,"homepage":"https://www.arxiv-vanity.com","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arxiv-vanity.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}},"created_at":"2017-07-27T14:04:35.000Z","updated_at":"2025-04-19T06:38:13.000Z","dependencies_parsed_at":"2024-09-24T05:02:09.260Z","dependency_job_id":"1f955057-5b96-41ea-9d16-168684cdf556","html_url":"https://github.com/arxiv-vanity/engrafo","commit_stats":{"total_commits":954,"total_committers":9,"mean_commits":106.0,"dds":0.3291404612159329,"last_synced_commit":"cb14a8bbfef4ca331a2e2f528df40468b51265eb"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arxiv-vanity%2Fengrafo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arxiv-vanity%2Fengrafo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arxiv-vanity%2Fengrafo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arxiv-vanity%2Fengrafo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arxiv-vanity","download_url":"https://codeload.github.com/arxiv-vanity/engrafo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501555,"owners_count":22081528,"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":["academic-publishing","arxiv","latex","latexml","science"],"created_at":"2024-07-31T16:01:24.342Z","updated_at":"2025-05-16T09:03:09.455Z","avatar_url":"https://github.com/arxiv-vanity.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"# Engrafo\n\nEngrafo converts LaTeX documents into beautiful responsive web pages using [LaTeXML](https://dlmf.nist.gov/LaTeXML/).\n\nIt is a set of stylesheets and scripts for LaTeXML output. It makes the design responsive so you can read it on phones, and adds various interactive bits like footnote tooltips.\n\nIt turns this sort of thing:\n\n\u003cimg src=\"docs/screenshot-pdf.png\" width=\"600\"\u003e\n\nInto this:\n\n\u003cimg src=\"docs/screenshot-screens.png\"\u003e\n\n## Usage\n\nThe easiest way to run Engrafo is by using the Docker image. To convert `input/main.tex` into `output/index.html`, run:\n\n    $ docker run \\\n      -v \"$(pwd)\":/workdir -w /workdir \\\n      arxivvanity/engrafo engrafo input/main.tex output/\n\nInput can be a TeX file, a directory containing a TeX file and supporting files, or a tarball containing a TeX file and supporting files.\n\nEither input or output can be on S3 by using the form `s3://bucket/path` and setting the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables.\n\nFor full usage, run `docker run arxivvanity/engrafo engrafo --help`.\n\n## Server\n\nEngrafo can also be run as an HTTP server, which is useful if you need to run it over a network.\n\n    $ docker run -e PORT=8000 -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -p 8000:8000 arxivvanity/engrafo engrafo-server\n    💃  Listening on http://0.0.0.0:8000\n\n    $ curl -X POST \\\n        -H 'Content-Type: application/json' \\\n        -d '{\"input\": \"s3://some-bucket/source.tar.gz\", \"output\": \"s3://some-bucket/output/\"}' \\\n        http://localhost:8000/convert\n    {\n        \"success\": true,\n        \"logs\": \"...\"\n    }\n\n## Development environment\n\nFirst, install [Node](https://nodejs.org/en/) and [Yarn](https://yarnpkg.com/en/docs/install#mac-stable). Then, install the Node dependencies:\n\n    $ yarn\n\n### Frontend development\n\nFor developing the CSS and frontend JavaScript, there are a bunch of pre-rendered documents you can use to work with. This means you don't need to install LaTeX or Docker.\n\nRun this command:\n\n    $ yarn run storybook\n\nThen, all the documents will be available as a Storybook at [http://localhost:6006](http://localhost:6006). Any changes you make to the CSS and JS in `src/assets/` will automatically be updated in the Storybook.\n\n### Converting documents\n\nThe LaTeXML and LaTeX toolchain runs inside Docker. If you want to work on the code that actually converts documents, you will need to install Docker.\n\n[Install Docker](https://docs.docker.com/install/) and build the Docker image:\n\n    $ script/docker-build\n\nYou can convert documents with `yarn run convert`:\n\n    $ yarn run convert tests/documents/sample2e.tex output/\n\nThere is also a development server, which is useful for developing CSS and JavaScript. When you make changes to the JavaScript or CSS, it will automatically update in the browser:\n\n    $ yarn run dev-server tests/documents/sample2e.tex\n\nThere is a script to download a paper from arXiv and start a development server:\n\n    $ script/arxiv-dev-server 1707.08901\n\n## Tests\n\nAs a one-off, you will need to build the Docker image:\n\n    $ script/docker-build\n\nThis only needs running once, unless you change something in the build process (e.g. LaTeXML version). The code is mounted at run-time.\n\nRun the main test suite:\n\n    $ yarn test\n\nYou can run particular suites:\n\n    $ yarn test tests/integration.test.js\n\nOr particular tests by matching a string:\n\n    $ yarn test -t \"titles and headings\"\n\n### Writing integration tests\n\nThe integration tests are LaTeX documents in `tests/integration` that are rendered to ensure they produce a particular output. The HTML output from LaTeXML is checked using [Jest snapshots](https://jestjs.io/docs/en/snapshot-testing), and the visual output is checked using [Percy](https://percy.io/).\n\nFirst, write a LaTeX document in `tests/integration`. If it is a test for a package, it normally has the same name as the package, as you can see from other documents in that directory.\n\nFor example, this could be a test in `tests/integration/textbf.tex`:\n\n```latex\n\\begin{document}\n  I am \\textbf{bold}!\n\\end{document}\n```\n\nNow, run the test passing the `-u` option to write out a snapshot of what is rendered:\n\n    $ yarn test -t \"textbf.tex\" -u\n\nCheck the output looks correct in `tests/__snapshots__/integration.test.js.snap`. You can re-run that command without the `-u` option to ensure the test passes.\n\nThe test will fail if the output changes in the future. If the change is expected, then you can simply re-run the test with `-u` to overwrite the snapshot and fix the test.\n\nThe visual changes are harder to test locally. The easiest way is to open a pull request, then Percy will check for any changes against master.\n\n## Code style\n\nAll code must be formatted with [Prettier](https://prettier.io/). To automatically format the code, run:\n\n    $ yarn run prettier\n\n## Sponsors\n\nThanks to our generous sponsors for supporting the development of arXiv Vanity!\n\n[\u003cimg src=\"docs/sponsor-yld.png\" alt=\"YLD\" width=\"250\" /\u003e](https://www.yld.io/)\n\nTested by:\n\n[\u003cimg src=\"docs/sponsor-percy.png\" alt=\"Percy\" width=\"350\" /\u003e](https://percy.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farxiv-vanity%2Fengrafo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farxiv-vanity%2Fengrafo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farxiv-vanity%2Fengrafo/lists"}