0

I've forked the github repo for a package that is on CTAN and distributed with TeXLive. I'd like to do some development on it, and use it locally before committing back. This seems a pretty standard workflow for package development.

Previously I was on Windows and could use an absolute path to the local development version of the package. I've since moved to Linux (Ubuntu) and just like this issue cannot use an absolute path. The answers there are fine for installing a new local package, but not one that conflicts with a package already distributed in TeXLive.

I've tried renaming the TeXLive version *.sty file to *.sty.tmp and using a symbolic link to my development version, but the symlink gets removed for some reason and the CTAN version restored (I presume tlmgr is 'smart' and is watching/updating/correcting its folders).

So how can I point latex to my development version of a CTAN package in Linux?

7
  • First of all, maybe you mean CTAN as it is Comprehensive TeX Archive Network.
    – Niranjan
    Feb 6, 2022 at 5:52
  • @Niranjan Haha - thanks - corrected!
    – Colin
    Feb 6, 2022 at 5:53
  • Does this answer your actual query?
    – Niranjan
    Feb 6, 2022 at 5:54
  • If the concerned package uses the l3build mechanism for building and installing the packages, like say for example, the datestamp package, you can clone its git repository, cd to the package directory (which in case of datestamp will require cd datestamp/datestamp) and issue the l3build install command. This will locally install the package. Just one command and you are done. You can make changes in the dtx and issue this command multiple times to change the locally installed version.
    – Niranjan
    Feb 6, 2022 at 6:00
  • 1
    your question is not very clear, firstly there is no difference here between windows and linux, using a path in \usepackage is always conceptually wrong and will give warnings that it does not match providesPackage, but does sort of work. to test your development package there is nothing special you need to do just put it in any directory and ensure that directory is earlier in the TEXINPUTS path than the standard directories. Feb 6, 2022 at 11:00

2 Answers 2

2

The situtation on linux is identical to that on windows, you just need to ensure that your test version is ahead of the installed one in the search path. So if you have a test version of color.sty that you want to be used in preference to /usr/local/texlive/2021/texmf-dist/tex/latex/graphics/color.sty then you can do any of

  • Place color.sty in the current working directory (. is at the front of the path)
  • Place color.sty in ~/texmf/tex/latex/ or any subdirectoy of that (TEXMFHOME is before the installed directories in the default path
  • Place color.sty anywhere (eg your git directory) and set TEXINPUTS=/path/to/directory: (The trailing colon means search standard places after the specified directory).
3
  • Thank you so much @DavidCarlisle! Where do I set the TEXINPUTS, just in the shell for the current session, or in the .bashrc?
    – Colin
    Feb 6, 2022 at 14:37
  • 1
    @Colin anywhere: you can set it on the commandline for a single invocation TEXINPUTS=/a/b/c: pdflatex myfile will mean it is just set for one command, or set it in the shell so it is force for the rest of the session or set it in your profile so it is always set when you log in or .... Feb 6, 2022 at 14:39
  • Just to add to @DavidCarlisle's answer: if you need it in your system path (and not just the bash shell), see here: stackoverflow.com/questions/37676849/…
    – Colin
    Feb 7, 2022 at 2:53
0

In the end, I couldn't get the accepted answer to work. I ended up creating a local ~/texmf tree and cloning my git work in there for development. It supersedes the CTAN version of the package.

Other variations of this solution can be seen here: Create a local texmf tree in Ubuntu

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .