is about finding the cause of errors or wrong results in (La)TeX code/documents using a methodical approach.

learn more… | top users | synonyms

76
votes
2answers
8k views

How to best debug LaTeX?

..and I don't mean finding out why it doesn't compile, I mean serious debugging: breakpoints, figuring out value of variables at a given moment during run/compile, stepping, examining a stack (is ...
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} ...
54
votes
3answers
4k views

2013, year of the TeX bugs report. Will pdfTeX, XeTeX, etc. be changed accordingly?

Barbara Beeton said (TUGboat vol. 34, pag. 4): As noted on Don Knuth's TeX web pages, www-cs-faculty.stanford.edu/~knuth/abcde.html, he "intend[s] to check on purported bugs again in the ...
51
votes
4answers
1k views

Why does \vspace, after section heading, sometimes jump/snap in discrete steps?

Well, this is one question that I've had for a long time, and one that always gets me extremely irritated. However, this time I'm even somewhat happy - that I can ask the question at all; and that is ...
40
votes
8answers
4k views

Reducing the console output of LaTeX

When I run pdfLaTeX, I get very verbose output: (/usr/local/texlive/2008/texmf-dist/tex/generic/pgf/frontendlayer/tikz/librarie s/tikzlibrarycalc.code.tex) ... Is there a script to soak up all the ...
39
votes
2answers
2k views

Is there a \show for lengths?

The \show command is extremely useful for figuring out what's going on with a particular macro. Similarly, using \the can tell me the value of a counter. I'd like to know if there's something ...
32
votes
3answers
31k views

LaTeX with Sublime Text 2

I recently (2 days back) started using LaTeX, I use Sublime Text 2 (ST2) for most of the programming. I found that ST2 has LaTeX package. So what I am doing is write the document with ST2 and run it ...
27
votes
2answers
737 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 ...
26
votes
2answers
1k views

Introspection and reflection with LaTeX/TeX macros

