Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline KHomola  
#1 Posted : 18 October 2013 20:58:29(UTC)
KHomola

Rank: Newbie

Groups: Registered
Joined: 16/10/2013(UTC)
Posts: 3
United States
Location: Jamestown, ND

Was thanked: 2 time(s) in 2 post(s)
In the Handbook included in the Reference Book (portable version), the Home button appears to do nothing. The Back button works like hitting the backspace key. The copy button seems to work correctly. Excellent handbook by the way.

Using Windows version

Edited by user 18 October 2013 21:43:40(UTC)  | Reason: Not specified

thanks 1 user thanked KHomola for this useful post.
on 18/10/2013(UTC)

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline mkraska  
#2 Posted : 18 October 2013 22:19:38(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: KHomola Go to Quoted Post
In the Handbook included in the Reference Book (portable version), the Home button appears to do nothing. The Back button works like hitting the backspace key. The copy button seems to work correctly. Excellent handbook by the way.

Using Windows version

Thanks for the feedback.

Some of these problems may be due to the fact that the external handbook pages are in edit mode. One can switch them to read only state in the file properties dialog but I am not going to do that manually for more than 400 pages. Here, some sort of batch file would be handy, to do the required source mod automatically. This also would enable following links just by clicking them instead of CTRL-Click. Volunteers to write such a script are welcome. I promise to apply it to the pages before publishing them in the portable distribution. One could even think of an export filter for TortoiseSVN.

Currently, the handbook is just a reverse engineered extension to the built-in math reference book without any official support by the main program, except some editing improvements in the last smath update in summer.

