Latex preview
Modérateur : xcasadmin
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Latex preview
The file menu has a
File>LaTex>latex preview
command. In the
Cfg>General configuration
menu there is a "PS view" box in the dialog. It appears to be a place to put a command to create the preview. I can't figure out how to use it. I have a cygwin bash script that creates a PDF the way I like it ( I can hide grouped levels, show just resulting equations, etc.). Is there a way to run that script from inside Xcas (like click the File>LaTex>latex preview) by putting something in the "PS view" box. Actually I am open to any method to run my script from inside Xcas. I am running Win10 with 64bit Xcas and I have Cygwin installed.
Thanks,
Matt
File>LaTex>latex preview
command. In the
Cfg>General configuration
menu there is a "PS view" box in the dialog. It appears to be a place to put a command to create the preview. I can't figure out how to use it. I have a cygwin bash script that creates a PDF the way I like it ( I can hide grouped levels, show just resulting equations, etc.). Is there a way to run that script from inside Xcas (like click the File>LaTex>latex preview) by putting something in the "PS view" box. Actually I am open to any method to run my script from inside Xcas. I am running Win10 with 64bit Xcas and I have Cygwin installed.
Thanks,
Matt
Re: Latex preview
Xcas for windows has it's own minimal cygwin installation, independant from your own cygwin installation. You can certainly add bash scripts in the xcas directory and run them but they will only be able to run Windows programs and cygwin programs that are provided with this minimal installation.
I have no idea if it's possible to run another cygwin shell and it's own programs, perhaps it's possible to call your cygwin bash shell and pass arguments. Another possibility is try to run a windows batch script.
I have no idea if it's possible to run another cygwin shell and it's own programs, perhaps it's possible to call your cygwin bash shell and pass arguments. Another possibility is try to run a windows batch script.
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex preview
I will try those options. I think I can get it to work if I know how to use the "PS view" dialog box. I tried putting commands in the "PS view" dialog box and was not able to get any response when I click File>LaTex>latex preview.
Is the "PS view" script linked to some other menu command?
Matt
Is the "PS view" script linked to some other menu command?
Matt
Re: Latex preview
I just looked at the source code, the Preview PS field is only used if you print a session (or some levels) from the Print menu (moreover some parts seems disabled in win32), it does not apply to the Latex menu.
For latex preview under windows, Xcas is calling the scripts latex.bat and xdvi.bat from the Xcas directory. It should be easy to edit them and get what you want.
For latex preview under windows, Xcas is calling the scripts latex.bat and xdvi.bat from the Xcas directory. It should be easy to edit them and get what you want.
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex preview
Perfect. Thanks
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex preview
I modified:
latex.bat
to
rem set PATH=%PATH%;c:\Program Files\TeXLive\bin\win32
rem set TEXMFCNF=c:\Program Files\TeXLive\texmf-var\web2c
rem set TEXMFTEMP=c:\Program Files\TeXLive\temp
echo %1 %2 %3 %4 %5 %6 %7 %8 %9 >%USERPROFILE%\desktop\xcas_latex_info.txt
and
xdvi.bat
to
rem set PATH=%PATH%;c:\Program Files\TeXLive\bin\win32
rem set TEXMFCNF=c:\Program Files\TeXLive\texmf-var\web2c
rem set TEXMFTEMP=c:\Program Files\TeXLive\temp
echo %1 >%USERPROFILE%\desktop\xcas_xdvi_info.txt
neither file seems to run if I click the menu items in File>Print ir File>LaTex. If I run them independently from Explorer they produce the respective output files.
could you check if they run for you?
Thanks,
Matt
latex.bat
to
rem set PATH=%PATH%;c:\Program Files\TeXLive\bin\win32
rem set TEXMFCNF=c:\Program Files\TeXLive\texmf-var\web2c
rem set TEXMFTEMP=c:\Program Files\TeXLive\temp
echo %1 %2 %3 %4 %5 %6 %7 %8 %9 >%USERPROFILE%\desktop\xcas_latex_info.txt
and
xdvi.bat
to
rem set PATH=%PATH%;c:\Program Files\TeXLive\bin\win32
rem set TEXMFCNF=c:\Program Files\TeXLive\texmf-var\web2c
rem set TEXMFTEMP=c:\Program Files\TeXLive\temp
echo %1 >%USERPROFILE%\desktop\xcas_xdvi_info.txt
neither file seems to run if I click the menu items in File>Print ir File>LaTex. If I run them independently from Explorer they produce the respective output files.
could you check if they run for you?
Thanks,
Matt
Re: Latex preview
It does indeed not run the command. I could get it running by starting xcas from my cygwin64 bash (it's the same bash as in /c/xcas64).
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex preview
This is interesting. When I run from bash in cygwin and click File>LaTex>Latex preview, the commands
/xcas64/latex.bat /cygdrive/c/Users/Matt/Desktop/test_intg
/xcas64/xdvi.bat /cygdrive/c/Users/Matt/Desktop/test_intg &
get sent to stderr which I could redirect to sh or bash. Were you able to get them to run? I used both Windows cmd scripts and bash scripts in them and couldn't get a response.
Thanks,
Matt
/xcas64/latex.bat /cygdrive/c/Users/Matt/Desktop/test_intg
/xcas64/xdvi.bat /cygdrive/c/Users/Matt/Desktop/test_intg &
get sent to stderr which I could redirect to sh or bash. Were you able to get them to run? I used both Windows cmd scripts and bash scripts in them and couldn't get a response.
Thanks,
Matt
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex preview
I was trying to use grep in the xcas directory and got
missing cygpcre-1.dll
It appears the cygwin version is 2.0.0 (in cygwin1.dll). Do you know where I can find cygpcre-1.dll for that version?
(still working on this)
I think it would be great if I can effectively get a latex preview working from inside xcas. I'm kind of going in the back door right now. I noticed the runxcas.en script outputs the command for latex.bat to stderr every time I run "latex preview". I was going to grep it out of the output stream and use that to cause my script to run.
Thanks for spending time on this,
Matt
missing cygpcre-1.dll
It appears the cygwin version is 2.0.0 (in cygwin1.dll). Do you know where I can find cygpcre-1.dll for that version?
(still working on this)
I think it would be great if I can effectively get a latex preview working from inside xcas. I'm kind of going in the back door right now. I noticed the runxcas.en script outputs the command for latex.bat to stderr every time I run "latex preview". I was going to grep it out of the output stream and use that to cause my script to run.
Thanks for spending time on this,
Matt
Re: Latex preview
I have it on my hard drive. I'm afraid you will need other dlls from my cygwin install, I have therefore archived all cyg*dll from my /usr/bin here https://www-fourier.univ-grenoble-alpes ... ll.tar.bz2
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex preview
Thank you!
This will help I'm sure.
Matt
This will help I'm sure.
Matt
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex preview
I got the script modified to pipe just the command from stderr to a shell, but I can't get the pipe to flush until Xcas closes. Almost worked. Is there any way to reenable a call to a script in windows when I click "latex preview"?
Thanks again,
Matt
Thanks again,
Matt
Re: Latex preview
Sorry, I have no idea...
-
- Messages : 146
- Inscription : mer. janv. 13, 2010 3:20 pm
Re: Latex preview
Sorry, just one more question. When you said "I could get it running by starting xcas from my cygwin64 bash (it's the same bash as in /c/xcas64)." did you mean compiling Xcas in cygwin64 or just running stock Xcas from a cygwin64 bash window?
Matt
Matt
Re: Latex preview
I meant that I ran xcas from the same bash shell that I used to compile Xcas.