[texhax] \input command under Linux

Heiko Oberdiek heiko.oberdiek at googlemail.com
Tue May 4 15:56:07 CEST 2010


On Mon, May 03, 2010 at 04:08:26AM +0000, Randolph J. Schilling wrote:

> I have a .tex file with the following Linux path and name: 
> /home/randy/RJSTeX/UTILITIES/AAMacros. 
> This file contains nothing but macros and I want to be able 
> to use TeX's \input command to be able to use these macros 
> in other .tex files. 
> What is the correct syntax for the \input command? 
> 
> These attempts failed with the "can't find this file" error: 
> \input /home/randy/RJSTeX/UTILITIES/AAMacros (FAILS) 
> \input home/randy/RJSTeX/UTILITIES/AAMacros (FAILS) 
> \input AAMacros (FAILS) 
> 
> I know how to do this in windows but I'm stuck trying 
> to set things up under Ubuntu. I'd be grateful for any help. 

* In opposite to windows the file systems under Linux
  are usually case sensitive.
* The extension was already discussed.

* It's easy to make a package (assuming you are working with LaTeX):

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{AAMacros}[2010/05/04 Private macros]
% contents of AAMacros follows
\endinput

  With the name `AAMacros.sty' then it can be loaded via
\usepackage{AAMacros}
  Benefits:
  * Version information
  * Possibility to use options. For example, options
    can be added for draft or print settings.
  * Via \RequirePackage{AAMacros} the package can be used
    in other classes or packages. LaTeX takes care that the
    package is loaded once only.

* Usually TeX distributions support a home or local texmf tree.
  For example, the default settings of TeX Live support
  a home texmf tree in ~/texmf. TeX files are then searched
  below ~/texmf/tex/latex/ (for LaTeX files).
  Thus you can put the package (or .tex file) there, e.g.
    ~/texmf/tex/latex/mytex/AAMacros.sty

Yours sincerely
  Heiko Oberdiek


More information about the texhax mailing list