Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
657cb148
Kaydet (Commit)
657cb148
authored
Ock 13, 1998
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
After discussion with Guido, agreed to only support double-sided PostScript,
so we'll not need this shell whackery after all.
üst
dca8792b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
95 deletions
+0
-95
texoption.sh
Doc/texoption.sh
+0
-95
No files found.
Doc/texoption.sh
deleted
100755 → 0
Dosyayı görüntüle @
dca8792b
#! /bin/sh
#
# Script to convert LaTeX2e documents to & from having a \documentclass{}
# option.
VERBOSE
=
false
SETOPTION
=
true
FILES
=
`
echo
???.tex
`
usage
()
{
exec
>
&2
echo
"usage:
$0
[-d] [-v] option [files...]"
echo
echo
"
\t
-d disable option, if present"
echo
"
\t
-v tell which files are being edited, and how"
echo
echo
"
\t
By default, files... will be '???.tex'."
echo
"
\t
This will match each of the Python manuals."
echo
exit
2
}
editing
()
{
# tell the user what we're doing
if
$VERBOSE
;
then
echo
$1
$FILE
...
fi
}
addoption
()
{
# add an option not already present
editing
"adding to"
(
sed
's/^\(\\documentclass[[].*\)]/\1,'
$OPTION
']/
s/^\\documentclass{/\\documentclass['
$OPTION
']{/'
$FILE
>
temp-
$$
\
&&
mv
temp-
$$
$FILE
)
||
exit
$?
}
remoption
()
{
# remove an option currently on
editing
"removing from"
(
sed
's/^\(\\documentclass[[].*\),'
$OPTION
'\([],]\)/\1\2/
s/^\\documentclass[[]'
$OPTION
']/\\documentclass{/
s/^\\documentclass[[]'
$OPTION
',/\\documentclass[/'
$FILE
>
temp-
$$
\
&&
mv
temp-
$$
$FILE
)
||
exit
$?
}
chkoption
()
{
# return true iff the option is already on
egrep
'^\\documentclass[[]([A-Za-z0-9]*,)*'
$OPTION
'[],]'
$FILE
>
/dev/null
return
$?
}
# parse the command line...
while
[
"$#"
-gt
0
]
;
do
case
"
$1
"
in
-d
)
SETOPTION
=
false
shift
;;
-v
)
VERBOSE
=
true
shift
;;
-
*
)
usage
;;
*
)
break
;
;;
esac
done
if
[
-z
"
$1
"
]
;
then
usage
fi
# setup variables
OPTION
=
"
$1
"
shift
FILES
=
${
1
:+
$*
}
if
[
"
$FILES
"
=
''
]
;
then
FILES
=
`
echo
???.tex
`
fi
# check each file and do the work as required
for
FILE
in
$FILES
;
do
if
chkoption
;
then
if
$SETOPTION
;
then
:
else
remoption
fi
elif
$SETOPTION
;
then
addoption
fi
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment