I often surf arXiv for new articles to read. I usually benefit doubly from this endeavour: secondly to mathematical knowledge I like to learn different LaTeX techniques which are used to typeset beautiful documents. But recently I got a hold of rather peculiar .tex file. Its origins derive from a brilliant article regarding algebraic topology which can be found here.

The whole file is way too large to be rawly posted in my comment, so I included it in my Google Drive. However I can express two of my remarks:

It seems strange to me that multiple .sty files were packed in a single .tex file, as recognised via Google Drive analysis; more accurately, it seems that 8 individual files (1 .aux, 1 .bbl, 3 .sty and 3 .tex) are somehow compressed in one .tex file. Strange.

I decided to post the beginning of the "big" .tex document for further clarity and to make the situation simpler for the community:





%  Variables, Variable Commands, and Styles

%%% Variables %%%

%%% New Variables %%%
\newlength{\cobheight}      % Height of a pair of pants
\newlength{\cobwidth}       % Width of a cylinder
\newlength{\cobgap}         % Gap between adjacent cylinders
\newlength{\cupheight}      % Height of a cup or cap
\newlength{\ellipseheight}  % Height of a boundary ellipse
\newlength{\cobordismlinewidth} % Width of line used to draw cobordisms
\newlength{\coboffset}      % cobwidth + cobgap; the horizontal offset between adjacent cylinders

Those of you who want to help me with my struggle can find the full file here.

The ones who took their time and opened my uploaded .tex file will probably understand the source of my confusion. My primary request is to clarify the syntax to me as much as possible. And a bonus: how can I achieve the beautiful results presented in the paper with the normal format? Thank you in advance. (Please don't mark this as off-topic; it's just a complex question.)

  • 5
    Is there something in particular you want clarified or the entire thing? I personally don't want to go through thousands of lines of code for that. Commented Jul 27, 2017 at 19:17
  • 3
    I don't know if it is off-topic, but I don't like questions very much where all relevant information is behind some links. Imho you should make an effort to add at least some example/screenshot here Commented Jul 27, 2017 at 19:17
  • 2
    "Delivered as a gzipped tar (.tar.gz) file if there are multiple files," It's not a single text file, it's a zipped file. If you unpack it, instead of renaming, you'll see that it's actually 8 files. Commented Jul 27, 2017 at 19:35
  • 2
    You don't compile three .tex at once, you just compile paperIV.tex. That file reads the two other ones. And you don't need to move the .sty files either, if they are placed in the same folder as paperIV.tex, LaTeX will find them. Commented Jul 27, 2017 at 19:46
  • 2
    Well, to answer a question you first need to understand the problem ... I can summarize my comments in an answer later. Commented Jul 27, 2017 at 19:51

1 Answer 1


arXiv says this about the source:


Delivered as a gzipped tar (.tar.gz) file if there are multiple files, otherwise as a PDF file, or a gzipped TeX, DVI, PostScript or HTML (.gz, .dvi.gz, .ps.gz or .html.gz) file depending on submission format.

And indeed, my terminal tells me this:

$ file 1509.06811 
1509.06811: POSIX tar archive (GNU)

Hence, you cannot just rename the file, you need to unpack/extract it. Exact details for that will depend on the system, in Kubuntu I can just right click the file and choose Extract.

After extracting, you'll see that there are eight different files:

$ ls
Cobordism.sty  knots.sty    paperIV.bbl  spath.sty
header.tex     paperII.aux  paperIV.tex  stringdiagram-header.tex

The file paperIV.tex is the main article file. The other two .tex files contain the bulk of the preamble for paperIV.tex, and are included in lines 8-9 of that:

7 % Import the preamble
8 \include{header}
9 \include{stringdiagram-header}

(The numbers indicate line numbers. Note that in the preamble one should use \input, not \include, see When should I use \input vs. \include?)

Hence, the two other .tex files should not be compiled, the reason for having them is to make the preamble of the "main" file more tidy. You could have replaced line 8 and 9 in paperIV.tex with the 700+ lines of code from those files and the result would be the same.

To make a PDF you should in theory just be able to do pdflatex paperIV.tex, but unfortunately that throws an error in Cobordism.sty:

! Undefined control sequence.
\anchor ... \csname pgf@anchor@\pgf@sm@shape@name 
                                                  @#1\endcsname {#2}
l.4118 }

I don't know exactly why that occurs, possibly Cobordism.sty was written for TikZ 2.x, and needs some updating for use with TikZ 3. That is just a wild stab in the dark though, I'd suggest asking a new question about that specific problem.

LaTeX will always look in the current folder for packages, so you don't have to move the .sty files anywhere else, but for reference: Where do I place my own .sty or .cls files, to make them available to all my .tex files?

Note however a couple of things:

  • There is a newer version of spath, called spath3, already on CTAN, and in TeXLive/MikTeX.
  • You might be interested in the tqft package, see e.g. drawing cobordisms using tqft

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .