I have a good book "Thinking Forth" which has LaTeX code availale. (http://thinking-forth.sourceforge.net)

The source code uses PSTricks, so I'm trying to remove the PSTricks dependent code. The biggest hurdle is to convert \tip environment which can be used as follows

\documentclass[12pt, english]{book}



    Hello,     Hello.     Hello.    Hello.    Hello.    Hello.

to get this pdf results. The tip environment is smart that it shows the correct left or right finger pointing depending on the even/odd page.

enter image description here

I need to use three commands to make PSTrick code into pdf file.

latex --output=ps tip.tex
dvips tip.dvi
ps2pdf tip.ps

In the tf.sty file, tip environment calls the \tipbox.

\list{}{\listparindent 0pt\itemindent 0pt}
{\iftip{\sc Tip}\small\else TIP\iftipno{} \tipno\fi\fi}\par\medskip\small

The tipbox is defined as follows.

\hbox to \linewidth{\leavevmode%
\vbox to \@tempdima{\hbox{\includegraphics{pointing-r}}\iftipno\hbox{\small\tipno}\fi\vss}~}\fi
%%% <---
%%% ---> 
~\vbox to \@tempdima{%
\hbox{\includegraphics{pointing-l}}\iftipno\hbox to 27pt{\hss\small\tipno}\fi\vss}\hss%
\hbox to 2.5em{\hss}%

The \tipbox uses color definition from PSTricks.

\newrgbcolor{midgreen}{.9 .95 .9}%{.25 .62 .25}
\newrgbcolor{lightgreen}{.9 .95 .9}

I think I can 1) replace the \pst@divide{\@tempdima}{\@tempdimb}{\pst@tempa}% \psshadowbox code into equivalent box function in TikZ and 2) remove the \newrgbcolor can remove the PSTriks dependency.

Is this correct? If so, how to replace the PSTricks code into TikZ? If not, is there any easy code to replace the tip environment in gray box and pictures?

Style file and LaTeX source can be downloaded to be compiled from https://dl.dropboxusercontent.com/u/10773282/share/2016/06/tip.zip


I could use xelatex to compile the source. This is the process.

Run make tfoptions.tex to get the option file.

Remove the \newif\.. ... \fi, and also remove the pdftex setting in book class. Also remove fontenc and inputenc package.


Run make index and xelatex thinking-forth.tex twice.


For getting the cover.pdf.

Remove the line 8 - 14 (\newif ... \fi), remove the \ifpdf to have %\else \documentclass[10pt,\tflang,dvips]{book} only.

Create pagecount.tex file and \def\pagecount{306}.

Create isbn.eps; go to http://smallpressbarcode.com and give ISBN number 978-0976458708. Then generate the eps file to download and rename it into isbn.eps.

Run latex --output=ps cover.tex; dvips cover.dvi; ps2pdf cover.ps.

  • 1
    Why do you need to convert it? I think xelatex accepts pstricks and generates pdf files. – Ignasi Jun 29 '16 at 9:40

This is a first test with tcolorbox. If you can consider it, it could be further customized.


\newtcolorbox[auto counter, number within=section]{mytip}%
{enhanced, width=.8\linewidth,  before upper={Tip\par}, notitle, 
 overlay={\node[align=center, text width=2cm, anchor=north west, drop fuzzy shadow] 
          at (frame.north east) {{\Huge\HandLeft}\\ \thetcbcounter};}}

tip tip tip tip tip tip

tip tip tip tip tip tip tip tip tip tip tip tip


enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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