Below is a short program that can use \meaning and \string to let a combination of LaTeX and TeX commands to print out the listing of macros. Unsurprisingly (nothing can surprise me with TeX any ...
24
votes
3answers
1k views

How can I work around this TikZ bug: (\x)^2 and \x^2 produce different results in TikZ plot?

I have some files with TikZ graphics that have suddenly changed appearance since I upgraded to PGF-2.10. Here is a minimal example: \documentclass{minimal} \usepackage{tikz} \begin{document} ...
23
votes
1answer
2k views

Latex \tracing commands list?

Often I need to recall the different \tracing commands; and a couple of times I stumbled on some webpages that worked fine for me; sadly, I didn't keep them, and my searches don't take me there ...
18
votes
1answer
398 views

A “stacktrace” for errors

Is it possible to get some kind of "stacktrace" in TeX errors? I sometimes get errors which only show some deep LaTeX internals, but nothing about which LaTeX macro referenced it. Thanks,
17
votes
5answers
661 views

What tips and tricks are there for debugging TikZ/PGF code?

When answering questions here and when drawing my own complicated TikZ/PGF drawings, I've developed a fair number of "tips and tricks" for debugging the code. I'm sure that others have as well. I ...
17
votes
2answers
5k views

Is plotting exponential graphs a known source of bugs in TikZ?

I want to plot $y = 2^x$ over a small domain. Unfortunately, even though tikz (v 2.1) seems to be able to calculate 2^{negative numbers} it is not plotting them correctly. My minimal example is: ...
15
votes
1answer
9k views

How do you effectively debug overfull \hbox warnings?

I still haven't found out how to effectively solve Overfull \hbox (0.80913pt too wide) has occurred while \output is active warnings. For instance, this piece of latex generates such a warning and I ...
13
votes
4answers
3k views

LaTeX debugging strategies and brace mismatching

What is the recommended way to track down brace mismatches in LaTeX? I have a large beamer presentation, but this equally applies to any other LaTeX work I've done. In other computer languages I've ...
12
votes
1answer
381 views

Are subcaption and tabularx incompatible?

I know that tex.sx isn't the forum for bug-reporting, but I have a bit of a problem and I'm looking for a technical workaround. The following MWE produces odd labels: \documentclass{article} ...
11
votes
1answer
236 views

How to report *amsart* bugs? (Looks like a bug to me.)

I have noticed the following strange behavior when using a custom counter in certain situations in amsart document class. Here is an example: \documentclass{amsart} \newcounter{exercise} ...
11
votes
3answers
13k views

Compilation Error “! Missing \endcsname inserted” The control sequence marked <to be read again> should not appear between \csname and \endcsname

here's my thesis Latex files: http://www.mediafire.com/download/c7q8z4v6gv864rk/triet_thesis_clean.rar Please help me to fix the error, I've tried all the things I can find with Google :( : ! ...
11
votes
2answers
531 views

\underfullrule?

I always use something like \overfullrule=1mm when I am writing Latex documents. I do read all warnings regarding overfull \hboxes, but I still prefer the visual output that very clearly shows exactly ...
10
votes
1answer
329 views

Is there a \show for catcodes?

In the course of attempting to out-pedant another mathematician, I wanted to \show the catcode of $ to convince myself that it was a "special" character in ordinary TeX as well as LaTeX. I was just ...
10
votes
1answer
258 views

Get current source line number

How can I get the current .tex source line number? I want to use it to generate useful error messages in a package I am writing. There are some errors that can only be detected at the end of the ...
10
votes
1answer
63 views

Log all keys in a module

Using l3keys, is there any way to inspect the keys currently in a (sub)module? I'm looking for something like \clist_show, but for keys. \keys_show sounded promising, but requires that you already ...
10
votes
1answer
555 views

Visualizing correct page lengths with 'layouts' and 'tikz' packages?

I am currently working on a project with xelatex/fontspec and tikz, and so, this example is basically the same as the one from layouts package reads all length as zero with tikz/fontspec/xelatex?. ...
9
votes
1answer
2k views

Install emerald font package on ubuntu

I tried to install the emerald font package on my ubuntu natty box. However if I compile a minimal example like (emerald.tex) \documentclass{article} \usepackage{emerald} \usepackage[T1]{fontenc} ...
9
votes
1answer
257 views

Help with the lua-visual-debug package

The documentation for lua-visual-debug is a little sparse. Can someone interpret the boxes/lines/colors that lua-visual-debug produces?
9
votes
2answers
5k views

Sublime Text 3 LatexTools

I just installed ST3 and installed the LatexTools package using Package control. Everything seems to have gone fine except when I compile using CMD+b nothing seems to happen. On the terminal I get ...
9
votes
2answers
116 views

Ease the handling of labels

I want to ease the handling of labels in my document, and I want to show the label for a section if define a "variable". Currently I'm doing it like this Setting the up the "variable": ...
9
votes
1answer
291 views

Using \typeout behaviour different with \newtoks vs. \def

I feel as I really should know this, but sadly I don't. Why is the output of \typeout{\the\myToken} not the same as having it printed in the PDF as \the\myToken. No problem with a \def, just with ...
9
votes
1answer
535 views

Using pgfplots with a0poster

I want to use tikz/pgf to plot some graphs in a poster done with a0poster. That is the code: \begin{tikzpicture} \begin{axis}[xlabel=lambda, ylabel=int] \addplot[blue] table [mark=none, col ...
8
votes
2answers
334 views

How come the tilde ~ sometimes does not behave like non-breaking space?

This is again one of the behaviors that are quite difficult to catch in a reconstructible (and simple) example, so one has to resort to animations. Basically, the issue is this: the tilde (~) is ...
8
votes
2answers
351 views

Goto or jump command in LaTeX?

The answer to this is probably "no", but I just wanted to make sure... (also, I'm not trying to get into the whole "gotos are evil" debate :)). Basically, one of the things that irritates me in my ...
8
votes
1answer
142 views

How can \ifx\\\\ be false?

It appears that I have a case where \ifx\\#2\\ is false, even though #2 is empty. Here is the relevant excerpt from the log file, with \tracingcommands and \tracingmacros turned on: \lastpageref ...
8
votes
1answer
352 views

htlatex interrupted at '\:temp{rm}'

Using TL2013, I cannot compile documents with htlatex anymore. For example, using: \documentclass{scrbook} \begin{document} test \end{document} I get: $ htlatex test.tex This is pdfTeX, ...
8
votes
1answer
3k views

How to find the lost text part when having “Float(s) lost” error

I've lost some text. I don't know if theres something missing, so how can I find it? I'm not in the mood to compare the chapter1.tex to the pdf file by reading both. Chapter 1 (chapter1.tex) is rather ...
8
votes
1answer
88 views

Upper limit on the number of pause commands in a frame

Is there any upper limit on the number of pause commands in a frame in beamer, when it is used along with the \only<>{} command ?. I have a simple beamer example with 14 pause commands, but the ...
7
votes
4answers
319 views

Debugging Advice: Dimension too large (Need stack trace)

Background: I am stuck on a "Dimension too large" problem which is occurring during index generation. This is a large index of links to files (along with other related information), and am sure the ...
7
votes
1answer
1k 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} ...
7
votes
2answers
115 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 ...
7
votes
1answer
109 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 ...
7
votes
1answer
881 views

Why does loading pgfplots after tikz break the default layers in a tikzpicture?

Taking the MWE from Jake's answer to the question Background rectangles with equal width but 'fitting' height, I get an error when loading pgfplots after the tikz packages but not before. I'm assuming ...
7
votes
1answer
161 views

I cannot determine the error between hyperref and hypdvips

Look at the following Minimal Non Working Example. It's not correct, because the output pdf will be created. Nevertheless the logfile produces an error. It took me a lot of time and I am still not ...
7
votes
1answer
434 views

bug with page numbers when using soul package

I recently ran into a curious bug when using the soul package. I managed to boil it down to the following example. The problem is that the page numbers get messed up. In the example below, they should ...
7
votes
1answer
166 views

Bug in polylongdiv?

\documentclass{article} \usepackage{polynom} \begin{document} \polylongdiv{x^4-1}{x^3+x^2} \end{document} It leaves out the first x in the quotient. How can I fix this?
7
votes
0answers
58 views

Determine File Name and Line Number Where a Macro is Invoked From

Wondering if there is any way to print out (for debugging purposes) the file name and the line number from where a macro is invoked (not where it is defined). My attempt to use the currfile package ...
6
votes
3answers
329 views

\settowidth problem in tikz and in groups

I just came to the following problem - using \settowidth on a length in a tikzpicture resets that length to 0? Here is a (totally command-line) MWE, compiled with pdflatex test.tex: ...
6
votes
2answers
525 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 ...
6
votes
1answer
1k views

TikZ datavisualization example fails

While trying an example from the datavisualization section of the current TikZ manual I get a strange error message. On my system I have the current MikTeX 2.9 and installed the CVS version of TikZ ...
6
votes
1answer
123 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: ...
6
votes
2answers
157 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 ...