• No results found

Normally, the files referenced are in the same folder as the main source file

N/A
N/A
Protected

Academic year: 2021

Share "Normally, the files referenced are in the same folder as the main source file"

Copied!
2
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

The lmacs Package

D. P. Story Released May 30, 2012

1∗package

Description. This package is used to clean up the preamble of LATEX files. Some preambles have a (large) number of definitions in them. To clean up the preamble, move the definitions in the preamble into a separate file, and use this package in import them into your preamble. Normally, lmacs would have a position that follows all packages for the document.

lmacs stands for local macros. Normally, the files referenced are in the same folder as the main source file; they should not (but can) be in the search path of LATEX.

Demo files: lmacs tst.tex (a simple latex source) and lmacs aeb.tex (a file that uses the web and exerquiz packages). These are found in the examples folder.

Documentation and Code. We begin by requiring kvoptions, this package does not test for the presence of a class file, so we can use it. It allows us to define key-values as options of the package.

2\RequirePackage{kvoptions}[2009/07/21]

cfg def js

With these keys, you can specify the file with the specified extension be imported.

For example, the following line

\usepackage[cfg=myconf,def=mydef,js=myjs]{lmacs}

will import (using \InputIfFileExists) the files myconf.cfg, mydef.def, and myjs.js. Multiple specifications of the same extension is permitted, for example,

\usepackage[def=mydef1,def=mydef2]{lmacs}

3\let\LM@inputlist\@empty

\LM@input inputs #1.#2, while \LM@warning issues a package warning if #1.#2 is not found.

4\newcommand{\LM@input}[2]{\InputIfFileExists{#1.#2}{}%

5 {\LM@warning{#1}{#2}}}

6\newcommand{\LM@warning}[2]{\PackageWarning{lmacs}

7 {The file #1.#2 cannot be found}}

1

(2)

For each of these options, we add the specified file to \LM@inputlist, this will be

!cfg

!def

!js

executed at the end of the package. The three options !cfg, !def, !js do nothing, making it easy to include, or not include a file.

8\define@key{lmacs}{cfg}{\g@addto@macro\LM@inputlist{\LM@input{#1}{cfg}}}

9\define@key{lmacs}{!cfg}{}

10\define@key{lmacs}{def}{\g@addto@macro\LM@inputlist{\LM@input{#1}{def}}}

11\define@key{lmacs}{!def}{}

12\define@key{lmacs}{js}{\g@addto@macro\LM@inputlist{\LM@input{#1}{js}}}

13\define@key{lmacs}{!js}{}

14\ProcessKeyvalOptions{lmacs}

Once the options have been process, we execute the command \LM@inputlist which contains a list of the files to be input.

15\LM@inputlist

16/package

2

Referenties

GERELATEERDE DOCUMENTEN

The comment character can be used to wrap a long URL to the next line without effecting the address, as is done in the source file.. Let’s take that long URL and break it across

the kerning is broken, apostrophes are converted to closing single quote, some primitives are broken (most notably the \catcode‘\hchar i syntax will not work any more), and writing

The following block redefines the character class of uppercase Greek letters and some accents, if it is equal to 7 (variable family), to avoid incorrect results if the font encoding

When this file is read as an option to the \usepackage command that loads babel, piedmontese could be an ‘unknown’ language, or better, a language who’s patterns have not been

Here the language name Romansh refers itself to the official language Rumantsch Grischun used in Switzerland as the formal language used by the Federal offices for its

the kerning is broken, apostrophes are converted to closing single quote, some primitives are broken (most notably the \catcode‘\hchar i syntax will not work any more), and writing

\thaiAlph Similar to \thaialph, the \thaiAlph macro provides Thai alphabetic numbering with full alphabet set in the order defined in Thai official dictionary. So, it supports up to

For example, a link on a frame before a subframe (or a group of subframes) with details should skip them in embed mode, while in append mode the same link should lead to the