Skip to content

Commit

Permalink
git subrepo pull --update --branch=main --force _support/latex/sbabook
Browse files Browse the repository at this point in the history
subrepo:
  subdir:   "_support/latex/sbabook"
  merged:   "d7cdd1c"
upstream:
  origin:   "https://github.com/cdlm/sbabook.git"
  branch:   "main"
  commit:   "d7cdd1c"
git-subrepo:
  version:  "0.4.6"
  origin:   "https://github.com/Homebrew/brew"
  commit:   "f5cde8ad0d"
  • Loading branch information
cdlm committed Apr 26, 2024
1 parent ad2e9ca commit ed01a7c
Show file tree
Hide file tree
Showing 12 changed files with 296 additions and 70 deletions.
109 changes: 109 additions & 0 deletions _support/latex/sbabook/.drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
kind: pipeline
type: docker
name: TeXlive

steps:
- name: build
image: texlive/texlive
commands:
- tlmgr option repository https://ctan.gutenberg-asso.fr/systems/texlive/tlnet
- tlmgr update --self --all
- latexmk sbabook
- latexmk sbabook.bod
- latexmk sbabook.spiral

- name: build log
image: alpine
commands:
- cat sbabook.log
- cat sbabook.bod.log
- cat sbabook.spiral.log
when:
status: [failure, success]

---
kind: pipeline
type: docker
name: minimal TeXlive

steps:
- name: build
image: texlive/texlive:latest-minimal
pull: always
commands:
- tlmgr option repository https://ctan.gutenberg-asso.fr/systems/texlive/tlnet
- tlmgr update --self --all
- tlmgr install latex-bin latexmk
- xargs tlmgr install < texlive.deps
- tlmgr path add
- latexmk sbabook
- latexmk sbabook.bod
- latexmk sbabook.spiral

- name: build log
image: alpine
commands:
- cat sbabook.log
- cat sbabook.bod.log
- cat sbabook.spiral.log
when:
status: [failure, success]

---
kind: pipeline
type: docker
name: Ubuntu + TeXlive 2023

environment:
TEXLIVE_RELEASE: 2023

steps:
- name: build
image: ubuntu
commands:
- apt update && apt install -y curl perl
- echo $PATH
- export PATH=$HOME/texlive/bin/x86_64-linux:$HOME/texlive/bin/aarch64-linux:$PATH
- ./ci/install-texlive
- latexmk sbabook
- latexmk sbabook.bod
- latexmk sbabook.spiral

- name: build log
image: alpine
commands:
- cat sbabook.log
- cat sbabook.bod.log
- cat sbabook.spiral.log
when:
status: [failure, success]

---
kind: pipeline
type: docker
name: Ubuntu + TeXlive rolling

environment:
TEXLIVE_RELEASE: rolling

steps:
- name: build
image: ubuntu
commands:
- apt update && apt install -y curl perl
- echo $PATH
- export PATH=$HOME/texlive/bin/x86_64-linux:$HOME/texlive/bin/aarch64-linux:$PATH
- ./ci/install-texlive
- latexmk sbabook
- latexmk sbabook.bod
- latexmk sbabook.spiral

