2
votes
2answers
135 views

Strange errors while writing a package

This short document: \documentclass[a4paper]{report} \usepackage{gnu} \begin{document} \end{document} with the following package: %!TEX encoding = UTF-8 Unicode \def\fileversion{2.7} ...
7
votes
2answers
115 views

\RequirePackage within \if\else\fi

Why does the package iftex have to be loaded outside of a \if...\else\fi structure? (The same goes for packages ifpdf, ifluatex, ifxetex.) Consider: ...
13
votes
2answers
192 views

Load a package as optional argument

I'm creating my personal package. I'd like to use an option to turn on/off the line numbering provided by the package lineno. So, my sty file contains \RequirePackage{lineno} \linenumbers But if ...
0
votes
1answer
304 views

conditional commands in .sty file, conditional on \documentclass [duplicate]

Possible Duplicate: Which document class is being used? I'd like to include conditional formatting in a .sty file, conditional on the document class of the document that invokes it. For ...
8
votes
1answer
508 views

Help wanted on \openout, \write and \closeout

Is there a way to test if a token is already associated with a writer? Something like this: \def\do@write#1{% \immediate\write\mywriter{something: #1}% } \def\@writesomething#1{% ...
9
votes
2answers
229 views

Is it possible to abort loading a package if it's too old?

I'm working on a package that has to work on both TeXlive 2009 (Ubuntu, so updating TeXlive is a nonstarter) and later versions, and I'd like to be able to use fontspec with LuaLaTeX if we're on ...
32
votes
1answer
4k views

Test if a package (or package option) is loaded

[french]{babel} (aka frenchb) is incompatible with some other packages, such as tikz, since it tries to insert \thinspace before semi-colons. In order to make these two play nice, you have to call ...