3
votes
1answer
61 views

Dump command as readable text?

Is it possible to dump the expanded form of a command as text? E.g. when I write a macro \newcommand{\mytest}[1]{\texttt{#1}} I would want to define a macro \mydump such that ...
7
votes
2answers
94 views

Redefine \newcommand to insert code at start and end of custom macros

I would like to be able to insert code into the definitions of my custom macros, without having to modify each macro definition. This seemed like a simple case of redefining \newcommand, but this ...
6
votes
1answer
70 views

testing parameter values with \ifx

Let's say that I would like to redefine \@seccntformat so that whenever the section counter is printed, it is prefixed by Section, but other counters should no be changed. Here is my failed attempt: ...
0
votes
0answers
80 views

I need some help debugging this LaTeX macro - TeX “skips past” a bunch of code?

I'm trying to test and debug a collection of LaTeX macros that I've been working on, and I have run into a problem that has me totally stumped. Essentially, the problem is that at a certain point in a ...
7
votes
1answer
101 views

What is wrong with this macro-defining macro?

have this \newsetter macro that defines a "setter" macro (for lack of a better name) and a @-prefixed macro of the same name that holds the value. This is how is supposed to work: \newsetter\macro ...
3
votes
1answer
180 views

Print macro output instead of executing

I am attempting to debug a Tikz/PGF script. I have a STY file that generates Tikz/PGF scripts, but the output graphic isn't quite what I want it to be. In order to debug the problem, I was hoping ...
60
votes
1answer
2k views

A LaTeX log analyzer application (visualizing TeX expansion)

Consider the following MWE, test.tex: \documentclass[12pt]{article} \begin{document} \tracingassigns=1 \tracingmacros=1 \def\aaa{something} \def\bbb{else \aaa, else} \edef\ccc{third \bbb, level} ...
7
votes
1answer
983 views

A \typeout (or expandable command) that can expand once - or with variable levels of expansion?

Consider the following MWE: \documentclass[12pt]{article} \begin{document} \def\aaa{something} \typeout{=1==\aaa==} \typeout{=1==\meaning\aaa==} \typeout{} \def\bbb{else \aaa, else} ...
5
votes
2answers
148 views

Showing definition of macros with custom characters?

Consider the following MWE: \documentclass{book} \usepackage{biblatex} \begin{document} \typeout{1.=\meaning\usebibmacro} \typeout{2.=\meaning\usebibmacro{name:first-last}} \makeatletter ...
4
votes
1answer
255 views

Showing expanded `\let` command with `\typeout`

I have already seen the related page macros - What is the difference between \let and \edef?, but I'm afraid it still doesn't expain to me the following MWE: \documentclass{minimal} ...
6
votes
2answers
488 views

On unprotecting (expanding) \protected macros (or, “the space after command name”)

I quite often come into a situation, where I need to obtain some text produced by a package macro as a string, like in say: Expanding (edef) a lipsum command? How do I "unprotect" an ...
26
votes
2answers
706 views

How do I debug pgfkeys?

I'm sure if you're reading this question you are already familiar with my love for pgfkeys. However, it is absolutely impossible to debug: \tracingmacros is a total mess, with every key expanding to ...