Starlink / starlink

Starlink Software Collection
162 stars 53 forks source link

Issues with new latex style #43

Open timj opened 9 years ago

timj commented 9 years ago

In 289b69db59cf5af276f7014bec7fb96c340883f2 SUN/209 was converted to use the new latex style but there are two outstanding problems:

  1. The document comes with private SST-like commands that need to be updated to the new SST look and feel (currently they are squashed together)
  2. There are many unresolved label references that will cause "??" to appear in the HTML version.
timj commented 9 years ago

SSN/4 has trouble with Figure 2 as well (a latex diagram).

timj commented 9 years ago

I should rename this issue to track latex class file issues. SUN/92 has its Figure 1 messed up with the new class (also a latex diagram). Worked fine before I updated it.

timj commented 9 years ago

Many latex documents use a \noteroutine macro for printing out summaries of the API. Would be nice to unify these, maybe creating a \sstnoteroutine and then migrating the documents over.

MalcolmCurrie commented 9 years ago

The subsections of the classified commands in SUN/95 are hard to see.

The size of the SST parameter headings look too small in html. They are smaller than the description that follows.

timj commented 9 years ago

Are they the things that use \noteroutine?

MalcolmCurrie commented 9 years ago

No. I was going by the title.

timj commented 9 years ago

SUN/261(IRQ) is okay but @dsberry IRQ_ADDQN talks about IRQ_SETQC which is a subroutine that does not seem to exist (it triggers a latex warning).

sfgraves commented 9 years ago

SUN/92: I think I've fixed the picture issue in commit eabdb704a338 It just required the unitlength to be set before creating the picture -- this was in one of the sections that starlink_fixup_perl removes. The appearance in the html output could probably be improved, it looks a bit low-res.

timj commented 9 years ago

Also @dsberry, Appendix P is not being created when make_sun238.csh executes in kaplibs.

sfgraves commented 9 years ago

SSN/4 is also fixed I believe (same fix as for SUN/92)

timj commented 9 years ago

PS @dsberry I'm explicitly not upgrading the AST documents. I'm leaving those ones to you.

dsberry commented 9 years ago

OK - I'll do AST. Do you have a list of standard changes that need to be made to each doc, or do I work it out by looking at the commits you've been making? A cursory glance suggests it's a fairly involved process. BTW - I've made the IRQ and KAPLIBS changes you pointed out.

sfgraves commented 9 years ago

There's a perl script in latexsupport that attempts to remove the most common bits of the prologue and put the correct class and various fix ups in.

I usually run that and then try to run pdflatex and see if it breaks anywhere. Most standard latex should be reasonable. The class file still needs some improvements though.

timj commented 9 years ago

regarding the script, you always have to clean up the prologue a bit when you are done and remove the abstract and stuff after scfrontmatter. Not hard though. Then you have to go and sort out any verbatim paragraphs and use small environments rather than \small. Then take a look at the PDF and tweak it a bit.

timj commented 9 years ago

@sfgraves we need to address the optional nature of \stardocversion and \stardocmanual. System Notes won't have a \stardocversion because they aren't generally talking about a library or application so it makes no sense. Abstracts are going to get a bit limited as well so we need to make these three items optional.

MalcolmCurrie commented 9 years ago

This terminalv environment has turned each of my multi-line Fortran code extracts into a single long lines in Redman/Redmond style. Please @sfgraves can it respect line feeds and indentation.

timj commented 9 years ago

@MalcolmCurrie it does act exactly like a verbatim environment so I'm a bit confused. Can you send me an example of something that is not working. I've converted many documents by now and they all use terminalv.

timj commented 9 years ago

I've got the PCS docs ready to go pending resolution of the stardocversion and stardocmanual issue. SUN/61 (TRN) is also ported but the conversion to HTML doesn't work properly with the heavy math usage and latex diagrams. I can push what I have of TRN if people want to take a look (it does do the conversion, just not very well).

sfgraves commented 9 years ago

I've added in a 'noabs' class option, and set stardocversion and stardocmanual to default to a space. We may want to tweak the title formatting a bit at some point, but this seems to look okay.

If a lot of documents really shouldn't have an abstract, we could also do something more clever and detect if the content of \stardocabstract is blank. Not sure its worth it though.

sfgraves commented 9 years ago

@timj I'd be interested in knowing where SUN/61 is breaking, particularly with the maths.

MalcolmCurrie commented 9 years ago

@timj http://www.starlink.ac.uk/devdocs/sun114.htx/node13.html, but something else has gone wrong with that build in that the navigation controls are late2xhtml style.

timj commented 9 years ago

Note that the old latex2html files are not deleted when you rerun with the new style. node13.html is a latex2html output file isn't it? tex4ht does not use that naming scheme.

timj commented 9 years ago

You want this URL: http://www.starlink.ac.uk/devdocs/sun114.htx/sun114se5.html#x6-140007 for that page.

sfgraves commented 9 years ago

Yup -- if you are in an existing install, there's no process to clean out the old html pages. It looks odd because when you view them you pick up the css from the new version, but the html from the old version.

MalcolmCurrie commented 9 years ago

