{package-writing} is about writing packages. If your question is about choosing, installing, or using packages, choose {package} instead.

learn more… | top users | synonyms

9
votes
2answers
149 views

Is it possible to prevent users from seeing the package codes while they still can make use of its publicly exposed macros?

Assume that I have a confidential package that nobody is allowed to see the source code. The users are only allowed to use the public macros. This question is closely related to my other question. ...
9
votes
1answer
164 views

Defining synonyms for indexing

Is it possible to set things up so that indexing synonyms does not generate multiple entries? For example, if the text includes \index{cur}, \index{hound}, and \index{mutt}, can these be coalesced ...
2
votes
1answer
131 views

How to add text to beginning of body via sty file

This is my first post here. I can usually find what I'm looking for using questions other people have asked, but this time I'm stumped. Please can anyone help? I am very new to Latex. I am trying to ...
3
votes
1answer
522 views

Using qstest to implement unit tests

I was trying to figure out how to test my xpeek package (see https://github.com/jcsalomon/xpeek) and I came across What's the folk-lore on automatic testing of TeX programming? and Testing ...
0
votes
1answer
404 views

modular title pages

How to achieve having modular title pages in latex (xelatex), to only have to change one word in the .tex file and have it changed? All the files must be defined in the project's directory, not ...
12
votes
3answers
154 views

Executing a command after a package has been loaded

In my previous question I ended up with \DeclareMathSymbol{:}{\mathpunct}{operators}{"3A} But now I'm using the fontspec package which redefines : with \AtBeginDocument itself. So as my own ...
25
votes
1answer
310 views

Wrote a new package. Is there some standard place to share?

So I finished writing my package for typesetting Begriffsschrift. I think it marks a marked improvement over the package begriff, which is the only other package for the same purpose, that I can find ...
11
votes
2answers
245 views

Other than syntax what is the difference between \dimen0= and \setlength{}{}?

I have been browsing around for a while trying to find an answer to the above question, and I have found some similar questions along with there answers, so I already have a vague idea how to answer ...
4
votes
1answer
155 views

how to organise common preamble of dtx files

I have some new packages (see latexthesistemplate/trunk/packages/template which all use a shared preamble file. I want all of them to have the same packages and commands available and the same ...
37
votes
3answers
2k views

Is it really bad to use \makeatletter and \makeatother in a package or class file?

In my answer to this question What do \makeatletter and \makeatother do? I apparently wrote: The commands should not be used within .sty and .cls files themselves as they may conflict with the ...
25
votes
2answers
2k views

\newcommand vs \DeclareRobustCommand

I sort of understand the difference between the two. But that's not what I'm interested in—I just want to know, which one should I use? In general, when I'm creating commands in a package or class, ...
1
vote
0answers
77 views

Name collision in package development [duplicate]

Possible Duplicate: choosing macro names so as to avoid namespace conflicts How package developer find out whether other packages already used a specific command name or not? How do they ...
17
votes
1answer
651 views

How to write overlay-specification–aware macros that work w/o the beamer class

The LaTeX beamer class provides with \newcommand<> and \newenvironment<> an interface to define own commands that can deal with beamer's overlay specifications. Internally, commands ...
6
votes
1answer
433 views

suffix package, cannot redefine a suffixed macro

I have two local packages A and B. Package B is used occasionally to override macros defined in package A. Package A defines a macro and, using the suffix package, also defines a starred version of ...
4
votes
1answer
148 views

How to count the number of authors of a document?

I need to make a change to a Latex style (.sty) which contains the following line: {\large {\boldCondensed\color{corporate3Color}\raggedright AUTHORS: \MakeUppercase \@author\par}} The problem is ...
8
votes
1answer
1k views

Using of \usetikzlibrary in an expl3 package fails

In the example below I provided a small test package mytestpackage.sty which uses the syntax of expl3. If I use the command \usetikzlibrary inside the package I will get the error: Runaway argument? ...
7
votes
1answer
495 views

Is it possible to use \PassOptionsToClass into a package?

Context: I'm building a new package for my university. I need to set a lot of options for the document class, like twoside, a4paper, 12pt, or firstpagenum=chapter. I would like to set them by default ...
4
votes
1answer
81 views

Spaces in pfgopts options

Is there a simple way to allow spaces in the options of a package using pgfopts to process them, which is local to that package i.e. I don't have to include some package in the main document before ...
9
votes
1answer
379 views

How to make a CTAN package MiKTeX friendly?

I've heard that it is difficult to install my new statrep package using MiKTeX. The dtx file is self-extracting, but I think MiKTeX doesn't expect to work with a dtx file. Can someone provide a ...
1
vote
0answers
237 views

What is the use of @ and @@ in variables names in TeX/LaTeX? [duplicate]

Possible Duplicate: Why do LaTeX internal commands have an @ in them? What do \makeatletter and \makeatother do? What is the difference between \myname and \my@name while writing a .cls file? ...
0
votes
1answer
92 views

Creating a Matrixlist package

I haven't been able to find a suitable package that does what I want. The closest is parcolumns and I've spent several hours trying to understand TeX programming and the parcolumns style. While I got ...
0
votes
1answer
310 views

Adding border/frame around boxes [closed]

I'm trying to modify a package to suit my needs but since I'm not very familar with the tex macro language I would like to add a border around the boxes created by the package so I can see exactly ...
18
votes
3answers
1k views

Customizing LaTeX - create a document class or a package?

Are there general rules for when to create a document class vs. creating a package to customize LaTeX? Does one have benefits over the other? My specific need is to create a customized page layout, ...
21
votes
1answer
488 views

When to use “.sty” extension and when to use “.def”

I'm new to this forum and a recent LaTeX user. I state that, before posting here, I searched all the web through, but I was not succeeded to solve a doubt. I'm writing my own class (myclass.cls), ...
8
votes
2answers
232 views

Key Value option in package

I trying to write a package, and I'd like to specify whether there should be colour or not. I'd like to do: \usepackage[color=false]{foo} and have this set \RequirePackage[color=false]{hyperref} ...
18
votes
4answers
707 views

Editing the package

I didn't find anything about this issue, but if I missed something, please point me to it. The documentation on the ctan.org site is usually about how to use the packages in a LaTeX document, but ...
9
votes
1answer
282 views

Indexing Macros without a leading backslash in a dtx file

I'm documenting a file containing several biblatex bibmacros and booleans and would like to create an index via \EnableCrossrefs, but % \begin{macro}{mybibmacro} % \begin{macrocode} ...
7
votes
2answers
246 views

Emulate a “tuple” data structure (when you are free to choose the syntax)

How can a "tuple" data structure be implemented in LaTeX? The idea is to store several elements (possibly a predefined number) in one macro and then be able to extract each of these elements by index ...
6
votes
3answers
229 views

Emulate a “tuple” data structure when the syntax for creating a tuple is predefined and cannot be altered

Imagine I have a macro \createcontact that accepts three parameters. Now, instead of using these during the expansion, I would like to save them separately for later use and retrieval. The above macro ...
6
votes
2answers
421 views

Global key-value dictionary

Is there any package that implements a data structure that provides a key-value mapping (akin to Python's dict)? The keys will be user input and may contain spaces and non-ASCII characters. I would ...
10
votes
1answer
649 views

How to extend the \lstinputlisting command

With the answer from autogobble for lstinputlistings I've managed to create a command that gobbles \lstinputlisting and makes firstnumber to start by firstline. I would like to rewrite it as a ...
0
votes
0answers
93 views

Why package enumitem conflicts with Tufte-book and/or beamer [duplicate]

Possible Duplicate: Trouble combining enumitem and beamer I am trying to produce a package, combining tufte-book and beamer, in order to produce lecture slides and handout (with ...
27
votes
1answer
620 views

Macro naming best practice?

Is there a preferred or generally accepted idiom for naming user defined macros? I notice that in the change from Tufte 3.5.0 to 3.5.2, for example, the names of the debugging macros have change, for ...
4
votes
2answers
283 views

Writing/Modifying Package

There is a package I'm trying to modify that essentially displays a grid. It uses counters to increment the distance. I want to change the distance each step instead of adding a constant value. In ...
6
votes
1answer
203 views

Is there a lipsum-like package for metadata?

I know about the lipsum, blindtext and kantlipsum packages. What I would need is a variant creating dummy metadata: author name/affiliation, title, thanks etc. Does anyone know of anything like ...
11
votes
1answer
126 views

How to prevent `doc` from indexing foreign macros?

The doc package, used for documenting LaTeX packages, has the ability to produce an index of all macros used in the package. Index entries can of of three types: where the macro is described, where it ...
0
votes
0answers
79 views

How to write TikZ packages [duplicate]

Possible Duplicate: tutorial for making tikz/pgf library I want to write a TikZ-based package. What TikZ/PGF-specific things should I be aware of? For those who've written such packages, ...
6
votes
1answer
152 views

Nested parameters lost when generating new macros from package options

I've created a package which I would like to take in options and turn these into new macros (one new macro for each option). I also want these new macros to produce new macros in turn. For example, ...
6
votes
3answers
242 views

What packages are actively maintained/developed on github/bitbucket?

I would like to improve my TeX skills by following the development of actively developed packages. I findingwould like to give back by taking on some of the low hanging fruit among the ...
0
votes
1answer
287 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 ...
15
votes
3answers
578 views

How would you name these fraction macros?

I've got four macros now for typesetting fractions in text mode. The first writes them horizontally (shilling style, with a hyphen), the second writes them diagonally, the third writes them ...
5
votes
1answer
167 views

Version number for a bundle

I need some advice. I am going to bundle a package of mine (lets say its named foo, currently v2.0a) with two not yet released packages (therefore both v0.1). I am unsure which version number the ...
8
votes
1answer
487 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{% ...
14
votes
3answers
377 views

Advantages of a custom class over a package and environment

What are the advantages/disadvantages of defining a class over a package and environment? I have recently started to clean up some of the cruft in the preamble of my letters. The simplest solution ...
3
votes
1answer
221 views

float package: get list of all floats defined with \newfloat?

I develop a new package and as one functionality, I would need to get the list of all floats defined using the \newfloat command of the float package. I could of course modify this command in ...
33
votes
3answers
937 views

How to publish a package that includes scripts and/or executables?

I'm preparing to publish my first package, and am not sure about the best way to proceed. I understand the standard CTAN publishing approach, but I'm dealing with a somewhat atypical case since my ...
35
votes
2answers
648 views

When or why should I use %% as opposed to %?

I've noticed that many (all?) style and class files have "documentation blocks" with a double comment character at the beginning of the line, %% like so instead of the usual style of comments, % ...
6
votes
3answers
362 views

Collaborating with the non-TeX-savvy

What tips do you have for collaborating on a LaTeX document with people who may not be as TeX savvy as you? For one example and potential problem case: Consider you have a set of new commands and ...
11
votes
2answers
263 views

biblatex: How to build a testing environment

Maybe the question is also of interest beyond biblatex but here's the thing: I recently published my biblatex style biblatex-fiwi and I'm always having trouble making sure that updates don't lead to ...
26
votes
4answers
520 views

Any suggestions/requests for features for a new package that allows disabling ligatures for (pre)selected words?

I'm starting to put together a LaTeX package, which I hope to distribute broadly, that provides lualatex code to disable ligation of character pairs and triplets for selected words (globally within ...