5

My ultimate goal is the following: given a pull of a TeX file (for example by Overleaf) in some repository of GitHub, I would like to automatically overwrite the associated PDF file in the repository of my GitHub Page (i.e. under username/username.github.io) to update my html homepage. So far, I have the following .yml code:

name: Build LaTeX document
on: [push]
jobs:
  build_latex:
    runs-on: ubuntu-latest
    steps:
      - name: Set up Git repository
        uses: actions/checkout@v2
      - name: Compile LaTeX document
        uses: xu-cheng/latex-action@v2
        with:
          root_file: main.tex
      - name: Upload artifact
        uses: actions/upload-artifact@v2
        with:
          name: PDF
          path: main.pdf
      - name: Download a Build Artifact
        uses: actions/download-artifact@v2.0.9
        with: 
          name: PDF 
          path: path/to/PDF

which successfully produces a zip file containing the desired pdf file (main.pdf) in the GitHub UI and downloads the pdf file to /home/runner/work/repo name/repo name/path/to/PDF.

I have two questions:

  1. How can I automatically import the raw pdf file (main.pdf) to another repository (preferably with new name "original repo name.main.pdf")?
  2. Where is /home/runner/work/repo name/repo name/path/to/PDF? Do we have the url to this path?

Since I am a math student who is not familiar with coding, a detailed answer would be really helpful. Also, any suggestion to my approach to achieve my goal will be much appreciated. Thank you in advance.

EDIT: In terms of my goal, I can do the following:

  1. Create a project in Overleaf, which generates a folder in Dropbox.
  2. Open PowerShell, set the current directory to be the folder (write "cd C:\Users\username\Dropbox\Apps\Overleaf\project name" provided that I have installed Dropbox app), and generates the associated pdf file main.pdf (write "latexmk -pdf" provided that I have installed TeX Live).
  3. Get the link of main.pdf in Dropbox and paste it to my html.

Downside: Each time I edit the TeX file, I need to repeat 2, which I would like to avoid or simplify at least (I am really lazy). It would also be better if I can use the raw pdf file instead of the link to Dropbox.

EDIT2: Ok, although I gave up with GitHub Action, I am satisfied with the following solution:

  1. Create a project in Overleaf, which generates a Dropbox folder.
  2. Provided that I have installed TeX Live and Dropbox app, write the following .bat file
cd C:\Users\username\Dropbox\Apps\Overleaf\projectname & latexmk -pdf
  1. Copy the Dropbox link of main.pdf (generated in C:\Users\username\Dropbox\Apps\Overleaf\projectname) and paste it to my html.

Each time I edit the TeX file, I can update the associated PDF in my homepage by double-clicking the .bat file in step 2.

P. Usada
  • 151
  • 3

0 Answers0