Skip to content

Commit

Permalink
version 2023D
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjr committed Apr 7, 2023
1 parent aa00009 commit 3b83ae7
Show file tree
Hide file tree
Showing 6 changed files with 325 additions and 62 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/texlive.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

option_doc 0
option_src 0
tlpdbopt_autobackup 0
selected_scheme scheme-infraonly
145 changes: 145 additions & 0 deletions .github/workflows/texlive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# Based on https://github.com/CTeX-org/ctex-kit/blob/master/.github/workflows/test.yml

name: Test in TeX Live

on: [push, pull_request]

env:
TLCurrent: https://mirrors.rit.edu/CTAN/systems/texlive/tlnet

jobs:
build-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install TeX Live
run: |
export PATH=/usr/local/texlive/2023/bin/x86_64-linux:$PATH
wget ${{env.TLCurrent}}/install-tl-unx.tar.gz
tar -xzf install-tl-unx.tar.gz
cd install-tl-20*
sudo ./install-tl --profile ../.github/workflows/texlive.profile --repository=${{env.TLCurrent}}
sudo env "PATH=$PATH" tlmgr install lualibs luatex
sudo env "PATH=$PATH" tlmgr update --self --all --no-auto-install --repository=${{env.TLCurrent}}
- name: Test texfindpkg query
run: |
export PATH=/usr/local/texlive/2023/bin/x86_64-linux:$PATH
texlua texfindpkg.lua query array.sty
echo --------------------------------
texlua texfindpkg.lua query \\fakeverb
echo --------------------------------
texlua texfindpkg.lua query {frame}
echo --------------------------------
texlua texfindpkg.lua query foobar
echo --------------------------------
texlua texfindpkg.lua query foobar.sty
echo --------------------------------
texlua texfindpkg.lua query \\foobar
echo --------------------------------
texlua texfindpkg.lua query {foobar}
- name: Test texfindpkg install
run: |
export PATH=/usr/local/texlive/2023/bin/x86_64-linux:$PATH
texlua texfindpkg.lua install array.sty
echo --------------------------------
texlua texfindpkg.lua install \\fakeverb
echo --------------------------------
texlua texfindpkg.lua install {frame}
echo --------------------------------
texlua texfindpkg.lua install foobar
echo --------------------------------
texlua texfindpkg.lua install foobar.sty
echo --------------------------------
texlua texfindpkg.lua install \\foobar
echo --------------------------------
texlua texfindpkg.lua install {foobar}
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install TeX Live
run: |
export PATH=/usr/local/texlive/2023/bin/universal-darwin:$PATH
curl -O ${{env.TLCurrent}}/install-tl-unx.tar.gz
tar -xzf install-tl-unx.tar.gz
cd install-tl-20*
sudo ./install-tl --profile ../.github/workflows/texlive.profile --repository=${{env.TLCurrent}}
sudo env "PATH=$PATH" tlmgr install lualibs luatex
sudo env "PATH=$PATH" tlmgr update --self --all --no-auto-install --repository=${{env.TLCurrent}}
- name: Test texfindpkg query
run: |
export PATH=/usr/local/texlive/2023/bin/universal-darwin:$PATH
texlua texfindpkg.lua query array.sty
echo --------------------------------
texlua texfindpkg.lua query \\fakeverb
echo --------------------------------
texlua texfindpkg.lua query {frame}
echo --------------------------------
texlua texfindpkg.lua query foobar
echo --------------------------------
texlua texfindpkg.lua query foobar.sty
echo --------------------------------
texlua texfindpkg.lua query \\foobar
echo --------------------------------
texlua texfindpkg.lua query {foobar}
- name: Test texfindpkg install
run: |
export PATH=/usr/local/texlive/2023/bin/universal-darwin:$PATH
texlua texfindpkg.lua install array.sty
echo --------------------------------
texlua texfindpkg.lua install \\fakeverb
echo --------------------------------
texlua texfindpkg.lua install {frame}
echo --------------------------------
texlua texfindpkg.lua install foobar
echo --------------------------------
texlua texfindpkg.lua install foobar.sty
echo --------------------------------
texlua texfindpkg.lua install \\foobar
echo --------------------------------
texlua texfindpkg.lua install {foobar}
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install TeX Live
run: |
${env:PATH} = "C:\texlive\2023\bin\windows;" + ${env:PATH}
Invoke-WebRequest -Uri ${{env.TLCurrent}}/install-tl.zip -OutFile install-tl.zip
Expand-Archive install-tl.zip -DestinationPath .
Set-Location install-tl-*
.\install-tl-windows --no-gui --profile ..\.github\workflows\texlive.profile --repository=${{env.TLCurrent}}
tlmgr install lualibs luatex
tlmgr update --self --all --no-auto-install --repository=${{env.TLCurrent}}
- name: Test texfindpkg query
run: |
${env:PATH} = "C:\texlive\2023\bin\windows;" + ${env:PATH}
texlua texfindpkg.lua query array.sty
echo --------------------------------
texlua texfindpkg.lua query \fakeverb
echo --------------------------------
texlua texfindpkg.lua query `{frame`}
echo --------------------------------
texlua texfindpkg.lua query foobar
echo --------------------------------
texlua texfindpkg.lua query foobar.sty
echo --------------------------------
texlua texfindpkg.lua query \foobar
echo --------------------------------
texlua texfindpkg.lua query `{foobar`}
- name: Test texfindpkg install
run: |
${env:PATH} = "C:\texlive\2023\bin\windows;" + ${env:PATH}
texlua texfindpkg.lua install array.sty
echo --------------------------------
texlua texfindpkg.lua install \fakeverb
echo --------------------------------
texlua texfindpkg.lua install `{frame`}
echo --------------------------------
texlua texfindpkg.lua install foobar
echo --------------------------------
texlua texfindpkg.lua install foobar.sty
echo --------------------------------
texlua texfindpkg.lua install \foobar
echo --------------------------------
texlua texfindpkg.lua install `{foobar`}
48 changes: 39 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,57 @@
# FindPkg tool for installing TeX packages
# TeXFindPkg tool for installing TeX packages

