Skip to content

Commit

Permalink
install apt-get texlive-xelatex and pkgs (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjyetman authored Nov 20, 2022
1 parent d947d42 commit 805b4a7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
52 changes: 26 additions & 26 deletions transitionmonitor_docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,32 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/*

# install TeX system and fonts
ARG TEX_APT="\
texlive-xetex \
texlive-fonts-recommended \
texlive-fonts-extra \
lmodern \
"
RUN apt-get update \
&& apt-get install -y --no-install-recommends $TEX_APT \
&& tlmgr init-usertree \
&& rm -rf /var/lib/apt/lists/*
ARG TEX_APT="\
texlive-xetex \
texlive-fonts-recommended \
texlive-fonts-extra \
lmodern \
"
RUN apt-get update \
&& apt-get install -y --no-install-recommends $TEX_APT \
&& tlmgr init-usertree \
&& rm -rf /var/lib/apt/lists/*

# install tex package dependencies
ARG CTAN_REPO=https://www.texlive.info/tlnet-archive/2019/12/31/tlnet/

ARG TEX_DEPS="\
geometry \
hyperref \
l3packages \
mdframed \
needspace \
tools \
xcolor \
zref \
"

RUN tlmgr --repository $CTAN_REPO install $TEX_DEPS

# install R package dependencies
ARG PKG_DEPS="\
Expand Down Expand Up @@ -81,22 +97,6 @@ RUN Rscript -e "\
remotes::install_cran(pkg_deps); \
"

# install {tinytex} and TeX packages
ARG TEX_DEPS="\
geometry \
mdframed \
multicol \
needspace \
xcolor \
xparse \
zref \
"
RUN Rscript -e "\
tex_deps <- strsplit(trimws(gsub('[\\\]+', '', '$TEX_DEPS')), '[[:space:]]+')[[1]]; \
remotes::install_cran('tinytex'); \
tinytex::install_tinytex(extra_packages = tex_deps); \
"

# copy in PACTA repos
COPY pacta-data /pacta-data
COPY pacta.executive.summary /pacta.executive.summary
Expand Down
4 changes: 3 additions & 1 deletion transitionmonitor_docker/build_with_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ green () {
}

dir_start="$(pwd)"
dir_temp="$(mktemp -d)"
dir_temp="$(mktemp -d -p /datadrive/tmp)"
cleanup () {
rm -rf $dir_temp
cd $dir_start
Expand Down Expand Up @@ -164,6 +164,8 @@ cp "${dir_start}/Dockerfile" "$dir_temp"
# Maybe copy in custom data path
# FIXME: this should be handled better
if [ -n "${datapath}" ]; then
yellow " $datapath"
yellow " $dir_temp"
mkdir "${dir_temp}/pacta-data"
cp -r "${datapath}" "${dir_temp}/pacta-data"
fi
Expand Down

0 comments on commit 805b4a7

Please sign in to comment.