Yes I hadn't noticed the old style last night, but it was obvious today but got to the correct version starting from the top (sun114.html).

We need the make world and make install to clean up previous versions.

timj commented 9 years ago

@sfgraves for SC/3 487eaf0534bedb85ea987efb3a336affb930d9d9 I had to use negative \vspace in the title picture element to compensate for the extra space taken up by the lack of software version and manual type.

timj commented 9 years ago

@sfgraves I'm looking at SUN/259 (in SMURF) and pdflatex refuses to deal with underscores in equations:

\begin{equation}
MAP\_WDTH \,=\, NO\_Y\_MAP\_PNTS \times CELL\_Y
\end{equation}

The command just hangs there until I ctrl-C:

) [1]^C
! Interruption.
l.335 NSCAN \times NO\_
                       SCAN\_PNTS
? 

If I remove the \_ everything works. Obviously this all worked before I switched to the starlink class. Any thoughts? I'm using:

This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
sfgraves commented 9 years ago

Damn, yes, I know what this is.

Previously, we didn't use any hyperrefs inside the latex document, and the sst routine didn't turn the title of the routine into a label when running latex. Now of course we are providing hyperlinks inside the pdf, so I set a label and an xlabel with the name of the title of the routine (as was always done in html), and all the references link to that

Unfortunately, our routine titles have lots of escaped underscores in them, and (pdf?)latex can't handle escaped underscores in labels/refs.

I got around this by putting in a line in starstyle.sty to force to be a \string , and I think this is now what's breaking _ in math mode.

I think I can fix this in this case easily by adding an 'ifmath' check to that renewcommand -- I'll commit that now if it works.

I'm a bit worried we'll come up against other issues based on this though. I'm not sure this method of handling it is really ideal...

timj commented 9 years ago

SUN/259 now works for me.

nxg commented 9 years ago

I haven't looked at the style file, to see what's happening where, but if you set \catcode```\_=11 at a suitable place, then underscore will become just a plain character, as opposed to an subscript indicator. However that character won't appear as an actual underscore in a roman font, so there are other games necessary.

If you can prepare a minimal test case, I might be able to work something out.

timj commented 9 years ago

As noted in commit 8b70ea05231de374ff039d3c350f6ae0b568c5a5 the description lists and equations on pages 7/8 don't convert to HTML correctly.

timj commented 9 years ago

Also, tex4ht seems to ignore angle modifiers to \includegraphics.

timj commented 9 years ago

In datacube SUN/237 the enumerated list at the start doesn't come out right in HTML.

timj commented 9 years ago

I'm not convinced that calling the standard Starlink figure display command \myfig is a good idea. SC/16 had its own version and that took me a while to work out.

Also, SC/16 has problems in section 5.2 with a terminalv environment suddenly changing itself into math mode when it sees a \[.

timj commented 9 years ago
timj commented 9 years ago

SC/9 has an issue with the figures and an issue with the first Display example.

dsberry commented 9 years ago

polka.tex is not a sun because it's not a note for users (as in sUN) - it's the source for the polka help system.

timj commented 9 years ago

@sfgraves did you change \htmladdnormallink to always write a footnote? That was what \htmladdnormallinkfoot was for. SC/15 is full of footnotes because of this.

timj commented 9 years ago

SUN/1 has raised a couple of issues with index creation and labeling of items. Regarding the labeling, it may well be easiest to replace the description lists with normal subsections.

See 65bd8c8877c98229734597102a94f985e5fc4a01

timj commented 9 years ago

Remaining documents are AST, TSP and SLALIB. The latter two have their own variants of SST.

dsberry commented 9 years ago

I'll add converting the AST docs to my list of things to do in the long Hilo evenings....

David

On 14 January 2015 at 16:26, Tim Jenness notifications@github.com wrote:

Remaining documents are AST, TSP and SLALIB. The latter two have their own variants of SST.

— Reply to this email directly or view it on GitHub https://github.com/Starlink/starlink/issues/43#issuecomment-69943565.

timj commented 9 years ago

@dsberry I'm happy to make the attempt if it lets you focus on the AST A&C paper... :smile:

timj commented 9 years ago

The AST docs were done in 1759d0a3739ad9f89bd70d52a9afeef3e7f2be80 but there are issues with the labels (essentially when the name includes parens since \sstlabel can't be used as SST already creates a label).

sfgraves commented 9 years ago

I was having a bit of trouble identifying all the issues I still need to fix up, so I think I've summarised below everything from this long issue. Please add if I've missed anything that hasn't been fixed already.

Still To Do

sfgraves commented 9 years ago

Re support of angle modifiers to includegraphics in html output:

I could try and do it using CSS, but from a quick attempt I think it might make the amount of space allocated for the image in html a bit weird. It would be a lot easier if people could rotate the images themselves rather than doing it in tex. There's only about 9 instances of it in our codebase I think, so my plan is to change those rather than support this with tex4ht.

timj commented 9 years ago

Noting it in the SUN is fine. I've been de-rotating them as I find them. Just needs a warning so that people don't look at the PDF and assume it's all going to be fine.