Re: [tex4ht] Detecting TeX4ht

2012-10-09 Thread Denis Bitouzé
Le mardi 09/10/12 à 00h59,
k...@freefriends.org (Karl Berry) a écrit :

 Hi Denis,

Hi Karl,

  [...]
 
 Sorry for the late reply.  I just wanted to chime in that I also have
 always used \ifx\HCode.

OK, thanks.

 Although I understand and even agree with Eitan's response in
 principle (to use configuration files), in practice it is just too
 much trouble. And configuration files are barely documented at all,
 as far as I know.

I agree.

All the best.
-- 
Denis



Re: [tex4ht] Detecting TeX4ht

2012-10-08 Thread Karl Berry
Hi Denis,

  \newif\ifhttex \ifx\HCode\undefined \httexfalse \else \httextrue \fi

Sorry for the late reply.  I just wanted to chime in that I also have
always used \ifx\HCode.

Although I understand and even agree with Eitan's response in principle
(to use configuration files), in practice it is just too much trouble.
And configuration files are barely documented at all, as far as I know.

Best,
karl


[tex4ht] Detecting TeX4ht

2012-10-03 Thread Denis Bitouzé
Hello,

I understand the answer of the late Eitan in the following thread:

  https://groups.google.com/d/topic/comp.text.tex/ByoF82q20sI/discussion

where he said that it is a wrong approach to include
translator-dependent code within source files with the help of macros as
\ifHtml...\else...\fi.

He advised the alternative route through local configuration files.
This is indeed enough for the if part of \ifHtml...\else...\fi but it
is not relevant for the else part: for instance, TeX4ht is currently
not compatible with floatrow package so it may be useful to have
something like:

  \ifHtml
  \else
  \usepackage{floatrow}
  \fi

or, better:

  \ifnotHtml
  \usepackage{floatrow}
  \fi

There is another route with ifpdf package that lets you write:

  \usepackage{ifpdf}
  \ifpdf
  \usepackage{floatrow}
  \fi

But, if later you decide to compile the file not with pdflatex, but
with xelatex? OK, in this case, you could use ifxetex package and write
something like:

  \usepackage{ifxetex}
  \ifxetex
  \usepackage{floatrow}
  \fi

That's not very nice because this needs adjustments (what about if you
want to compile now with lualatex: OK, there is a ifluatex package...
Not very nice). Furthermore, the ifxetex package's route doesn't work
if you decide to compile with htxelatex!

For the moment, I will use the Anthony Williams' approach:

  \newif\ifhttex \ifx\HCode\undefined \httexfalse \else \httextrue \fi

but, if you see a better approach, I'd be happy to know it :)

Thanks in anticipation.
-- 
Denis