Overleaf is an online service that allows you to create/edit/collaborate
on LaTeX
documents. For details on how the badge must be used, see the Example
below.
Overleaf also provides an API (application programming interface) that can be used to
open any online LaTeX (.tex
) document directly on Overleaf.com. Please see the
Overleaf api docs for further details.
To keep things short, we could use the following api end-point(s):
-
Single File
Syntax:
https://www.overleaf.com/docs?snip_uri=http://pathtoyourfile.tex
-
Example: Open a single
.tex
file using overleaf-api.https://www.overleaf.com/docs?snip_uri=https://github.com/posquit0/Awesome-CV/blob/master/examples/resume.tex
-
Example: Open a single
.zip
file using overleaf-api.https://www.overleaf.com/docs?snip_uri=https://github.com/k4rtik/latex-project-report-template/archive/refs/heads/master.zip
-
-
Multiple Files
Multiple files can be uploaded to overleaf with the
snip_uri[]
array parameters.https://www.overleaf.com/docs?snip_uri[]=http://.../a.tex&snip_uri[]=http://.../b.tex
-
Example: Open a list of
.tex
files using overleaf-api.https://www.overleaf.com/docs?snip_uri[]=https://github.com/posquit0/Awesome-CV/blob/master/examples/resume.tex& snip_uri[]=https://github.com/posquit0/Awesome-CV/blob/master/examples/coverletter.tex
-
I used some of the content from the following links to create the overleaf-badge
.
-
Example GitHub repository: https://github.com/k4rtik/latex-project-report-template
-
Overleaf api docs: https://www.overleaf.com/devs
-
Simple-Icon for Overleaf:
- search url: https://simpleicons.org/?q=overleaf
- Slug for Overleaf:
overleaf
source
-
badge url:
The following badge (open-in-overleaf) opens a github repository directly in Overleaf.com. If you do not have an account, you can sign up for one for free.
The following code snippet was used in markdown to create this overleaf-badge
.
[![Open in Overleaf][#overleaf-badge]][#github-repo-zip]
[#overleaf-badge]: https://tinyurl.com/overleaf-badge
[#github-repo-zip]: https://www.overleaf.com/docs?snip_uri=https://github.com/k4rtik/latex-project-report-template/archive/refs/heads/master.zip
In case you want to use this badge for any github repository, all you need to do is:
REPLACE
the following:
[#github-repo-zip]: https://www.overleaf.com/docs?snip_uri=https://github.com/k4rtik/latex-project-report-template/archive/refs/heads/master.zip
WITH
this:
[#github-repo-zip]: https://www.overleaf.com/docs?snip_uri=https://github.com/<OWNER>/<REPO>/archive/refs/heads/<BRANCH>.zip
So, finally, your modified markdown code for overleaf-badge would look like this:
<REPO>
: repository name<OWNER>
: owner of repository<BRANCH>
: branch name under the repository
[![Open in Overleaf][#overleaf-badge]][#github-repo-zip]
[#overleaf-badge]: https://tinyurl.com/overleaf-badge
[#github-repo-zip]: https://www.overleaf.com/docs?snip_uri=https://github.com/<OWNER>/<REPO>/archive/refs/heads/<BRANCH>.zip
Example image of overleaf-badge.