Results 1 to 4 of 4

Thread: which directory to put LaTeX .sty files into?

  1. #1
    Join Date
    Aug 2010
    Location
    California
    Beans
    119
    Distro
    Kubuntu 14.04 Trusty Tahr

    which directory to put LaTeX .sty files into?

    I want to manually install a LaTeX library. Where do I put the .sty file?

    I've already seen this post, but it didn't work for me.

    Thanks!
    If you have freedom but you don't value it, you're likely to lose it. -Richard Stallman

  2. #2
    Join Date
    Nov 2011
    Location
    Portugal - Chaves
    Beans
    295
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: which directory to put LaTeX .sty files into?

    Please take a look here →

    https://help.ubuntu.com/community/LaTeX

    This is the steps that you need to take attention →
    User install

    We will copy this into our personal texmf tree. The advantages of this solution are that if we migrate our files to a new computer, we will remember to take our texmf tree with us, resulting in keeping the same packages we had. The disadvantages are that if multiple users want to use the same packages, the tree will have to be copied to each user's home folder.
    We'll first create the necessary directory structure:

    cd ~
    mkdir -p texmf/tex/latex/fooNotice that the final directory created is labeled foo. It is a good idea to name directories after the packages they contain. The -p attribute tomkdir tells it to create all the necessary directories, since they don't exist. Now, using either the terminal, or the file manager, copy foo.styinto the directory labeled foo.
    Now, we must make LaTeX recognize the new package:

    texhash ~/texmfSystem install

    We will copy the foo to the LaTeX system tree. The advantages are that every user on the computer can access these files. The disadvantages are, that the method uses superuser privileges, and in a possible reformat/reinstall you have to repeat the procedure.
    First, go to the folder your foo is located. The following commands will create a new directory for your files and copy it to the new folder:

    sudo mkdir /usr/share/texmf/tex/latex/foo
    sudo cp foo.sty /usr/share/texmf/tex/latex/fooThen update the LaTeX package cache:

    sudo texhash
    Ubuntu with me & me with Ubuntu! my GNU/Linux https://wiki.ubuntu.com/DerivativeTe.../Flavitu-Linux

  3. #3
    Join Date
    Aug 2011
    Location
    52.5° N 6.4° E
    Beans
    6,824
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: which directory to put LaTeX .sty files into?

    When I manually install some LaTeX packages, I put them in (subdirectories of) /usr/local/texmf/. The .sty files usually go in /usr/local/texmf/tex/latex/packagename/. This way they don't interfere with the packages supplied from the Ubuntu repositories (in /usr/share/tex*). /usr/local/ is the appropriate directory for system-wide manual installation.

    After installation, run sudo texhash to update TeXs database of available packages. For most packages (with the notable exceptions of fonts and hyphenation patterns) that should work.

    Note that after a release upgrade, you may have to fix your manually installed packages, whether they are in /usr/local or in your home directory. You get a new version of TexLive, which results in new versions of many packages and different packages too. Your manually installed package may now be available from the Ubuntu repositories, or one of its dependencies may no longer be available from there, or there may be version conflicts.

  4. #4
    Join Date
    Aug 2010
    Location
    California
    Beans
    119
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: which directory to put LaTeX .sty files into?

    Yay, it worked! Thank you both for helping.

    For those who might stumble across this thread, here's the quick-and-dirty of how to manually install a package:

    Code:
    cd ~
    
    mkdir -p texmf/tex/latex/USER_DEFINED_NAME_GOES_HERE
    
    copy the .sty file into the newly-created directory
    
    texhash ~/texmf
    If you have freedom but you don't value it, you're likely to lose it. -Richard Stallman

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •