-- load the keyset as before. If Czech.E is used, then czech_is holds the state
-- New keys switching implemented on 18.1.1998 (Greek switched off spell checking):
-- Unfortunately, neither or these 2 work: keys 'edit_keys' .keyset=cstex_prev_keyset
-- and thus doing it explicitly:
-- InfoBox('cstex_prev_keyset',cstex_prev_keyset)
-- sayerror 'cstex_prev_keyset='cstex_prev_keyset
-- if cstex_prev_keyset='EDIT_KEYS' then keys edit_keys
if cstex_prev_keyset='EDIT_KEYS' then
if czech_is=1 then keys czech_keys
elseif czech_is=2 then keys czech_switch
else keys edit_keys
endif
elseif cstex_prev_keyset='SPELL_KEYS' then keys spell_keys
elseif cstex_prev_keyset='CZECH_KEYS' then keys czech_keys
elseif cstex_prev_keyset='CZECH_SWITCH' then keys czech_switch
elseif cstex_prev_keyset='PM_GREEKKEYS' then keys edit_keys -- this should not happen!
else ErrorBox('Sorry, the previous keyset is uknown','Please, modify the end of the routine pm_TypeGreek() in CSTeX.e (part ... elseif cstex_prev_keyset= ...) for the keyset 'cstex_prev_keyset)
endif
-- This was the old (until 18.1.1998) keys switching:
Wait a little bit. I don't know how to put a DOS prog into window
without STARTing it.
Note: this routine is no more use; it was in use when calling some DOS
programs in the Czech version.
*/
COMPILE IF CSTEX_CSTEX=1
DEFPROC PleaseRelax ()
InfoBox('Please relax...','Wait till the program finishes. I do not know how to run DOS windowed program and wait till it finishes. Please send me the solution if you know it.')
return
COMPILE ENDIF
DEFC cstex_texit
universal pm4epm_MasterNotFound, cstex_reLaTeXed
parse arg action x
if action='S' then
i=length(.filename)
if (i>4) and (upcase(substr(.filename,i-3,4))='.LOG') -- update 28.5.1996
then e='% MASTER: 'substr(.filename,1,i-4)'.tex'
insertline e,1
N=pm_expansion('%format.cmd %N') -- you edit .log file, thus name only
else N=pm_expansion('%format.cmd %.N') -- full name
endif
if pm4epm_MasterNotFound=1 then return ''; endif
save_the_ring()
e=get_env('EMTEXOPT'); -- now cool tricks to set up EMTEXOPT environmental variable
if (words(e)>0) then e=e' ' endif
e=e''pm_expansion('%optsemtex')
if (words(e)=0) then e=N; else e='(set EMTEXOPT='e') & 'N; endif
COMPILE IF CSTEX_USEMASTERDIR=1
e=pm_expansion('%h & (cd %d) &')''e -- 4.1.1997
COMPILE ENDIF
'start /c /win /f cmd.exe /c "'e'"'
cstex_reLaTeXed=1 -- information for cstex_next_error
if action='S' then call cstex_dvips(opts,0); beep(440,1)
elseif action='I' then sayerror cstex_dvips_inf
endif
DEFC cstex_dvips_pause
parse arg action opts
if action='S' then call cstex_dvips(opts,1); -- beep(440,1)
elseif action='I' then sayerror cstex_dvips_inf
endif
DEFC cstex_gvpm
parse arg action x
if action='S' then
Master=cstex_dvips('',0)
if Master<>'' then 'start gvpm 'Master'.ps' endif
endif
DEFC cstex_psview
parse arg action x
if action='S' then Master=cstex_dvips('',0);
if Master<>'' then 'pm_command_cmd S psview.cmd %M.ps' endif
endif
DEFC cstex_about
InfoBox('This is pmCSTeX for EPM','Version 16. 4. 2000'\13\13'Developed by Petr Mikulík'\13\13' Dept. of Solid State Physics, and'\13' Lab. Thin Films & Nanostructures'\13' Masaryk University'\13' Brno, Czech Republic'\13\13'pmCSTeX for EPM resides at http://www.sci.muni.cz/~mikulik/os2/')
DEFC cstex_view_pmCSTeXINF
-- Note: this routine works if the EPM has been compiled with WANT_SEARCH_PATH
s=search_path(get_env('EPMPATH'),'pmCSTeX.INF')
'start view 's'pmCSTeX.INF'
DEFC cstex_viewINF
-- if "view LaTeX2e.INF" works from the command line, then this one works too:
parse arg action x
if action='S' then 'start view 'x
endif
DEFC cstex_bugs
WinMessageBox('This is pmCSTeX for EPM','Please address your bug reports, suggestions, comments, congratulations, improvements and solutions by e-mail to the author: mikulik@physics.muni.cz',MB_OK + MB_MOVEABLE +MB_ERROR)
s=updir'\units\'Name -- there could be my .h files
if EXIST(s)=0 then s='\emtex\texinput\'Name -- there could be my .tex or .sty files
if EXIST(s)=0 then s='\emx\include\'Name -- look for GNU C/C++ files
if EXIST(s)=0 then s='\emx\include\cpp\'Name -- look for GNU C/C++ files
if EXIST(s)=0 then s='\emx\include\sys\'Name -- look for GNU C/C++ files
if EXIST(s)=0 then s='\emx\include\cpp\gen\'Name -- look for GNU C/C++ files
endif endif endif endif endif endif endif
*/
-- now open it if exists
getfileid Lid, s -- is that file in ring?
if Lid<>'' then activatefile(Lid); return; endif
if EXIST(s)<>0
then 'edit 's;
else ErrorBox('Sorry','File 'Name' not found.'\13\13'You can try to edit CSTeX.e, routines cstex_WhereExists and cstex_include, to supply your favourite paths and extensions.')
endif
elseif action='I' then sayerror cstex_include_inf
endif
/* Cykl is obsolete now
DEFC cstex_cykl
universal pm4epm_MasterNotFound
parse arg action
if action='S' then
-- 'pm_command_cmd S cykl! %.W call %format.cmd %.N'
nextfile -- 23.1.1997: nextfile + toggle is works, otherwise badly.
'a_togl_hilit S' -- It seems that 'a_togl_hilit S' is multi-threaded, so up
endfor -- to now the last nextfile was not executed.
sayerror ' '
elseif action='I' then sayerror cstex_highlight_all_inf
endif
DEFC cstex_save_all
parse arg action x
if action = 'S' then
sayerror ''
call save_the_ring()
elseif action='I' then sayerror cstex_save_all_inf
endif
COMPILE IF CSTEX_CSTEX=1
COMPILE IF CSTEX_CS2CS=1
DEFC CStoCS
-- CS2CS using OS/2 program
w=.filename -- pm_expansion('%.W') -- 4.1.1997
'save 'w -- save
CP='*CP852 (PC Latin II - CP 852)*KEYBCS2 (podle Kamenickych)*CP850 (PC Latin I - CP 850)*IBM852 (Latin II - IBM 852)*ISO-8859-1 (ISO-8859-1 Latin 1)*ISO-8859-2 (ISO-8859-2 Latin 2)*TEX1 (TeX, \v{C})*TEX2 (TeX, \v C)*CORKY (podle Corky)*CP1250 (MS-Windows - CP 1250)*KOI8-CS (KOI8-CS)*MAC (Macintosh)*'
'pm_command_os2 S dvi'hpljcnf'.cnf // %viewopts %M 'outfile
COMPILE ENDIF
DEFC cstex_print
parse arg action args
if action='S' then cstex_print(args,'prn')
endif
DEFC cstex_printfile
parse arg action args
if action='S' then cstex_print(args,'%M.pri')
endif
COMPILE IF PM_DICTIONARIES=1
DEFC pm_change_dictionary
universal ADDENDA_FILENAME
universal DICTIONARY_FILENAME
parse arg action which
if action='S' then
e=get_env('EPM_DICTIONARIES')
if (e='') then e='\apps\epm\';
else if (substr(e,length(e),1)<>'\') then e=e'\' endif
endif
dic=e''which'.dic'
if not(EXIST(dic)) then
ErrorBox('Sorry---Error','Cannot find file 'dic'. Please copy the dictionary 'which'.dic into the directory specified by EPM_DICTIONARIES.'); return; endif
DICTIONARY_FILENAME=dic
dic=e''which'.adl'
if not(EXIST(dic)) then
InfoBox('Warning','Cannot find file 'dic'. This is your personal dictionary, thus maybe this does not exist yet ('which'.adl should be in the directory specified by EPM_DICTIONARIES).'); endif
ADDENDA_FILENAME=dic
endif
COMPILE ENDIF
/*************************** BUILD CSTEX MENU *********************/
DEFC BuildCSTeXMenu
universal defaultmenu,
app_hini
,DICTIONARY_FILENAME
defaultmenu = 'default'
-- Note for accelkeys: 'cstex_texit'1\'Preview Document'\9'Sh+F11'
idcount = 6940 -- start value of counter of ids
cstexid = 1969 -- registration id of the CSTeX menu
/*
Cykl is obsolete now
cstex_cykl_inf = '(La)TeX forever on the master file when working file changed'
*/
id=idcount -- Note: center hotkeys right: 'Texujx'\9'Sh+F12'
buildsubmenu defaultmenu, cstexid, 'CS~TeX', \1'Menu for (La)TeXing', 0,0
id=id+1; buildmenuitem defaultmenu, cstexid, id, 'PM Preview before print', ' '\1'Preview document by dvipm with @_theprinter_.cnf and VIEWOPTS:',17+64,0
id=id+1; buildmenuitem defaultmenu, cstexid, id, 'FS Preview before print', ' '\1'Preview document by dviscr with @_theprinter_.cnf and VIEWOPTS:',17+64,0
-- id=id+1; buildmenuitem defaultmenu, cstexid, id, 'Make~Index', 'pm_command_os2 S 'worldindex' %M'\1''worldindex' program (make index of course)', 0,0
id=id+1; buildmenuitem defaultmenu, cstexid, id, 'Make~Index', 'DoMakeindex S'\1''worldindex' program (make index of course)', 0,0