diff options
Diffstat (limited to 'macros/luatex/generic/addtoluatexpath/README.md')
-rw-r--r-- | macros/luatex/generic/addtoluatexpath/README.md | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/macros/luatex/generic/addtoluatexpath/README.md b/macros/luatex/generic/addtoluatexpath/README.md index da97dfa4a3..722f626cbb 100644 --- a/macros/luatex/generic/addtoluatexpath/README.md +++ b/macros/luatex/generic/addtoluatexpath/README.md @@ -1,8 +1,8 @@ # addtoluatexpath -The `addtoluatexpath` package provides a convenient way to add input and Lua package paths in your document. -You may want this package, for example, if a `.cls` or `.sty` file is located on a network or cloud storage drive. +The `addtoluatexpath` package provides a convenient way to add input and Lua package paths to your document. +You may want this package if `.cls` or `.sty` files are located outside of your tex directories (like a network drive or cloud storage drive). ## Usage * You can either pass the comma-separated paths via package options like `\RequirePackage[path1,path2]{addtoluatexpath}` in pre-amble, @@ -11,24 +11,25 @@ You may want this package, for example, if a `.cls` or `.sty` file is located on eg. `\RequirePackage[C:/Users/me/Desktop/*]{addtoluatexpath}` adds your Desktop and all folders in the desktop to path. * If you wish to include all nested sub-directories of all levels, include a `/**` at the end of the path. * If you want to add to Lua path (`package.path`) only, include `notex=true` in the argument. -* If you want to add to tex input path only, include `nolua=true` in the argument. - eg. `\RequirePackage[nolua=true, C:/Users/me/Desktop/*, /**]{addtoluatexpath}` -* The lua functions below are globally defined: -* `atlp_main(paths_str)` is the main function that runs -* `atlp_paths = {}` is a table containing all paths added by this package -* `atlp_find_file(file_str)` is a function that returns the full path of a file, it searches through all paths that were input to this package and returns the first valid. If no paths are found, an error is issed +* If you want to add to tex input path only, include `nolua=true` in the argument, eg. `\RequirePackage[nolua=true, C:/Users/me/Desktop/*, /**]{addtoluatexpath}`. +* If you want to supress a package error that comes up if a directory you try to add does not exist, set `noerror=true`. +* The lua table `addtoluatexpath` is globally defined with the following attributes: +* `.main(paths_str)` is the main function that runs, `paths_str` is the argument to `\addtoluatexpath` or the package options. +* `.paths = {'.', ...}` is a table containing all paths added by this package +* `.find_file(file_str)` is a function that returns the full path of a file, it searches through all paths that were input to this package and returns the first valid. If no paths are found, an error is issued. +* `.prt_paths()` prints the paths to the log file. -## Note -This package appends to the `package.path` Lua variable and the `\input@path` command (it first uses `\providecommand` to intialize it). -Lua files in the added paths can then added via `require'fileinpath1'`; however `loadfile` and `dofile` still require the full path. +## Notes +This package appends to the `package.path` Lua variable and the `\input@path` command sequence (it first uses `\providecommand` to initialize it). +Lua files in the added paths can then be added via `require'fileinpath1'`; however `loadfile` and `dofile` still require the full path. Caveat: `graphicx` internally uses `\input@path` as a default list of the paths; -therefore, paths specified by this package will also include graphics if the `graphicx` package is loaded after paths are set. -However, if `\graphicspath{}` is used after paths are added by this package, graphics search paths will not use `\input@path`, omitting the paths you added with this package. +therefore, paths specified by this package will also include graphics if the `graphicx` package is loaded _after_ paths are set. +However, if `\graphicspath{}` is used after paths are added by this package, graphics search paths will not use `\input@path`, therefore not using the paths you added with this package. ## Dependencies -`luacode`, `luakeys`, `penlight` (only if using `*` in paths) +`luacode`, `luakeys`, `penlight` ## Repo & Contact @@ -39,7 +40,7 @@ However, if `\graphicspath{}` is used after paths are added by this package, gra ## License -Copyright (C) 2023-2024 Kale Ewasiuk +Copyright (C) 2023-2025 Kale Ewasiuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal |