Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ubuntu installation with latest pandoc (citeproc), Fix tlmgr use with TinyTex #102

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
44 changes: 25 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ language: bash

os:
- osx
# - linux # https://tex.stackexchange.com/questions/313768/why-getting-this-error-tlmgr-unknown-directive
- linux # https://tex.stackexchange.com/questions/313768/why-getting-this-error-tlmgr-unknown-directive

# env:
# global:
env:
global:
# - PATH=$TRAVIS_BUILD_DIR/usr/bin/:$PATH
# - PATH=/Library/TeX/texbin:$PATH
- PATH="$PATH:$HOME/bin"
- PATH="$PATH:$HOME/.local/bin"

python:
# We don't actually use the Travis Python, but this keeps it organized.
Expand All @@ -29,8 +31,9 @@ python:
addons:
apt:
packages:
- texlive
# - texlive
- xzdec
- python3-pip
update: true
homebrew:
casks:
Expand All @@ -45,7 +48,10 @@ before_install:
eval "$(/usr/libexec/path_helper)"
sudo tlmgr update --self
elif [ "$TRAVIS_OS_NAME" = "linux" ]; then
tlmgr init-usertree
wget -qO- "https://yihui.org/tinytex/install-bin-unix.sh" | sh
sudo env PATH=$PATH tlmgr update --self
TEMP_DEB="$(mktemp)" && wget -O "$TEMP_DEB" 'https://github.com/jgm/pandoc/releases/download/2.11.4/pandoc-2.11.4-1-amd64.deb' && sudo dpkg -i "$TEMP_DEB"
rm -f "$TEMP_DEB"
echo MSG FROM JO:
echo on linux we cannot update apt installed texlive
echo next steps to fix see commit msg: https://github.com/tompollard/phd_thesis_markdown/pull/100/commits/85fd9e7ac413a34066b79f1e49b3e1d3efdeac00
Expand Down Expand Up @@ -95,17 +101,17 @@ install:
# Installs both python and texlive dependencies
- make install
# For debug
- cat /usr/local/texlive/2020/texmf-var/web2c/tlmgr.log
- conda list
- pip list
- python --version
- pandoc --version
- tlmgr --version
- latex --version
- echo $PATH
- which tlmgr
- which latex
- find /usr/local/texlive/2020/ -type f -name "l3backend*"
# - cat /usr/local/texlive/2020/texmf-var/web2c/tlmgr.log
# - conda list
# - pip list
# - python --version
# - pandoc --version
# - tlmgr --version
# - latex --version
# - echo $PATH
# - which tlmgr
# - which latex
# - find /usr/local/texlive/2020/ -type f -name "l3backend*"

# Attempt to create all document output types
script:
Expand All @@ -116,10 +122,10 @@ script:
- make pdf
- cat pandoc.pdf.log
# Debugging the mac error
- find /usr/local/texlive/2020/ -type f -name "l3backend*"
# - find /usr/local/texlive/2020/ -type f -name "l3backend*"
- make html
- cat pandoc.html.log
- make docx
- cat pandoc.docx.log
# - cat pandoc.docx.log
- make all
- cat pandoc.*.log
# - cat pandoc.*.log
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ If you have used this template in your work, please cite the following publicati
> Tom Pollard et al. (2016). Template for writing a PhD thesis in Markdown. Zenodo. http://dx.doi.org/10.5281/zenodo.58490

## Quickstart
### Mac
If you're a mac user and you have conda and brew installed, run the following in your terminal to install and generate the example outputs:
```bash
# get texlive
Expand All @@ -27,6 +28,29 @@ conda activate phd
make install
```

### Ubuntu
On Ubuntu, texlive installed with apt is not working, use an installer like below and make sure it is not installed with apt:
```bash
# get TinyTex and make sure PATH is set
wget -qO- "https://yihui.org/tinytex/install-bin-unix.sh" | sh
PATH="$PATH:$HOME/bin"
PATH="$PATH:$HOME/.local/bin"

# update tlmgr and packages
sudo env PATH=$PATH tlmgr update --self

# Install pip
sudo apt install python3-pip

# Install latest pandoc (apt version too old, needs at least 2.11.*)
TEMP_DEB="$(mktemp)" &&
wget -O "$TEMP_DEB" 'https://github.com/jgm/pandoc/releases/download/2.11.4/pandoc-2.11.4-1-amd64.deb' &&
sudo dpkg -i "$TEMP_DEB"
rm -f "$TEMP_DEB"

# Install required python and texlive packages
make install
```
## Why write my thesis in Markdown?

Markdown is a super-friendly plain text format that can be easily converted to a bunch of other formats like PDF, Word and LaTeX. You'll enjoy working in Markdown because:
Expand Down
39 changes: 28 additions & 11 deletions install_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,34 @@

set -e # makes the script fail as soon as one command fails

sudo tlmgr install truncate
sudo tlmgr install tocloft
sudo tlmgr install wallpaper
sudo tlmgr install morefloats
sudo tlmgr install sectsty
sudo tlmgr install siunitx
sudo tlmgr install threeparttable
sudo tlmgr update l3packages
sudo tlmgr update l3kernel
sudo tlmgr update l3experimental
sudo tlmgr update l3backend
sudo env PATH=$PATH tlmgr install truncate
sudo env PATH=$PATH tlmgr install tocloft
sudo env PATH=$PATH tlmgr install wallpaper
sudo env PATH=$PATH tlmgr install morefloats
sudo env PATH=$PATH tlmgr install sectsty
sudo env PATH=$PATH tlmgr install siunitx
sudo env PATH=$PATH tlmgr install threeparttable
sudo env PATH=$PATH tlmgr update l3packages
sudo env PATH=$PATH tlmgr update l3kernel
sudo env PATH=$PATH tlmgr update l3experimental
sudo env PATH=$PATH tlmgr update l3backend
sudo env PATH=$PATH tlmgr install mathspec
sudo env PATH=$PATH tlmgr install xltxtra
sudo env PATH=$PATH tlmgr install realscripts
sudo env PATH=$PATH tlmgr install eso-pic
sudo env PATH=$PATH tlmgr install ctable
sudo env PATH=$PATH tlmgr install listings
sudo env PATH=$PATH tlmgr install pdfpages
sudo env PATH=$PATH tlmgr install bbold
sudo env PATH=$PATH tlmgr install cleveref
sudo env PATH=$PATH tlmgr install fancyhdr
sudo env PATH=$PATH tlmgr install ulem
sudo env PATH=$PATH tlmgr install setspace
sudo env PATH=$PATH tlmgr install makecell
sudo env PATH=$PATH tlmgr install pdflscape
sudo env PATH=$PATH tlmgr install caption

#
# Would it be simpler to just update all packages? (takes ~10m)
# sudo tlmgr update --all
pip install pandoc-fignos pandoc-eqnos pandoc-tablenos pandoc-secnos pandoc-shortcaption