LSSTDESC / start_paper

Make a folder containing everything you need to start writing an LSST DESC paper or Note
BSD 3-Clause "New" or "Revised" License
11 stars 4 forks source link

start_paper/ desc_note project accessible on overleaf #74

Open rbiswas4 opened 6 years ago

rbiswas4 commented 6 years ago

In working with collaborators who wanted to use overleaf rather than set up latex on their own machines:

What is not clear to me is if I have to choose between github + clone to personal machines + compile model vs overleaf model. This has to do with desc-tex being used as a submodule on the git repository, but needs to removed for pushing to overleaf.

abmantz commented 6 years ago

What is not clear to me is if I have to choose between github + clone to personal machines + compile model vs overleaf model. This has to do with desc-tex being used as a submodule on the git repository, but needs to removed for pushing to overleaf.

To use overleaf, you will need to direct-download desc-tex rather than installing it as a submodule. This does not prevent you from working with the project locally with git or on github. It simply means that if you want any updated desc-tex files, you'll need to download them yourself instead of relying on git or the Makefile to do it.

is it possible to not commit the pdf file, but have it autogenerated?

This is the default behavior. The pdf is never committed automatically.

rbiswas4 commented 6 years ago

To use overleaf, you will need to direct-download desc-tex rather than installing it as a submodule. This does not prevent you from working with the project locally with git or on github. It simply means that if you want any updated desc-tex files, you'll need to download them yourself instead of relying on git or the Makefile to do it.

OK. But here is my problem:

This is the default behavior. The pdf is never committed automatically.

The default behavior is to not commit ... yes. But it is not autogenerated in the github either. ie. if a collaborator wants to look at the pdf, they have to clone the github repo and make the pdf themselves.

abmantz commented 6 years ago

Look into the git help for submodule. You probably need to deinit the module. You may also need to delete the .gitmodules file to satisfy overleaf, even if it's empty.

I don't understand what you're looking for with the second issue. Are you expecting GitHub to compile the code for you when you push and then host the result? Because that isn't something it does. @drphilmarshall once had a way of using Travis to accomplish this excrutiatingly slowly, but it's since vanished. However, I have the non-Travis guts in the script below. It isn't integrated with start_paper, but should work with perhaps minor modifications.

#!/bin/bash

# q/d way of getting compiled products onto GitHub without saving their histories.

function parse_git_branch {
    s=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/' | tr -d ' '`
    echo "$s"
}

current=$(parse_git_branch)
orphan=compiled
files=$(basename $(pwd)).pdf
message=upload
safe=safety

[ ${#files[@]} -ge 1 ] || {
    echo "No files to upload."
    exit
}

# because this process is destructive, make a copy of everything
mkdir $safe || exit $?
rm -f $safe/* # oh, the irony
cp -v $files $safe/

git checkout --orphan $orphan && \
    git rm -rf . && \
    git add $files && \
    git commit -m "$message" && \
    git push -f origin $orphan

git checkout $current
git branch -D $orphan

mv -v $safe/* .
rmdir $safe
rbiswas4 commented 6 years ago

Look into the git help for submodule. You probably need to deinit the module. You may also need to delete the .gitmodules file to satisfy overleaf, even if it's empty.

Yes ... I have tried those following instructions on the net (without understanding why etc.: so I will not be shocked if I did something wrong). But the thing that surprised me is that this was a problem even when I tried doing this from a freshly cloned repository.

Anyway, thanks for confirming that there is some submodule related issue I am missing, and I should hope to be able to fix this: that is quite useful to know :)

I don't understand what you're looking for with the second issue

You exactly pointed to what I was looking for. I know @drphilmarshall got the pdf to display (I thought using gh-pages) for example in the Observing Strategy white paper. This is also common in the LSST documents stored on github. For similar reasons, this is useful for DESC notes, as it is useful to point large groups of people to a pdf, rather than asking them to download and make the note. Will look at your script and try to understand what was supposed to happen.

abmantz commented 6 years ago

Ok. I'm certainly not opposed to bringing this kind of functionality back in, so let me know how it goes.