forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem Importing a TEX File into an SVG file

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
John-Silver



Joined: 30 Jul 2013
Posts: 1226
Location: Aerospace Valley

PostPosted: Fri Aug 23, 2019 2:02 am    Post subject: Problem Importing a TEX File into an SVG file Reply with quote

Problem Importing a TEX File into an SVG file

EDIT(TED) #1 : 23/8/2019 around mid-day - TEX code used with sample program added, see in RED at bottom of post


(related to a previous post: http://forums.silverfrost.com/viewtopic.php?t=4061)

When I compile & run the following test program:-
Quote:
!
! ftn95-ex-svg_tex_eqn_gen-1b2.3a.f95 - IMPORT TEX OBJECT Only
!
INCLUDE <windows.ins>
!INCLUDE <clearwin.ins>

INTEGER i,icolor,ans

DOUBLE PRECISION X_OFFSET, Y_OFFSET, SCALE, WIDTH,HEIGHT

X_OFFSET = 0.0d+00
Y_OFFSET = 0.0d+00
SCALE = 1.0d+00


ans = open_svg@("sample2incleqn.svg",600,900)


CALL SAVE_TEX_SVG_CONVERSION@()

CALL IMPORT_TEX_OBJECT@("ftn95-Tex_ex_1a-NormCumDistrEq.tex",X_OFFSET,Y_OFFSET, SCALE,WIDTH,HEIGHT)

ans = close_svg@(0)

PRINT*, 'SVG image WIDTH = ',WIDTH
PRINT*, 'SVG image HEIGHT = ',HEIGHT



END


it runs fine without any runtime error.

Note: that the following is part of the output in the DOS window:-
Quote:
processing EPS file
graphic size: 598.235pt x 845.1575pt (210.255556mm x 297.038889mm)
output written to __SVGTEMP.svg
file converted in 0.303 seconds
SVG image WIDTH = -594.000000000
SVG image HEIGHT = -842.000000000


which is why I chose a IMPORT_TEX_OBJECT SVG window dimensions of 600 x 900 and zero offsets in the code, so the image fits within the 'SVG surface'
Opening the saved file: __SVGTEMP.svg by double-clicking, it open fine in an internet browser (for me Firefox) and the TEX equation is there.(*)

However, opening it in EditSVG, the SVG blank, white 'drawing surface' is visible, but not the equation.

Opening it with the 'crop' option from the menu produces no image at all not even just the 'blank page' (obviously (?) ... because it has cropped out everything, there being no equation image detected from the __SVGTEMP-svg file !)

The second file created: sample2incleqn.svg created by a simple IMPORT_TEX_OBJECT@ call
this time also shows nothing when double clicked to open it in the internet browser
The same ežwhen opening in EditSVG.

My conclusion is that:

1) there is some problem with Editsvg in reading in the svg file created by IMPORT_TEX_OBJECT

2) there is some problem with the creation of the second svg file: sample2incleqn.svg by IMPORT_TEX_OBJECT@ because it is neither cropped, nor does the equation appear in either an internet browser, nor in EditSVG.

... unless of course I've made a fundamental mistake.

An Observation:-

If you open both .svg files in Notepad you'll see that :-
the __SVGTEMP.svg file has all positive co-ordinates
while in sample2incleqn.svg all the co-ordinates are negative !

I knoweth not if this is significant and an indcation where the problem might be.

So, what am I doing wrong?

John-S
__________________________________
(*) note that I tried also opening it in a number of other SVG programs and it opened fine, albeit in some cases as a 'reversed ' image !

Edit #1 - I forgot the TEX code used with the sample program,.
it's the same as that in the documentation
It's also the code which fails to load within EditSVG via the menu 'OPEN TEX'

Quote:


\documentclass[12pt]{article}
\usepackage{amsmath,bm}
\pagestyle{empty}
\begin{document}
\Large
\[
\frac{1}{\sigma \sqrt{2\pi}}
\int\limits_{-\infty}^x
\exp -\left\{
\frac{1}{2} \left( \frac{t-\mu}{\sigma} \right)^2 \right\}\,dt
\]
\end{document}


_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "


Last edited by John-Silver on Fri Aug 23, 2019 2:04 pm; edited 9 times in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6071
Location: Salford, UK

PostPosted: Fri Aug 23, 2019 7:27 am    Post subject: Reply with quote

The author is preparing a sample program and I will aim to make it available on this thread.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1226
Location: Aerospace Valley

PostPosted: Fri Aug 23, 2019 10:47 am    Post subject: Reply with quote

Thank you,

I look forward to David's input.

