Page 1 sur 1

printing Latex

Publié : mer. sept. 21, 2016 5:19 pm
par XcasEngGuy
Is there a way to not output levels that are grouped and hidden when producing Latex output?

Re: printing Latex

Publié : jeu. sept. 22, 2016 5:38 am
par parisse
No, you must edit manually the tex file.

Re: printing Latex

Publié : jeu. mars 09, 2017 4:46 pm
par XcasEngGuy
Could you put an identifiable text string in the tex file before and after grouped and hidden sections?

Re: printing Latex

Publié : jeu. mars 09, 2017 5:09 pm
par parisse
I'll try...

Re: printing Latex

Publié : dim. mars 26, 2017 12:29 am
par XcasEngGuy
Thank you. The more I use xcas the more I like it. I use in in teaching. I teach Mechanical Engineering at the University of Miami. The latex output is great for handouts and explanations.

Re: printing Latex

Publié : dim. mars 26, 2017 7:03 am
par parisse
It should be implemented now:

Code : Tout sélectionner

%% begin hidden group
and

Code : Tout sélectionner

%% end hidden group

Re: printing Latex

Publié : lun. avr. 10, 2017 2:44 am
par XcasEngGuy
Thank you.

I got to try it and it works very well. Here is a sample bash script

# remove hidden sections from xcas latex printout
if [ $# -eq 0 ] # if no args
then
echo "Usage: $0 <xcas latex filename>"
echo "backup of original latex file saved in xcas_strip_hidden.bk"
exit
fi
cp $1 xcas_strip_hidden.bk # save original .tex file
gawk '
BEGIN {
printflag=1
}
/%% begin hidden group/{
# print "found:", $0
printflag=0
}
/\\end\{document\}/{
printflag=1
}
/%% end hidden group/&&printflag==0{
# print "found:", $0
printflag=1
next
}
printflag==1{
print
}
' xcas_strip_hidden.bk >$1

works good in Cygwin