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

Overhaul for SILE v0.13+ #1

Merged
merged 4 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 54 additions & 77 deletions examples.sil
Original file line number Diff line number Diff line change
@@ -1,104 +1,81 @@
\begin[papersize=210mm x 100mm]{document}
\nofolios
\neverindent
\use[module=packages.raiselower]
\use[module=packages.rotate]
\use[module=packages.frametricks]
\use[module=packages.rules]
\use[module=packages.rebox]
\use[module=packages.sile-logos]
\set[parameter=font.family,value=EB Garamond,makedefault=true]
\set[parameter=font.size,value=12,makedefault=true]
\script[src=packages/raiselower]
\script[src=packages/rotate]
\script[src=packages/frametricks]

\include[src=sile-logos.sil]

\neverindent\nofolios
\define[command=line]{\novbreak\noindent\hrule[width=4em,height=0.3pt]\par\novbreak\skip[height=5pt]}

\script[src=packages/rules]
\script[src=packages/rebox]

\rebox[phantom=y]{A}

\par\center{\font[size=24pt,weight=1000]{\LaTeX logos—in \SILE!}}
\skip[height=1em]

\define[command=line]{\hrule[width=4em,height=0.3pt]\skip[height=1ex]}
\hbox{}
\skip[height=1ex]
\center{\font[size=24pt,weight=1000]{\LaTeX logos—in \SILE!}}
\skip[height=3ex]
\breakframevertical
\makecolumns[columns=4]

\center{
\begin{center}
\line
\LaTeX < \SILE

\font[family=Libertinus Serif]{\LaTeX < \SILE}

\LaTeX < \SILE\par
\font[family=Libertinus Serif]{\LaTeX < \SILE}\par
\define[command=kernSI]{\kern[width=-0.18em]}
\define[command=kernIL]{\kern[width=-0.18em]}
\font[family=FreeMono]{\LaTeX < \SILE}
\font[family=FreeMono]{\LaTeX < \SILE}\par
\define[command=kernSI]{\kern[width=-0.0em]}
\define[command=kernIL]{\kern[width=-0.0em]}
\font[family=Libertinus Sans]{\strong{\LaTeX < \SILE}}\par
\LaTeX-CM < \SILE-CM\par
\line
\end{center}

\font[family=Libertinus Sans]{\strong{\LaTeX < \SILE}}
\framebreak

\LaTeX-CM < \SILE-CM
\begin{center}
\line
}

\eject
\center{
\LaTeX2e\par
\font[family=Libertinus Serif]{\LaTeX2e}\par
\font[family=FreeMono]{\LaTeX2e}\par
\font[family=Libertinus Sans]{\strong{\LaTeX2e}}\par
\LaTeX2e-CM\par
\line
\LaTeX2e
\end{center}

\font[family=Libertinus Serif]{\LaTeX2e}
\framebreak

\font[family=FreeMono]{\LaTeX2e}

\font[family=Libertinus Sans]{\strong{\LaTeX2e}}

\LaTeX2e-CM
\begin{center}
\line
}

\eject
\center{
\XeTeX\par
\font[family=Libertinus Serif]{\XeTeX}\par
\font[family=FreeMono]{\XeTeX}\par
\font[family=Libertinus Sans]{\strong{\XeTeX-rot}}\par
\XeTeX-CM\par
\line
\XeTeX
\end{center}

\font[family=Libertinus Serif]{\XeTeX}

\font[family=FreeMono]{\XeTeX}

\font[family=Libertinus Sans]{\strong{\XeTeX-rot}}

\XeTeX-CM
\begin{center}
\line
}

\eject
\center{
\XeLaTeX\par
\font[family=Libertinus Serif]{\XeLaTeX}\par
\font[family=FreeMono]{\XeLaTeX}\par
\font[family=Libertinus Sans]{\strong{\XeLaTeX-rot}}\par
\XeLaTeX-CM\par
\line
\XeLaTeX

\font[family=Libertinus Serif]{\XeLaTeX}

\font[family=FreeMono]{\XeLaTeX}

\font[family=Libertinus Sans]{\strong{\XeLaTeX-rot}}
\end{center}

\XeLaTeX-CM
\line
}
\frame[left=left(content), right=right(content), top=60%ph, bottom=100%ph, id=center]
\typeset-into[frame=center]{
\center{
\define[command=line]{\novbreak\noindent\hrule[width=14em,height=0.3pt]\par\novbreak\skip[height=5pt]}
\begin[frame=center]{typeset-into}
\begin{center}
\define[command=line]{\hrule[width=14em,height=0.3pt]\skip[height=5pt]}
\line
\TeX \LuaTeX \LuaLaTeX

\font[family=Libertinus Serif]{\TeX \LuaTeX \LuaLaTeX}

\font[family=FreeMono]{\TeX \LuaTeX \LuaLaTeX}

\font[family=Libertinus Sans]{\strong{\TeX \LuaTeX \LuaLaTeX}}

\TeX-CM \LuaTeX-CM \LuaLaTeX-CM
\TeX \LuaTeX \LuaLaTeX\par
\font[family=Libertinus Serif]{\TeX \LuaTeX \LuaLaTeX}\par
\font[family=FreeMono]{\TeX \LuaTeX \LuaLaTeX}\par
\font[family=Libertinus Sans]{\strong{\TeX \LuaTeX \LuaLaTeX}}\par
\TeX-CM \LuaTeX-CM \LuaLaTeX-CM\par
\line
}
}

\end{center}
\end{typeset-into}
\end{document}
24 changes: 24 additions & 0 deletions packages/sile-logos/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
local base = require("packages.base")

local package = pl.class(base)
package._name = "sile-logos"

local function script_path ()
local str = debug.getinfo(2, "S").source:sub(2)
return str:match("(.*/)")
end

function package:_init ()
base._init(self)
end

function package:registerCommands ()
base.registerCommands(self)
-- The first iteration of this package was a collection of commands
-- registered using \define{} macros in the SIL input format. They should
-- probably be refactored using Lua, but to get the party started with SILE
-- v0.13 package support we'll just process them here.
SILE.processFile(script_path() .. "macros.sil")
end

return package
File renamed without changes.
34 changes: 34 additions & 0 deletions sile-logos-dev-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
rockspec_format = "3.0"
package = "sile-logos"
version = "dev-1"

source = {
url = "git+https://github.com/ctrlcctrlv/sile-logos.git",
tag = "master"
}

description = {
summary = "LaTeX logos—in SILE! ",
detailed = [[This package adds the "bumpy road" logos from the LaTeX metalogo package to SILE.]],
license = "Apache 2",
homepage = "https://github.com/ctrlcctrlv/sile-logos",
issues_url = "https://github.com/ctrlcctrlv/sile-logos/issues",
maintainer = "Fredrick Brennan <copypaste@kittens.ph>",
labels = { "sile", "typesetting" }
}

dependencies = {
"lua >= 5.1"
}

build = {
type = "builtin",
modules = {
["sile.packages.sile-logos"] = "packages/sile-logos/init.lua"
},
install = {
lua = {
["sile.packages.sile-logos.macros"] = "packages/sile-logos/macros.sil"
}
}
}