Skip to content

Commit

Permalink
Using larger tex scheme for texlive install, added more deps
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverKillane committed Sep 27, 2023
1 parent 058ca90 commit d11ecd8
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 159 deletions.
8 changes: 5 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@ FROM ubuntu:latest

# Install basic packages
RUN apt-get update -q
RUN apt-get install -qy build-essential wget curl sudo
RUN apt-get install -qy build-essential wget curl sudo openssh-client git

# LATEX:
# Install basic texlive distribution
# Install full texlive distribution (very large)
ARG TL_VERSION=2023
ARG TL_MIRROR=https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
RUN cd /tmp && \
wget --directory-prefix /tmp ${TL_MIRROR} && \
zcat < install-tl-unx.tar.gz | tar xf - && \
cd install-tl-* && \
perl ./install-tl --scheme=small --no-interaction
perl ./install-tl --no-interaction --no-doc-install --no-src-install
ENV PATH="${PATH}:/usr/local/texlive/${TL_VERSION}/bin/x86_64-linux"

# Update packages and tlmgr
RUN tlmgr init-usertree
RUN tlmgr update --self --all
RUN tlmgr install latexindent chktex

# install inkscape (for tikz) and minted (for code highlighting)
RUN apt-get install -qy inkscape python3 python3-pip
Expand All @@ -39,6 +40,7 @@ RUN apt-get install -qy elixir
RUN apt-get install -qy default-jdk

# Haskell
RUN apt-get install -qy libffi-dev libffi8ubuntu1 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_GHC_VERSION=latest BOOTSTRAP_HASKELL_CABAL_VERSION=latest BOOTSTRAP_HASKELL_INSTALL_STACK=1 BOOTSTRAP_HASKELL_INSTALL_HLS=1 BOOTSTRAP_HASKELL_ADJUST_BASHRC=P sh

# Clean up to reduce image size
Expand Down
103 changes: 7 additions & 96 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"image": "ghcr.io/oliverkillane/imperial-computing-notes-dev:enh-development-docker",
"image": "ghcr.io/oliverkillane/imperial-computing-notes-dev",
"customizations": {
"vscode": {
"settings": {
"latex-workshop.linting.chktex.enabled": true,
"latex-workshop.latex.tools": [
{
"name": "latexmk",
Expand All @@ -17,96 +18,6 @@
"%DOC%"
],
"env": {}
},
{
"name": "lualatexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-lualatex",
"-outdir=%OUTDIR%",
"%DOC%"
],
"env": {}
},
{
"name": "xelatexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-xelatex",
"-outdir=%OUTDIR%",
"%DOC%"
],
"env": {}
},
{
"name": "latexmk_rconly",
"command": "latexmk",
"args": [
"%DOC%"
],
"env": {}
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
],
"env": {}
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
],
"env": {}
},
{
"name": "rnw2tex",
"command": "Rscript",
"args": [
"-e",
"knitr::opts_knit$set(concordance = TRUE); knitr::knit('%DOCFILE_EXT%')"
],
"env": {}
},
{
"name": "jnw2tex",
"command": "julia",
"args": [
"-e",
"using Weave; weave(\"%DOC_EXT%\", doctype=\"tex\")"
],
"env": {}
},
{
"name": "jnw2texmintex",
"command": "julia",
"args": [
"-e",
"using Weave; weave(\"%DOC_EXT%\", doctype=\"texminted\")"
],
"env": {}
},
{
"name": "tectonic",
"command": "tectonic",
"args": [
"--synctex",
"--keep-logs",
"%DOC%.tex"
],
"env": {}
}
],
"editor.rulers": [
Expand Down Expand Up @@ -144,10 +55,10 @@
}
},
"mounts": [
{
"source": "${localEnv:HOME}/.ssh",
"target": "/root/.ssh",
"type": "bind"
}
// {
// "source": "${localEnv:HOME}/.ssh",
// "target": "/root/.ssh",
// "type": "bind"
// }
]
}
17 changes: 17 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Develop

### From Github Codespaces
Given you have github pro (e.g through the student developer pack)
1. Open the repository in a new codespace
2. Setup git, ssh *...and you're done*

### From Devcontainer
See the provided [container](../.devcontainer).
1. Install docker desktop
2. Install vscode and the [Dev Container Extension](vscode:extension/ms-vscode-remote.remote-containers)
3. Clone this repository, and open within a devcontainer.
4. Setup git, ssh *...and you're done*

### Locally
Please use the dockerfile and vscode features from the [container setup](../.devcontainer) as a guide.
- @oliverkillane is using MikTex + vscode + wsl on Windows
4 changes: 4 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Description
*{A short description of the issue here}*

*{Include references to incorrect information (to file, line in latex)}*
4 changes: 4 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
- Only semi-jingled, decided against replacement due to additional build complexity

> :eyes: **Please see zarg formatting** (decreased cadence)
## Chores
- [ ] PDFs regenerated
- [ ] Reformatted
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Oliver Killane

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
61 changes: 1 addition & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,69 +16,10 @@ It is designed as an improvement in quality over the [second year repo](https://
- [60029 - Data Processing Systems](60029%20-%20Data%20Processing%20Systems)

## How do I build this?
### Dependencies
1. A tex distribution. [See options here](https://www.latex-project.org/get/)

2. Inkscape (required for tikz). Needs to be added to path
```powershell
# Check inkscape is installed and on path
inkscape --version
```

3. [Pygments](https://pygments.org/) - used by minted (code listings), which requires [python & pip](https://www.python.org/downloads/).
```powershell
pip install Pygments
```

4. Correctly configured editor (minted and tikz need shell escape).

5. `latexindent` for code formatting

6. [draw.io](https://app.diagrams.net/) for diagrams. This can also be downloaded.

### My Setup
I am editing on windows 11.
1. Tex Distribution is [MikTex](https://miktex.org/).
2. Inkscape 0.92.4 installed from, their website. `C:\Program Files\Inkscape` added to `Path`.
3. Python 3.10.7 installed with Pip 22.2.2. Pygments 2.13.0 installed.
5. I use wsl as my default terminal, so I run latexindent from there as part of texlive.
```bash
sudo apt install texlive-extra-utils
```
4. I edit using VSCode using the [Latex Workshop extension](https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop). To allow shell escape I have added:
```json
{
...

"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-shell-escape", // Shell Escape enabled!
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"-outdir=%OUTDIR%",
"%DOC%"
],
"env": {}
},
...
],
...
}
```

## [I want to contribute!](./.github/CONTRIBUTING.md)
## I've found a mistake!
Simply [add a new issue](https://github.com/OliverKillane/Imperial-Computing-Year-3-Notes/issues/new/choose) and attach the relevant labels.

![Screenshot 2022-10-09 015053](https://user-images.githubusercontent.com/44177991/194732526-54cca108-9fa7-4b0e-a4af-b0baad625af9.png)

## I want to contribute!
Fork the repository and create a [pull request](https://github.com/OliverKillane/Imperial-Computing-Year-3-Notes/pulls).
- I will review as soon as I can
- PRs need to be formatted correctly (using latexindent)
- If there are merge conflicts, rebase!
- PDFs need to be rebuilt.

0 comments on commit d11ecd8

Please sign in to comment.