printing Latex

Messages in english

Modérateur : xcasadmin

XcasEngGuy
Messages : 146
Inscription : mer. janv. 13, 2010 3:20 pm

printing Latex

Message par XcasEngGuy » mer. sept. 21, 2016 5:19 pm

Is there a way to not output levels that are grouped and hidden when producing Latex output?

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: printing Latex

Message par parisse » jeu. sept. 22, 2016 5:38 am

No, you must edit manually the tex file.

XcasEngGuy
Messages : 146
Inscription : mer. janv. 13, 2010 3:20 pm

Re: printing Latex

Message par XcasEngGuy » jeu. mars 09, 2017 4:46 pm

Could you put an identifiable text string in the tex file before and after grouped and hidden sections?

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: printing Latex

Message par parisse » jeu. mars 09, 2017 5:09 pm

I'll try...

XcasEngGuy
Messages : 146
Inscription : mer. janv. 13, 2010 3:20 pm

Re: printing Latex

Message par XcasEngGuy » dim. mars 26, 2017 12:29 am

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.

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: printing Latex

Message par parisse » dim. mars 26, 2017 7:03 am

It should be implemented now:

Code : Tout sélectionner

%% begin hidden group
and

Code : Tout sélectionner

%% end hidden group

XcasEngGuy
Messages : 146
Inscription : mer. janv. 13, 2010 3:20 pm

Re: printing Latex

Message par XcasEngGuy » lun. avr. 10, 2017 2:44 am

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

Répondre