Questions tagged [registers]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
63 views

Adding top inserts in LaTeX

I would like to add top insertions in a LaTeX document, compiled with pdflatex. Although I can add insertions at the bottom of the page, it seems like I can't do the same with top insertions. \insert\...
HomoVafer's user avatar
  • 274
3 votes
1 answer
92 views

usebox macro not expanded?

I'm trying to store the text output of a shell command mktemp and reuse it later in another latex command. I'm attempting to do this using \savebox and \usebox as below. When using \usebox outside a ...
user84207's user avatar
  • 145
3 votes
1 answer
117 views

Registers 0-9 policies

I recall seeing somewhere that registers 0-9 are to be used locally if they are even and globally if they are odd (or was it the other way around). Once you use a register globally, no one else can ...
John Kormylo's user avatar
  • 79.2k
2 votes
1 answer
68 views

LuaTeX's \textdir primitive fails a string-comparison test

A demonstration of the problem by way of a minimal working example I saved the following LaTeX code in the file ~/Test.tex. \documentclass{article} \usepackage{ifthen} \begin{document} \the\textdir =% ...
Evan Aad's user avatar
  • 11k
1 vote
1 answer
93 views

Is there any way to retrieve saved string in the beginning of document from its end in LuaLaTeX?

There are different types of “registers” in LuaTeX. With totcount package, you can save counter (number) from any place in a document and get its value also in any place in a document with the help of ...
Andrew15_5's user avatar
4 votes
1 answer
218 views

What are the differences between primitives/registers/macros/tokens?

I started learning LaTeX and these words appear a lot in both questions and answers. Do they all mean the same thing or are they different concepts?
ains94997's user avatar
1 vote
2 answers
81 views

How to implement token.get_char

There is a token.set_char but no token.get_char. Starting from \chardef\MyNumber=1 I can change the value with \directlua{ token.set_char('MyNumber', 421) } and retrieve the value on the TeX side \...
Jérôme LAURENS's user avatar
0 votes
0 answers
67 views

tex.runtoks: uniqueness of the <token register>

tex.runtoks can be used to execute instructions immediately. \directlua{ tex.settoks(421,'ABCDE'); tex.runtoks(421) } Here 421 should be replaced by a unique private number, in LaTeX we could ...
Jérôme LAURENS's user avatar
2 votes
1 answer
79 views

How to format items within a register in ConTeXt?

I have some documents that use a register to keep track of items, that is then displayed in a list: \defineregister[animals][pagenumber=no, indicator=no, before=, n=1] \def\definegetanimal{\animals} \...
Village's user avatar
  • 13.5k
4 votes
2 answers
106 views

Putting \the\wd inside a group makes it produce 0.0pt

The following is a minimal example demonstrating some behavior of latex that I don't understand. I'm using xelatex, but the behavior in pdflatex seems to be the same. \documentclass{article} \...
user avatar
2 votes
1 answer
414 views

What's the meaning of \@tempskipa?

