<commit_before>#!/bin/sh

# Convert Yacas books to TeX
# Usage: book2txt.sh bookname.chapt
# result: bookname.chapt.tex

if [ x"$1" = x ]; then
	echo "Convert Yacas docs to TeX"
	echo "Usage: `basename $0` bookname.chapt [outputname.tex]"
else
if [ x"$2" = x ]; then
	target="$1.tex"
else
	target="$2"
fi
ourdir=`dirname $0`
if [ -r "$1" ]; then
	rm -f "$target"
	echo 'ToFile("'"$target"'") [ Use("'"$ourdir"'/book2TeX.ys"); Load("'"$1"'"); TeXFinishUp(); ];' | yacas -f
	if [ -s "$target" ]; then
		echo "File '$target' was created."<commit_msg>changed yacas path to always use src/yacas and --rootdir scripts/ rather than systemwide yacas (which may not be there)<commit_after>#!/bin/sh

# Convert Yacas books to TeX
# Usage: book2txt.sh bookname.chapt
# result: bookname.chapt.tex

if [ x"$1" = x ]; then
	echo "Convert Yacas docs to TeX"
	echo "Usage: `basename $0` bookname.chapt [outputname.tex]"
else
if [ x"$2" = x ]; then
	target="$1.tex"
else
	target="$2"
fi
ourdir=`dirname $0`
yacas="$ourdir/../src/yacas --rootdir $ourdir/../scripts/"

if [ -r "$1" ]; then
	rm -f "$target"
	echo 'ToFile("'"$target"'") [ Use("'"$ourdir"'/book2TeX.ys"); Load("'"$1"'"); TeXFinishUp(); ];' | $yacas -f
	if [ -s "$target" ]; then
		echo "File '$target' was created."
{'fraction_non_alphanumeric': 0.20935765265662173, 'fraction_numerical': 0.01586042823156225, 'mean_word_length': 4.151020408163265, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6231479', 'n_tokens_mistral': 531, 'n_tokens_neox': 507, 'n_words': 142}