6,602 reputation
22837
bio website
location
age
visits member for 3 years, 9 months
seen 5 hours ago

May
8
comment Reactivating “\clearpage” in LaTeX after turning it off with “\let\clearpage\relax”
@GaryKlasen: I updated my answer to include a more specific fix. And you should use \begingroup\endgroup instead, if you can; it's cleaner.
May
8
comment Reactivating “\clearpage” in LaTeX after turning it off with “\let\clearpage\relax”
@DavidCarlisle: Yes, but it does that even without the \let\clearpage\relax; the problem is with the \clearpage that's implicit in \chapter, so there's an (apparently undesirable) page break in between the table of contents and the first chapter.
May
8
comment Reactivating “\clearpage” in LaTeX after turning it off with “\let\clearpage\relax”
@ChristianHupfer: Thanks for your comment – I was able to find a solution using that!
May
8
comment Reactivating “\clearpage” in LaTeX after turning it off with “\let\clearpage\relax”
@GaryKlasen: I should have realized that, since your \begingroup\endgroup version should have worked. Perhaps some command after the \tableofcontents is the one issuing the \clearpage – have you tried making the group enclose more commands?
Feb
19
comment Can cleveref be made to use the Oxford comma for multiple citations?
@karlkoeller: So it is! I guess great minds think alike; I must have started writing my answer while you were finishing writing yours.
Feb
19
comment Can cleveref be made to use the Oxford comma for multiple citations?
@LukeMaurer: You'd think so, but surprisingly not.
Nov
24
comment Hyperref jumps to the wrong equation if the equation has a \tag and cleveref is used
Awesome! I just checked it out; with hyperref v6.82q, I get the spurious warnings, but things seem to work. Thanks!
Jul
21
comment inputenc Error: Unicode char \u8: not set up for use with LaTeX
possible duplicate of "inputenc Error: Unicode char \u8" error while trying to write a degree symbol (invisible character)
Mar
14
comment Is there a BNF grammar of the TeX language?
The difference between TeX and most languages (one might say "sensible languages") is that these sorts of changes can affect the parsing of TeX. (I imagine Perl might have similar problems thanks to source filters and BEGIN blocks?) For instance, \ifx\f\g\catcode`\\{=12\fi{} is a parse error if and only if \f and \g are equal; and as discussed above, the Turing-completeness of TeX (and of TeX's mouth!) means that the equality of \f and \g is undecidable. Does that help clear things up?
Dec
16
comment How to read a stream of tokens up to one of two different delimiters
@StephanLehmke: A very good idea! For anybody who's wondering, the input-gathering logic happens somewhere in \collect@body/\collect@@body; for the environments that call into \start@align (e.g., align and alignat and their starred variants), this body is passed to \measure@, which you can hack into. Note that aligned and alignedat (at least) don't pre-gather their input (as far as I can tell).
Dec
15
comment How to read a stream of tokens up to one of two different delimiters
Fair enough, really. (Especially since I'm making amsmath-like environments anyway.) Would you consider leaving this as an answer, then? I'll leave the question open for now to see if anybody can answer it as asked, but your answer is a good one. (And thanks for the link.)
Dec
15
comment How to read a stream of tokens up to one of two different delimiters
@StephanLehmke: I had thought about that, but had hoped to avoid it, since it's just sort of ugly (and probably inefficient, especially for large environments)—I don't need all that information :-) But it's true, that would work.
Sep
27
comment In the minted package, how do I enforce straight single quotes?
For anyone who comes across this later: the upquote package modifies all verbatim text (\verb and the verbatim environment) to render ' and ` as the upright versions, not the “smart” and . Since (as I understand it) minted and listings rely on fancyvrb, which itself calls out to verbatim text under the hood, this has the desired effect.
May
25
comment Hyperref jumps to the wrong equation if the equation has a \tag and cleveref is used
This works, but is clearly sort of ugly. If there's a better solution, I'm all ears (really!), but this is what ended up in my document.
May
25
comment Hyperref jumps to the wrong equation if the equation has a \tag and cleveref is used
I awarded you the bounty because your solution is what gave me the ability to understand what was going on and come up with a half-assed fix; thank you! (I'd still love to see if/how this generalizes to a nicer solution, but my urgent deadline is past, so it's just academic at this point. And/or if I need it in the future.)
May
18
comment Hyperref jumps to the wrong equation if the equation has a \tag and cleveref is used
As you noticed, this only works for equation. Unfortunately, I only noticed this now too, which is my own fault but is unfortunate. I've updated the question to reflect my actual needs (I need correct links to most of the possible environments), and I've added a bounty. If you have the solution and/or the time, I'd love to have it... :-)
May
18
comment Hyperref jumps to the wrong equation if the equation has a \tag and cleveref is used
I realized that what I was asking for was insufficient, so I've extended the question and added a bounty.
May
7
comment Hyperref jumps to the wrong equation if the equation has a \tag and cleveref is used
This seems to work—thanks! A question, though: why are you patching \tag as well as \equation? Intuitively, it seems like you should only need to patch \equation to maintain this new unique \theHequation; and if I comment out the patch to \tag, everything seems to still work at a quick glance.
May
7
comment Hyperref jumps to the wrong equation if the equation has a \tag and cleveref is used
I just noticed that the hyperref README suggests replacing equation by gather; that doesn't fix the behavior of the links, but I added information about what happens when I do that.
Apr
22
comment Cleveref can't refer to line numbers in listings
Perfect! I thought I had the most up-to-date version, but clearly should have checked more carefully. Thanks!