Looking at the source code I could not figure out what the command does, I know it is a "skip" (I admit I'm unaware about how skips work), since it is defined by \newskip\@tempskipa as on latex.ltx ...
GiuTeX's user avatar
  • 1,299
3 votes
2 answers
82 views

How to generate error on assignment to \count register if value being assigned contains decimal point?

Please, if possible, plain TeX + eTeX commands only (I compile in XeLaTeX but use TeX commands). I need parameter value to be an integer value, not a decimal. In this example, parameter is being ...
bp2017's user avatar
  • 3,746
3 votes
2 answers
300 views

Why \countdef, \dimendef, and alike require custom-named register to be empty before assignment?

Why \dA can't be assigned a value before it is assigned to \dB? \documentclass[varwidth,border=5mm]{standalone} \begin{document} \newdimen\dA \dimendef\dB\dA % ERROR IF PRECEDED BY NEXT LINE \...
bp2017's user avatar
  • 3,746
0 votes
1 answer
31 views

How can ID of a custom-named register be displayed in the document (not terminal or log)?

How to get a hold of ID of a register? I can see it with \show but can't use it (save and display) in the document itself. \documentclass[varwidth,border=5mm]{standalone} \begin{document} \newdimen\...
bp2017's user avatar
  • 3,746
5 votes
1 answer
331 views

How to Set Lengths (Glue/Skips?, not Dimensions), in LuaTeX?

I am trying to define a length, (not a dimension)—using Lua. But, I am having trouble with the syntax. I think I am supposed to be using the same structures/prototypes as glue_spec in order to still ...
elika kohen's user avatar
0 votes
0 answers
105 views

Is there a way to put \showbox into the page? [duplicate]

I am reading the Texbook, and there in exercise 11.2 (and the preceding page) there is a conversation of exploring box structure. The idea is that it may be put into a register that is then logged. I ...
Ignat Insarov's user avatar
10 votes
1 answer
351 views

How do I define a new TeX register with arguments in LuaTeX?

Some time ago I tried to implement the \pdfadjustinterwordglue from pdfTeX in LuaTeX using a callback. Getting the callback to work is pretty simple, but there is another major problem in the way ...
Henri Menke's user avatar
2 votes
2 answers
132 views

How to classify and print only certain items from a register in ConTeXt?

I created many registers in my document like this, which lets me store vocabulary words, using \definevocabulary{word} and then call the list later with \placeregister[vocabulary]: \defineregister[...
Village's user avatar
  • 13.5k
1 vote
1 answer
226 views

How to read a counter register from a file in Plain TeX?

I am a TeX user, and I would like to read a number from an auxiliary file in order to achieve things like: printing at the footing "page number X out of Total". I was trying to use the primitives ...
Lagrang3's user avatar
4 votes
3 answers
419 views

accumulator variable

I know in latex it is possible to use counters which are based on integers. Is there also some way to define a floating point register to perform simple arithmetic operations? Basically I would need ...
nicmus's user avatar
  • 217
3 votes
1 answer
168 views

Custom Ordering for a Index (register) in ConTeXt

I need to have index that will be sorted by book of the Bible in the order that the books appear in the Bible (Genesis, Exodus, etc.). Is there any way to define a custom sorting of a register in ...
John Grasty's user avatar
16 votes
3 answers
875 views

Why does the TeX scanner process tokens for register numbers and macro names differently?

This is a "How does TeX know when to stop" question. Case 1 Note: I have since found out that my understanding here is wrong. See SPOILER and answers. When TeX is constructing a macro name, ...
Jonathan Komar's user avatar
12 votes
4 answers
1k views

How to prepend and append tokens to a macro definition in the current scope only?

I am facing the problem of both prepending and appending some tokens to the definition of a macro that does not take arguments. I found out that in the LaTeX2e kernel there is the macro \g@addto@...
user120378's user avatar
11 votes
1 answer
6k views

Can I define a variable to scale with it several figures?

I have several pictures in my document, using the subfigure environment, the code is the following: \begin{subfigure}[b]{0.22\textwidth} \includegraphics[width=\textwidth]{pictures/...} \end{...
wondering's user avatar
  • 741
3 votes
1 answer
285 views

Aliases for temporary registers

In a package I'm working on I have several macros which require the use of a register temporarily to figure something out before the macro knows what to print (usually its a length or glue which needs ...
rpspringuel's user avatar
10 votes
3 answers
600 views

Typesetting A when a register is 1, B when 2, etc

I have a register \count0=<some-value> and need to get the letter of the alphabet on the index of \count0. That is, if it is 1, I need an A, if 2, a B, etc. Is this possible? I'm reluctant ...
Keelan's user avatar
  • 5,415
2 votes
2 answers
328 views

Passing the value of a register as a macro argument

I'm looking for a solution to the following problem: \def\m#1{{ \dimen0=200pt \#1=\the#1 % Outputs 200pt rather than 100pt }} \dimen0=100pt \m{\dimen0} EDIT: The code sample above ...
SJU's user avatar
  • 1,721
5 votes
1 answer
771 views

How to skip \newsavebox?

I frequently try out stuff and do a little introspection to find out why things (don't) work the way they do. Using boxes and obtaining their width, height and depth is an integral part of this. As ...
Bananguin's user avatar
  • 2,574
54 votes
3 answers
12k views

What does the 'etex' package do, exactly?

I was creating a rather large LaTeX project, so I had to use many packages. This gave me an error No room for a new \dimen \newdimen \MPscratchDim while my editor(Kile) opened the file supp-pdf....
Thanos's user avatar
  • 12.4k
7 votes
3 answers
1k views

Reusing saveboxes

Since \newsavebox{\name} assigns the box register number to \name, there are probably a maximum of 256 boxes available. Is there a way to release a \savebox after you are through with it?
John Kormylo's user avatar
  • 79.2k