Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

tex4ht generates a page head and foot with navigation elements, such as [next] [tail] [up] with hyperlinks.

Now I would like to change that appearance to have the page heading left and right of the title:

[prev] My second section [next]

instead of

[prev] [next]

My second section

and (challange!) in the foot:

[prev] My first section <-            -> My third section [next]

where My first section is the name of the previos section and similar with My third section

share|improve this question
    
I found an obscure reference to \Configure{crosslinks}{}{}{}{}{}{}{}{} (eight parameters!) which seems to configure the way the navigation links behave. Unfortunately I never got tex4ht to work, so I can't test it. :( –  Paulo Cereda Feb 4 '12 at 21:01

1 Answer 1

Your first question is not so hard. Just create dummy sty file, testcrosslink.sty for example, testcrosslink.4ht and put \usepackage{testcrosslink} to your document preamble.

Content of testcrosslink.4ht:

\def\my:nextlink{%
\ifx\nextCut\empty\relax\else[\Link[\nextCut]{}{}Next\EndLink]\fi
}
\def\my:prevlink{%
\ifx\prevCut\empty\relax\else[\Link[\prevCut]{}{}Prev\EndLink]\fi
}

\Configure{section}{\empty}{\empty}{\HCode{<h3>}\my:prevlink}{\my:nextlink\HCode{</h3>}}
\Configure{crosslinks+}{}{}{\empty}{\empty}

This configuration makes top crosslinks empty and redefines section to include links to previous and next file.

To change bottom crosslinks, you can try this:

\Configure{crosslinks}{}{}{ -> \macrofornexttitle [next]}{[prev] \macroforprevtitle <- }{}{}{}{}
\Configure{crosslinks*}{prev}{next}{}

For more information about various configuration options for crosslinks etc., see the CVR's blog

Problem is, I don't know how to automatically retrieve contents of prev and next sections, so how to define macros \macrofornexttitle and \macroforprevtitle must answer someone else. Maybe it could be done using nameref or zref and automatically generated labels, but what I have tried failed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.