3
votes
3answers
147 views

ConTeXt: Prevent Reference Name Clashes in Floating Objects of Different Types

I find it very annoying that ConTeXt uses the same namespace for references of floating objects. In other words, if you give the same reference to a figure and a table, then you'd always refer to the ...
2
votes
1answer
123 views

Macro to get character width in ConTeXt

Background Looking to adjust the location of the first letter in a word based on its width. Problem The calculation resembles: \define[1]\StyleChapterChar{% \cldcontext{string.sub("#1",1,1)}% } ...
54
votes
2answers
1k views

If LaTeX is only a macro package, why does it have its own executable?

From other answers on this site and the FAQ of the TeX User Group my understanding is that: TeX is the original typesetting program, written by Knuth Omega, eTeX, pdfTeX, XeTeX, LuaTeX are engines. ...
7
votes
2answers
246 views

What does \s! do?

1st example: \starttypescript [\s!serif] [paratype] \definefontsynonym [ParatypeSerif-Regular] [\s!name:PTSerif-Regular] [\s!features=\s!default] \definefontsynonym [ParatypeSerif-Italic] ...
3
votes
1answer
65 views

Get confused about the `command` option in some ConTeX \setup*

Since I switched to ConTeXt from plain TeX, I always get confused about macros in it. Now it is the command option in \setup* of ConTeXt. In ConTeXt, some macros, like \setuphead, \setuplist, have ...
7
votes
2answers
589 views

Macro for the average width of a character

How can i made a macro similar to \averagecharwidth of ConTeX in LaTeX, that calculates the average width of a character based on the frequency of that character into my document ? that macro is show ...
4
votes
1answer
103 views

How to check if it is the first time or last time a macro has been used in ConTeXt?

I have some text in my document which appears repeatedly many times throughout the document, so I have defined a custom macro, e.g.: \define\mymacro{ \section{A} There is some text. ...
7
votes
2answers
160 views

How can a macro know how many times a value has appeared and will appear?

Using ConTeXt, I have a macro which can be given a unique key value: \macro{000010} \macro{000011} \macro{000010} \macro{000010} \macro{000012} \macro{000011} I need to be able to access ...
5
votes
2answers
175 views

Printing only the text that appears between two symbols

I have a macro which contains some text: \textmacro{This is some text.} Normally, when compiled, it should just print text, like this: This is some text. Sometimes, the text contains “①”and “②”, ...
13
votes
3answers
550 views

Can I make a command not gobble spaces?

(I'm using ConTeXt, but I suspect the answer will lie in plain TeX.) I've created an environment that takes one argument myBufferName, and stores its contents in a buffer of that name. Unfortunately, ...
4
votes
2answers
466 views

Using macro variables with Lua in ConTeXt

I need to make some macros in ConTeXt. I have tried to use Lua code, but I do not understand how to mix ConTeXt source and Lua source together. Here is an example: \define[3]\textmacro{ \startlua ...
9
votes
1answer
2k views

How to delete/undefine macros in Context?

How can one delete or undefine macros in Context? Is there a difference if i've used \def or \define to create a macro?