backslashes and latex2html

backslashes and latex2html

Post by LC's No-Sp » Sat, 09 May 2009 18:45:08


I would like to include in a manual I'm writing a line looking like this

alias myprg 'setenv TMPARG1 \:1 ; setenv TMPARG2 \!:2 ; source myprg'

I am using

\\~~~\unix{alias myprg 'setenv TMPARG1 $\backslash$!:1 ; setenv TMPARG2
$\backslash$!:2 ; source myprg'}

where \unix gives a particular formatting

\newcommand{\unix}[1]{ \textcolor{mycg}{{\tt #1} } }

pdflatex output is OK, but latex2html output is using two big IMAGES
instead of the backslashes.

Any easy idea to get also the HTML output looking normal (either than
munging it a posteriori) ?

I suppose one could define a conditional new command which can somehow
output different things in *** and html (at worst an HTML hex encoded
sequence for the backslash) but there should be easier solutions ...

--
----------------------------------------------------------------------
XXXX@XXXXX.COM is a newsreading account used by more persons to
avoid unwanted spam. Any mail returning to this address will be rejected.
Users can disclose their e-mail address in the article if they wish so.
 
 
 

backslashes and latex2html

Post by Philipp St » Sat, 09 May 2009 20:58:51

LC's No-Spam Newsreading account schrieb:

Use a verb command, verbatim environment or one of the specialized
packages like listings instead. Then you can get rid of things like
$\backslash$ altogether.

\begin{verbatim}
alias myprg 'setenv TMPARG1 \:1 ; setenv TMPARG2 \!:2 ; source myprg'
\end{verbatim}

--
Replace EAD-MY-SIGby calveuto answer by mail.

 
 
 

backslashes and latex2html

Post by LC's No-Sp » Sun, 10 May 2009 00:13:29


Hmm... I tend to forget about \verbatim because I use *** OR for
latex2html manuals, or for beamer presentations, and \verbatim is
fragile in beamer ...

The main point however is that according to my manual \verb and
\verbatim cannot be used in the argument of another command like


(I replaced the backslash with ???)

where \unix gives a particular colour and font
\newcommand{\unix}[1]{ \textcolor{mycg}{{\tt #1} } }

Also \verbatim gives extra space around my sentence (I wanted it to
start on a new line \\ not on a new paragraph)

--
----------------------------------------------------------------------
XXXX@XXXXX.COM is a newsreading account used by more persons to
avoid unwanted spam. Any mail returning to this address will be rejected.
Users can disclose their e-mail address in the article if they wish so.
 
 
 

backslashes and latex2html

Post by Philipp St » Sun, 10 May 2009 00:46:45

LC's No-Spam Newsreading account schrieb:


beamer has an option to allow fragile environments.


That is right, but here it is unnecessary. If you simple want to
overwrite the verbatim font or create a custom verbatim-like
environment, use the verbatim package. For endless syntax coloring
possibilities, use the listings package which lets you customize really
everything.


Im quite sure this is customizable, too.

--
Replace EAD-MY-SIGby calveuto answer by mail.
 
 
 

backslashes and latex2html

Post by Philipp St » Sun, 10 May 2009 00:48:05

Another solution (which I won't prefer and only mention for
completeness's sake) could be provided by the \textbackslash command.

--
Replace EAD-MY-SIGby calveuto answer by mail.
 
 
 

backslashes and latex2html

Post by LC's No-Sp » Tue, 12 May 2009 18:08:05


Well, thanks ... THAT suits perfectly my needs !

I wonder why it is not mentioned in the docs of my SuSE-bundled latex
/usr/share/doc/packages/tetex/doc/latex/latex2e-html


--
----------------------------------------------------------------------
XXXX@XXXXX.COM is a newsreading account used by more persons to
avoid unwanted spam. Any mail returning to this address will be rejected.
Users can disclose their e-mail address in the article if they wish so.