Welcome to my computer page!

MY FREE SOFTWARE

My free software is available on its separate page.


Do you want to run on your wonderful PC i486/i586 (from mid 90's) a modern 32-bit multitasking operating system? Install

I like

IBM OS/2 Warp

very much! Please, go now to my

my large page devoted to OS/2


There, you will find also my wonderful TeXing package pmCSTeX for EPM and much more. Check it now!


TeX + LaTeX

Reference to my page devoted to TeXing in OS/2. You can get the latest version of pmCSTeX for EPM here.

Sazeni vektoru tucnou italikou

Kdyz chcete sazet vektory tucnou italikou, pak pouzijte prikaz:


\DeclareMathAlphabet{\mib}{OT1}{cmr}{bx}{it}

potom vam napr. $\mib r$ vysazi tucne sklonene r. Muzete tez predefinovat

\let\oldvec\vec \let\vec\mib
Pokud pisete ve vedeckem textu hodne vektoru, pak je (podle meho nazoru) desne neprakticke, a tez i spatne citelne psat vyrazy jako je nize uvedena definice rovinne vlny
\vec E(\vec r) = \vec E_0 \, e^{-i\vec k \vec r} ale mne se vic libi definice v preambuli
\def\bE{\vec E}
\def\bk{\vec k}
\def\br{\vec r}
...atd...
a pak uz v textu rychly a jednoduchy zapis:
\bE(\br) = \bE \, e^{-i\bk\br}
(Na matice pouzivam neco podobneho, kde pisi \matA, \matB,...)

Ve starsim LaTeXu 2.09 se na tucnou italiku muselo pouzit makro boldvec.sty, v kterem jsou i makra na vysazeni casove derivovanych vektoru (to jsem zatim v LaTeXu2e nepotreboval).

HOWTO convert png or jpeg to eps

Go to the postscript section to read how to efficiently convert a png or jpeg file into eps, so that it is small enough and compatible with dvips.

Oboustranny tisk a tisk ze zasobniku c. 2 z dvipsu

Nasledujici postup slouzi k tisknuti z dvipsu dvoustranne anebo na slajdy, aniz by bylo nutne rucne editovat postscriptovy soubor vylezly z dvipsu (vymysleno 18.1.1998):

A. Pouziti z prikazove radky:

dvips -h 2sideP.ps my_text[.dvi]
dvips -h 2sideL.ps my_text[.dvi]
dvips -h Slot2.ps my_text[.dvi]

B. Uziti z pmCSTeXu pro EPM (editor EPM pod OS/2):

na prvni radek "Master" souboru pridame:
%  ...   dvips: * -h 2sideP.ps *  ...
%  ...   dvips: * -h 2sideL.ps *  ...
%  ...   dvips: * -h Slot2.ps * ...

C. Popis vyse uvedeneho:

tisk oboustranne na papir PORTRAIT
tisk oboustranne na papir LANDSCAPE
tisk ze zasobniku cislo 2

D. Instalace: nasledujici tri soubory musi byt presunuty do adresare, kde dvips hleda data (v emTeXu je to adresar \EMTEX\data\dvips). Soubory si muzete bud stahnout odtudto, anebo si je muzete opsat odtud:

File 2sideP.ps:
% PRINT ON BOTH SIDES / TISKNUTI OBOUSTRANNE --- PORTRAIT:
[{
%%BeginFeature: Duplex DuplexNoTumble
<</Duplex true /Tumble false>> setpagedevice
%%EndFeature: Duplex
} stopped cleartomark


File 2sideL.ps:
% PRINT ON BOTH SIDES / TISKNUTI OBOUSTRANNE --- LANDSCAPE:
[{
%%BeginFeature: Duplex DuplexNoTumble
<</Duplex true /Tumble true>> setpagedevice
%%EndFeature: Duplex
} stopped cleartomark


File Slot2.ps:
% PRINT FROM SLOT NB. 2 (SLOT FOR TRANSPARENCIES, FOR INSTANCE):
[{
%%BeginFeature: *InputSlot Lower
   currentpagedevice /InputAttributes get 2 get
   dup null eq
   { pop }
   { dup length 1 add dict copy
     dup /InputAttributes
     1 dict dup /Priority [2] put
     put setpagedevice
   } ifelse
%%EndFeature
} stopped cleartomark

Zruseni LaTeXovskeho prostredi

Pokud se vam stane, ze se biji dve definice tehoz prostredi, definovane ve dvou ruznych souborech, ktere z nejakych duvodu nechcete menit (napr. nejste autorem), pak muzete pouzit ten prikaz pro vymazani prostredi:
\def\deleteenvironment#1{
\expandafter\let\csname #1\endcsname\relax
\expandafter\let\csname end#1\endcsname\relax
}

Pouziti napr.:
\deleteenvironment{equation*}

How to submit your publication with figures at the end

In document preamble (before \begin{document}), you should (always!) have this setup:
%%%%%% Setup for figures:
\setcounter{topnumber}{10}     % max. pocet floatu nahore (specifikace t)
\setcounter{bottomnumber}{10} % max. pocet floatu dole (specifikace b)
\setcounter{totalnumber}{20}   % max. pocet floatu na strance celkem
\renewcommand\topfraction{1.0}  % max podil stranky pro floaty nahore
\renewcommand\bottomfraction{1.0} % max podil stranky pro floaty dole
\renewcommand\textfraction{0.0}    % min podil stranky, ktery musi obsahovat text
%\intextsep pro ulozeni [h] floatu a \textfloatsep pro [b] or [t].
%\intextsep pro ulozeni [h] floatu a \textfloatsep pro [b] or [t].
\intextsep=6mm \textfloatsep=6mm
Then, in order to have all figures at the document end, sometimes
\usepackage{endfloats}
helps, and sometimes not (like in case of classes of some journals). In this case, and in the case the journal requires all figure captions on one page, on figures on separate pages afterwards, then it is the most easy way to put the following code towards the end of your paper:
%%%% FIGURE CAPTIONS AND FIGURES:

\iftrue
% Life of scientists would be much easier if journals don't require
% captions and figures on different pages, as in the old dark ages
% of machine typing. We use computers, nowadays!
{
  \def\includegraphics[#1]#2{}
  \gdef\mycaption#1#2{Figure \ref{#1}. #2}
  \input{paper-figs.tex}
  \clearpage
}
{
  \let\oldincludegraphics\includegraphics
  \def\includegraphics[#1]#2{\vskip4cm\oldincludegraphics[#1]{#2}}
  \gdef\mycaption#1#2{\caption{\label{#1}}\vskip6cm}
  \input{paper-figs.tex}
}
\fi
while having all figures listed in a separate file paper-figs.tex like this (note using \mycaption instead of \caption):
%%%================= FIGURE ====================
\begin{figure}[p]
\begin{center}
  \includegraphics[width=14cm]{figures/adExpScheme.eps}
\end{center}
\mycaption{Fig-Exp-Setup}{%
  Sketch of the experimental arrangement with horizontal scattering plane and
  vertical rocking axis.  GaN ELO measured at one azimuth with stripes vertical,
  GaAs samples at two mutually perpendicular azimuths (0\degdeg and 90\degdeg).
}
\end{figure}

%%%================= FIGURE ====================
\begin{figure}[p]
...

If you have any better solution, please let me know.

Miscellanous TeX-related addresses

CSTUG = Czech and Slovak TeX Users Group
TUG = TeX Users Group
(La)TeX FAQ = frequently asked questions
Prof. D.E. Knuth's page at Stanford
Bulletin CSTUGu
Tex2RTF: konvertuje z LaTeXu do RTF
PDF specification
Ceska dokumentace k metapostu


gnuplot

is nice graph plotting program compatible between various operating systems (UNIX, OS/2, VMS, DOS, Windows, Mac, Atari...)! Please download the latest official version 4.2.x if you have any previous one.

My enhancements to gnuplot: please look at

my separate gnuplot page

where you find information about


My other favourite programs

I like free programs (freeware, public-domain, GNU etc.), e.g.

Information about C and C++ programming languages

Information from my own

My conversion program from C++ to LaTeX (C++2ltx).

Special method to calculate the integral \int_{xA}^{xB} \cos(A x) F(x) dx byl the Filon method.

Pro prenos souboru mezi ruznymi OS je potreba prejmenovat C++ zdrojove soubory na priponu .cpp, .cxx ci .cc. V OS/2, DOSu i VMS jde pouzit prikaz ren *.cpp *.cxx, avsak na Unixu ne. Zdenek mi napsal takovyto unixovsky skript:


for i in *.cpp
  do mv $i `echo $i|sed s/cpp$/cxx/`
done

An anti-char * article, alias C++ Programming HOWTO, is here.

Taky jsem si vzpomnel na testy ruznych prekladacu, publikovane v casopise EDM/2 (konkretne to bylo cislo 1-5). Z toho vyplyva, ze predevsim diky pouziti metody predkompilovanych hlavicek je nejrychlejsim prekladacem Borland C/C++. Naopak nejkompaktnejsi kod produkuje Watcom, a nejrychlejsi kod dostaneme pouzitim prekladace GNU C/C++ -- to je priznive zvlaste proto, ze tento prekladac je sireny zdarma a je k dispozici na vsech operacnich systemech. IBM Visual C++ ma nejlepsi rozhrani pro navrhovani OS/2 aplikaci, prekladac Watcomu bezici v jedne z verzi pod OS/2, DOSem, Windows ci Windows NT zase umoznuje prelozit jeden a tentyz zdrojovy texty na spustitelny program pro libovolny z techto OS.

Some other net servers

All freeware and shareware C Programming programs (plus more than 23,288 others) are now on JUMBO. The Official Web Shareware Site:

Jumbo
Jumbo/prog/os2
Jumbo/prog/dos/c

C++ resource directory
g++ page and FAQ
STL: Standard Template Library
C++ info and links
Cantrip Corpus C++
imatix: SFL = Standard function library for C/C++ --- open source

GNU page
free software list

Archiv kulturniho programovani pro Web, C a C++
GNU C/C++, ANSI draft for C++

Matrix calculations in C++

Po projiti ruznych volne sirenych implementacich maticovych knihoven jsem dospel k nasledujicimu: * V cistem Cecku existuje meschach, ovsem narazil jsem na jakesi potize kdyz jsem to zarazoval do C++. Dale tu je LAPACK++: netlib2.cs.utk.edu:netlib/c++/lapack++ (ja jsem pouzil zrcadlo netlibu na elib.ZIB-Berlin.de:netlib/*). Kontakt na spravce: netlib@research.att.com. Pouzivaji se pritom fortranske rutiny Lapacku, prevedene do C podoby prekladacem f2c a dale rucne -- viz CLapack. Lapack++ je tak dobre udelany, ze pres to, ze jde o C++, tak rychlost vypoctu je ve Fortranu (originalni lapack), C (lapack) a C++ (lapack++) stejna, nekdy spise ve prospech C/C++. V dokumentaci lapacku++ je prilozen i clanek pojednavajici o tomto testovani. Bohuzel tam dosud nebyly implementovany vsechny potrebne funkce maticoveho poctu (hlavne mi tam chybi invertovani matic). Autori to nechali jako ulohu ctenarum/programatorum...

Nakonec jsem si vybral C++ knihovnu z programu Octave. Tento program je podobny Matlabu, ovsem umi toho vic, je to verze pro X-Windows a OS/2 sirena pod GNU licenci. Program vcetne zdrojaku se da stahnout z libovolneho GNU archivu ci z hobbes ci z linuxovskych serveru. A prave knihovny z tohoto baliku se daji velice jednoduse pouzit ve vlastnich C++ programech. Podporovany jsou double a complex-ni vektory a matice, ale zase nejsou zacleneny specialni rutiny treba pro vypocet vlastnich hodnot symetrickych matic.

Lapack++ i Octave pouzivaji na vetsinu vypoctu fortranske rutiny. Ty jsou k Octavu pricleneny, anebo se daji tez stahnout z netlibu. Ovsem zjistil jsem, ze pod Borlandim C prekladacem (ani pro DOS, ani pro Winbloze) je neprelozim kvuli 64KB DGROUP limitu. Zato se to podarilo s Borland C++ for OS/2 -- OS/2 a Unixy pameti linearizuji a stupidni problemy DOSu zde neexistuji. Jinak pod gcc/emx prekladacem se to prelozilo bez problemu, vsak prilozene makefily jsou pro tento prekladac. Pro Borland bylo nutne provest vicero uprav, jez vam na pozadani zaslu.

A pokud si chcete precist kratky referat o sitove pristupnych C++ zdrojacich pro maticovy pocet, tak voditkem muze byt tohle.

Mumit's home page (Lapack++, FFTPack++, Shadow etc.)


PostScript

Welcome to my PostScript web page!

Contents of my PostScript part:

Main Postscript-related web sites

Ghostscript and ghostview are free previewers of postscript files for many operating systems. Ghostscript can raster postscript files for printing them on non-ps printers.
GhostScript and GhostView main site
Download of ghostscript and ghostview, many information about them, a lot of links.
Internet Resources for Postscript and Ghostscript
It's cool!
PostScript WWW pointers
W3/PS
Lots of PS information at quite
Internet PostScript Resources
psview
fast previewer for postscript files (small front-end for ghostscript). Available for DOS and OS/2. It is the best one for DOS!

Postscript documentation

A PostScript Tutorial and Reference
from Computing Laboratory, UKC
A First Guide to PostScript
WWW document
PS documentation by Adobe
the full list of level 2 operator descriptions at Luminous
Postscript Quick Tips
How to make watermark and more...
Zaklady PostScriptu --- zaklady, neni zde uplny popis prikazu
Thinking in PostScript by Glenn Reid, PDF version
A First Guide to PostScript
Printable PS handbook
And of course the best book is the PostScript Language Reference Manual by Adobe (costs 30 USD). There is also new Red Book on PostScript.
wisc.edu/~ghost

Postscript utililities

psutils: source, versions for OS/2 and for DOS.
very useful postscript utilities: psbook, psnup, psresize, psselect, pstops. Scripts getafm, showchar, fixing output from various programs...
epstool
calculation of Bounding box, adding/removing preview pictures from PS files. You can download my script CalcPSBB.cmd (version for OS/2) which corrects wrong Bounding box of a .ps file.
Important: if you are putting .ps files (figures, graphs...) into your a (La)TeX document, you must correct their bounding box since 99% of applications produce postscript files with wrong bounding information!
PageDraw drawing program
PageDraw is a PostScript based vector drawing program for Windows 3.1. It lets you draw, edit or transform several graphical shapes.
It's freeware, input files must be converted to AI = Adobe Illustrator format.
Its features are quite limited. Don't use it for making graphics. Xfig is the best tool.
two-side and slot2 config utilities
Do you use a printer capable of both-side (recto-verso) printing but it is not configured so that you can both-side print long documents printed on one page only? Or, you do not know how to print your slides (in a PS files) to the lower slot (with transparencies) on a network printer? Then enjoy this utility, which adds some PS setup code in the beginning of the file and makes what you want.
Even when it is said that each printer has another way to set this both side/slot2 printing, I have found that the above-mentioned utility worked for all printers I tried. Note: see also a similar section in the above TeXing part.
syntax highlighting for postscript files
if you edit postscript files in the (free) editor EPM under OS/2, then you may like colouring of the edited postscript files. This file, after necessary modification, could be of use for other editors too (nedit for X-Windows has such features).
Distillery
Distillery is a PostScript program for taking another PostScript program, and converting it so that it complies with the Adobe document structuring conventions (DSC). The advantage of this is that individual pages can be accessed randomly, without requiring all previous pages to be processed in order to correctly determine the state of the machine.

My PostScript Tricks

There are some my notes about PostScript hacking, editing, resizing, inputing into other programs...

Documetn HOWTO-Bitmap2eps describes how to efficiently convert a bitmap image into an encapsulated postscript level 2 file (for latexing and dvipsing, for example).
Results:

If you are putting your plots into a typesetting system, like TeX, then you should recalculate the Bounding box written in the header of the file. This is a general rule for nearly all PS-producing programs.

For reducing the size of a postscript file, you can make CRLF to LF conversion (DOS to Unix conversion). dvips compiled by gcc/emx produces CRLF.

Newer versions of ghostview (e.g. GSview 2.5) can show .ps.gz / .eps.gz files. You don't have to decompress them.

dvips can also include graphics in .(e)ps.gz form. However, TeX (e.g. \includegraphics in LaTeX) requires the Bounding box specification either as the parameter (in \includegraphics[bb= x1 y1 x2 y2]{..} or a .(e)ps.bb file. There is a script called psgzip that makes takes .(e)ps files and makes .bb and .gz for them. Note: dvips calls gunzip program for unzipping; so you can make script gunzip.(cmd,bat) with the command gzip -d %1.

How do I edit PS files? In editor EPM, for which I have also the syntax hilighting file (look into pmCSTeX.

How to efficiently transform a bitmap (BMP, TIFF, PCX, GIF, JPG...) file into (encapsulated) postscript? Please, do NOT just print it from PMView, XV, PaintBrush or Word! The best solution I have found is to convert the figure into JPEG format, and then convert it into postscript by jpeg2ps. (The linked file contains executables for OS/2 and DOS, and the source code. At the moment, I don't remember the homepage). Don't forget to use the option -h if you intend to include the file into TeX (using dvips). The converted .PS file is not too much larger than .JPG itself, since it uses the ability of PostScript Level 2 of decoding JPEG data.

Note: there is also a program called giftops which does GIF to PS translation, but this is very unefficient --- generated file is huge. It's better to conver GIF to JPEG and then used the jpeg2ps.

Hacking PostScript output from Adobe Driver

Here I discuss how to change the output from Adobe PostScript Driver. This is needed when you don't have the source text/picture/whatever ready, or when you get PS file for priting or including into a publication and it does not fit your printer or your needs. This driver is available for (as I know) Win 3.11 (works fine under Win-OS/2) --- it's better replacement of the default Microsoft PS driver, which is quite buggy. At least, I have found some bugs: generated PS was not PS compatible and it was not possible to print it. Story says that Adobe was so upset about the M$ driver that they offered M$ their driver as default for use in Win 9x or NT. Look into the header to see which one is it. Note: download is at www.adobe.com, section download, then PS drivers for Windows (the other are for Macintoshes).

Changing landscape/portrait or size of the plot

The structure of a postscript file produced is
...
beginning of PS file
...
/mysetup [ 0.24 0 0 -0.24 117.520 119.600 ] | 
...
Scale (thus size), angle and shift of the figure on the sheet are given by this definition of mysetup. The general notation is the following:
/mysetup [ scalex slope_baseline slope_backslanted scaley shiftx shifty ] |

where

Hacking PostScript output from Micro$oft PS driver for Win 3.11

This, sometimes buggy, is the default PS printer driver for Win 3.11. (Thus, it's default also in Win-OS/2). If you have not replaced it by the Adobe driver, see above, and want to change size or shift of a postscript file, then you may be interesting in the following. It will describe properties similar to those discussed for the Adobe driver above.

The structure of a postscript file produced by this driver is

...
beginning of PS file
...
%%EndSetup
SS
0 1 25 31 776 1169 300 SM
...
Shift and size of the figure on the sheet is given by the command SM. Its general notation is the following:
mirroring rotation  shiftx shifty  ashiftx ashifty  resolution  SM
where

Hacking PostScript output from Origin

Origin is a commercial scientific plotting program (2d graphs, 3d maps) for M$-Windows (version for 3.11 runs under OS/2 as well). Even though I do not use this program (I like gnuplot much more for its portability and speed), I'm getting plots made by this program in order to put them in publications. Some people produce figures under Win 3.11 with MS PS driver, the PS output from Origin, and the size / linestyles etc. are not convenient for you, then you may find the following information useful.

Changing landscape/portrait or size of the plot

...discussed a little bit above.

Changing linetypes directly in PS file

It may happen that you get a PS file from Origin, but the original data have been lost, or the person having them is unreachable. You desperately need to change
linetypes or linewidths
The trick is to search for lines with SP command, like
0 3 SP
General syntax is
linetype linewidth SP
where linetypes are 0 for solid; 1,2 for dashed; 3,5 for hatch; 5 for dotted line.
fonts
The trick is to search for font and SBcommands, like
32 0 0 156 156 0 1 1 50 /MSTT31c158 font
418 1030 31 (0) 31 SB
The meaning is the following:
? ? ? scaleX scaleY ? underline overline ? vertical_shift /MSTT31c158 font
x y width (text) ? SB
The values for underline, overline are 0 (no), 1 (yes). width determines the spaces (density) which is put in between characters. That crazy name /MSTT31c158 is a true type font name defined at the end of the file.
Example of putting Greek character Phi somewhere:
32 0 0 66 66 0 0 0 67 /Symbol font
1214 1737 50 (F) 50 SB

Hacking PostScript output from IDL

IDL is a scientific plotting program (2d graphs, 3d maps) for X-Windows. It is very expensive commercial program, but produces very nice maps. Here I describe some awful features of its postscript output, since I have got some PS figures from IDL to put into a publication.

fonts in IDL

That really terrible that IDL does not use PostScript fonts at all! Instead, it draws all characters by thin lines! As the result, the labels on the graph do not comply with the text used on other figures of the publications, shame on IDL! The worst thing is the these segments for characters are somewhere in the PS file undistinguishable from other curves, so that hacking is not possible at all.
Well, I never used IDL, so I do not know whether it is not possible to switch off IDL's characters and print the text using usual PS fonts with show command. If it is possible, then let me know, and shame to people not using that!

If you are putting your plots into a typesetting system, like TeX, then you should recalculate the Bounding box written in the header of the file. This is a general rule for nearly all PS-producing programs.

decreasing PS file size

Note: I was told that the latest IDL does not suffer from the problem mentioned further, so you will see whether it will work for you. Since I don't use IDL, I cannot tell you anything about its versions...
Did you notice has big are PS files representing maps? I really wonder that the authors did not look inside their creature:
  1. there are a lot of sequences x x x setrgbcolor (x is number) in black&white figures,
  2. there are trailing zeros in numbers!
Thus I wrote an awk script NoSetrgbcolorIDL.awk which takes an IDL PS file and replaces there
  1. x x x setrgbcolor strings by x K strings (K is IDL's abbreviation for setgray,
  2. x y z setrgbcolor strings by x y z k with new definition /k{setrgbcolor}bdef,
  3. 0.000 by 0, and wipes trailing zeros in decimal numbers.
This results in an enourmous reduction of the .ps file size (here I can see 25--30%, which are megabytes for large files. Quite important if you want to store the figures of the publication forever!

Hacking PostScript output from Matlab

Matlab is a system and language for numerical computations. Matlab is a commercial program.

There are several open source alternatives, where the most compatible is Octave. I use Octave, not Matlab, even though there is a multilicense for the university: I can have legal copies of Octaves on all my machines, including the home computer; Octave is a standard part of most Linux distributions; there was no Octave for OS/2 when I used heavily this OS; I find the "gset" commands for drawing more intuitive then Matlabish handles.

Convert Matlab's postscript files to Latin2 encoding (=allow Czech labels)

Users reported that Czech labels cannot be used in Matlab is it has no counterpart of "set encoding iso_8859_2" command of gnuplot alias "gset encoding iso_8859_2" in Octave. For them, I solved this problem. The following patch can be applied to an (encapsulated) postscript file from Matlab. It will add ISO Latin2 and CP1250 encoding vectors (as you may find in gnuplot postscript files) and redefine either of them (according to your default selection) as the default encoding vector for the text in the postscript file.

Here is the description and patch file MatlabEpsTo-CZencodings.diff.

(Don't wonder that I wrote it even of not using Matlab...)



Jokes

2*B||!2*B

I've implemented Hamlet's phrase and was amazed what does it really does mean!

Různé další vtípky




Last update: August 2005. Previous: May 2004.