```
Description: Install TeX packages and their dependencies
Copyright: 2023 (c) Jianrui Lyu <[email protected]>
Repository: https://github.com/lvjr/findpkg
Repository: https://github.com/lvjr/texfindpkg
License: GNU General Public License v3.0
```

## Introduction

FindPkg makes it easy to install TeX packages and their dependencies by file names, command names or environment names.
TeXFindPkg makes it easy to install TeX packages and their dependencies by file names, command names or environment names.

- To install a package by its file name you can run `texlua findpkg.lua install array.sty`;
- To install a package by some command name you can run `texlua findpkg.lua install \fakeverb`;
- To install a package by some environment name you can run `texlua findpkg.lua install {frame}`.
- To install a package by its file name you can run `texfindpkg install array.sty`;
- To install a package by some command name you can run `texfindpkg install \fakeverb`;
- To install a package by some environment name you can run `texfindpkg install {frame}`.

FindPkg supports both TeXLive and MiKTeX distributions. At present it focuses mainly on LaTeX packages, but may extend to ConTeXt packages if anyone would like to contribute.
TeXFindPkg supports both TeXLive and MiKTeX distributions. At present it focuses mainly on LaTeX packages,
but may extend to ConTeXt packages if anyone would like to contribute.

## Installation

Your TeX distribution should have created a binary file `texfindpkg` when you install this package.
If not, you could create a symbolic link from `/usr/local/bin/texfindpkg` to `texfindpkg.lua` on Linux or MacOS,
or create a batch file `texfindpkg.bat` in binary folder of the TeX distribution with these lines on Windows:

```
@echo off
texlua path\to\texfindpkg.lua %*
```

## Usage

```
texfindpkg <action> [<options>] [<name>]
```

where `<action>` could be `install` or `query`, and `<name>` could be file name, command name or environment name.
For example:

```
texfindpkg install array.sty
texfindpkg install \fakeverb
texfindpkg install {frame}
texfindpkg query array.sty
texfindpkg query \fakeverb
texfindpkg query {frame}
```

## Building

FindPkg uses completion files of TeXstudio editor which are in `completion` folder of TeXstudio [repository](https://github.com/texstudio-org/texstudio).
TeXFindPkg uses completion files of TeXstudio editor which are in `completion` folder of TeXstudio [repository](https://github.com/texstudio-org/texstudio).

After putting `completion` folder into current folder, you can run `texlua findpkg.lua generate` to generate `findpkg.json` file.
After putting `completion` folder into current folder, you can run `texlua texfindpkg.lua generate` to generate `texfindpkg.json` and `texfindpkg.json.gz` files.

## Contributing

Expand Down
26 changes: 26 additions & 0 deletions texfindpkg.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.TH texfindpkg 1 "2023-04-05" "2023D"
.SH NAME
TexFindPkg \- Install TeX packages and their dependencies
.SH SYNOPSIS
texfindpkg <action> [<options>] [<name>]
.SH DESCRIPTION
TeXFindPkg makes it easy to install TeX packages and their dependencies
by file names, command names or environment names.
.PP
The most commonly used TeXFindPkg actions are:
.IP install
Install some package and its dependencies
.IP query
Query dependencies for some package
.SH OPTIONS
Various options apply
.IP --help
Print a help message and exit
.IP --version
Print version information and exit
.SH BUGS
.SH AUTHOR
Jianrui Lyu <[email protected]>
.PP
Please log issues on the GitHub homepage:
https://github.com/lvjr/texfindpkg/issues.
File renamed without changes.
Loading

0 comments on commit 3b83ae7

Please sign in to comment.