Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
on-line_resources:faq:latex [2011/07/21 09:04]
giunta
on-line_resources:faq:latex [2021/05/14 14:50]
giunta [TeX Live package manager (tlmgr)]
Line 1: Line 1:
 ====== SISSA Computing FAQ: about LATEX ====== ====== SISSA Computing FAQ: about LATEX ======
  
-It sometimes happens that you need a new version of some macro package or font; the correct approach is to create a private installation of (La)TeX which includes the new stuff you need.+It sometimes happens that you need a new version of some macro package or font; the correct approach is to create a private installation of (La)TeX which includes the new stuff you need.  
 + 
 +There are two options: the [[on-line_resources:​faq:​latex#​tex_live_package_manager_tlmgr|TeX Live package manager]] or the [[on-line_resources:​faq:​latex#​manual_mode|manual mode]] 
 + 
 +===== TeX Live package manager (tlmgr) ===== 
 +<note important>​To use the TeX Live package manager, you have to load the ''​texlive''​ module first </​note>​ 
 + 
 +Before using ''​tlmgr''​ in user mode for the first time, you have to set up the user tree with the //​init-usertree//​ action: 
 + 
 +  tlmgr init-usertree 
 +   
 +This command creates a directory named ''​texmf''​ in your home directory. 
 + 
 +Then, you have to use the //install// action: it checks if the package and all dependencies are already installed in the system installation. ​ If this is not the case, it installs the package and all dependencies into the user tree (~/texmf).  
 + 
 +  tlmgr --user-mode install pkg 
 + 
 +==== Use an updated version of TeX Live ==== 
 + 
 +To use an updated version of ''​Tex Live'',​ create missing //backup// folder in your user tree : 
 + 
 +  mkdir -p ~texmf/​tlpkg/​backups 
 +   
 +Update the repository:​ 
 + 
 +  tlmgr --usermode option repository ctan 
 +   
 +and finally update all your Tex packages: 
 + 
 +  tlmgr --usermode update --all 
 +==== Example ==== 
 + 
 +Load ''​texlive''​ module: 
 + 
 +  $ module load texlive 
 + 
 +Compile a tex file: 
 + 
 +<​code>​ 
 +$ latex example.tex 
 +... 
 + 
 +! LaTeX Error: File `memorygraphs.sty'​ not found. 
 + 
 +Type X to quit or <​RETURN>​ to proceed 
 +</​code>​ 
 + 
 +Search which package contains //​memorygraphs.sty//​ file: 
 + 
 +<​code>​ 
 +$ tlmgr search --global --all memorygraphs.sty 
 +... 
 +memorygraphs:​ 
 + texmf-dist/​tex/​latex/​memorygraphs/​memorygraphs.sty 
 +</​code>​ 
 + 
 +If it is the first time you use ''​tlmgr'',​ set up the user tree with the command ''​tlmgr init-usertree''​ 
 + 
 +  $ tlmgr init-usertree 
 + 
 +You need to install the package ''​memorygraphs'',​ using the command ''​tlmgr --user-mode install memorygraphs''​ 
 + 
 +<​code>​ 
 +$ tlmgr --user-mode install memorygraphs 
 +... 
 +tlmgr: package repository http://​ctan.mirror.garr.it/​mirrors/​CTAN/​systems/​texlive/​tlnet (verified) 
 +[1/1, ??:??/??:??​] install: memorygraphs [189k] 
 +running mktexlsr ... 
 +done running mktexlsr. 
 +tlmgr: package log updated: /​u/​j/​janedoe/​texmf/​web2c/​tlmgr.log 
 +</​code>​ 
 + 
 +===== Manual mode =====
  
 Create in your home directory a subdirectory named ''​texmf'',​ using the following command: ​ Create in your home directory a subdirectory named ''​texmf'',​ using the following command: ​
Line 7: Line 79:
   mkdir ~/texmf   mkdir ~/texmf
  
 +Install your new package (or whatever) in a directory structure like this:
  
-To be able to use your class files (with extension .clsor +^File extension^Directory^Description^ 
-style files (with extension ​.sty) using LaTeX:+|.sty, ​.cls or .fd|~/​texmf/​tex/​latex/<​package_name>/​|Style file, Document class file or Font Definition ​files
 +|.mf|~/​texmf/​fonts/​source/​public/<​font_name>/​|METAFONT outline| 
 +|.tfm|~/​texmf/​fonts/​tfm/​public/<​font_name>/​|TeX Font Metrics for METAFONT and Type 1 fonts| 
 +|.vf|~/​texmf/​fonts/​vf/​public/<​font_name>/​|TeX virtual fonts| 
 +|.afm|~/​texmf/​fonts/​afm/​public/<​font_name>/​|Adobe Font Metrics for Type 1 fonts| 
 +|.pfb|~/​texmf/​fonts/​type1/​public/<​font_name>/​|PostScript Type 1 outline| 
 +|.ttf|~/​texmf/​fonts/​truetype/​public/<​font_name>/​|TrueType font| 
 +|.otf|~/​texmf/​fonts/​opentype/​public/<​font_name>/​|OpenType font| 
 +|.bst|~/​texmf/​bibtex/​bst/<​package_name>/​|BibTeX style|
  
-  * **1)** create in your main directory a subdirectory named texmf, using the following command**mkdir ~/​texmf**\\ +where:
-  * **2)** copy to this subdirectory the files *.cls or/and *.sty\\  +
-  * **3)** check which is your default shell using one of the following commands on a linux pc or on ssh.sissa.it:​ **echo $SHELL**  +
-  * or if you do not obtain the information,​ please use: **getent passwd //​yourusername//​ | cut -d: -f7** (for example: //getent passwd falco | cut -d: -f7// )+
  
-=== if the result is: /bin/bash === +  * **//<​package_name>//​** refers to the name of macro package you are installing(p.e. //beamer//
-falco'​s shell is bash...\\ +  ​* **//<​font_name>//​** refers to the name of font you are installing (p.e //gothic//)
-If you are using// bash shell//, add into the file **.bashrc** of your main directory ​the following line:+
  
-  export TEXINPUTS="​$HOME/​texmf//:​$TEXINPUTS"​+and generate an index of that tree 
  
-=== if the result is: /bin/tcsh === +  mktexlsr ~/texmf
-falco'​s shell is tcsh... \\ +
-If you are using //tsch shell//, add into the files **.cshrc** of your main directory the following line:\\+
  
-   ​setenv TEXINPUTS $HOME/​texmf//:​$TEXINPUTS+You can use this approach for updates to packages installed in the SISSA workstations,​ as well as for installing new versions of things. ​
  
-The double slash, after //$HOME/texmf//, is not an error.+==== Reference ==== 
 +[[http://www.tex.ac.uk/cgi-bin/texfaq2html?​label=privinst]]
  
 +[[http://​www.tex.ac.uk/​cgi-bin/​texfaq2html?​label=install-where]]
  
-After you change the appropriate startup files, log out and log back in+[[http://​www.tex.ac.uk/​tex-archive/​tds/​tds.html]]
  
-=== Reference === 
 [[http://​www.tug.org/​texinfohtml/​kpathsea.html#​Supported-file-formats]] [[http://​www.tug.org/​texinfohtml/​kpathsea.html#​Supported-file-formats]]