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?

Colin
  • 223
  • 4
  • 9
  • First of all, maybe you mean CTAN as it is Comprehensive TeX Archive Network. – Niranjan Feb 06 '22 at 05:52
  • @Niranjan Haha - thanks - corrected! – Colin Feb 06 '22 at 05:53
  • Does this answer your actual query? – Niranjan Feb 06 '22 at 05: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 06 '22 at 06:00
  • Oh and by the way, to see if your desired package uses the l3build or not, you just need to see if the package files have a file named build.lua. – Niranjan Feb 06 '22 at 06:52
  • Thanks @Niranjan - I was hoping it would be a bit easier than installing another texmf tree. I'll try work through that process. – Colin Feb 06 '22 at 07:56
  • 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. – David Carlisle Feb 06 '22 at 11:00

2 Answers2

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).
David Carlisle
  • 757,742
  • 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 06 '22 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 .... – David Carlisle Feb 06 '22 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: https://stackoverflow.com/questions/37676849/where-is-path-variable-set-in-ubuntu – Colin Feb 07 '22 at 02: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

Colin
  • 223
  • 4
  • 9