In the future, I would recommend/expect:
- jumping to the corresponding function description using F1 if on a function name (much like invoking the dynamic assistant using F12
- Seach capability within documents and in the help system
- Better support for editing links (currently, this is xml source editing)
- Sort of automatic table of contents based on directory hierarchy (currently, all up-, down- and crosslinking is done manually)
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Davide Carpi  
#3 Posted : 19 October 2013 02:02:57(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: mkraska Go to Quoted Post
Some of these problems may be due to the fact that the external handbook pages are in edit mode. One can switch them to read only state in the file properties dialog but I am not going to do that manually for more than 400 pages.

You can do it easily using this program: FAR

Because the <editable> attribute is optional, you need to enable the at leat one time the read-only attribute manually (for new pages) or using FAR (2nd screenshot; be careful with tabs, to avoid issues copy and paste the code from a sm file)


best regards,

Davide

Edited by user 19 October 2013 02:16:25(UTC)  | Reason: Not specified

Davide Carpi attached the following image(s):
2013-10-19 01_20_31-Find And Replace.png
2013-10-19 01_12_36-Find And Replace.png
2013-10-19 01_13_36-Find And Replace.png
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 19/10/2013(UTC)
Offline KHomola  
#4 Posted : 19 October 2013 02:50:06(UTC)
KHomola

Rank: Newbie

Groups: Registered
Joined: 16/10/2013(UTC)
Posts: 3
United States
Location: Jamestown, ND

Was thanked: 2 time(s) in 2 post(s)
Here's a script to make the .SM files in a folder read-only (both the file-system attribute and SMath attribute)

It's actually two scripts, the .bat file calls the .vbs and they must be in the same folder. I'm sure it could be done from one .vbs but I didn't want to take the time.

Usage: MakeAllSMfilesReadOnly <folder>

where <folder> is the full path and name of the folder containing the .sm files to make read-only

I assigned a right-click Send To command shortcut to it so I can just right-click the folder and Send to, Make SM files read only.

In case I cannot attach the files the code is also included below. Code is between separators ===...

MakeAllSMfilesReadOnly.bat
===========================================
@echo off
:: This script makes an SMath file read-only by adding the string <editable>false</editable>
:: to the <settings> section. This is the same as File, Properties, File Attributes, Read-only in SMath
Title=Make all SMath files in folder %1 read-only...
set spath=%~dp0
:: Might need to uncomment below for older systems
rem setlocal EnableExtensions
set ATTR=%~a1
set DIRATTR=%ATTR:~0,1%
rem endlocal
:: If %1 is a folder then continue
if /i "%DIRATTR%"=="d" (
echo.
echo Are you sure? [read title of this window - Ctrl-C to cancel]
echo.
pause
%~d1
cd %1
setlocal EnableDelayedExpansion
for /f "delims=|" %%i IN ('dir /b %1\*.sm'Wink DO (
set smfile="%%i"
echo.
echo Processing file [ %%i ]...
echo.
For /F "Delims=" %%j In ('Attrib !smfile!'Wink Do Set _Attribs=%%j
:: Remove read-only attribute, if set
If "!_Attribs:~5,1!"=="R" Attrib -R !smfile!
cscript "%spath%read-only-sm-file.vbs" !smfile!
:: Set read-only attribute
Attrib +R !smfile!
)
endlocal
) else (
echo.
echo %1 is NOT a folder
echo.
)
pause
:EOF
===========================================

read-only-sm-file.vbs
===========================================
' Modify SMath .sm file to make it read-only

Const ForReading = 1
Const ForWriting = 2

strFileName = Wscript.Arguments(0)
strOldText = "<settings>" & vbCrLf & " <identity>"
strNewText = "<settings>" & vbCrLf & " <editable>false</editable>" & vbCrLf & " <identity>"

On Error Resume Next
lngCount = Wscript.Arguments(3)
If Err.Number <> 0 Then lngCount = -1
On Error Goto 0

Set objFSO = CreateObject("Scripting.FileSystemObject"Wink
Set objFile = objFSO.OpenTextFile(strFileName, ForReading)
strText = objFile.ReadAll
objFile.Close

If Instr(1, strText, strOldText) > 0 Then
strNewText = Replace(strText, strOldText, strNewText, 1, lngCount)
Set objFile = objFSO.OpenTextFile(strFileName, ForWriting)
objFile.Write strNewText 'WriteLine adds extra CR/LF
objFile.Close
End If
===========================================
thanks 1 user thanked KHomola for this useful post.
on 19/10/2013(UTC)
Offline mkraska  
#5 Posted : 19 October 2013 20:40:07(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Thanks for the scripts. I just tried them (without the system attribute change part):

- links are activated by click instead of ctrl-click
- Buttons in the reference manual window are inactive

But:
- Nothing is re-calculated
- Plot regions are empty
- computed links (e.g. in the plugin index) are not updated according to the given installation
- Manual re-calculation does not work.

It might be a matter of taste, if this is an improvement. My personal preference is to still have an "active" book with the ctrl-click-drawback.

Andrey, do you see an option to resolve this?
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline vldmrrr  
#6 Posted : 03 February 2016 18:43:46(UTC)
vldmrrr

Rank: Newbie

Groups: Registered
Joined: 03/02/2016(UTC)
Posts: 2

Still no love for back button after two years. In current version (0.97) the buttons in included Reference book work as expected, but not in the "Interactive SMath Handbook".

Judging from the above discussion, the interactive nature of the handbook is not supported by design of the application. Is that correct? If so, maybe adding a specific feature request is justified?
Offline mkraska  
#7 Posted : 03 February 2016 21:10:57(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: vldmrrr Go to Quoted Post
Still no love for back button after two years. In current version (0.97) the buttons in included Reference book work as expected, but not in the "Interactive SMath Handbook".

Judging from the above discussion, the interactive nature of the handbook is not supported by design of the application. Is that correct? If so, maybe adding a specific feature request is justified?


The interactive handbook is based on reverse engineering of the built-in math reference book. Andrey has supported the interactive handbook by implementing some improvements for handling text regions with links. Davide's text region utilities helped a lot in simpler writing of handbook pages.

There is a function index, where all the pages have file names matching the function names. Thus, in principle, Andrey could offer you to open the appropriate file if you press F1 when the cursor is on a function name. But that is not implemented.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 04/02/2016(UTC)
Users browsing this topic
Guest
Similar Topics
Reference Book where is it (Questions)
by p3aul 23/04/2014 06:32:57(UTC)
Reference book? (Questions)
by omorr 03/07/2010 09:52:07(UTC)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.