Not signed in

Want to take part in these discussions? Sign in if you have an account, or apply for one below

Site Tag Cloud

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

• CommentRowNumber1.
• CommentAuthorUrs
• CommentTimeMay 15th 2017
• (edited May 15th 2017)

The Instiki-to-LaTeX conversion that is built into the $n$Lab (via the button “TeX” at the bottom of each page), used to produce LaTeX code that didn’t compile on most pages. (It’s years ago that I looked into this.)

But, if I recall properly, the (only) problem seems to have been our use of the “\array” environment to do diagrams. I forget what exactly the issue was or is, but I seem to remember it was one isolated little sticking point.

Might anyone here have the ambition to track this down and, if necessary, write a little script that fixes the LaTeX output produced by the nLab, not for beauty, but just so that it compiles at all?

We should test on some semi-simple page such as, say, stabilizer group, which has a couple of simple diagrams in it.

• CommentRowNumber2.
• CommentAuthorDavid_Corfield
• CommentTimeMay 15th 2017
I was trying to do that by hand the other day. It seems we need to take something like

$$\array{ Stab_G(x) &\to& * \\ \downarrow && \downarrow^{\mathrlap{x}} \\ * &\stackrel{x}{\to}& X/G }$$

and replace it with

$$\begin{array}{c c c} Stab_G(x) &\to& * \\ \downarrow && \downarrow^{\mathrlap{x}} \\ * &\stackrel{x}{\to}& X/G \end{array}$$

But I don't know anything about writing scripts. It would have to count the numbers of &s to know the width?
• CommentRowNumber3.
• CommentAuthorUrs
• CommentTimeMay 15th 2017

I was suspecting it might be something simple like this. That would be good.

I believe there are people reading here for whom writing a script that does this should be a matter of five minutes. Is that right?

• CommentRowNumber4.
• CommentAuthorMike Shulman
• CommentTimeMay 15th 2017
• (edited May 15th 2017)

in 15 minutes, here’s a perl script:

my $inarray = 0; my$accum = "";
while (<>) {
if(! $inarray) { if(/\\array\{/) { print$;
$inarray = 1;$accum = $'; } else { print$_;
}
} else {
$accum .=$_;
}
if ($inarray) { if ($accum =~ /\\\\/) {
my @amps = ($accum =~ /&/gs); my$namps = (scalar @amps) + 1;
print '\\nlabarray{', ('c' x $namps), '}{',$accum;
$inarray = 0;$accum = "";
}
}
}


It assumes the first line of the array is the longest one, and it doesn’t switch from a command to an environment (that would require parsing matched braces), so you need to add something like

\newcommand{\nlabarray}[2]{\begin{array}{#1}#2\end{array}}


in the preamble.

• CommentRowNumber5.
• CommentAuthorUrs
• CommentTimeMay 16th 2017
• (edited May 16th 2017)

Thanks, Mike. I still need to fiddle around with this. Did you try to run the script on some example, such as, say, the LaTeX code here: ncatlab.org/nlab/tex/stabilizer+group? Does the result compile?

• CommentRowNumber6.
• CommentAuthorMike Shulman
• CommentTimeMay 16th 2017

No, my 15 minutes were up. (-:

• CommentRowNumber7.
• CommentAuthorMike Shulman
• CommentTimeMay 16th 2017

What exactly is the problem again? That latex compiles for me without any modification.

• CommentRowNumber8.
• CommentAuthorDavidRoberts
• CommentTimeMay 17th 2017

@Mike,

Urs plans to extract compilable LaTeX from much longer pages he’s written.

• CommentRowNumber9.
• CommentAuthorUrs
• CommentTimeMay 17th 2017
• (edited May 17th 2017)

That latex compiles for me without any modification.

Oh, does it?

On my system I get stuck with installing the required packages. Maybe my package manager is broken. I have installed a bunch by hand now, but don’t find “13bootstrap.sty”.

extract compilable LaTeX from much longer pages he’s written.

While I am struggling with installing packages, does the LaTeX of these long pages compile on your system?

• CommentRowNumber10.
• CommentAuthorMike Shulman
• CommentTimeMay 17th 2017

While I am struggling with installing packages, does the LaTeX of these long pages compile on your system?

Examples?

• CommentRowNumber11.
• CommentAuthorUrs
• CommentTimeMay 17th 2017
• CommentRowNumber12.
• CommentAuthorUrs
• CommentTimeMay 17th 2017

Okay, I managed to compile the tex-output for “stabilizer subgroup”.

I see, the diagrams do come out. But other things do not. All hyperlinked keywords appear with their double square brackets and the included files are not included. Worse, hyperlinks coded as

  [[page name|link text]]


get printed out as

        [[page name -- link text]]


And I suppose the section and prop-numbering which we added by css is missing.

When trying to compile the tex-output ncatlab.org/nlab/tex/Introduction+to+Homotopy+Theory all I get is the error message claiming that “\begin{document}” is missing (it’s not missing in the source, but apparently some code before that doesn’t parse properly)

So I went for something a little smaller: when I try ncatlab.org/nlab/tex/classical+model+structure+on+topological+spaces I also get no output, now the error is “no legal \end found”.

Ah well.

• CommentRowNumber13.
• CommentAuthorMike Shulman
• CommentTimeMay 17th 2017

When I try ncatlab.org/nlab/tex/Introduction+to+Homotopy+Theory I get an error about the command \b being valid only in math mode. I don’t know why there is a \b in the source, shouldn’t it just be b?

Similarly, with ncatlab.org/nlab/tex/classical+model+structure+on+topological+spaces I get an error about an undefined command \W, which also seems like it should just be a W` in the source.

• CommentRowNumber14.
• CommentAuthorUrs
• CommentTimeMay 17th 2017

Thanks, Mike.

I suppose in any case the Instiki-to-TeX functionality is not really usable.

That’s what I used to think all along The reason that I have come back to this is that I recently I have offered “Introduction to Stable Homotopy Theory” to AMS and to CUP for publication.

From AMS I had gotten the reaction that while they believe that they have IT experts who could write a script to turn the Instiki source into sensible LaTeX, these experts cannot be bothered with this before referees have recommended the manuscript, and the referees, I was told, could not be bothered with reading the pages in their nLab form.

There was no such fuss with CUP, apparently they have contacted referees right away. But nevertheless I was wondering again just how far we are from turning nLab pages into sensible LaTeX code.

• CommentRowNumber15.
• CommentAuthorMike Shulman
• CommentTimeMay 17th 2017

It is a shame. Someone who knows more about the instiki internals than I do ought to be able to improve the script significantly, by fixing the link problem at least.