- name: build log
image: alpine
commands:
- cat sbabook.log
- cat sbabook.bod.log
- cat sbabook.spiral.log
when:
status: [failure, success]
8 changes: 4 additions & 4 deletions _support/latex/sbabook/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
;
[subrepo]
remote = https://github.com/cdlm/sbabook.git
branch = master
commit = 6ba943f40408c19528b5c62d5c498c9507e44335
parent = d9663feb3a92f12b7cc6268e6cc41a5d6aef60da
branch = main
commit = d7cdd1cda27c9a00825fd39490a5c4e4505b7ff9
parent = ad2e9ca56bf2d67f6ca52a1c647a36afd034107a
method = merge
cmdver = 0.4.1
cmdver = 0.4.6
Binary file added _support/latex/sbabook/CreativeCommons-BY-SA.pdf
Binary file not shown.
Binary file removed _support/latex/sbabook/CreativeCommons-BYNOCND.pdf
Binary file not shown.
17 changes: 9 additions & 8 deletions _support/latex/sbabook/ci/install-texlive
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ function texlive-release() {
function get-texlive-installer() {
# download, checksum, extract
curl --silent --location --remote-name-all "${TEXLIVE_REPOSITORY}/${TEXLIVE_TARBALL}"{,.sha512}
shasum --check "${TEXLIVE_TARBALL}.sha512"
sha512sum --check "${TEXLIVE_TARBALL}.sha512"
tar --extract --gzip --file "${TEXLIVE_TARBALL}"
}

function texlive-profile() {
cat <<EOF
selected_scheme scheme-basic
selected_scheme scheme-infraonly
TEXDIR $HOME/texlive
TEXMFLOCAL \$TEXDIR/texmf-local
Expand All @@ -76,13 +76,14 @@ tlpdbopt_generate_updmap 0
tlpdbopt_install_docfiles 0
tlpdbopt_install_srcfiles 0
tlpdbopt_post_code 1
tlpdbopt_sys_bin /usr/local/bin
tlpdbopt_sys_info /usr/local/info
tlpdbopt_sys_man /usr/local/man
EOF
}

function install-texlive() {
[[ $TRAVIS = true ]] || die "Should only run on Travis"
echo "Downloading minimal TeXlive..."
echo "Downloading TeXlive..."
echo " release $TEXLIVE_RELEASE"
echo " from $TEXLIVE_REPOSITORY"

Expand All @@ -98,9 +99,9 @@ function install-texlive() {
}

function install-deps() {
xargs tlmgr install \
latexmk \
< "$(deps-file "$TEXLIVE_RELEASE")"
tlmgr update --self --all
tlmgr install latex-bin latexmk
xargs tlmgr install < "$(deps-file "$TEXLIVE_RELEASE")"
}

# Only call the main function if this script was called as a command. This makes
Expand Down
91 changes: 91 additions & 0 deletions _support/latex/sbabook/ci/list-deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#!/usr/bin/env bash
set -o nounset
set -o errexit
set -o errtrace
set -o pipefail
IFS=
trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR

shopt -s extglob
declare -A DEPS

PREFIX="$(kpsewhich --var-value TEXMFROOT)"

function die {
local code="${1:-1}"
[[ $# -ge 1 ]] && shift

printf "$(tput setaf 1)%s$(tput sgr0)\n" "$@" 1>&2
exit "$code"
}

function info-inline {
printf "$(tput setaf 3)%s$(tput sgr0)" "$@" 1>&2
}

function info {
info-inline "$@"
printf "\n" 1>&2
}

function filter-inputs {
sed -e '\#^INPUT '"$PREFIX"'/texmf-dist#!d' \
-e 's#^INPUT '"$PREFIX"'/##' \
"$@"
}

function query-package-containing {
local filename="${1?}"
tlmgr search --global --file "$filename" \
| sed '/^\t/d ; /^tlmgr:/d ; s/:$//'
}

function list-package-files {
local pkgname="${1?}"
tlmgr info --list "$pkgname" \
| sed '/^ /!d ; s/^ *//'
}

function encache-file {
local filename="${1?}" pkgname
pkgname="$(query-package-containing "${filename}")"
while read -r provided; do
DEPS["$provided"]="$pkgname"
done < <(list-package-files "$pkgname")
}

function package-name {
local filename="${1?}"
info-inline "$filename"
if [[ -z "${DEPS["$filename"]+found}" ]]; then
info " (querying…)"
encache-file "$filename"
echo "${DEPS["$filename"]}"
else
info " (from ${DEPS[$filename]})"
fi
}

function find-packages {
while read -r filename; do
package-name "$filename"
done
}

function list-deps {
local main="${1:-main}"
main="${main%.@(tex|aux|fls)}" # extglob
[[ -f "$main.fls" ]] || die 1 "no such file: $main.fls"

filter-inputs "$main.fls" | sort --unique > "$main.inputs"
info "$(wc -l "$main.inputs")"

find-packages < "$main.inputs" | tee "$main.deps"
sort --unique --output "$main.deps" "$main.deps"
}

# Only call the main function if this script was called as a command. This makes
# it possible to source this script as a library.
if [[ ${BASH_SOURCE[0]} == "$0" ]]; then
list-deps "$@"
fi
7 changes: 7 additions & 0 deletions _support/latex/sbabook/sbabook.bod.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
% Paper format for https://librairie.bod.fr
\newcommand{\bodpage}{
\setstocksize{220mm}{155mm} % final trimmed book dimensions
\setbleed{5mm} % additional paper, before trimming
\setlrmarginsandblock{.85in}{.65in}{*}
\setulmarginsandblock{.75in}{.75in}{*}}
\providecommand{\setuppage}{\bodpage}\input{sbabook}
19 changes: 3 additions & 16 deletions _support/latex/sbabook/sbabook.cls
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{sbabook}[2020/02/28]
\ProvidesClass{sbabook}[2024/03/18]

% \ExecuteOptions{a4paper,11pt,twoside}
\ProcessOptions*
\LoadClassWithOptions{memoir}

Expand All @@ -19,20 +18,17 @@
\settrims{#1}{#1}%
\advance\stockheight 2\trimtop
\advance\stockwidth 2\trimedge}

\newcommand{\paperbackpage}{
\stockustrade
\setbleed{.125in}
% \setbinding{5mm}
\setlrmarginsandblock{.85in}{.65in}{*}
\setulmarginsandblock{.75in}{.75in}{*}}

\newcommand{\spiralboundpage}{
\stockaivus
\setbleed{0pt}% trims not required (unless we deliver this via Lulu as well?)
\setlrmarginsandblock{1.25in}{1.25in}{*}
\setulmarginsandblock{.75in}{1in}{*}}

\newcommand{\pagelayout}[1]{
\providecommand{\setuppage}{#1}% set default page layout
\setuppage\checkandfixthelayout
Expand All @@ -42,20 +38,12 @@

\raggedbottom

%%for www.BOD.fr
\newcommand{\bodpage}{
\setstocksize{220mm}{155mm} % final trimmed book dimensions
\setbleed{5mm} % additional paper, before trimming
\setlrmarginsandblock{.85in}{.65in}{*}
\setulmarginsandblock{.75in}{.75in}{*}}
\pagelayout{\bodpage}

%%%
%%% Fonts & paragraph typography
%%%
\RequirePackage{fontspec,gentium,opensans,FiraMono}
\RequirePackage{fontspec,gentiumbook,opensans,FiraMono}

\setmainfont{Gentium Book Basic}
\setmainfont{Gentium Book Plus}
\setsansfont{Open Sans}[
\@ifpackagelater{opensans}{2019/06/19}% test for font naming bug
{}% 2019/06/20 fixed it
Expand Down Expand Up @@ -500,7 +488,6 @@
%% verbatim setup
\bvtopandtail % \bvsides
\setlength{\bvboxsep}{.25em}
\tabson[4]
\setverbatimfont{\normalfont\codefamily\small}

\DeclareRobustCommand{\LaTeX}{%
Expand Down
1 change: 1 addition & 0 deletions _support/latex/sbabook/sbabook.spiral.tex
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
% Paper format for office binding (A4 or letter paper)
\providecommand{\setuppage}{\spiralboundpage}\input{sbabook}
9 changes: 1 addition & 8 deletions _support/latex/sbabook/sbabook.tex
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
\documentclass[twoside,openany,showtrims]{sbabook}

%\pagelayout{\paperbackpage}

\newcommand{\bodpage}{
\setstocksize{220mm}{155mm} % final trimmed book dimensions
\setbleed{5mm} % additional paper, before trimming
\setlrmarginsandblock{.85in}{.65in}{*}
\setulmarginsandblock{.75in}{.75in}{*}}
\pagelayout{\bodpage}
\pagelayout{\paperbackpage}

\usepackage[useregional]{datetime2}

Expand Down
Loading

0 comments on commit ed01a7c

Please sign in to comment.