Skip to content

Commit

Permalink
Switched to latexmk instead of make #2
Browse files Browse the repository at this point in the history
- Also removed style and lexer submodules
  • Loading branch information
mossr committed Apr 16, 2021
1 parent ff3a656 commit bff7e84
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 30 deletions.
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
[submodule "style"]
path = style
url = https://github.com/sisl/pygments-style-algforopt
[submodule "lexer"]
path = lexer
url = https://github.com/sisl/pygments-julia
[submodule "juliaplots.sty"]
path = juliaplots.sty
url = https://github.com/sisl/juliaplots.sty
40 changes: 18 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,35 +81,28 @@ Clone the repository to a location of your choosing:
git clone https://github.com/mossr/julia-tufte-beamer.git
```

Initialize and update the submodules:
Initialize and update the submodule ([juliaplots.sty](https://github.com/sisl/juliaplots.sty)):
```
git submodule init
git submodule update
```

Compile the style:
Install lexer and style (may need `pip3` instead):
```
cd style
sudo python setup.py install
cd ..
```

Compile the lexer:
```
cd lexer
sudo python setup.py install
cd ..
pip install --upgrade git+https://github.com/sisl/pygments-julia#egg=pygments_julia
pip install --upgrade git+https://github.com/sisl/pygments-style-algfordm#egg=pygments_style_algfordm
```

Install the required Julia packages.
```
make install
julia jl/install.jl
```

Install `pdf2svg`, which is used by PGFPlots (we assume Ubuntu - other operating systems may install pdf2svg differently):
```
sudo apt-get install pdf2svg
```
For `pdf2svg` on Windows (place `dist-*` directory on PATH): https://github.com/jalios/pdf2svg-windows

Install [pgfplots](https://ctan.org/pkg/pgfplots).

Expand All @@ -119,18 +112,21 @@ We require pythontex 0.17, which was just recently tagged. You will probably hav

## Test

Running `make test` pulls all the code and then runs all tests in `juliatest` blocks. See `runtests.jl` for details.
Running the following pulls all the code and then runs all tests in `juliatest` blocks. See `runtests.jl` for details.

```
julia jl/runtests.jl
```

## Compilation

* `make compile` compiles the whole presentation (`make main` works too)
* `make sandbox` will compile `tex/sandbox.tex` (meant for development, e.g., single slides)
* `make quick` will only run `lualatex` (skipping `pythontex` and `biber` for quick LaTeX compilation)
* `make quick-sandbox` does quick compilation for `tex/sandbox.tex`
* `make clean` removes all generated files except `main.pdf` and `sandbox.pdf`
* `make full` runs `clean` and `compile`
* `make full-sandbox` does full clean/compilation for `tex/sandbox.tex`
* `make save` copies the `main.pdf` file to `presentation.pdf` (which you can modify in the makefile)
Install `latexmk` from: https://mg.readthedocs.io/latexmk.html#installation

* `latexmk` will compile everything (see `output/` for PDF).
* `latexmk` will intelligently compile only the necessary bits.
* `latexmk -c` will clean up generated files.
* `latexmk -C` will clean up generated files (including `.pdf`).
* `latexmk tex/sandbox.tex` will compile `tex/sandbox.tex` (meant for development, e.g., single files)


## Directory structure
Expand Down
45 changes: 45 additions & 0 deletions latexmkrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
ensure_path( 'TEXINPUTS', './tex//' );
ensure_path( 'BIBINPUTS', './tex//' );

$pdf_mode = 4;
$out_dir = 'output';
$aux_dir = 'output';

$MSWin_back_slash = 0;

$clean_ext .= " pythontex-files-%R/* pythontex-files-%R";
push @generated_exts, 'pytxcode';

$pythontex = 'pythontex %O %S';
$extra_rule_spec{'pythontex'} = [ 'internal', '', 'mypythontex', "%Y%R.pytxcode", "%Ypythontex-files-%R/%R.pytxmcr", "%R", 1 ];

sub mypythontex {
my $result_dir = $aux_dir1."pythontex-files-$$Pbase";
my $ret = Run_subst( $pythontex, 2 );
rdb_add_generated( glob "$result_dir/*" );
my $fh = new FileHandle $$Pdest, "r";
if ($fh) {
while (<$fh>) {
if ( /^%PythonTeX dependency:\s+'([^']+)';/ ) {
print "Found pythontex dependency '$1'\n";
rdb_ensure_file( $rule, $aux_dir1.$1 );
}
}
undef $fh;
}
else {
warn "mypythontex: I could not read '$$Pdest'\n",
" to check dependencies\n";
}
return $ret;
}

sub pull_julia_code {
system("julia --color=yes jl/pull_julia_code.jl");
}

pull_julia_code();

$lualatex = "lualatex %O -shell-escape %S";

@default_files = ('main');
1 change: 0 additions & 1 deletion lexer
Submodule lexer deleted from 16d142
Binary file modified main.pdf
Binary file not shown.
1 change: 0 additions & 1 deletion style
Submodule style deleted from 58dada

0 comments on commit bff7e84

Please sign in to comment.