You mentioned at the end of the other post Paul an example of calling calls EDITSVG_DRIVER routine, and subsequent 'messing about' interactively on the 'collage' rover.

What is more interesting for me would be an example showing how to programatically (not via EditSVG) to place the equation (previously created as a seperate file) precisely on a drawing surface (be it an svg one (or on the screen via a %gr maybe if that's possible?) would be ideal for my application.

Say with a single vertical object (say a square) in the middle of the page and the formula placedto it's left hand side ?

I suspect I'm barking up the 'it's impossible' tree, due to the apparent impossibility to programatically not interactively) crop the image, know it's dimensions, and how to consequntly place it in a precise location, ... but we'll see.
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2102
Location: South Pole, Antarctica

PostPosted: Sun Aug 25, 2019 11:57 pm    Post subject: Reply with quote

I tried this example and got totally empty screen. Produced SVG file i do not know how to see, none of my browsers show anything inside this file (Edge, Opera, Chrome, Firefox, Brave).

MicTEX produces image of formula on screen and in pdf file.

Full version of FTN95, June 6 update

/* This might be also because i hate TEX and TEX hates me.

We all have bad habits, this is given by DNA probably. I for example make billions of typos and recompilations. This is possibly why i like FTN95 - i find it smarter than me in cleaning my Fortran sources.

But within SF also exists bad tradition started with the Salford FTN90 in 90th to issue half-cooked software and let users report the bugs and polish its rough edges. Anyone in SF team worked on FTN90 ? This person/people have to pay attention to their bad habit and triple check everything before issuing anything new for consumers. I can also offer quality control via my codes-- send me your new versions and if my codes (which in 30 years with this compiler and 40 years total collect both legacy and new sources and use VAX extensions, something from old DBOS, Clearwin+, OpenGL in their 300 000 lines) are compiled and work OK -- then chances are that all is OK


Last edited by DanRRight on Sun Sep 08, 2019 2:41 am; edited 1 time in total
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1226
Location: Aerospace Valley

PostPosted: Sat Sep 07, 2019 2:01 am    Post subject: Reply with quote

Gosh I just relisd that we're already 2 weeks down the lin on this thread.

Any feedback from David yet Paul ?

About the specific bugs with Editsvg or with progress on creation of sample programs ?
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6071
Location: Salford, UK

PostPosted: Sat Sep 07, 2019 8:35 am    Post subject: Reply with quote

The authors (whose names I have not mentioned) are still working on this.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1226
Location: Aerospace Valley

PostPosted: Tue Sep 10, 2019 4:13 am    Post subject: Reply with quote

It would be useful to know from the authors (whoever they might be, and even though you haven't mentioned them) if there's a bug or not with the reading into EditSVG

And also to know what type of example problem(s) they're working on creating (you must be aware of that) so I know if my comments about that are being taken onboard or not, because you initial comment on that particular topic were in a direction at 90 deg. to the one I'm looking to go in, I think. That's not a criticism, I just don't want to 'hang around' waiting for something that might no appear . (I'm sue something very useful will appearwhatever it is).

I won't ask how long it might be before something consequential appears, because clearly we have a piece of string here of indeterminate length (again, that's no criticism of anyone by the way, it's just a fact of life with software)
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6071
Location: Salford, UK

PostPosted: Tue Sep 10, 2019 6:49 am    Post subject: Reply with quote

I suggest that we wait. I don't think that it will be long now. Any extra admin just slows down the development.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1226
Location: Aerospace Valley

PostPosted: Sat Sep 21, 2019 12:15 am    Post subject: Reply with quote

Here we are, another 2 weeks later .... what news brave bug-basher (that's you Paul) ?
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "


Last edited by John-Silver on Wed Sep 25, 2019 9:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1226
Location: Aerospace Valley

PostPosted: Wed Sep 25, 2019 9:12 pm    Post subject: Reply with quote

So, what update can you give us please on the status of this then Paul ?
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6071
Location: Salford, UK

PostPosted: Tue Oct 01, 2019 10:47 am    Post subject: Reply with quote

Unfortunately it has proved necessary to make changes to salflibc.dll and clearwin64.dll relating to TEX files. This means that we will need to wait until we have stable versions of these DLLs before providing an update on this topic.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1226
Location: Aerospace Valley

PostPosted: Tue Oct 01, 2019 8:30 pm    Post subject: Reply with quote

Thanks for the update Paul, I look forwrd to the updates.

Can you give us some brief idea of what the problem was ?

... and what do you men exactly by Stable DLLs release ? a formal update (8.5.2 ?) and will the perso version be updated at same time this time round with these changes in it ?

... and of course the 6 million dollar question ...... when ?
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group