summaryrefslogtreecommitdiff
path: root/support/shlatex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/shlatex
Initial commit
Diffstat (limited to 'support/shlatex')
-rw-r--r--support/shlatex/GPL.TXT287
-rw-r--r--support/shlatex/README51
-rw-r--r--support/shlatex/TODO.TXT10
-rw-r--r--support/shlatex/en/CHANGELOG.TXT51
-rw-r--r--support/shlatex/en/README.TXT38
-rw-r--r--support/shlatex/en/ShLaTeX1610
-rw-r--r--support/shlatex/en/install102
-rw-r--r--support/shlatex/en/man/cman21
-rw-r--r--support/shlatex/en/man/shlatex.1.bz2bin0 -> 3268 bytes
-rw-r--r--support/shlatex/en/man/shlatex.pdfbin0 -> 95707 bytes
-rw-r--r--support/shlatex/en/test/biblio.bib7
-rw-r--r--support/shlatex/en/test/externe.tex3
-rw-r--r--support/shlatex/en/test/test15
-rw-r--r--support/shlatex/en/test/test.tex68
-rw-r--r--support/shlatex/en/uninstall38
-rw-r--r--support/shlatex/fr/CHANGELOG.TXT165
-rw-r--r--support/shlatex/fr/README.TXT40
-rw-r--r--support/shlatex/fr/ShLaTeX1617
-rw-r--r--support/shlatex/fr/install102
-rw-r--r--support/shlatex/fr/man/cman21
-rw-r--r--support/shlatex/fr/man/shlatex.1.bz2bin0 -> 3521 bytes
-rw-r--r--support/shlatex/fr/man/shlatex.pdfbin0 -> 96868 bytes
-rw-r--r--support/shlatex/fr/test/biblio.bib7
-rw-r--r--support/shlatex/fr/test/externe.tex2
-rw-r--r--support/shlatex/fr/test/test15
-rw-r--r--support/shlatex/fr/test/test.tex63
-rw-r--r--support/shlatex/fr/uninstall38
-rw-r--r--support/shlatex/misc/logo.jpgbin0 -> 15362 bytes
-rw-r--r--support/shlatex/src/tex8to7.c390
29 files changed, 4761 insertions, 0 deletions
diff --git a/support/shlatex/GPL.TXT b/support/shlatex/GPL.TXT
new file mode 100644
index 0000000000..a8fdb685e1
--- /dev/null
+++ b/support/shlatex/GPL.TXT
@@ -0,0 +1,287 @@
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software,
+and (2) offer you this license which gives you legal permission to
+copy, distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on,
+we want its recipients to know that what they have is not the
+original, so that any problems introduced by others will not reflect
+on the original authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at
+all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the Program
+(independent of having been made by running the Program). Whether that
+is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software
+ interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new
+versions of the General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Program does not specify a
+version number of this License, you may choose any version ever
+published by the Free Software Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the
+author to ask for permission. For software which is copyrighted by
+the Free Software Foundation, write to the Free Software Foundation;
+we sometimes make exceptions for this. Our decision will be guided by
+the two goals of preserving the free status of all derivatives of our
+free software and of promoting the sharing and reuse of software
+generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
diff --git a/support/shlatex/README b/support/shlatex/README
new file mode 100644
index 0000000000..214770d9ff
--- /dev/null
+++ b/support/shlatex/README
@@ -0,0 +1,51 @@
+ShLaTeX version 1.2b -- LaTeX compilation script for Linux.
+Copyright (C) 2003 Mael Hilléreau (mael.hillereau@free.fr)
+
+
+Instructions :
+--------------
+
+Goto the sub-directory corresponding to the language you want to use and then
+read the file called "README.TXT"...
+
+
+Directory structure : Description :
+------------------------------------------------------------------------------
+shlatex-1.2b
+|-- GPL.TXT GNU General Public Licence
+|-- README.TXT This file
+|-- TODO.TXT Supposed future features of the program
+|-- en English version of the script
+| |-- CHANGELOG.TXT
+| |-- README.TXT
+| |-- ShLaTeX
+| |-- install
+| |-- man Manual in PDF and Linux 'man page' formats
+| | |-- cman
+| | |-- shlatex.1.bz2
+| | `-- shlatex.pdf
+| |-- test A small test
+| | |-- biblio.bib
+| | |-- externe.tex
+| | |-- test
+| | `-- test.tex
+| `-- uninstall
+|-- fr French version of the script
+| |-- CHANGELOG.TXT
+| |-- README.TXT
+| |-- ShLaTeX
+| |-- install
+| |-- man French manual
+| | |-- cman
+| | |-- shlatex.1.bz2
+| | `-- shlatex.pdf
+| |-- test A small test
+| | |-- biblio.bib
+| | |-- externe.tex
+| | |-- test
+| | `-- test.tex
+| `-- uninstall
+|-- misc Misc stuff
+| `-- logo.jpg
+`-- src C sources of the tex8to7 program
+ `-- tex8to7.c
diff --git a/support/shlatex/TODO.TXT b/support/shlatex/TODO.TXT
new file mode 100644
index 0000000000..febca805fd
--- /dev/null
+++ b/support/shlatex/TODO.TXT
@@ -0,0 +1,10 @@
+List of the future improvings of ShLaTeX :
+
+- Try to find a solution to the problem of figures not having a boundingbox
+directly in the source. (a solution could be to do the stuff by searching the
+\includegraphics commands.)
+- Create an option for using ispell with the script.
+- Make it possible to save preferences as well as the name of a latex source
+file in a kind of "makefile", stored in the calling directory. This "makefile"
+would act in addition of the standard ".shlatex" file in the home directory. Its
+name may be "ShLaTeX", "Shlatex", "shlatex" or something like this...
diff --git a/support/shlatex/en/CHANGELOG.TXT b/support/shlatex/en/CHANGELOG.TXT
new file mode 100644
index 0000000000..4d94dc1808
--- /dev/null
+++ b/support/shlatex/en/CHANGELOG.TXT
@@ -0,0 +1,51 @@
+------ v1.2b ------
+
+o 21/08/2003 15:15
+ - Fixed a bug in tex8to7.
+ - CTRL^C are now supported.
+
+o 17/08/2003 00:36
+ - Fixed the following bug: concatenation in the dvipdf, dvips and ps2pdf log
+ files.
+
+o 06/08/2003 14:35
+ - New version of tex8to7 (v1.1c).
+
+o 05/08/2003 00:15
+ - Fixed the bug existing with bib file having a different name from the tex
+ file.
+ - Modification of the test in order to use such a bib file.
+
+
+------ v1.2a ------
+
+o 22/07/2003 13:47
+ - Fixed a bug with external files handling.
+
+o 21/07/2003 23:20
+ - A bug fixed in tex8to7 (problem with "\\{" and imbricated quotation
+ marks).
+ - The external files may now be stored in a directory different from the
+ directory of the main source file.
+
+o 17/07/2003 21:30
+ - The TODO.TXT files have merged into a single file having the same name and
+ being placed at the root of the project only in english language.
+
+o 09/07/2003 00:50
+ - The install and uninstall scripts have been changed in order to be more
+ flexible. They now check the presence of the files necessary to the
+ installation procedure.
+
+
+------ v1.2 ------
+
+o 03/07/2003 23:35
+ - Release of the first english version.
+
+
+------ v1.1b ------
+
+[...]
+
+(see the french version for older changelog)
diff --git a/support/shlatex/en/README.TXT b/support/shlatex/en/README.TXT
new file mode 100644
index 0000000000..b0144cd569
--- /dev/null
+++ b/support/shlatex/en/README.TXT
@@ -0,0 +1,38 @@
+ShLaTeX version 1.2b-en -- LaTeX compilation script for Linux.
+Copyright (C) 2003 Mael Hilléreau (mael.hillereau@free.fr)
+
+This program is under the terms of the GNU General Public Licence. The GNU GPL
+is supplied with this program (file "GPL.TXT").
+
+o Install :
+ open a root session and execute the "install" script.
+
+o Uninstall :
+ open a root session and execute the "uninstall" script.
+
+o Manual Installation :
+
+ If you don't have the root's rights, you may use ShLaTeX like this :
+
+ - Compile the "tex8to7" program :
+
+ cd ../src
+ gcc tex8to7.c -o tex8to7
+
+ the file "tex8to7" is now created.
+
+ - Copy the "ShLaTeX" script and the file "tex8to7" in an accessible directory
+ (i.e. which is in the PATH environment variable).
+
+ cp tex8to7 <dir>
+ cp ../en/ShLaTeX <dir>
+
+ where <dir> is the directory you'll have choosen.
+
+ - Change this files's rights in order to execute them :
+
+ cd <dir>
+ chmod 755 tex8to7 ShLaTeX
+
+ - You may now use the script...
+
diff --git a/support/shlatex/en/ShLaTeX b/support/shlatex/en/ShLaTeX
new file mode 100644
index 0000000000..f0ea2855d9
--- /dev/null
+++ b/support/shlatex/en/ShLaTeX
@@ -0,0 +1,1610 @@
+#!/bin/bash
+###############################################################################
+# #
+# ShLaTeX #
+# #
+###############################################################################
+# #
+# Author: Mael Hilléreau #
+# Mail: mael.hillereau@free.fr #
+# Web: http://mael.hillereau.free.fr #
+# Creation : 06/03/2003 #
+# Last modif.: 21/08/2003 #
+# Version: 1.2a-en #
+# Description: LaTeX compilation script for Linux #
+# #
+###############################################################################
+# #
+# ShLaTeX -- LaTeX compilation script for Linux. #
+# Copyright (C) 2003 Mael Hilléreau #
+# #
+# This program is free software; you can redistribute it and/or #
+# modify it under the terms of the GNU General Public License #
+# as published by the Free Software Foundation; either version 2 #
+# of the License, or (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program; if not, write to the Free Software #
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
+# #
+###############################################################################
+
+nomshell=`expr match "$0" '.*/\([^-\]*\).*'`;
+version="1.2b-en";
+
+## envoi du code de retour approprié
+function fin() {
+ echo -ne "done.\n\n";
+ if [ $errindex -eq 1 ]
+ then
+ exit 3;
+ else
+ if [ $errbib -eq 1 ]
+ then
+ exit 2;
+ else
+ if [ $errcompil -eq 1 ]
+ then
+ exit 1;
+ else
+ exit 0;
+ fi
+ fi
+ fi
+}
+
+## suppression des temporaires
+function suppressionTemp() {
+ if [ $tmp -eq 0 ]
+ then
+ echo "deletion of latex temporary files...";
+ rm -fr ./"$f".ShLaTeX
+ fi
+}
+
+## fct de rappel pour CTRL^C
+function ctrlc() {
+ echo -ne "\n> Cancel!\n";
+ if [ ! "$f" == "-" ]
+ then
+ repCourant=`pwd`;
+ repCourant=`expr match "$repCourant" '.*/\(.*\)'`
+ if [ "$repCourant" == "$f".ShLaTeX ]
+ then
+ cd ..;
+ fi
+ suppressionTemp;
+ fi
+ fin;
+}
+
+## déclaration des variables globales
+
+# nom du fichier
+f="-";
+
+# codes d'erreur
+errindex=0;
+errcompil=0;
+errbib=0;
+
+# options préférencielles
+P_dvipdf=-1;
+P_pdflatex=-1;
+P_dvips=-1;
+P_pstopdf=-1;
+P_dvi=-1;
+P_idx=-1;
+P_no_idx=-1;
+P_idx_file="-";
+P_bib=-1;
+P_no_bib=-1;
+P_bib_file="-";
+P_toc=-1;
+P_no_toc=-1;
+P_tmp=-1;
+P_no_tmp=-1;
+P_z=-1;
+P_no_z=-1;
+P_un=-1;
+P_deux=-1;
+P_quatre=-1;
+P_sep=-1;
+P_no_sep=-1;
+P_m=-1;
+P_no_m=-1;
+P_view=-1;
+P_no_view=-1;
+P_sept=-1;
+P_huit=-1;
+P_v_ps="-";
+P_v_pdf="-";
+P_v_dvi="-";
+
+# options de la ligne de commande
+L_dvipdf=-1;
+L_pdflatex=-1;
+L_dvips=-1;
+L_pstopdf=-1;
+L_dvi=-1;
+L_idx=-1;
+L_no_idx=-1;
+L_idx_file="-";
+L_bib=-1;
+L_no_bib=-1;
+L_bib_file="-";
+L_toc=-1;
+L_no_toc=-1;
+L_tmp=-1;
+L_no_tmp=-1;
+L_z=-1;
+L_no_z=-1;
+L_un=-1;
+L_deux=-1;
+L_quatre=-1;
+L_sep=-1;
+L_no_sep=-1;
+L_m=-1;
+L_no_m=-1;
+L_view=-1;
+L_no_view=-1;
+L_sept=-1;
+L_huit=-1;
+L_v_ps="-";
+L_v_pdf="-";
+L_v_dvi="-";
+
+## options d'éxécution
+mode="dvi";
+idx=0;
+idx_file="-";
+bib=0;
+bib_file="-";
+toc=1;
+tmp=0;
+z=0;
+ppf=1;
+sep=0;
+m=0;
+view=1;
+ascii=7;
+v_ps="gv";
+v_pdf="gv";
+v_dvi="xdvi";
+
+## capture des CTRL^C
+trap "ctrlc" SIGINT
+
+## affiche une aide rapide
+function aideRapide() {
+ echo -ne "> Usage :\n";
+ echo -ne "\n";
+ echo -ne " $nomshell [options] <file.tex>\n";
+ echo -ne "\n";
+ echo -ne " hit \"man shlatex\" or \"$nomshell -?\" for more help.\n";
+ echo -ne "\n";
+}
+
+## affiche une aide complète
+function aideComplete() {
+echo ".TH \\fBShLaTeX\\fP 1 \"August 2003\" \"version 1.2b\" \"User Manual\"
+
+.SH NAME
+\\fBShLaTeX\\fP \\- Compilation script for documents written in LaTeX language.
+
+.SH SYNOPSIS
+\\fBShLaTeX\\fP [options] \\fIsourceFile.tex\\fP
+
+.SH DESCRIPTION
+.PP
+ This script allows to centralize the many program calls necessary to
+completely compile a LaTeX document. In particular, the multiple calls of the
+\\fBlatex\\fP command necessary in order to create a table of contents, a
+bibliography or an index are carried out automatically. Are also managed the
+call of the programs \\fBbibtex\\fP and \\fBmakeindex\\fP as well as the
+vizualisation of the resulting file (in DVI, PostScript or PDF format) by
+calling an external program.
+.PP
+ It is possible to compile documents wich use the \\fB\\input\\fP and
+\\fB\\include\\fP commands to make references to some external files and that in a
+transparent way by compiling only the main source file.
+.PP
+ Once compilation done, the temporary files are erased (option \\fB-no-tmp\\fP)
+or preserved (option \\fB-tmp\\fP). The DVI file generated by LaTeX can then
+directly be converted to the PostScript or PDF formats.
+.PP
+ This script also provides the stressing of the French characters by the
+intermediary of an external C program (named \\fBtex8to7\\fP) and provided with
+the script. It also manages the C cedilla as well as the replacement of the
+quotation marks by the \\fB\\\\og\\fP and \\fB\\\\fg\\fP commands (supposing that the
+quotation marks are coupled). The quotation marks may be imbricated by using
+accodances for distinguishing the different quotation mark couples. For example,
+the text :
+.PP
+ The quotation marks \"may be {\"imbricated\"} by using accodances\".
+.PP
+ is a correct example.
+.PP
+ The default options (preferences) are saved in the personal directory of the
+user, in the file \\fB~/.shlatex\\fP. See section FILES to know the synthax of
+this file.
+.SH OPTIONS
+.IP \"\\fB\\-dvipdf\\fP\"
+Select a PDF format instead of the DVI format for the resulting file. The
+program \\fBdvipdf\\fP is used for converting.
+.IP \"\\fB\\-pdflatex\\fP\"
+Select a PDF format instead of the DVI format for the resulting file. The
+program \\fBpdflatex\\fP is directly used to create the resulting file.
+.IP \"\\fB-dvips\\fP\"
+Select a PostScript format instead of the DVI format for the resulting file. The
+program \\fBdvips\\fP is used for converting.
+.IP \"\\fB-ps2pdf\\fP\"
+Select a PDF format instead of the PaostScript format for the resulting file.
+This option uses the \\fB-dvips\\fP option. The programs \\fBdvips\\fP and
+\\fBps2pdf\\fP are successively used for conversion and the PostScript file is
+keeped after conversion.
+.IP \"\\fB-dvi\\fP\"
+Select a DVI format for the resulting file.
+.IP \"\\fB-idx\\fP \\fI[style.ist]\\fP or \\fB--index\\fP \\fI[style.ist]\\fP\"
+Enable the creation of the index (using the \\fImakeidx\\fP latex module). The
+optionnal file \\fIstyle.ist\\fP is a style file for \\fBmakeindex\\fP.
+.IP \"\\fB-no-idx\\fP or \\fB--no-index\\fP\"
+Disable the creation of the index.
+.IP \"\\fB-bib\\fP \\fI[file.bib]\\fP or \\fB--bibliography\\fP \\fI[file.bib]\\fP\"
+Enable the creation of the bibliography with \\fBbibtex\\fP being based on
+\\fIfichier.bib\\fP. If no file is present, the file with the \".bib\" extension
+must have the same name as \\fIsourceFile\\fP.tex.
+.IP \"\\fB-no-bib\\fP or \\fB--no-bibliography\\fP\"
+Disable the creation of the bibliography.
+.IP \"\\fB-toc\\fP or \\fB--table-of-contents\\fP\"
+Enable the additional compilation for the construction of a table of contents, a
+table of figures, a list of figures and all LaTeX references
+(\\fB\\\\label{...}\\fP).
+.IP \"\\fB-no-toc\\fP or \\fB--no-table-of-contents\\fP\"
+Disnable the additional compilation for the construction of a table of contents,
+a table of figures, a list of figures and all LaTeX references
+(\\fB\\\\label{...}\\fP).
+.IP \"\\fB-tmp\\fP or \\fB--temporary\\fP\"
+Once compilation performed, keep the temporary files created by LaTeX.
+.IP \"\\fB-no-tmp\\fP or \\fB--no-temporary\\fP\"
+Once compilation performed, delete the temporary files created by LaTeX.
+.IP \"\\fB-z\\fP or \\fB--gzip\\fP\"
+Compress the PsotScript files with the program \\fBgzip\\fP. The files have then
+the extension \".ps.gz\".
+.IP \"\\fB-no-z\\fP or \\fB--no-gzip\\fP\"
+Disable compression of the PsotScript files with the program \\fBgzip\\fP.
+.IP \"\\fB-1\\fP or \\fB--1page\\fP\"
+Generate PostScript files having 1 page per a4 sheet.
+.IP \"\\fB-2\\fP or \\fB--2pages\\fP\"
+Generate PostScript files having 2 pages per a4 sheet.
+.IP \"\\fB-4\\fP or \\fB--4pages\\fP\"
+Generate PostScript files having 4 pages per a4 sheet.
+.IP \"\\fB-sep\\fP or \\fB--separator\\fP\"
+Use this option in conjunction with the options \\fB-2\\fP or \\fB-4\\fP. Draw a
+separating line between the different pages of a single sheet.
+.IP \"\\fB-no-sep\\fP or \\fB--no-separator\\fP\"
+Use this option in conjunction with the options \\fB-2\\fP or \\fB-4\\fP. Disable
+drawing a separating line between the different pages of a single sheet.
+.IP \"\\fB-m\\fP or \\fB--messages\\fP\"
+Always show the LaTeX messages in the terminal (see also the section COMPILATION
+ERRORS).
+.IP \"\\fB-no-m\\fP or \\fB--no-messages\\fP\"
+If this option is used, the LaTeX messages only appear if there is some errors
+(see also the section COMPILATION ERRORS).
+.IP \"\\fB-view\\fP or \\fB--viewer\\fP\"
+Enable the final vizualisation.
+.IP \"\\fB-no-view\\fP or \\fB--no-viewer\\fP\"
+Disable the final vizualisation.
+.IP \"\\fB-7\\fP or \\fB--7bits\\fP\"
+Disable the sressing of the LaTeX source file. The source file must then use 7
+bits ascii codes.
+.IP \"\\fB-8\\fP or \\fB--8bits\\fP\"
+Enable the sressing of the LaTeX source file. The source file may then use 8
+bits ascii codes.
+.IP \"\\fB-v-ps\\fP \\fIviewer\\fP or \\fB--view-ps-with\\fP \\fIviewer\\fP\"
+Use the program \\fIviewer\\fP for the final vizualisation of the PostScript
+files.
+.IP \"\\fB-v-pdf\\fP \\fIviewer\\fP or \\fB--view-pdf-with\\fP \\fIviewer\\fP\"
+Use the program \\fIviewer\\fP for the final vizualisation of the PDF files.
+.IP \"\\fB-v-dvi\\fP \\fIviewer\\fP or \\fB--view-dvi-with\\fP \\fIviewer\\fP\"
+Use the program \\fIviewer\\fP for the final vizualisation of the DVI files.
+.IP \"\\fB-v\\fP or \\fB--version\\fP\"
+Print version and exit.
+.IP \"\\fB-?\\fP, \\fB-h\\fP or \\fB--help\\fP\"
+Print some help.
+
+.IP \"\\fINote\\fP :\"
+When using the option \\fB\\-view\\fP, the resulting file format choosen (DVI,
+PostScript or PDF) must be compatible with the program \\fIviewer\\fP in order to
+make the vizualisation running correctly. By default, the programs used are
+\\fBxdvi\\fP for the DVI files and \\fBgv\\fP for the PostScript and PDF files.
+
+.SH \"COMPILATION ERRORS\"
+.PP
+ If option \\fB-no-m\\fP is used, if LaTeX compilation error occurs, the script
+seems to get stuck. One can stop it by typing command line options (\"x\" for
+ignore, \"q\" for quit, ...) without viewing the messages, or by typing \"Ctrl^C\".
+In the two cases, the error messages will be shown afterwards. This imperfection
+is due to the choice of not printing the \\fBlatex\\fP program messages by
+default. However, the problem exists only if the interaction mode allows LaTeX
+to stop on errors (wich is not the case, for instance if the \\fB\\\\nonstopmode\\fP
+command is used).
+.PP
+ Anyway, it is possible to force display of the \\fBlatex\\fP messages by using
+the option \\fB-m\\fP instead of the option \\fB-no-m\\fP.
+
+.SH \"FILES\"
+.PP
+ The file \\fB~/.shlatex\\fP contains the user's preferences. It can be modified
+in order to use custom default values for the script's options, but the synthax of
+the script must be respected :
+.PP
+ Each line of the file must hold a single option. All the options are allowed
+excepting \\fB-v\\fP and \\fB-?\\fP which wouldn't have any sence in this file. For
+the options which need a parameter, as in the shell, they will be placed after
+their respective option but the separator have to be a single space character
+('\\ '). The order of the options doesn't matter.
+.PP
+ If some inconstancies appear during execution of the script, some warnings
+will be displayed.
+.PP
+ If while running the script for the first time, the file \\fB~/.shlatex\\fP
+doesn't exist, it will be created automatically with the following content :
+.RS 5
+.IP \"-dvips\"
+.IP \"-view\"
+.IP \"-no-idx\"
+.IP \"-no-bib\"
+.IP \"-toc\"
+.IP \"-no-tmp\"
+.IP \"-no-z\"
+.IP \"-1\"
+.IP \"-no-sep\"
+.IP \"-no-m\"
+.IP \"-8\"
+.IP \"-v-ps gv\"
+.IP \"-v-pdf gv\"
+.IP \"-v-dvi xdvi\"
+
+.SH \"KNOWN PROBLEMS\"
+.SS \"BoundingBox\"
+.PP
+ While inserting an image with the command \\fB\\\\includegraphics\\fP, it is
+necessary to specify the \"boundingbox\" as argument of the command, unless
+compilation doesn't work. Here is an exemple :
+.PP
+ \\\\includegraphics[bb=0 0 100 200]{image.eps}
+.SS \"External files\"
+ If you want external file inclusion to work properly, you have to put the
+\\fB\\\\input\\fP and \\fB\\\\include\\fP commands on a single line in the file
+\\fIsourceFile.tex\\fP.
+
+.SH \"SEE ALSO\"
+.BR latex (1),
+.BR pdflatex (1),
+.BR dvips (1),
+.BR ps2pdf (1),
+.BR dvipdf (1),
+.BR xdvi (1),
+.BR gv (1),
+.BR gzip (1)
+
+.SH \"BUGS\"
+.PP
+Thanks for reporting bugs by sending an email to the AUTHOR section adress.
+
+.SH \"LICENCE\"
+.PP
+ This script and all its relative files (including this manual) are released
+under the terms of the GNU General Public Licence. The GNU GPL is provided with
+the script (file /usr/share/shlatex/GPL.TXT) and is also available at the adress
+http://www.gnu.org/licenses/gpl.html.
+
+.SH \"AUTHOR\"
+.PP
+Copyright (C) 2003 Mael Hilléreau
+.PP
+\\fIcontact\\fP : mael.hillereau@free.fr
+.PP
+\\fIweb\\fP : http://mael.hillereau.free.fr
+
+" > ~/ShLaTeX_"$version".tmp;
+man ~/ShLaTeX_"$version".tmp
+rm -f ~/ShLaTeX_"$version".tmp
+}
+
+## affiche un message d'erreur
+function erreur() {
+ echo -ne "\n";
+ echo -ne "> Error :\n";
+ echo -ne " $1\n";
+ echo -ne "\n";
+ if [ $# -eq 2 ]
+ then
+ if [ $2 == "-?" ]
+ then
+ aideRapide;
+ fi
+ fi
+}
+
+## affiche un message d'avertissement
+function avertissement() {
+ echo -ne "\n";
+ echo -ne "> Warning :\n";
+ echo -ne " $1\n";
+ echo -ne "\n";
+}
+
+## affiche la version et sort
+function version() {
+ echo -ne "$nomshell version $version - LaTeX compilation script for Linux.\nCopyright (C) 2003 Mael Hilléreau\n";
+ exit 0;
+}
+
+## recherche les fichiers externes (1 seul par ligne dans le source LaTeX !)
+function fichiersExternes() {
+ fExt="";
+ lignes=`grep -e "^[ |\t]*\input{" $1`;
+ lignes=`echo $lignes | grep -v -E "^[ |\t]*%.*"`
+ for l in $lignes
+ do
+ fExt="$fExt `expr match $l '.*\input{\(.*\)}'`";
+ done
+ lignes=`grep -e "^[ |\t]*\include{" $1`;
+ lignes=`echo $lignes | grep -v -E "^[ |\t]*%.*"`
+ for l in $lignes
+ do
+ fExt="$fExt `expr match $l '.*\include{\(.*\)}'`";
+ done
+ lignes=`grep -e "^[ |\t]*\in\(put\|clude\) " $1`;
+ lignes=`echo $lignes | grep -v -E "^[ |\t]*%.*"`
+ for l in $lignes
+ do
+ if [ ! $l == "\input" -a ! $l == "\include" ]
+ then
+ fExt="$fExt $l";
+ fi
+ done
+ fTemp="";
+ for l in $fExt
+ do
+ cTemp=`expr match $l '[ |\t]*\(.*\)\.tex'`;
+ if [[ $cTemp == "" ]]
+ then
+ fTemp="$fTemp $l";
+ else
+ fTemp="$fTemp $cTemp";
+ fi
+ done
+ fExt=$fTemp;
+}
+
+## remplace les fichiers externes nommés $1 par $2 dans le fichier $3
+function rplcExtFich() {
+ if [ -f $3 ]
+ then
+ lignes=`cat $3 | grep -n "\input $1" | tr " " "@"`;
+ lignes="`cat $3 | grep -n \input{$1}` $lignes";
+ for ligne in $lignes
+ do
+ ligne=`echo $ligne | tr "@" " "`;
+ nblignes=`wc -l $3 | tr -s " " ":" | cut -f 2 -d ":"`;
+ nligne=`echo $ligne | cut -f 1 -d ":"`;
+ nligne=`expr $nligne - 1`;
+ fin=`expr $nblignes - $nligne - 1`;
+ head -$nligne "$3" > "$3".tmp
+ echo "\input{$2}" >> "$3.tmp"
+ tail -n $fin "$3" >> "$3".tmp
+ mv -f "$3".tmp "$3"
+ done
+ lignes=`cat $3 | grep -n "\include $1" | tr " " "@"`;
+ lignes="`cat $3 | grep -n \include{$1}` $lignes";
+ for ligne in $lignes
+ do
+ ligne=`echo $ligne | tr "@" " "`;
+ nblignes=`wc -l $3 | tr -s " " ":" | cut -f 2 -d ":"`;
+ nligne=`echo $ligne | cut -f 1 -d ":"`;
+ nligne=`expr $nligne - 1`;
+ fin=`expr $nblignes - $nligne - 1`;
+ head -$nligne "$3" > "$3".tmp
+ echo "\include{$2}" >> "$3.tmp"
+ tail -n $fin "$3" >> "$3".tmp
+ mv -f "$3".tmp "$3"
+ done
+ fi
+}
+
+## vérifie que le fichier fourni est accessible et éxécutable
+function estExec() {
+ for rep in `echo $PATH | tr ":" " "`
+ do
+ if [ -x $rep/$1 ]
+ then
+ return 1;
+ fi
+ done
+ return 0;
+}
+
+## vérifie qu'au plus un seul des arguments entiers a été initialisé
+function verifInit() {
+ i=0;
+ for a
+ do
+ if [ $a -ne -1 ]
+ then
+ i=`expr $i + 1`;
+ fi
+ done
+ return $i;
+}
+
+## charge les préférences à partir du fichier ~/.shlatex (une option par ligne)
+function preferences() {
+ for ligne in `grep -e "^-.*" ~/.shlatex | tr " " "="`
+ do
+ opt=`expr match $ligne '[:space:]*\(-[-a-z0-9]*\)=*.*'`;
+ paramopt="";
+ paramopt=`expr match $ligne '[:space:]*-[-a-z0-9]*=\(.*\)'`;
+ case $opt in
+ "-dvipdf" )
+ P_dvipdf=1;;
+ "-pdflatex" )
+ P_pdflatex=1;;
+ "-ps2pdf" )
+ P_pstopdf=1;;
+ "-dvips" )
+ P_dvips=1;;
+ "-dvi" )
+ P_dvi=1;;
+ "-idx" | "--index" )
+ P_idx=1;
+ if [ ! $paramopt == "" ]
+ then
+ P_idx_file=$paramopt;
+ fi ;;
+ "-no-idx" | "--no-index" )
+ P_no_idx=1;
+ ;;
+ "-bib" | "--bibliography" )
+ P_bib=1;
+ if [ ! $paramopt == "" ]
+ then
+ P_bib_file=`expr match $paramopt '\(.*\)\.bib'`;
+ fi ;;
+ "-no-bib" | "--no-bibliography" )
+ P_no_bib=1;;
+ "-toc" | "--table-of-contents" )
+ P_toc=1;;
+ "-no-toc" | "--no-table-of-contents" )
+ P_no_toc=1;;
+ "-tmp" | "--temporary" )
+ P_tmp=1;;
+ "-no-tmp" | "--no-temporary" )
+ P_no_tmp=1;;
+ "-z" | "--gzip" )
+ P_z=1;;
+ "-no-z" | "--no-gzip" )
+ P_no_z=1;;
+ "-1" | "--1page" )
+ P_un=1;;
+ "-2" | "--2pages" )
+ P_deux=1;;
+ "-4" | "--4pages" )
+ P_quatre=1;;
+ "-sep" | "--separator" )
+ P_sep=1;;
+ "-no-sep" | "--no-separator" )
+ P_no_sep=1;;
+ "-m" | "--messages" )
+ P_m=1;;
+ "-no-m" | "--no-messages" )
+ P_no_m=1;;
+ "-view" | "--viewer" )
+ P_view=1;;
+ "-no-view" | "--no-viewer" )
+ P_no_view=1;;
+ "-7" )
+ P_sept=1;;
+ "-8" )
+ P_huit=1;;
+ "-v-ps" | "--view-ps-with" )
+ if [ ! $paramopt == "" ]
+ then
+ P_v_ps=$paramopt;
+ else
+ avertissement "file \"$HOME/.shalatex\" -- option \"$opt\" ignored, missing argument!";
+ fi ;;
+ "-v-pdf" | "--view-pdf-with" )
+ if [ ! $paramopt == "" ]
+ then
+ P_v_pdf=$paramopt;
+ else
+ avertissement "file \"$HOME/.shalatex\" -- option \"$opt\" ignored, missing argument!";
+ fi ;;
+ "-v-dvi" | "--view-dvi-with" )
+ if [ ! $paramopt == "" ]
+ then
+ P_v_dvi=$paramopt;
+ else
+ avertissement "file \"$HOME/.shalatex\" -- option \"$opt\" ignored, missing argument!";
+ fi ;;
+ * )
+ avertissement "file \"$HOME/.shlatex\" -- option \"$opt\" ignored ; this option doesn't exist or isn't supported in preferences file";;
+ esac
+ done
+ ## vérification des options des préférences
+ # mode
+ verifInit $P_pstopdf $P_dvips $P_dvipdf $P_pdflatex $P_dvi;
+ if [ $? -gt 1 ]
+ then
+ avertissement "file \"$HOME/.shlatex\" -- options -dvipdf, -dvips, -pdflatex, -ps2pdf and -dvi are mutually exclusive!";
+ fi
+ # index
+ verifInit $P_idx $P_no_idx;
+ if [ $? -gt 1 ]
+ then
+ avertissement "file \"$HOME/.shlatex\" -- options -idx and -no-idx are mutually exclusive!";
+ fi
+ # bibliography
+ verifInit $P_bib $P_no_bib;
+ if [ $? -gt 1 ]
+ then
+ avertissement "file \"$HOME/.shlatex\" -- options -bib and -no-bib are mutually exclusive!";
+ fi
+ # table of contents
+ verifInit $P_toc $P_no_toc;
+ if [ $? -gt 1 ]
+ then
+ avertissement "file \"$HOME/.shlatex\" -- options -toc and -no-toc are mutually exclusive!";
+ fi
+ # temporary
+ verifInit $P_tmp $P_no_tmp;
+ if [ $? -gt 1 ]
+ then
+ avertissement "file \"$HOME/.shlatex\" -- options -tmp and -no-tmp are mutually exclusive!";
+ fi
+ # gzip
+ verifInit $P_z $P_no_z;
+ if [ $? -gt 1 ]
+ then
+ avertissement "file \"$HOME/.shlatex\" -- options -z and -no-z are mutually exclusive!";
+ fi
+ # 1, 2, 4
+ verifInit $P_un $P_deux $P_quatre;
+ if [ $? -gt 1 ]
+ then
+ avertissement "file \"$HOME/.shlatex\" -- options -1, -2 and -4 are mutually exclusive!";
+ fi
+ # separator
+ verifInit $P_sep $P_no_sep;
+ if [ $? -gt 1 ]
+ then
+ avertissement "file \"$HOME/.shlatex\" -- options -sep and -no-sep are mutually exclusive!";
+ fi
+ # messages
+ verifInit $P_m $P_no_m;
+ if [ $? -gt 1 ]
+ then
+ avertissement "file \"$HOME/.shlatex\" -- options -m and -no-m are mutually exclusive!";
+ fi
+ # view
+ verifInit $P_view $P_no_view;
+ if [ $? -gt 1 ]
+ then
+ avertissement "file \"$HOME/.shlatex\" -- options -view and -no-view are mutually exclusive!";
+ fi
+ # 7, 8
+ verifInit $P_sept $P_huit;
+ if [ $? -gt 1 ]
+ then
+ avertissement "file \"$HOME/.shlatex\" -- options -7 and -8 are mutually exclusive!";
+ fi
+}
+
+## si il n'y a pas de fichier de préférences, on le crée avec des valeurs par défaut
+if [ ! -f ~/.shlatex ]
+then
+ echo -ne "-dvips\n-view\n-no-idx\n-no-bib\n-toc\n-no-tmp\n-no-z\n-1\n-no-sep\n-no-m\n-8\n-v-ps gv\n-v-pdf gv\n-v-dvi xdvi\n" > ~/.shlatex
+fi
+
+## chargement des préférences
+preferences;
+
+## vérification du nombre d'arguments et récupération des options
+if [ $# -lt 2 ]
+then
+ if [ $# -eq 1 ]
+ then
+ if [ $1 == "-?" -o $1 == "-h" -o $1 == "--help" ]
+ then
+ aideComplete;
+ exit 0;
+ elif [ $1 == "-v" -o $1 == "--version" ]
+ then
+ version
+ exit 0;
+ fi
+ else
+ erreur "bad number of arguments!" -?;
+ exit 1;
+ fi
+else
+ noshift=0;
+ while [ $# -gt 1 ]
+ do
+ case $1 in
+ "-dvipdf" )
+ L_dvipdf=1;;
+ "-pdflatex" )
+ L_pdflatex=1;;
+ "-ps2pdf" )
+ L_pstopdf=1;;
+ "-dvips" )
+ L_dvips=1;;
+ "-dvi" )
+ L_dvi=1;;
+ "-idx" | "--index" )
+ L_idx=1;
+ if [ $# -gt 2 ]
+ then
+ shift;
+ if [ ! ${1:0:1} == "-" ]
+ then
+ L_idx_file=$1;
+ else
+ noshift=1;
+ fi
+ fi ;;
+ "-no-idx" | "--no-index" )
+ L_no_idx=1;;
+ "-bib" | "--bibliography" )
+ L_bib=1;
+ if [ $# -gt 2 ]
+ then
+ shift;
+ if [ ! ${1:0:1} == "-" ]
+ then
+ if [ -f $1 ]
+ then
+ L_bib_file=`expr match "$1" '\(.*\)\.bib'`;
+ else
+ erreur "the bibliography file \"$1\" doesn't exists!" -?;
+ exit 1;
+ fi
+ else
+ noshift=1;
+ fi
+ fi ;;
+ "-no-bib" | "--no-bibliography" )
+ L_no_bib=1;;
+ "-toc" | "--table-of-contents" )
+ L_toc=1;;
+ "-no-toc" | "--no-table-of-contents" )
+ L_no_toc=1;;
+ "-tmp" | "--temporary" )
+ L_tmp=1;;
+ "-no-tmp" | "--no-temporary" )
+ L_no_tmp=1;;
+ "-z" | "--gzip" )
+ L_z=1;;
+ "-no-z" | "--no-gzip" )
+ L_no_z=1;;
+ "-1" | "--1page" )
+ L_un=1;;
+ "-2" | "--2pages" )
+ L_deux=1;;
+ "-4" | "--4pages" )
+ L_quatre=1;;
+ "-sep" | "--separator" )
+ L_sep=1;;
+ "-no-sep" | "--no-separator" )
+ L_no_sep=1;;
+ "-m" | "--messages" )
+ L_m=1;;
+ "-no-m" | "--no-messages" )
+ L_no_m=1;;
+ "-view" | "--viewer" )
+ L_view=1;;
+ "-no-view" | "--no-viewer" )
+ L_no_view=1;;
+ "-7" )
+ L_sept=1;;
+ "-8" )
+ L_huit=1;;
+ "-v-ps" | "--view-ps-with" )
+ if [ $# -gt 2 ]
+ then
+ shift;
+ if [ ! ${1:0:1} == "-" ]
+ then
+ estExec $1;
+ if [ $? -eq 1 ]
+ then
+ L_v_ps=$1;
+ else
+ erreur "the file \"$1\" isn't accessible or isn't runable on the command line!";
+ exit 1;
+ fi
+ else
+ noshift=1;
+ fi
+ else
+ erreur "the option $1 needs a parameter!" -?;
+ exit 1;
+ fi ;;
+ "-v-pdf" | "--view-pdf-with" )
+ if [ $# -gt 2 ]
+ then
+ shift;
+ if [ ! ${1:0:1} == "-" ]
+ then
+ estExec $1;
+ if [ $? -eq 1 ]
+ then
+ L_v_pdf=$1;
+ else
+ erreur "the file \"$1\" isn't accessible or isn't runable on the command line!";
+ exit 1;
+ fi
+ else
+ noshift=1;
+ fi
+ else
+ erreur "the option $1 needs a parameter!" -?;
+ exit 1;
+ fi ;;
+ "-v-dvi" | "--view-dvi-with" )
+ if [ $# -gt 2 ]
+ then
+ shift;
+ if [ ! ${1:0:1} == "-" ]
+ then
+ estExec $1;
+ if [ $? -eq 1 ]
+ then
+ L_v_dvi=$1;
+ else
+ erreur "the file \"$1\" isn't accessible or isn't runable on the command line!";
+ exit 1;
+ fi
+ else
+ noshift=1;
+ fi
+ else
+ erreur "the option $1 needs a parameter!" -?;
+ exit 1;
+ fi ;;
+ "-?" | "-h" | "--help" )
+ aideRapide;
+ exit 0;;
+ "-v" | "--version" )
+ version;;
+ * )
+ erreur "the option \"$1\" is incorrect!" -?;
+ exit 1;;
+ esac
+ if [ $noshift -eq 0 ]
+ then
+ shift;
+ else
+ noshift=0;
+ fi
+ done
+fi
+
+# vérification de l'existence d'un nom pour le fichier source LaTeX
+if [ $# -ne 1 ]
+then
+ erreur "LaTeX source file missing!" -?;
+ exit 1;
+fi
+
+# vérification de l'existence du fichier source LaTeX
+if [ ! -f $1 ]
+then
+ erreur "unable to find the file \"$1\"!" -?;
+ exit 1;
+fi
+
+# nom du fichier source
+fich=$1;
+
+# nom du fichier source sans son extension ".tex"
+f=`expr match "$fich" '\(.*\)\.[a-zA-Z]*'`;
+
+## vérification des options de la ligne de commande
+# mode
+verifInit $L_pstopdf $L_dvips $L_dvipdf $L_pdflatex $L_dvi;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "options -dvipdf, -dvips, -pdflatex, -ps2pdf and -dvi are mutually exclusive!";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_dvipdf -eq 1 ]
+ then
+ mode="dvipdf";
+ elif [ $L_dvips -eq 1 ]
+ then
+ mode="dvips";
+ elif [ $L_pdflatex -eq 1 ]
+ then
+ mode="pdflatex";
+ elif [ $L_pstopdf -eq 1 ]
+ then
+ mode="ps2pdf";
+ elif [ $L_dvi -eq 1 ]
+ then
+ mode="dvi";
+ fi
+else
+ # préférences
+ if [ $P_dvipdf -eq 1 ]
+ then
+ mode="dvipdf";
+ elif [ $P_dvips -eq 1 ]
+ then
+ mode="dvips";
+ elif [ $P_pdflatex -eq 1 ]
+ then
+ mode="pdflatex";
+ elif [ $P_pstopdf -eq 1 ]
+ then
+ mode="ps2pdf";
+ elif [ $P_dvi -eq 1 ]
+ then
+ mode="dvi";
+ fi
+fi
+# index
+verifInit $L_idx $L_no_idx;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "options -idx and -no-idx are mutually exclusive!";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_idx -eq 1 ]
+ then
+ idx=1;
+ else
+ idx=0;
+ fi
+else
+ # préférences
+ if [ $P_idx -eq 1 ]
+ then
+ idx=1;
+ else
+ idx=0;
+ fi
+fi
+if [ ! $L_idx_file == "-" ]
+then
+ idx_file=$L_idx_file;
+elif [ ! $P_idx_file == "-" ]
+then
+ idx_file=$P_idx_file;
+fi
+# bibliography
+verifInit $L_bib $L_no_bib;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "options -bib and -no-bib are mutually exclusive!";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_bib -eq 1 ]
+ then
+ bib=1;
+ else
+ bib=0;
+ fi
+else
+ # préférences
+ if [ $P_bib -eq 1 ]
+ then
+ bib=1;
+ else
+ bib=0;
+ fi
+fi
+if [ ! $L_bib_file == "-" ]
+then
+ bib_file=$L_bib_file;
+elif [ ! $P_bib_file == "-" ]
+then
+ bib_file=$P_bib_file;
+fi
+# table of contents
+verifInit $L_toc $L_no_toc;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "options -toc and -no-toc are mutually exclusive!";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_toc -eq 1 ]
+ then
+ toc=1;
+ else
+ toc=0;
+ fi
+else
+ # préférences
+ if [ $P_toc -eq 1 ]
+ then
+ toc=1;
+ else
+ toc=0;
+ fi
+fi
+# temporary
+verifInit $L_tmp $L_no_tmp;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "options -tmp and -no-tmp are mutually exclusive!";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_tmp -eq 1 ]
+ then
+ tmp=1;
+ else
+ tmp=0;
+ fi
+else
+ # préférences
+ if [ $P_tmp -eq 1 ]
+ then
+ tmp=1;
+ else
+ tmp=0;
+ fi
+fi
+# gzip
+verifInit $L_z $L_no_z;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "options -z and -no-z are mutually exclusive!";
+ exit 1;
+elif [ $mode == "dvips" -o $mode == "ps2pdf" ]
+then
+ if [ $iopt -eq 1 ]
+ then
+ # ligne de commande
+ if [ $L_z -eq 1 ]
+ then
+ z=1;
+ else
+ z=0;
+ fi
+ else
+ # préférences
+ if [ $P_z -eq 1 ]
+ then
+ z=1;
+ else
+ z=0;
+ fi
+ fi
+elif [ $iopt -eq 1 ]
+then
+ avertissement "option -z ignored -- option -z doesn't concern PostScript files!";
+fi
+# 1, 2, 4
+verifInit $L_un $L_deux $L_quatre;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "options -1, -2 and -4 are mutually exclusive!";
+ exit 1;
+elif [ $mode == "dvips" -o $mode == "ps2pdf" ]
+then
+ if [ $iopt -eq 1 ]
+ then
+ # ligne de commande
+ if [ $L_un -eq 1 ]
+ then
+ ppf=1;
+ elif [ $L_deux -eq 1 ]
+ then
+ ppf=2;
+ else
+ ppf=4;
+ fi
+ else
+ # préférences
+ if [ $P_un -eq 1 ]
+ then
+ ppf=1;
+ elif [ $P_deux -eq 1 ]
+ then
+ ppf=2;
+ else
+ ppf=4;
+ fi
+ fi
+elif [ $iopt -eq 1 ]
+then
+ if [ $L_un -eq 1 ]
+ then
+ avertissement "option -1 ignored -- options -1, -2 and -4 only concern PostScript files!";
+ elif [ $L_deux -eq 1 ]
+ then
+ avertissement "option -2 ignored -- options -1, -2 and -4 only concern PostScript files!";
+ else
+ avertissement "option -4 ignored -- options -1, -2 and -4 only concern PostScript files!";
+ fi
+fi
+# separator
+verifInit $L_sep $L_no_sep;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "options -sep and -no-sep are mutually exclusive!";
+ exit 1;
+elif [ $ppf -gt 1 ]
+then
+ if [ $iopt -eq 1 ]
+ then
+ # ligne de commande
+ if [ $L_sep -eq 1 ]
+ then
+ sep=1;
+ else
+ sep=0;
+ fi
+ else
+ # préférences
+ if [ $P_sep -eq 1 ]
+ then
+ sep=1;
+ else
+ sep=0;
+ fi
+ fi
+elif [ $iopt -eq 1 ]
+then
+ avertissement "option -sep ignored -- option -sep must be used with options -2 and -4!";
+fi
+# messages
+verifInit $L_m $L_no_m;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "options -m and -no-m are mutually exclusive!";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_m -eq 1 ]
+ then
+ m=1;
+ else
+ m=0;
+ fi
+else
+ # préférences
+ if [ $P_m -eq 1 ]
+ then
+ m=1;
+ else
+ m=0;
+ fi
+fi
+# view
+verifInit $L_view $L_no_view;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "options -view and -no-view are mutually exclusive!";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_view -eq 1 ]
+ then
+ view=1;
+ else
+ view=0;
+ fi
+else
+ # préférences
+ if [ $P_view -eq 1 ]
+ then
+ view=1;
+ else
+ view=0;
+ fi
+fi
+# 7, 8
+verifInit $L_sept $L_huit;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "options -7 and -8 are mutually exclusive!";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_sept -eq 1 ]
+ then
+ ascii=7;
+ else
+ ascii=8;
+ fi
+else
+ # préférences
+ if [ $P_sept -eq 1 ]
+ then
+ ascii=7;
+ else
+ ascii=8;
+ fi
+fi
+# v_dvi
+if [ ! $L_v_dvi == "-" ]
+then
+ # lige de commande
+ v_dvi=$L_v_dvi;
+elif [ ! $P_v_dvi == "-" ]
+then
+ # préférences
+ v_dvi=$P_v_dvi;
+fi
+# v_ps
+if [ ! $L_v_ps == "-" ]
+then
+ # lige de commande
+ v_ps=$L_v_ps;
+elif [ ! $P_v_ps == "-" ]
+then
+ # préférences
+ v_ps=$P_v_ps;
+fi
+# v_pdf
+if [ ! $L_v_pdf == "-" ]
+then
+ # lige de commande
+ v_pdf=$L_v_pdf;
+elif [ ! $P_v_pdf == "-" ]
+then
+ # préférences
+ v_pdf=$P_v_pdf;
+fi
+
+
+## test de l'existance du fichier de bibliographie
+if [ $bib -eq 1 -a $bib_file == "-" ]
+then
+ if [ ! -f "$f".bib ]
+ then
+ erreur "you have used option -bib and the file \"$f.bib\" doesn't exists!" -?;
+ exit 1;
+ fi
+fi
+
+
+## affichage d'un petit message de version
+echo -ne "\n$nomshell version $version - LaTeX compilation script for Linux.\nCopyright (C) 2003 Mael Hilléreau\n\n";
+
+
+## création d'un répertoire de travail
+if [ ! -d "$f".ShLaTeX ]
+then
+ mkdir "$f".ShLaTeX
+fi
+
+
+## recherche (non récursive) des fichiers externes
+fichiersExternes $fich
+
+
+## copie du fichier latex source principal
+cp "$f".tex "$f".ShLaTeX
+
+## copie des fichiers latex source externes
+fExtTmp="";
+for fe in $fExt
+do
+ if [ -f "$fe".tex ]
+ then
+ cp "$fe".tex "$f".ShLaTeX
+ # élimination du chemin relatif dans le fichier source
+ sansChemin=`expr match "/$fe" '.*/\(.*\)'`;
+ rplcExtFich "$fe.tex" "$sansChemin.tex" "$f".ShLaTeX/"$f".tex
+ fExtTmp="$sansChemin $fExtTmp";
+ else
+ avertissement "the external file \"$fe.tex\" referenced in \"$fich\" is unavailable!";
+ fi
+done
+fExt=$fExtTmp;
+
+## copie du fichier de bibliographie
+if [ $bib -eq 1 ]
+then
+ if [ $bib_file == "-" ]
+ then
+ bib_file=$f;
+ fi
+ cp "$bib_file".bib "$f".ShLaTeX
+fi
+
+## copie du fichier de style d'index
+if [ ! $idx_file == "-" ]
+then
+ if [ -f $idx_file ]
+ then
+ cp $idx_file "$f".ShLaTeX
+ fi
+fi
+
+## on passe dans le répertoire de travail
+cd "$f".ShLaTeX
+
+## accentuation
+if [ $ascii -eq 8 ]
+then
+ ## accentuation du fichier latex source
+ echo "> Stressing in progress...";
+ echo -ne "<$fich>"
+ tex8to7 $fich > /dev/null 2>&1
+
+ ## écrasement du fichier latex source
+ mv -f "$fich"7 $fich
+
+ ## accentuation et écrasement des fichier latex source externes
+ for fe in $fExt
+ do
+ if [ -f "$fe".tex ]
+ then
+ echo -ne "<$fe.tex>"
+ tex8to7 "$fe".tex > /dev/null 2>&1
+ mv -f "$fe".tex7 "$fe".tex
+ fi
+ done
+ echo ""
+fi
+
+## compilation du fichier latex source accuentué
+echo "> Begining latex compilation...";
+reslatex=0;
+echo "> Compilation (ShLaTeX)" >latex.log
+if [ ! $mode == "pdflatex" ]
+then
+ if [ $m -eq 1 ]
+ then
+ latex $fich
+ else
+ latex $fich >>latex.log 2>&1
+ fi
+ reslatex=$?;
+else
+ if [ $m -eq 1 ]
+ then
+ pdflatex $fich
+ else
+ pdflatex $fich >>latex.log 2>&1
+ fi
+ reslatex=$?;
+fi
+if [ $reslatex -ne 0 ]
+then
+ errcompil=1;
+else
+ echo "first compilation successfull.";
+fi
+
+## création de la biliographie et deuxième compilation
+if [ $bib -eq 1 -a $errcompil -ne 1 ]
+then
+ echo "> Creation of the bibliography...";
+ bib_file=`expr match "/$bib_file" '.*/\(.*\)'`;
+ if [ $ascii -eq 8 ]
+ then
+ echo "> Stressing the file \""$bib_file".bib\"...";
+ tex8to7 "$bib_file".bib > /dev/null 2>&1
+ echo "<$bib_file.bib>"
+ mv -f "$bib_file".bib7 "$bib_file".bib
+ fi
+ bibtex "$f" > bibtex.log 2>&1
+ if [ $? -eq 0 ]
+ then
+ if [ ! $mode == "pdflatex" ]
+ then
+ echo "> Compilation (ShLaTeX)" >>latex.log
+ latex $fich >>latex.log 2>&1
+ reslatex=$?;
+ else
+ echo "> Compilation (ShLaTeX)" >>latex.log
+ pdflatex $fich >>latex.log 2>&1
+ reslatex=$?;
+ fi
+ if [ $reslatex -ne 0 ]
+ then
+ errcompil=1;
+ else
+ echo "second compilation successfull.";
+ fi
+ else
+ echo -ne "\n";
+ cat bibtex.log
+ erreur "problem while creating the bibliography!";
+ errbib=1;
+ fi
+fi
+
+## création d'un index
+if [ $idx -eq 1 -a $errcompil -ne 1 -a $errbib -ne 1 ]
+then
+ echo "> Creation of the index...";
+ if [ $idx_file == "-" ]
+ then
+ makeindex "$f".idx > makeindex.log 2>&1
+ else
+ makeindex -s $idx_file "$f".idx > makeindex.log 2>&1
+ fi
+ if [ $? -ne 0 ]
+ then
+ echo -ne "\n";
+ cat makeindex.log
+ cat "$f".ilg 2>/dev/null
+ erreur "problem while creating the index!";
+ errindex=1;
+ else
+ errindex=0;
+ echo "index successfully created.";
+ fi
+fi
+
+## deuxième ou troisième compilation pour l'index et la table des matières
+if [ $toc -eq 1 -a $errbib -ne 1 -a $errindex -ne 1 -a $errcompil -ne 1 ]
+then
+ if [ ! $mode == "pdflatex" ]
+ then
+ echo "> Compilation (ShLaTeX)" >>latex.log
+ latex $fich >>latex.log 2>&1
+ reslatex=$?;
+ else
+ echo "> Compilation (ShLaTeX)" >>latex.log
+ pdflatex $fich >>latex.log 2>&1
+ reslatex=$?;
+ fi
+ if [ $reslatex -ne 0 ]
+ then
+ errcompil=1;
+ else
+ if [ $bib -eq 1 ]
+ then
+ echo "third compilation successfull.";
+ else
+ echo "second compilation successfull.";
+ fi
+ fi
+fi
+
+## déplacement du fichier dvi ou pdf
+if [ $mode == "pdflatex" ]
+then
+ mv "$f".pdf ..
+else
+ mv "$f".dvi ..
+fi
+
+## on sort du répertoire de travail
+cd ..
+
+## conversion du fichier dvi
+errconvert=0;
+if [ $errbib -ne 1 -a $errindex -ne 1 -a $errcompil -ne 1 -a ! $mode == "pdflatex" -a ! $mode == "dvi" ]
+then
+ echo "> Conversion in progress...";
+ if [ $mode == "dvipdf" ]
+ then
+ dvipdf "$f".dvi "$f".pdf >> ./"$f".ShLaTeX/dvipdf.log 2>&1
+ if [ $? -ne 0 ]
+ then
+ echo -ne "\n";
+ cat ./"$f".ShLaTeX/dvipdf.log
+ erreur "problem while converting in PDF!";
+ errconvert=1;
+ fi
+ elif [ $mode == "dvips" -o $mode == "ps2pdf" ]
+ then
+ dvips -Ppdf "$f".dvi -o "$f".ps >> ./"$f".ShLaTeX/dvips.log 2>&1
+ if [ $? -ne 0 ]
+ then
+ echo -ne "\n";
+ cat ./"$f".ShLaTeX/dvips.log
+ erreur "problem while converting in PostScript!";
+ errconvert=1;
+ fi
+ if [ $errconvert -ne 1 ]
+ then
+ optpstops="";
+ if [ $sep -eq 1 ]
+ then
+ optpstops="-d";
+ fi
+ if [ $ppf -eq 2 ]
+ then
+ pstops $optpstops "2:0L@.7(21cm,0cm)+1L@.7(21cm,14.85cm)" "$f".ps "$f".2ppf.ps >/dev/null 2>&1
+ mv "$f".2ppf.ps "$f".ps
+ elif [ $ppf -eq 4 ]
+ then
+ pstops $optpstops "4:0@.5(0cm,14.85cm)+1@.5(10.5cm,14.85cm)+2@.5(0cm,0cm)+3@.5(10.5cm,0cm)" "$f".ps "$f".4ppf.ps >/dev/null 2>&1
+ mv "$f".4ppf.ps "$f".ps
+ fi
+ if [ $mode == "ps2pdf" ]
+ then
+ ps2pdf "$f".ps "$f".pdf >> ./"$f".ShLaTeX/ps2pdf.log 2>&1
+ if [ $? -ne 0 ]
+ then
+ echo -ne "\n";
+ cat ./"$f".ShLaTeX/ps2pdf.log
+ erreur "problem while converting in PDF!";
+ errconvert=1;
+ fi
+ fi
+ if [ $z -eq 1 ]
+ then
+ rm -f "$f".ps.gz
+ gzip "$f".ps > /dev/null 2>&1
+ fi
+ fi
+ fi
+ rm -f "$f".dvi
+fi
+
+## visualisation du fichier dvi, ps ou pdf
+if [ $errconvert -ne 1 -a $errbib -ne 1 -a $errindex -ne 1 -a $errcompil -ne 1 -a $view -eq 1 ]
+then
+ echo "> Launching viewer.";
+ case $mode in
+ "dvi" )
+ $v_dvi "$f".dvi >/dev/null 2>&1 & ;;
+ "dvips" )
+ if [ $z -eq 1 ]
+ then
+ $v_ps "$f".ps.gz >/dev/null 2>&1 &
+ else
+ $v_ps "$f".ps >/dev/null 2>&1 &
+ fi ;;
+ "ps2pdf" | "dvipdf" | "pdflatex" )
+ $v_pdf "$f".pdf >/dev/null 2>&1 & ;;
+ esac
+fi
+
+## affichage des messages d'erreur de compilation
+if [ $errcompil -eq 1 ]
+then
+ if [ $m -eq 0 ]
+ then
+ echo -ne "\n";
+ cat ./"$f".ShLaTeX/latex.log
+ fi
+ erreur "problem during compilation!";
+fi
+
+## suppression des temporaires et sortie
+suppressionTemp;
+fin;
diff --git a/support/shlatex/en/install b/support/shlatex/en/install
new file mode 100644
index 0000000000..dfb41032f9
--- /dev/null
+++ b/support/shlatex/en/install
@@ -0,0 +1,102 @@
+#!/bin/bash
+# Installation script for ShLaTeX
+# Warning : you must be root to run this script !
+# This script must be run in the ShLaTeX directory.
+
+# variables d'installation
+user=`whoami`;
+version="1.2b-en";
+
+# fichiers d'installation
+gpl="../GPL.TXT";
+src="../src";
+tex8to7="../src/tex8to7.c";
+man="./man/shlatex.1.bz2";
+shlatex="./ShLaTeX";
+todo="../TODO.TXT";
+fichInstall="$gpl $tex8to7 $man $shlatex $todo";
+
+# répertoires d'installation
+cheminMan="/usr/share/man/man1";
+cheminExec="/usr/bin";
+cheminScript="/usr/share";
+repInstall="$cheminMan $cheminExec $cheminScript";
+
+# vérification de l'identité de l'appelant
+if [ ! $user == "root" ]
+then
+ echo -ne "> Error : you must be 'root' to run this script\n";
+ echo -ne " See the README.TXT file for further details.\n";
+ exit 1;
+fi
+
+# vérification de l'abscence de cette version n'est pas déjà installée
+if [ -d "$cheminScript/shlatex-$version" ]
+then
+ echo "ShLaTeX $version is already installed on your system."
+ echo "Before re-installing, you have to uninstall."
+ exit 2;
+fi
+
+# vérification de l'existence des répertoires cibles, création le cas échéant
+for rep in $repInstall
+do
+ if [ ! -d "$rep" ]
+ then
+ echo -ne "> Avertissement : impossible de trouver \"$rep\", création du répertoire...\n";
+ mkdir -p "$rep"
+ fi
+done
+
+# vérification de l'existence des fichiers d'installation
+for fich in $fichiersInstall
+do
+ if [ ! -f "$fich" ]
+ then
+ echo -ne "> Erreur : impossible de trouver le fichier \"$fich\", ce fichier est nécessaire pour l'installation !\n";
+ exit 3;
+ fi
+done
+
+cat $gpl | more
+
+echo -ne "\n\n"
+
+rpse="-";
+until [ "$rpse" == "y" -o "$rpse" == "n" ]
+do
+ read -p "Do you agree the terms of the GNU GPL licence (y/n) ? " rpse
+done
+
+if [ ! "$rpse" == "y" ]
+then
+ echo "> Installation cancelled."
+ exit 1;
+fi
+
+clear
+
+echo -ne "> Installation in progress...\n"
+echo -ne "> Compiling...\n"
+gcc $tex8to7 -o tex8to7
+echo -ne "> Installation of tex8to7...\n"
+cp ./tex8to7 "$cheminExec/tex8to7"
+rm -f tex8to7
+chmod 755 "$cheminExec/tex8to7"
+echo -ne "> Installation of the man page...\n"
+cp $man "$cheminMan/shlatex.1.bz2"
+chmod 644 "$cheminMan/shlatex.1.bz2"
+echo -ne "> Installation of the script...\n"
+mkdir "$cheminScript/shlatex-$version"
+cp -fR * $gpl $src $todo "$cheminScript/shlatex-$version"
+chmod -R 755 "$cheminScript/shlatex-$version"
+if [ ! -L "$cheminExec/ShLaTeX" ]
+then
+ ln -s "$cheminScript/shlatex-$version/ShLaTeX" "$cheminExec/ShLaTeX"
+fi
+ln -s "$cheminScript/shlatex-$version/ShLaTeX" "$cheminExec/ShLaTeX-$version"
+echo -ne "> Test in progress...\n"
+cd "$cheminScript/shlatex-$version/test"
+chmod 755 ./test
+./test
+echo -ne "> Done.\n\n"
diff --git a/support/shlatex/en/man/cman b/support/shlatex/en/man/cman
new file mode 100644
index 0000000000..a0262dd427
--- /dev/null
+++ b/support/shlatex/en/man/cman
@@ -0,0 +1,21 @@
+#!/bin/bash
+# script de conversion du manuel en PDF et ascii.
+
+if [ ! -f shlatex.1 ]
+then
+ bunzip2 shlatex.1.bz2
+fi
+cp shlatex.1 "shlatex.help"
+groff -mandoc -Tps shlatex.1 > shlatex.ps
+bzip2 shlatex.1
+pstops -pa4 -w21cm -h29.7cm "1:0(-0.3cm,-1.5cm)" shlatex.ps shlatexA4.ps
+mv shlatexA4.ps shlatex.ps
+ps2pdf13 shlatex.ps
+rm -f shlatex.ps
+#acroread shlatex.pdf &
+
+rplc "\\" "\\\\" "`cat shlatex.help`" > "shlatex.help"
+rplc "\"" "\\\"" "`cat shlatex.help`" > "shlatex.help"
+manuel=`cat shlatex.help`;
+echo "echo \"$manuel\";" > "shlatex.help"
+
diff --git a/support/shlatex/en/man/shlatex.1.bz2 b/support/shlatex/en/man/shlatex.1.bz2
new file mode 100644
index 0000000000..7e5ef8969e
--- /dev/null
+++ b/support/shlatex/en/man/shlatex.1.bz2
Binary files differ
diff --git a/support/shlatex/en/man/shlatex.pdf b/support/shlatex/en/man/shlatex.pdf
new file mode 100644
index 0000000000..76b40c76f5
--- /dev/null
+++ b/support/shlatex/en/man/shlatex.pdf
Binary files differ
diff --git a/support/shlatex/en/test/biblio.bib b/support/shlatex/en/test/biblio.bib
new file mode 100644
index 0000000000..0d1b214207
--- /dev/null
+++ b/support/shlatex/en/test/biblio.bib
@@ -0,0 +1,7 @@
+@MANUAL{bib:manuel,
+ title= {User manual\index{U!User manual}},
+ author= {Mael Hilléreau},
+ month= {March},
+ year= {2003},
+ note= {Linux man page (type \texttt{man shlatex} to access it)},
+}
diff --git a/support/shlatex/en/test/externe.tex b/support/shlatex/en/test/externe.tex
new file mode 100644
index 0000000000..21a0631f2d
--- /dev/null
+++ b/support/shlatex/en/test/externe.tex
@@ -0,0 +1,3 @@
+\par It is possible to compile documents wich use the \verb|\input| and
+\verb|\include| commands to make references to some external files, and that in
+a transparent way by compiling only the main source file.
diff --git a/support/shlatex/en/test/test b/support/shlatex/en/test/test
new file mode 100644
index 0000000000..450336daf0
--- /dev/null
+++ b/support/shlatex/en/test/test
@@ -0,0 +1,15 @@
+#!/bin/bash
+# A small test for the ShLaTeX script
+
+version="1.2b-en";
+lignecom="ShLaTeX-$version -bib biblio.bib -toc -idx -dvips -z -2 -sep -no-tmp -no-m -8 -view -v-ps gv test.tex";
+
+$lignecom
+if [ $? -ne 0 ]
+then
+ echo -ne "> Error during the test!\n";
+else
+ echo -ne "> Test OK.\n";
+fi
+
+echo -ne "> Command used :\n$lignecom\n";
diff --git a/support/shlatex/en/test/test.tex b/support/shlatex/en/test/test.tex
new file mode 100644
index 0000000000..17aad94b4a
--- /dev/null
+++ b/support/shlatex/en/test/test.tex
@@ -0,0 +1,68 @@
+% Un petit test pour ShLaTeX
+\documentclass[a4paper,11pt]{article}
+
+\usepackage[frenchb]{babel}
+\usepackage{makeidx}
+\usepackage{graphicx}
+
+\newcommand{\shlatex}{\raisebox{0.05em}{\rotatebox{-6}{\scalebox{1.1}{S}}}\kern-0.2em\raisebox{-0.115em}{\rotatebox{14}{\scalebox{0.8}{$h$}}}\kern0.05em\LaTeX\xspace}
+
+\makeindex
+
+\title{\shlatex\footnote{A complete and up to date description is available in \cite{bib:manuel}.
+ }\ -- \LaTeX\ compilation script for Linux.}
+\author{Mael Hilléreau}
+\date{12$^{\textrm{\small th}}$ March, 2003}
+
+
+\begin{document}
+\maketitle
+\tableofcontents
+
+\section{Name}
+\par
+ \shlatex\index{S!\shlatex}\ -- \LaTeX\index{L!\LaTeX}\ compilation script for Linux.
+
+\section{Synopsis\index{S!Synopsis}}
+\par
+ \texttt{ShLaTeX [}\textit{options}\texttt{]} \texttt{sourceFile.tex}
+
+\section{Description}
+
+\subsection{A begining}
+
+\par This script allows to centralize the many program calls necessary to completely
+compile a \LaTeX\ document. In particular, the multiple calls to the \texttt{latex}
+command necessary in order to create a \index{T!table of contents}, a
+\textsc{Bib}\TeX\index{B!\textsc{Bib}\TeX} \index{B!bibliography} or an
+index\index{I!Index} are carried out automatically. Are also managed the calls to
+the programs \texttt{bibtex\index{B!bibtex}} and \texttt{makeindex\index{M!makeindex}}
+as well as the vizualisation of the resulting file (in DVI, PostScript or PDF format)
+by calling an external program.
+
+\input{externe.tex}
+
+\subsection{A continuation} \par Once compilation done, the temporary files are
+erased (option \textbf{-no-tmp}) or preserved (option \texttt{-tmp}). The DVI file
+generated by \LaTeX\ can then directly be converted\index{C!Conversion} to the
+PostScript or PDF formats. [\dots]
+
+\subsection{The continuation of a continuation}
+
+\par This script also provides the stressing of the French characters by the
+intermediary of an external C program (named \texttt{tex8to7}) and provided with the
+script. It also manages the C cedilla as well as the replacement of the quotation marks
+by the \verb|\og| and \verb|\fg| commands (supposing that the quotation marks are
+coupled). The quotation marks can be imbricated by using accodances for distinguishing
+the different quotation mark couples.
+
+\subsection{The continuation of the continuation of a continuation}
+
+\par Well, now I don't want to say anymore\dots
+
+\newpage
+ \bibliographystyle{alpha}
+ \bibliography{biblio.bib}
+
+\printindex
+\end{document}
diff --git a/support/shlatex/en/uninstall b/support/shlatex/en/uninstall
new file mode 100644
index 0000000000..f6e5565389
--- /dev/null
+++ b/support/shlatex/en/uninstall
@@ -0,0 +1,38 @@
+#!/bin/bash
+# Uninstall script for ShLaTeX
+# Warning : you must be root to run this script !
+
+user=`whoami`;
+version="1.2b-en";
+cheminMan="/usr/share/man/man1";
+cheminExec="/usr/bin";
+cheminScript="/usr/share";
+
+if [ ! $user == "root" ]
+then
+ echo "> Error : you must be 'root' to run this script";
+ echo " See the README.TXT file for further details.";
+ exit 1;
+fi
+
+if [ ! -d "$cheminScript/shlatex-$version" ]
+then
+ echo "> Warning : the script ShLaTeX-$version doesn't seem to be installed !";
+fi
+
+echo -ne "\n> Uninstall in progress...\n"
+cd /
+
+rm -f "$cheminExec/ShLaTeX-$version"
+rm -f "$cheminMan/shlatex.1.bz2"
+rm -fr "$cheminScript/shlatex-$version"
+if [ "`ls $cheminScript | grep "^shlatex-"`" == "" ]
+then
+ rm -f "$cheminExec/tex8to7"
+ rm -f "$cheminExec/ShLaTeX"
+else
+ echo "> Warning : another version of ShLaTeX seems to be present"
+ echo " The program tex8to7 hasn't been removed."
+fi
+echo -ne "> Done.\n\n"
+cd -
diff --git a/support/shlatex/fr/CHANGELOG.TXT b/support/shlatex/fr/CHANGELOG.TXT
new file mode 100644
index 0000000000..13138faf5f
--- /dev/null
+++ b/support/shlatex/fr/CHANGELOG.TXT
@@ -0,0 +1,165 @@
+------ v1.2b ------
+
+o 21/08/2003 15:15
+ - Correction d'un bogue dans tex8to7.
+ - les CTRL^C sont maintenant supportés.
+
+o 17/08/2003 00:36
+ - Correction d'un bogue (suppression de la concaténation des fichiers de log
+ pour dvipdf, dvips et ps2pdf).
+
+o 06/08/2003 14:35
+ - Nouvelle version de tex8to7 (v1.1c).
+
+o 05/08/2003 00:15
+ - Correction du bogue lors de la compilation avec un fichier de
+ bibliographie ayant un nom différent du fichier tex.
+ - Modification du test de façon à utiliser un tel fichier de bibliographie.
+
+
+------ v1.2a ------
+
+o 22/07/2003 13:47
+ - Correction d'un bogue dans la manipulation des fichiers externes.
+
+o 21/07/2003 23:20
+ - Correction d'un bogue dans tex8to7 (problème avec "\\{" et les guillemets
+ imbriqués).
+ - Les fichiers externes peuvent désormais être dans un répertoire différent
+ de celui du fichier LaTeX principal.
+
+o 17/07/2003 21:30
+ - Les fichiers TODO.TXT sont fusionnés en un unique fichier du même nom
+ placé à la racine du projet en version anglaise uniquement.
+
+o 09/07/2003 00:50
+ - Les scripts d'installation et de désinstallaion ont été remaniés afin
+ d'être plus souples. ils vérifient maintenant la présence des fichiers
+ indispensables à l'installation.
+
+
+------ v1.2 ------
+
+o 03/07/2003 23:35
+ - Sortie de la première version anglaise du script.
+
+
+------ v1.1b ------
+
+o 25/06/2003 16:27
+ - Ajout des options "-toc" et "-no-toc" pour activer ou désactiver la
+ compilation supplémentaire pour la table des matières.
+
+
+------ v1.1a ------
+
+o 24/06/2003 12:32
+ - Élimination d'un bogue : lors de l'affichage, le visionneur n'était pas
+ pris en compte (oubli lors du changement de version).
+
+o 24/06/2003 14:25
+ - Les commandes "\og" et "\fg" peuvent désormais être imbriquées à l'aide de
+ paires d'accolades.
+ - Le programme tex8to7 supporte maintenant les options "-?" et "-v" en ligne
+ de commande.
+
+
+------ v1.1 ------
+
+o 19/06/2003 12:50
+ - Support d'un fichier de préférences nommé ".shlatex" et placé dans le
+ répertoire personnel de l'utilisateur.
+ - Renommage des options suivantes :
+ --bibliographie --> --bibliography
+ --temporaires --> --temporary
+ --separateur --> --separator
+ -l --log --> -m --messages
+ -aff --afficheur --> -view --viewer
+ -sil --silencieux --> -no-view --no-viewer
+ Les options -view et -no-view permettent seulement d'activer ou de
+ désactiver la visualisation finale. Le visualiseur utilisé est précisé avec
+ les trois nouvelles options suivantes :
+ -v-ps --view-ps-with
+ -v-pdf --view-pdf-with
+ -v-dvi --view-dvi-with
+ - Ajout d'options permettant de contre-carer les effets du fichier de
+ préférences. les nouvelles options sont : -dvi, -no-idx, -no-bib, -no-tmp,
+ -no-z, -1, -no-sep, -no-m, -view et -8.
+ - Légère optimisation du script par le remplacement de variables chaînes par
+ des variables entières.
+ - Le test utilise les fichiers externes.
+
+
+------ v1.0d ------
+
+o 18/06/2003 10:03
+ - Renommage du script de "sLaTeX" en "ShLaTeX" car le nom sLaTeX existe déjà,
+ c'est le nom d'un package qui permet d'écrire du Scheme dans un fichier
+ LaTeX.
+ - Pré-support pour les fichiers externes inclus dans le source tex principal
+ avec les commandes "\input" et "\include".
+ - Amélioration de la version PDF du manuel.
+ - Les fichiers de log ne sont plus effacés sauf après la compilation si
+ l'option -tmp n'est pas utilisée. Tous les fichiers de log se trouvent dans
+ le répertoire de travail.
+
+
+------ v1.0c ------
+
+o 14/05/2003 20:16
+ - Élimination d'un bogue sur l'affichage de l'aide (option -?).
+
+o 07/05/2003 08:30
+ - Élimination d'un bogue sur les arguments optionnels de -idx et -bib.
+
+o 05/05/2003 15:35
+ - L'option -idx admet maintenant un argument optionnel pour spécifier un
+ fichier de style pour l'index.
+ - L'option -bib admet maintenant un argument optionnel pour spécifier un
+ fichier de bibliographie bibtex.
+
+o 04/05/2003 00:39
+ - Ajout d'un test aux scripts "install" et "uninstall" pour vérifier qu'ils
+ sont bien exécutés par root.
+ - Correction d'un bogue de la fonction d'erreur.
+
+o 01/05/2003 13:38
+ - Les messages d'erreur apparaissent désormais après le log latex, bibtex ou
+ makeindex.
+ - Ajout d'une note pour l'installation manuelle dans le fichier
+ LISEZ-MOI.TXT.
+
+
+------ v1.0b ------
+
+o 29/04/2003 00:35
+ - Élimination du message d'aide rapide après les erreurs de compilation ou
+ de conversion.
+ - Mise en place de messages d'avertissement pour les options réservées
+ PostScript.
+ - Options -2 et -4 pour avoir des fichiers PostScript ayant 2 ou 4 pages par
+ feuille.
+ - Option -sep pour délimiter les pages dans les fichiers ayant 2 ou 4 pages
+ par feuille.
+
+o 27/04/2003 21:54
+ - Option -z pour la compression des fichiers PostScript.
+ - Option -l pour afficher les messages LaTeX.
+ - Création d'un répertoire temporaire lors de la compilation.
+ - Option -7 permettant de désactiver l'accentuation (utile pour les
+ anglophones ou les utilisateurs du package fontenc).
+ - Affichage de l'aide complète avec groff et less.
+
+
+------ v1.0a ------
+
+o 31/03/2003 19:33
+ - Ajout des fichiers ".out" aux temporaires.
+ - Correction d'une erreur dans le manuel : dans la section DESCRIPTION
+ remplacement de "-sil" par "-tmp".
+
+
+------ v1.0 ------
+
+[...]
+
diff --git a/support/shlatex/fr/README.TXT b/support/shlatex/fr/README.TXT
new file mode 100644
index 0000000000..3a9fc31adf
--- /dev/null
+++ b/support/shlatex/fr/README.TXT
@@ -0,0 +1,40 @@
+ShLaTeX version 1.2b-fr -- Script de compilation LaTeX pour Linux.
+Copyright (C) 2003 Mael Hilléreau (mael.hillereau@free.fr)
+
+Ce programme est soumis aux termes de la Licence Publique Générale GNU. La GNU
+GPL est fournie avec ce programme (fichier "GPL.TXT").
+
+
+o Installation :
+ ouvrir une session root et exécuter le script "install".
+
+o Désinstallation :
+ ouvrir une session root et exécuter le script "uninstall".
+
+o Installation Manuelle :
+
+ Si vous ne disposez pas des droits de root, vous pouvez utiliser ShLaTeX de
+ la façon suivante :
+
+ - Compilez le programme "tex8to7" :
+
+ cd ../src
+ gcc tex8to7.c -o tex8to7
+
+ le fichier "tex8to7" est alors créé.
+
+ - Copiez le script "ShLaTeX" et le fichier "tex8to7" dans un répertoire
+ accessible (i.e. qui soit dans la variable d'environnement PATH).
+
+ cp tex8to7 <rép>
+ cp ../fr/ShLaTeX <rép>
+
+ où <rép> est le répertoire que vous avez choisi.
+
+ - Changez les droits de ces fichiers afin de pouvoir les exécuter :
+
+ cd <rép>
+ chmod 755 tex8to7 ShLaTeX
+
+ - Vous pouvez alors utiliser le script...
+
diff --git a/support/shlatex/fr/ShLaTeX b/support/shlatex/fr/ShLaTeX
new file mode 100644
index 0000000000..aabc85c266
--- /dev/null
+++ b/support/shlatex/fr/ShLaTeX
@@ -0,0 +1,1617 @@
+#!/bin/bash
+###############################################################################
+# #
+# ShLaTeX #
+# #
+###############################################################################
+# #
+# Auteur: Mael Hilléreau #
+# Mél : mael.hillereau@free.fr #
+# Web : http://mael.hillereau.free.fr #
+# Création : 06/03/2003 #
+# Dernière modif.: 21/08/2003 #
+# Version: 1.2b-fr #
+# Description: Script de compilation LaTeX pour Linux #
+# #
+###############################################################################
+# #
+# ShLaTeX -- Script de compilation LaTeX pour Linux. #
+# Copyright (C) 2003 Mael Hilléreau #
+# #
+# This program is free software; you can redistribute it and/or #
+# modify it under the terms of the GNU General Public License #
+# as published by the Free Software Foundation; either version 2 #
+# of the License, or (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program; if not, write to the Free Software #
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
+# #
+###############################################################################
+nomshell=`expr match "$0" '.*/\([^-\]*\).*'`;
+version="1.2b-fr";
+
+## envoi du code de retour approprié
+function fin() {
+ echo -ne "terminé.\n\n";
+ if [ $errindex -eq 1 ]
+ then
+ exit 3;
+ else
+ if [ $errbib -eq 1 ]
+ then
+ exit 2;
+ else
+ if [ $errcompil -eq 1 ]
+ then
+ exit 1;
+ else
+ exit 0;
+ fi
+ fi
+ fi
+}
+
+## suppression des temporaires
+function suppressionTemp() {
+ if [ $tmp -eq 0 ]
+ then
+ echo "suppression des temporaires latex...";
+ rm -fr ./"$f".ShLaTeX
+ fi
+}
+
+## fct de rappel pour CTRL^C
+function ctrlc() {
+ echo -ne "\n> Annulation !\n";
+ if [ ! "$f" == "-" ]
+ then
+ repCourant=`pwd`;
+ repCourant=`expr match "$repCourant" '.*/\(.*\)'`
+ if [ "$repCourant" == "$f".ShLaTeX ]
+ then
+ cd ..;
+ fi
+ suppressionTemp;
+ fi
+ fin;
+}
+
+## déclaration des variables globales
+
+# nom du fichier
+f="-";
+
+# codes d'erreur
+errindex=0;
+errcompil=0;
+errbib=0;
+
+# options préférencielles
+P_dvipdf=-1;
+P_pdflatex=-1;
+P_dvips=-1;
+P_pstopdf=-1;
+P_dvi=-1;
+P_idx=-1;
+P_no_idx=-1;
+P_idx_file="-";
+P_bib=-1;
+P_no_bib=-1;
+P_bib_file="-";
+P_toc=-1;
+P_no_toc=-1;
+P_tmp=-1;
+P_no_tmp=-1;
+P_z=-1;
+P_no_z=-1;
+P_un=-1;
+P_deux=-1;
+P_quatre=-1;
+P_sep=-1;
+P_no_sep=-1;
+P_m=-1;
+P_no_m=-1;
+P_view=-1;
+P_no_view=-1;
+P_sept=-1;
+P_huit=-1;
+P_v_ps="-";
+P_v_pdf="-";
+P_v_dvi="-";
+
+# options de la ligne de commande
+L_dvipdf=-1;
+L_pdflatex=-1;
+L_dvips=-1;
+L_pstopdf=-1;
+L_dvi=-1;
+L_idx=-1;
+L_no_idx=-1;
+L_idx_file="-";
+L_bib=-1;
+L_no_bib=-1;
+L_bib_file="-";
+L_toc=-1;
+L_no_toc=-1;
+L_tmp=-1;
+L_no_tmp=-1;
+L_z=-1;
+L_no_z=-1;
+L_un=-1;
+L_deux=-1;
+L_quatre=-1;
+L_sep=-1;
+L_no_sep=-1;
+L_m=-1;
+L_no_m=-1;
+L_view=-1;
+L_no_view=-1;
+L_sept=-1;
+L_huit=-1;
+L_v_ps="-";
+L_v_pdf="-";
+L_v_dvi="-";
+
+## options d'éxécution
+mode="dvi";
+idx=0;
+idx_file="-";
+bib=0;
+bib_file="-";
+toc=1;
+tmp=0;
+z=0;
+ppf=1;
+sep=0;
+m=0;
+view=1;
+ascii=7;
+v_ps="gv";
+v_pdf="gv";
+v_dvi="xdvi";
+
+## capture des CTRL^C
+trap "ctrlc" SIGINT
+
+## affiche une aide rapide
+function aideRapide() {
+ echo -ne "> Utilisation :\n";
+ echo -ne "\n";
+ echo -ne " $nomshell [options] <nom_fichier.tex>\n";
+ echo -ne "\n";
+ echo -ne " tapez \"man shlatex\" ou \"$nomshell -?\" pour une aide complète.\n";
+ echo -ne "\n";
+}
+
+## affiche une aide complète
+function aideComplete() {
+echo ".TH \\fBShLaTeX\\fP 1 \"Août 2003\" \"version 1.2b-fr\" \"Manuel d'utilisation\"
+
+.SH NOM
+\\fBShLaTeX\\fP \\- Script de compilation pour documents écrits en langage LaTeX.
+
+.SH SYNOPSIS
+\\fBShLaTeX\\fP [options] \\fIfichierSource.tex\\fP
+
+.SH DESCRIPTION
+.PP
+ Ce script permet de centraliser les nombreux appels de commandes nécessaires à
+la compilation complète d'un document LaTeX. Notamment, les appels multiples à
+la commande \\fBlatex\\fP indispensables pour créer une table des matières, une
+bibliographie ou un index sont effectués automatiquement. Sont également gérés
+les appels aux programmes \\fBbibtex\\fP et \\fBmakeindex\\fP ainsi que la
+visualisation du fichier résultat (au format DVI, PostScript ou PDF) par appel à
+un programme externe.
+.PP
+ Il est possible de compiler les documents qui utilisent les commandes
+\\fB\\\\input\\fP et \\fB\\\\include\\fP pour faire référence à des fichiers externes et
+cela de façon transparente en ne compilant que le fichier source principal.
+.PP
+ Une fois la compilation effectuée les fichiers temporaires sont effacés (option
+\\fB-no-tmp\\fP) ou conservés (option \\fB-tmp\\fP). Les fichiers DVI générés par
+LaTeX peuvent alors être directement convertis au format PostScript ou PDF.
+.PP
+ Ce script prend aussi en charge l'accentuation des caractères français par
+l'intermédiaire d'un programme C externe (nommé \\fBtex8to7\\fP) et fourni avec le
+script (la gestion des accents est donc transparente). Il gère aussi le \"c\"
+cédille ainsi que le remplacement des guillemets par les commandes \\fB\\\\og\\fP et
+\\fB\\\\fg\\fP (cela suppose que les guillemets soient appariés). Les guillemets
+peuvent être impriqués en utilisant des accolades pour distinguer les différentes
+paires de guillemets. Par exemple, le texte :
+.PP
+ Les guillemets \"peuvent être {\"imbriqués\"} à l'aide d'accolades\".
+.PP
+ est un exemple correct.
+.PP
+ Les options par défaut (préférences) sont stockées dans le répertoire
+personnel de l'utilisateur dans le fichier \\fB~/.shlatex\\fP. Voir la section
+FICHIERS pour connaître la syntaxe de ce fichier.
+.SH OPTIONS
+.IP \"\\fB\\-dvipdf\\fP\"
+Sélectionne un format PDF au lieu du format DVI pour le fichier résultat. Le
+programme \\fBdvipdf\\fP est alors utilisé pour la conversion.
+.IP \"\\fB\\-pdflatex\\fP\"
+Sélectionne un format PDF au lieu du format DVI pour le fichier résultat. Le
+programme \\fBpdflatex\\fP est alors directement utilisé pour créer le fichier
+résultat.
+.IP \"\\fB-dvips\\fP\"
+Sélectionne un format PostScript au lieu du format DVI pour le fichier résultat.
+Le programme \\fBdvips\\fP est alors utilisé pour la conversion.
+.IP \"\\fB-ps2pdf\\fP\"
+Sélectionne un format PDF au lieu du format PostScript pour le fichier résultat.
+Utilise l'option \\fB-dvips\\fP. Les programmes \\fBdvips\\fP et \\fBps2pdf\\fP sont
+successivement utilisés pour la conversion et le fichier PostScript est conservé
+après la conversion.
+.IP \"\\fB-dvi\\fP\"
+Sélectionne un format DVI pour le fichier résultat.
+.IP \"\\fB-idx\\fP \\fI[style.ist]\\fP ou \\fB--index\\fP \\fI[style.ist]\\fP\"
+Active la création de l'index (pour une utilisation avec le module
+\\fImakeidx\\fP). Le fichier optionnel \\fIstyle.ist\\fP est un fichier de
+style pour \\fBmakeindex\\fP.
+.IP \"\\fB-no-idx\\fP ou \\fB--no-index\\fP\"
+Désactive la création de l'index.
+.IP \"\\fB-bib\\fP \\fI[fichier.bib]\\fP ou \\fB--bibliography\\fP \\fI[fichier.bib]\\fP\"
+Active la création de la bibliographie avec \\fBbibtex\\fP en se basant sur
+\\fIfichier.bib\\fP. Si aucun fichier n'est indiqué, le fichier d'extension \".bib\"
+doit porter le même nom que \\fIfichierSource\\fP.tex.
+.IP \"\\fB-no-bib\\fP ou \\fB--no-bibliography\\fP\"
+Désactive la création de la bibliographie.
+.IP \"\\fB-toc\\fP ou \\fB--table-of-contents\\fP\"
+Active la compilation supplémentaire pour la construction d'une table des
+matières, une table des figures, une liste des tableaux et toutes les références
+LaTeX (commande \\fB\\label{...}\\fP).
+.IP \"\\fB-no-toc\\fP ou \\fB--no-table-of-contents\\fP\"
+Désactive la compilation supplémentaire pour la construction d'une table des
+matières, une table des figures, une liste des tableaux et toutes les références
+LaTeX (commande \\fB\\label{...}\\fP).
+.IP \"\\fB-tmp\\fP ou \\fB--temporary\\fP\"
+Conserve après l'ecécution du script les fichiers temporaires créés par LaTeX.
+Ces fichiers sont ainsi stockés dans un répertoire nommé
+\\fIfichierSource.ShLaTeX\\fP.
+.IP \"\\fB-no-tmp\\fP ou \\fB--no-temporary\\fP\"
+Supprime après l'ecécution du script les fichiers temporaires créés par LaTeX.
+.IP \"\\fB-z\\fP ou \\fB--gzip\\fP\"
+Compresse les fichiers PostScript avec le programme \\fBgzip\\fP. Les fichiers
+prennent alors l'extension \".ps.gz\".
+.IP \"\\fB-no-z\\fP ou \\fB--no-gzip\\fP\"
+Désactive la compression des fichiers PostScript avec le programme \\fBgzip\\fP.
+.IP \"\\fB-1\\fP ou \\fB--1page\\fP\"
+Génère des fichiers PostScript ayant 1 page a4 par feuille a4.
+.IP \"\\fB-2\\fP ou \\fB--2pages\\fP\"
+Génère des fichiers PostScript ayant 2 pages a5 par feuille a4.
+.IP \"\\fB-4\\fP ou \\fB--4pages\\fP\"
+Génère des fichiers PostScript ayant 4 pages a6 par feuille a4.
+.IP \"\\fB-sep\\fP ou \\fB--separator\\fP\"
+S'utilise avec l'option \\fB-2\\fP ou \\fB-4\\fP. Permet de tracer une ligne séparatrice entre
+les différentes pages d'une même feuille.
+.IP \"\\fB-no-sep\\fP ou \\fB--no-separator\\fP\"
+S'utilise avec l'option \\fB-2\\fP ou \\fB-4\\fP. Permet de désactiver le tracé de la
+ligne séparatrice entre les différentes pages d'une même feuille.
+.IP \"\\fB-m\\fP ou \\fB--messages\\fP\"
+Affiche systématiquement les messages de LaTeX dans la console (voir aussi la
+section ERREURS DE COMPILATION).
+.IP \"\\fB-no-m\\fP ou \\fB--no-messages\\fP\"
+Si cette option est utilisée, les messages de LaTeX n'apparaissent qu'en cas
+d'erreur (voir aussi la section ERREURS DE COMPILATION).
+.IP \"\\fB-view\\fP ou \\fB--viewer\\fP\"
+Active la visualisation finale.
+.IP \"\\fB-no-view\\fP ou \\fB--no-viewer\\fP\"
+Désactive la visualisation finale.
+.IP \"\\fB-7\\fP ou \\fB--7bits\\fP\"
+Désactive l'accentuation du fichier source LaTeX. Le fichier source doit être un
+fichier ascii codé sur 7 bits.
+.IP \"\\fB-8\\fP ou \\fB--8bits\\fP\"
+Active l'accentuation du fichier source LaTeX. Le fichier source peut être un
+fichier ascii codé sur 8 bits.
+.IP \"\\fB-v-ps\\fP \\fIvisionneur\\fP ou \\fB--view-ps-with\\fP \\fIvisionneur\\fP\"
+Utilise le programme \\fIvisionneur\\fP pour la visualisation finale des fichiers
+PostScript.
+.IP \"\\fB-v-pdf\\fP \\fIvisionneur\\fP ou \\fB--view-pdf-with\\fP \\fIvisionneur\\fP\"
+Utilise le programme \\fIvisionneur\\fP pour la visualisation finale des fichiers
+PDF.
+.IP \"\\fB-v-dvi\\fP \\fIvisionneur\\fP ou \\fB--view-dvi-with\\fP \\fIvisionneur\\fP\"
+Utilise le programme \\fIvisionneur\\fP pour la visualisation finale des fichiers
+DVI.
+.IP \"\\fB-v\\fP ou \\fB--version\\fP\"
+Affiche la version et quitte.
+.IP \"\\fB-?\\fP, \\fB-h\\fP ou \\fB--help\\fP\"
+Affiche l'aide.
+
+.IP \"\\fINote\\fP :\"
+Lors de l'utilisation de l'option \\fB\\-view\\fP, le format de fichier choisi en
+sortie (DVI, PostScript ou PDF) doit être lisible par le programme
+\\fIvisionneur\\fP pour que la visualisation fonctionne correctement. Par défaut,
+les programme utilisés sont \\fBxdvi\\fP pour les fichiers DVI et \\fBgv\\fP pour
+les fichiers PostScript et PDF.
+
+.SH \"ERREURS DE COMPILATION\"
+.PP
+ Si l'option \\fB-no-m\\fP est utilisée, en cas d'erreur de compilation par
+LaTeX, le script ne répond plus. On peut l'arrêter en tapant les options de la
+ligne de commande (\"x\" pour ignorer, \"q\" pour quitter, ...) en aveugle, ou en
+tapant \"Ctrl^C\". Dans les deux cas, les erreurs seront affichées juste après.
+Cette imperfection est due au choix de ne pas afficher les messages du programme
+\\fBlatex\\fP par défaut. Cependant, le problème n'existe que si le mode
+d'interaction autorise LaTeX à s'arrêter sur les erreurs (ce qui n'est pas le
+cas, par exemple si la commande \\fB\\\\nonstopmode\\fP est utilisée).
+.PP
+ Dans tous les cas, il est possible de forcer l'affichage des messages de
+\\fBlatex\\fP en utilisant l'option \\fB-m\\fP à la place de l'option \\fB-no-m\\fP.
+
+.SH \"FICHIERS\"
+.PP
+ Le fichier \\fB~/.shlatex\\fP contient les préférences de l'utilisateur. Il peut
+être modifié afin d'utiliser des valeurs par défaut personnalisées pour les
+options du script, mais la syntaxe du fichier doit être respectée :
+.PP
+ Chaque ligne du fichier doit contenir une et une seule option. Les options
+sont toutes permises à l'exeption de \\fB-v\\fP et \\fB-?\\fP qui n'auraient pas
+leur place dans le fichier de préférences. Pour les options qui admettent des
+paramètres, comme dans le shell, ils seront placés après leur option respective
+mais devront en être séparés par un seul caractère d'espacement ('\\ '). L'ordre
+des options n'importe pas.
+.PP
+ Dans le cas où des incohérences apparaîtraient lors de l'exécution du script,
+des avertissements seront affichés.
+.PP
+ Si lors de la première exécution du script, le fichier \\fB~/.shlatex\\fP
+n'existe pas, alors il sera créé automatiquement avec le contenu suivant :
+.RS 5
+.IP \"-dvips\"
+.IP \"-view\"
+.IP \"-no-idx\"
+.IP \"-no-bib\"
+.IP \"-toc\"
+.IP \"-no-tmp\"
+.IP \"-no-z\"
+.IP \"-1\"
+.IP \"-no-sep\"
+.IP \"-no-m\"
+.IP \"-8\"
+.IP \"-v-ps gv\"
+.IP \"-v-pdf gv\"
+.IP \"-v-dvi xdvi\"
+
+.SH \"PROBLÈMES CONNUS\"
+.SS \"BoundingBox\"
+.PP
+ Lorsque l'on insère une image avec la commande \\fB\\\\includegraphics\\fP, il
+faut spécifier la \"boundingbox\" en argument de la commande, sinon la compilation
+ne fonctionne pas. Voici un exemple :
+.PP
+ \\\\includegraphics[bb=0 0 100 200]{image.eps}
+.SS \"Fichiers externes\"
+ Pour que l'inclusion de fichiers externes fonctionne correctement, les commandes
+\\fB\\\\input\\fP et \\fB\\\\include\\fP doivent être placées sur des lignes indépendantes
+du fichier \\fIfichierSource.tex\\fP.
+
+.SH \"VOIR AUSSI\"
+.BR latex (1),
+.BR pdflatex (1),
+.BR dvips (1),
+.BR ps2pdf (1),
+.BR dvipdf (1),
+.BR xdvi (1),
+.BR gv (1),
+.BR gzip (1)
+
+.SH \"BOGUES\"
+.PP
+Merci de signaler les bogues en envoyant un mél à l'adresse de la section
+AUTEUR.
+
+.SH \"LICENCE\"
+.PP
+ Ce script et l'ensemble des fichiers qui lui sont relatifs (dont ce manuel)
+sont soumis aux termes de la Licence Publique Générale GNU. La GPL GNU est
+fournie avec le script (fichier /usr/share/shlatex/GPL.TXT) et est également
+disponible à l'adresse http://www.gnu.org/licenses/gpl.html.
+
+.SH \"AUTEUR\"
+.PP
+Copyright (C) 2003 Mael Hilléreau
+.PP
+\\fIcontact\\fP : mael.hillereau@free.fr
+.PP
+\\fIweb\\fP : http://mael.hillereau.free.fr
+" > ~/ShLaTeX_"$version".tmp;
+man ~/ShLaTeX_"$version".tmp
+rm -f ~/ShLaTeX_"$version".tmp
+}
+
+## affiche un message d'erreur
+function erreur() {
+ echo -ne "\n";
+ echo -ne "> Erreur :\n";
+ echo -ne " $1\n";
+ echo -ne "\n";
+ if [ $# -eq 2 ]
+ then
+ if [ $2 == "-?" ]
+ then
+ aideRapide;
+ fi
+ fi
+}
+
+## affiche un message d'avertissement
+function avertissement() {
+ echo -ne "\n";
+ echo -ne "> Avertissement :\n";
+ echo -ne " $1\n";
+ echo -ne "\n";
+}
+
+## affiche la version et sort
+function version() {
+ echo -ne "$nomshell version $version - Script de compilation LaTeX pour Linux.\nCopyright (C) 2003 Mael Hilléreau\n";
+ exit 0;
+}
+
+## recherche les fichiers externes (1 seul par ligne dans le source LaTeX !)
+function fichiersExternes() {
+ fExt="";
+ lignes=`grep -e "^[ |\t]*\input{" $1`;
+ lignes=`echo $lignes | grep -v -E "^[ |\t]*%.*"`
+ for l in $lignes
+ do
+ fExt="$fExt `expr match $l '.*\input{\(.*\)}'`";
+ done
+ lignes=`grep -e "^[ |\t]*\include{" $1`;
+ lignes=`echo $lignes | grep -v -E "^[ |\t]*%.*"`
+ for l in $lignes
+ do
+ fExt="$fExt `expr match $l '.*\include{\(.*\)}'`";
+ done
+ lignes=`grep -e "^[ |\t]*\in\(put\|clude\) " $1`;
+ lignes=`echo $lignes | grep -v -E "^[ |\t]*%.*"`
+ for l in $lignes
+ do
+ if [ ! $l == "\input" -a ! $l == "\include" ]
+ then
+ fExt="$fExt $l";
+ fi
+ done
+ fTemp="";
+ for l in $fExt
+ do
+ cTemp=`expr match $l '[ |\t]*\(.*\)\.tex'`;
+ if [[ $cTemp == "" ]]
+ then
+ fTemp="$fTemp $l";
+ else
+ fTemp="$fTemp $cTemp";
+ fi
+ done
+ fExt=$fTemp;
+}
+
+## remplace les fichiers externes nommés $1 par $2 dans le fichier $3
+function rplcExtFich() {
+ if [ -f $3 ]
+ then
+ lignes=`cat $3 | grep -n "\input $1" | tr " " "@"`;
+ lignes="`cat $3 | grep -n \input{$1}` $lignes";
+ for ligne in $lignes
+ do
+ ligne=`echo $ligne | tr "@" " "`;
+ nblignes=`wc -l $3 | tr -s " " ":" | cut -f 2 -d ":"`;
+ nligne=`echo $ligne | cut -f 1 -d ":"`;
+ nligne=`expr $nligne - 1`;
+ fin=`expr $nblignes - $nligne - 1`;
+ head -$nligne "$3" > "$3".tmp
+ echo "\input{$2}" >> "$3.tmp"
+ tail -n $fin "$3" >> "$3".tmp
+ mv -f "$3".tmp "$3"
+ done
+ lignes=`cat $3 | grep -n "\include $1" | tr " " "@"`;
+ lignes="`cat $3 | grep -n \include{$1}` $lignes";
+ for ligne in $lignes
+ do
+ ligne=`echo $ligne | tr "@" " "`;
+ nblignes=`wc -l $3 | tr -s " " ":" | cut -f 2 -d ":"`;
+ nligne=`echo $ligne | cut -f 1 -d ":"`;
+ nligne=`expr $nligne - 1`;
+ fin=`expr $nblignes - $nligne - 1`;
+ head -$nligne "$3" > "$3".tmp
+ echo "\include{$2}" >> "$3.tmp"
+ tail -n $fin "$3" >> "$3".tmp
+ mv -f "$3".tmp "$3"
+ done
+ fi
+}
+
+## vérifie que le fichier fourni est accessible et éxécutable
+function estExec() {
+ for rep in `echo $PATH | tr ":" " "`
+ do
+ if [ -x $rep/$1 ]
+ then
+ return 1;
+ fi
+ done
+ return 0;
+}
+
+## vérifie qu'au plus un seul des arguments entiers a été initialisé
+function verifInit() {
+ i=0;
+ for a
+ do
+ if [ $a -ne -1 ]
+ then
+ i=`expr $i + 1`;
+ fi
+ done
+ return $i;
+}
+
+## charge les préférences à partir du fichier ~/.shlatex (une option par ligne)
+function preferences() {
+ for ligne in `grep -e "^-.*" ~/.shlatex | tr " " "="`
+ do
+ opt=`expr match $ligne '[:space:]*\(-[-a-z0-9]*\)=*.*'`;
+ paramopt="";
+ paramopt=`expr match $ligne '[:space:]*-[-a-z0-9]*=\(.*\)'`;
+ case $opt in
+ "-dvipdf" )
+ P_dvipdf=1;;
+ "-pdflatex" )
+ P_pdflatex=1;;
+ "-ps2pdf" )
+ P_pstopdf=1;;
+ "-dvips" )
+ P_dvips=1;;
+ "-dvi" )
+ P_dvi=1;;
+ "-idx" | "--index" )
+ P_idx=1;
+ if [ ! $paramopt == "" ]
+ then
+ P_idx_file=$paramopt;
+ fi ;;
+ "-no-idx" | "--no-index" )
+ P_no_idx=1;
+ ;;
+ "-bib" | "--bibliography" )
+ P_bib=1;
+ if [ ! $paramopt == "" ]
+ then
+ P_bib_file=`expr match $paramopt '\(.*\)\.bib'`;
+ fi ;;
+ "-no-bib" | "--no-bibliography" )
+ P_no_bib=1;;
+ "-toc" | "--table-of-contents" )
+ P_toc=1;;
+ "-no-toc" | "--no-table-of-contents" )
+ P_no_toc=1;;
+ "-tmp" | "--temporary" )
+ P_tmp=1;;
+ "-no-tmp" | "--no-temporary" )
+ P_no_tmp=1;;
+ "-z" | "--gzip" )
+ P_z=1;;
+ "-no-z" | "--no-gzip" )
+ P_no_z=1;;
+ "-1" | "--1page" )
+ P_un=1;;
+ "-2" | "--2pages" )
+ P_deux=1;;
+ "-4" | "--4pages" )
+ P_quatre=1;;
+ "-sep" | "--separator" )
+ P_sep=1;;
+ "-no-sep" | "--no-separator" )
+ P_no_sep=1;;
+ "-m" | "--messages" )
+ P_m=1;;
+ "-no-m" | "--no-messages" )
+ P_no_m=1;;
+ "-view" | "--viewer" )
+ P_view=1;;
+ "-no-view" | "--no-viewer" )
+ P_no_view=1;;
+ "-7" )
+ P_sept=1;;
+ "-8" )
+ P_huit=1;;
+ "-v-ps" | "--view-ps-with" )
+ if [ ! $paramopt == "" ]
+ then
+ P_v_ps=$paramopt;
+ else
+ avertissement "fichier \"$HOME/.shalatex\" -- option \"$opt\" ignorée, paramètre manquant !";
+ fi ;;
+ "-v-pdf" | "--view-pdf-with" )
+ if [ ! $paramopt == "" ]
+ then
+ P_v_pdf=$paramopt;
+ else
+ avertissement "fichier \"$HOME/.shalatex\" -- option \"$opt\" ignorée, paramètre manquant !";
+ fi ;;
+ "-v-dvi" | "--view-dvi-with" )
+ if [ ! $paramopt == "" ]
+ then
+ P_v_dvi=$paramopt;
+ else
+ avertissement "fichier \"$HOME/.shalatex\" -- option \"$opt\" ignorée, paramètre manquant !";
+ fi ;;
+ * )
+ avertissement "fichier \"$HOME/.shlatex\" -- option \"$opt\" ignorée ; cette option n'existe pas ou n'est pas supportée dans le fichier de préférences";;
+ esac
+ done
+ ## vérification des options des préférences
+ # mode
+ verifInit $P_pstopdf $P_dvips $P_dvipdf $P_pdflatex $P_dvi;
+ if [ $? -gt 1 ]
+ then
+ avertissement "fichier \"$HOME/.shlatex\" -- les options -dvipdf, -dvips, -pdflatex, -ps2pdf et -dvi sont mutuellement exclusives !";
+ fi
+ # index
+ verifInit $P_idx $P_no_idx;
+ if [ $? -gt 1 ]
+ then
+ avertissement "fichier \"$HOME/.shlatex\" -- les options -idx et -no-idx sont mutuellement exclusives !";
+ fi
+ # bibliography
+ verifInit $P_bib $P_no_bib;
+ if [ $? -gt 1 ]
+ then
+ avertissement "fichier \"$HOME/.shlatex\" -- les options -bib et -no-bib sont mutuellement exclusives !";
+ fi
+ # table of contents
+ verifInit $P_toc $P_no_toc;
+ if [ $? -gt 1 ]
+ then
+ avertissement "fichier \"$HOME/.shlatex\" -- les options -toc et -no-toc sont mutuellement exclusives !";
+ fi
+ # temporary
+ verifInit $P_tmp $P_no_tmp;
+ if [ $? -gt 1 ]
+ then
+ avertissement "fichier \"$HOME/.shlatex\" -- les options -tmp et -no-tmp sont mutuellement exclusives !";
+ fi
+ # gzip
+ verifInit $P_z $P_no_z;
+ if [ $? -gt 1 ]
+ then
+ avertissement "fichier \"$HOME/.shlatex\" -- les options -z et -no-z sont mutuellement exclusives !";
+ fi
+ # 1, 2, 4
+ verifInit $P_un $P_deux $P_quatre;
+ if [ $? -gt 1 ]
+ then
+ avertissement "fichier \"$HOME/.shlatex\" -- les options -1, -2 et -4 sont mutuellement exclusives !";
+ fi
+ # separator
+ verifInit $P_sep $P_no_sep;
+ if [ $? -gt 1 ]
+ then
+ avertissement "fichier \"$HOME/.shlatex\" -- les options -sep et -no-sep sont mutuellement exclusives !";
+ fi
+ # messages
+ verifInit $P_m $P_no_m;
+ if [ $? -gt 1 ]
+ then
+ avertissement "fichier \"$HOME/.shlatex\" -- les options -m et -no-m sont mutuellement exclusives !";
+ fi
+ # view
+ verifInit $P_view $P_no_view;
+ if [ $? -gt 1 ]
+ then
+ avertissement "fichier \"$HOME/.shlatex\" -- les options -view et -no-view sont mutuellement exclusives !";
+ fi
+ # 7, 8
+ verifInit $P_sept $P_huit;
+ if [ $? -gt 1 ]
+ then
+ avertissement "fichier \"$HOME/.shlatex\" -- les options -7 et -8 sont mutuellement exclusives !";
+ fi
+}
+
+## si il n'y a pas de fichier de préférences, on le crée avec des valeurs par défaut
+if [ ! -f ~/.shlatex ]
+then
+ echo -ne "-dvips\n-view\n-no-idx\n-no-bib\n-toc\n-no-tmp\n-no-z\n-1\n-no-sep\n-no-m\n-8\n-v-ps gv\n-v-pdf gv\n-v-dvi xdvi\n" > ~/.shlatex
+fi
+
+## chargement des préférences
+preferences;
+
+## vérification du nombre d'arguments et récupération des options
+if [ $# -lt 2 ]
+then
+ if [ $# -eq 1 ]
+ then
+ if [ $1 == "-?" -o $1 == "-h" -o $1 == "--help" ]
+ then
+ aideComplete;
+ exit 0;
+ elif [ $1 == "-v" -o $1 == "--version" ]
+ then
+ version
+ exit 0;
+ fi
+ else
+ erreur "nombre d'arguments incorrect !" -?;
+ exit 1;
+ fi
+else
+ noshift=0;
+ while [ $# -gt 1 ]
+ do
+ case $1 in
+ "-dvipdf" )
+ L_dvipdf=1;;
+ "-pdflatex" )
+ L_pdflatex=1;;
+ "-ps2pdf" )
+ L_pstopdf=1;;
+ "-dvips" )
+ L_dvips=1;;
+ "-dvi" )
+ L_dvi=1;;
+ "-idx" | "--index" )
+ L_idx=1;
+ if [ $# -gt 2 ]
+ then
+ shift;
+ if [ ! ${1:0:1} == "-" ]
+ then
+ L_idx_file=$1;
+ else
+ noshift=1;
+ fi
+ fi ;;
+ "-no-idx" | "--no-index" )
+ L_no_idx=1;;
+ "-bib" | "--bibliography" )
+ L_bib=1;
+ if [ $# -gt 2 ]
+ then
+ shift;
+ if [ ! ${1:0:1} == "-" ]
+ then
+ if [ -f $1 ]
+ then
+ L_bib_file=`expr match "$1" '\(.*\)\.bib'`;
+ else
+ erreur "le fichier de bibliographie \"$1\" n'existe pas !" -?;
+ exit 1;
+ fi
+ else
+ noshift=1;
+ fi
+ fi ;;
+ "-no-bib" | "--no-bibliography" )
+ L_no_bib=1;;
+ "-toc" | "--table-of-contents" )
+ L_toc=1;;
+ "-no-toc" | "--no-table-of-contents" )
+ L_no_toc=1;;
+ "-tmp" | "--temporary" )
+ L_tmp=1;;
+ "-no-tmp" | "--no-temporary" )
+ L_no_tmp=1;;
+ "-z" | "--gzip" )
+ L_z=1;;
+ "-no-z" | "--no-gzip" )
+ L_no_z=1;;
+ "-1" | "--1page" )
+ L_un=1;;
+ "-2" | "--2pages" )
+ L_deux=1;;
+ "-4" | "--4pages" )
+ L_quatre=1;;
+ "-sep" | "--separator" )
+ L_sep=1;;
+ "-no-sep" | "--no-separator" )
+ L_no_sep=1;;
+ "-m" | "--messages" )
+ L_m=1;;
+ "-no-m" | "--no-messages" )
+ L_no_m=1;;
+ "-view" | "--viewer" )
+ L_view=1;;
+ "-no-view" | "--no-viewer" )
+ L_no_view=1;;
+ "-7" )
+ L_sept=1;;
+ "-8" )
+ L_huit=1;;
+ "-v-ps" | "--view-ps-with" )
+ if [ $# -gt 2 ]
+ then
+ shift;
+ if [ ! ${1:0:1} == "-" ]
+ then
+ estExec $1;
+ if [ $? -eq 1 ]
+ then
+ L_v_ps=$1;
+ else
+ erreur "le fichier \"$1\" n'est pas accessible ou n'est pas éxécutable depuis la ligne de commande !";
+ exit 1;
+ fi
+ else
+ noshift=1;
+ fi
+ else
+ erreur "l'argument $1 nécessite un paramètre !" -?;
+ exit 1;
+ fi ;;
+ "-v-pdf" | "--view-pdf-with" )
+ if [ $# -gt 2 ]
+ then
+ shift;
+ if [ ! ${1:0:1} == "-" ]
+ then
+ estExec $1;
+ if [ $? -eq 1 ]
+ then
+ L_v_pdf=$1;
+ else
+ erreur "le fichier \"$1\" n'est pas accessible ou n'est pas éxécutable depuis la ligne de commande !";
+ exit 1;
+ fi
+ else
+ noshift=1;
+ fi
+ else
+ erreur "l'argument $1 nécessite un paramètre !" -?;
+ exit 1;
+ fi ;;
+ "-v-dvi" | "--view-dvi-with" )
+ if [ $# -gt 2 ]
+ then
+ shift;
+ if [ ! ${1:0:1} == "-" ]
+ then
+ estExec $1;
+ if [ $? -eq 1 ]
+ then
+ L_v_dvi=$1;
+ else
+ erreur "le fichier \"$1\" n'est pas accessible ou n'est pas éxécutable depuis la ligne de commande !";
+ exit 1;
+ fi
+ else
+ noshift=1;
+ fi
+ else
+ erreur "l'argument $1 nécessite un paramètre !" -?;
+ exit 1;
+ fi ;;
+ "-?" | "-h" | "--help" )
+ aideRapide;
+ exit 0;;
+ "-v" | "--version" )
+ version;;
+ * )
+ erreur "l'argument \"$1\" est incorrect !" -?;
+ exit 1;;
+ esac
+ if [ $noshift -eq 0 ]
+ then
+ shift;
+ else
+ noshift=0;
+ fi
+ done
+fi
+
+# vérification de l'existence d'un nom pour le fichier source LaTeX
+if [ $# -ne 1 ]
+then
+ erreur "fichier source LaTeX manquant !" -?;
+ exit 1;
+fi
+
+# vérification de l'existence du fichier source LaTeX
+if [ ! -f $1 ]
+then
+ erreur "impossible de trouver le fichier \"$1\" !" -?;
+ exit 1;
+fi
+
+# nom du fichier source
+fich=$1;
+
+# nom du fichier source sans son extension ".tex"
+f=`expr match "$fich" '\(.*\)\.[a-zA-Z]*'`;
+
+## vérification des options de la ligne de commande
+# mode
+verifInit $L_pstopdf $L_dvips $L_dvipdf $L_pdflatex $L_dvi;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "les options -dvipdf, -dvips, -pdflatex, -ps2pdf et -dvi sont mutuellement exclusives !";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_dvipdf -eq 1 ]
+ then
+ mode="dvipdf";
+ elif [ $L_dvips -eq 1 ]
+ then
+ mode="dvips";
+ elif [ $L_pdflatex -eq 1 ]
+ then
+ mode="pdflatex";
+ elif [ $L_pstopdf -eq 1 ]
+ then
+ mode="ps2pdf";
+ elif [ $L_dvi -eq 1 ]
+ then
+ mode="dvi";
+ fi
+else
+ # préférences
+ if [ $P_dvipdf -eq 1 ]
+ then
+ mode="dvipdf";
+ elif [ $P_dvips -eq 1 ]
+ then
+ mode="dvips";
+ elif [ $P_pdflatex -eq 1 ]
+ then
+ mode="pdflatex";
+ elif [ $P_pstopdf -eq 1 ]
+ then
+ mode="ps2pdf";
+ elif [ $P_dvi -eq 1 ]
+ then
+ mode="dvi";
+ fi
+fi
+# index
+verifInit $L_idx $L_no_idx;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "les options -idx et -no-idx sont mutuellement exclusives !";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_idx -eq 1 ]
+ then
+ idx=1;
+ else
+ idx=0;
+ fi
+else
+ # préférences
+ if [ $P_idx -eq 1 ]
+ then
+ idx=1;
+ else
+ idx=0;
+ fi
+fi
+if [ ! $L_idx_file == "-" ]
+then
+ idx_file=$L_idx_file;
+elif [ ! $P_idx_file == "-" ]
+then
+ idx_file=$P_idx_file;
+fi
+# bibliography
+verifInit $L_bib $L_no_bib;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "les options -bib et -no-bib sont mutuellement exclusives !";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_bib -eq 1 ]
+ then
+ bib=1;
+ else
+ bib=0;
+ fi
+else
+ # préférences
+ if [ $P_bib -eq 1 ]
+ then
+ bib=1;
+ else
+ bib=0;
+ fi
+fi
+if [ ! $L_bib_file == "-" ]
+then
+ bib_file=$L_bib_file;
+elif [ ! $P_bib_file == "-" ]
+then
+ bib_file=$P_bib_file;
+fi
+# table of contents
+verifInit $L_toc $L_no_toc;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "les options -toc et -no-toc sont mutuellement exclusives !";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_toc -eq 1 ]
+ then
+ toc=1;
+ else
+ toc=0;
+ fi
+else
+ # préférences
+ if [ $P_toc -eq 1 ]
+ then
+ toc=1;
+ else
+ toc=0;
+ fi
+fi
+# temporary
+verifInit $L_tmp $L_no_tmp;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "les options -tmp et -no-tmp sont mutuellement exclusives !";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_tmp -eq 1 ]
+ then
+ tmp=1;
+ else
+ tmp=0;
+ fi
+else
+ # préférences
+ if [ $P_tmp -eq 1 ]
+ then
+ tmp=1;
+ else
+ tmp=0;
+ fi
+fi
+# gzip
+verifInit $L_z $L_no_z;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "les options -z et -no-z sont mutuellement exclusives !";
+ exit 1;
+elif [ $mode == "dvips" -o $mode == "ps2pdf" ]
+then
+ if [ $iopt -eq 1 ]
+ then
+ # ligne de commande
+ if [ $L_z -eq 1 ]
+ then
+ z=1;
+ else
+ z=0;
+ fi
+ else
+ # préférences
+ if [ $P_z -eq 1 ]
+ then
+ z=1;
+ else
+ z=0;
+ fi
+ fi
+elif [ $iopt -eq 1 ]
+then
+ avertissement "option -z ignorée -- l'option -z ne concerne que les fichiers PostScript !";
+fi
+# 1, 2, 4
+verifInit $L_un $L_deux $L_quatre;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "les options -1, -2 et -4 sont mutuellement exclusives !";
+ exit 1;
+elif [ $mode == "dvips" -o $mode == "ps2pdf" ]
+then
+ if [ $iopt -eq 1 ]
+ then
+ # ligne de commande
+ if [ $L_un -eq 1 ]
+ then
+ ppf=1;
+ elif [ $L_deux -eq 1 ]
+ then
+ ppf=2;
+ else
+ ppf=4;
+ fi
+ else
+ # préférences
+ if [ $P_un -eq 1 ]
+ then
+ ppf=1;
+ elif [ $P_deux -eq 1 ]
+ then
+ ppf=2;
+ else
+ ppf=4;
+ fi
+ fi
+elif [ $iopt -eq 1 ]
+then
+ if [ $L_un -eq 1 ]
+ then
+ avertissement "option -1 ignorée -- les options -1, -2 et -4 n'agissent que sur les fichiers PostScript !";
+ elif [ $L_deux -eq 1 ]
+ then
+ avertissement "option -2 ignorée -- les options -1, -2 et -4 n'agissent que sur les fichiers PostScript !";
+ else
+ avertissement "option -4 ignorée -- les options -1, -2 et -4 n'agissent que sur les fichiers PostScript !";
+ fi
+fi
+# separator
+verifInit $L_sep $L_no_sep;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "les options -sep et -no-sep sont mutuellement exclusives !";
+ exit 1;
+elif [ $ppf -gt 1 ]
+then
+ if [ $iopt -eq 1 ]
+ then
+ # ligne de commande
+ if [ $L_sep -eq 1 ]
+ then
+ sep=1;
+ else
+ sep=0;
+ fi
+ else
+ # préférences
+ if [ $P_sep -eq 1 ]
+ then
+ sep=1;
+ else
+ sep=0;
+ fi
+ fi
+elif [ $iopt -eq 1 ]
+then
+ avertissement "option -sep ignorée -- l'option -sep ne s'utilise qu'avec les options -2 et -4 !";
+fi
+# messages
+verifInit $L_m $L_no_m;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "les options -m et -no-m sont mutuellement exclusives !";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_m -eq 1 ]
+ then
+ m=1;
+ else
+ m=0;
+ fi
+else
+ # préférences
+ if [ $P_m -eq 1 ]
+ then
+ m=1;
+ else
+ m=0;
+ fi
+fi
+# view
+verifInit $L_view $L_no_view;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "les options -view et -no-view sont mutuellement exclusives !";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_view -eq 1 ]
+ then
+ view=1;
+ else
+ view=0;
+ fi
+else
+ # préférences
+ if [ $P_view -eq 1 ]
+ then
+ view=1;
+ else
+ view=0;
+ fi
+fi
+# 7, 8
+verifInit $L_sept $L_huit;
+iopt=$?;
+if [ $iopt -gt 1 ]
+then
+ erreur "les options -7 et -8 sont mutuellement exclusives !";
+ exit 1;
+elif [ $iopt -eq 1 ]
+then
+ # ligne de commande
+ if [ $L_sept -eq 1 ]
+ then
+ ascii=7;
+ else
+ ascii=8;
+ fi
+else
+ # préférences
+ if [ $P_sept -eq 1 ]
+ then
+ ascii=7;
+ else
+ ascii=8;
+ fi
+fi
+# v_dvi
+if [ ! $L_v_dvi == "-" ]
+then
+ # lige de commande
+ v_dvi=$L_v_dvi;
+elif [ ! $P_v_dvi == "-" ]
+then
+ # préférences
+ v_dvi=$P_v_dvi;
+fi
+# v_ps
+if [ ! $L_v_ps == "-" ]
+then
+ # lige de commande
+ v_ps=$L_v_ps;
+elif [ ! $P_v_ps == "-" ]
+then
+ # préférences
+ v_ps=$P_v_ps;
+fi
+# v_pdf
+if [ ! $L_v_pdf == "-" ]
+then
+ # lige de commande
+ v_pdf=$L_v_pdf;
+elif [ ! $P_v_pdf == "-" ]
+then
+ # préférences
+ v_pdf=$P_v_pdf;
+fi
+
+
+## test de l'existance du fichier de bibliographie
+if [ $bib -eq 1 -a $bib_file == "-" ]
+then
+ if [ ! -f "$f".bib ]
+ then
+ erreur "vous avez utilisé l'option -bib et le fichier \"$f.bib\" n'existe pas !" -?;
+ exit 1;
+ fi
+fi
+
+
+## affichage d'un petit message de version
+echo -ne "\n$nomshell version $version - Script de compilation LaTeX pour Linux.\nCopyright (C) 2003 Mael Hilléreau\n\n";
+
+
+## création d'un répertoire de travail
+if [ ! -d "$f".ShLaTeX ]
+then
+ mkdir "$f".ShLaTeX
+fi
+
+
+## recherche (non récursive) des fichiers externes
+fichiersExternes $fich
+
+
+## copie du fichier latex source principal
+cp "$f".tex "$f".ShLaTeX
+
+## copie des fichiers latex source externes
+fExtTmp="";
+for fe in $fExt
+do
+ if [ -f "$fe".tex ]
+ then
+ cp "$fe".tex "$f".ShLaTeX
+ # élimination du chemin relatif dans le fichier source
+ sansChemin=`expr match "/$fe" '.*/\(.*\)'`;
+ rplcExtFich "$fe.tex" "$sansChemin.tex" "$f".ShLaTeX/"$f".tex
+ fExtTmp="$sansChemin $fExtTmp";
+ else
+ avertissement "le fichier externe \"$fe.tex\" référencé dans \"$fich\" est introuvable !";
+ fi
+done
+fExt=$fExtTmp;
+
+## copie du fichier de bibliographie
+if [ $bib -eq 1 ]
+then
+ if [ $bib_file == "-" ]
+ then
+ bib_file=$f;
+ fi
+ cp "$bib_file".bib "$f".ShLaTeX
+fi
+
+## copie du fichier de style d'index
+if [ ! $idx_file == "-" ]
+then
+ if [ -f $idx_file ]
+ then
+ cp $idx_file "$f".ShLaTeX
+ fi
+fi
+
+## on passe dans le répertoire de travail
+cd "$f".ShLaTeX
+
+## accentuation
+if [ $ascii -eq 8 ]
+then
+ ## accentuation du fichier latex source
+ echo "> Accentuation en cours...";
+ echo -ne "<$fich>"
+ tex8to7 $fich > /dev/null 2>&1
+
+ ## écrasement du fichier latex source
+ mv -f "$fich"7 $fich
+
+ ## accentuation et écrasement des fichier latex source externes
+ for fe in $fExt
+ do
+ if [ -f "$fe".tex ]
+ then
+ echo -ne "<$fe.tex>"
+ tex8to7 "$fe".tex > /dev/null 2>&1
+ mv -f "$fe".tex7 "$fe".tex
+ fi
+ done
+ echo ""
+fi
+
+## compilation du fichier latex source accuentué
+echo "> Lancement de la compilation latex...";
+reslatex=0;
+echo "> Compilation (ShLaTeX)" >latex.log
+if [ ! $mode == "pdflatex" ]
+then
+ if [ $m -eq 1 ]
+ then
+ latex $fich
+ else
+ latex $fich >>latex.log 2>&1
+ fi
+ reslatex=$?;
+else
+ if [ $m -eq 1 ]
+ then
+ pdflatex $fich
+ else
+ pdflatex $fich >>latex.log 2>&1
+ fi
+ reslatex=$?;
+fi
+if [ $reslatex -ne 0 ]
+then
+ errcompil=1;
+else
+ echo "première compilation effectuée avec succès.";
+fi
+
+## création de la biliographie et deuxième compilation
+if [ $bib -eq 1 -a $errcompil -ne 1 ]
+then
+ echo "> Création de la bibliographie...";
+ bib_file=`expr match "/$bib_file" '.*/\(.*\)'`;
+ if [ $ascii -eq 8 ]
+ then
+ echo "> Accentuation du fichier \""$bib_file".bib\"...";
+ tex8to7 "$bib_file".bib > /dev/null 2>&1
+ echo "<$bib_file.bib>"
+ mv -f "$bib_file".bib7 "$bib_file".bib
+ fi
+ bibtex "$f" > bibtex.log 2>&1
+ if [ $? -eq 0 ]
+ then
+ if [ ! $mode == "pdflatex" ]
+ then
+ echo "> Compilation (ShLaTeX)" >>latex.log
+ latex $fich >>latex.log 2>&1
+ reslatex=$?;
+ else
+ echo "> Compilation (ShLaTeX)" >>latex.log
+ pdflatex $fich >>latex.log 2>&1
+ reslatex=$?;
+ fi
+ if [ $reslatex -ne 0 ]
+ then
+ errcompil=1;
+ else
+ echo "deuxième compilation effectuée avec succès.";
+ fi
+ else
+ echo -ne "\n";
+ cat bibtex.log
+ erreur "problème lors de la création de la bibliographie !";
+ errbib=1;
+ fi
+fi
+
+## création d'un index
+if [ $idx -eq 1 -a $errcompil -ne 1 -a $errbib -ne 1 ]
+then
+ echo "> Création de l'index...";
+ if [ $idx_file == "-" ]
+ then
+ makeindex "$f".idx > makeindex.log 2>&1
+ else
+ makeindex -s $idx_file "$f".idx > makeindex.log 2>&1
+ fi
+ if [ $? -ne 0 ]
+ then
+ echo -ne "\n";
+ cat makeindex.log
+ cat "$f".ilg 2>/dev/null
+ erreur "problème lors de la création de l'index !";
+ errindex=1;
+ else
+ errindex=0;
+ echo "index créé avec succès.";
+ fi
+fi
+
+## deuxième ou troisième compilation pour l'index et la table des matières
+if [ $toc -eq 1 -a $errbib -ne 1 -a $errindex -ne 1 -a $errcompil -ne 1 ]
+then
+ if [ ! $mode == "pdflatex" ]
+ then
+ echo "> Compilation (ShLaTeX)" >>latex.log
+ latex $fich >>latex.log 2>&1
+ reslatex=$?;
+ else
+ echo "> Compilation (ShLaTeX)" >>latex.log
+ pdflatex $fich >>latex.log 2>&1
+ reslatex=$?;
+ fi
+ if [ $reslatex -ne 0 ]
+ then
+ errcompil=1;
+ else
+ if [ $bib -eq 1 ]
+ then
+ echo "troisième compilation effectuée avec succès.";
+ else
+ echo "deuxième compilation effectuée avec succès.";
+ fi
+ fi
+fi
+
+## déplacement du fichier dvi ou pdf
+if [ $mode == "pdflatex" ]
+then
+ mv "$f".pdf ..
+else
+ mv "$f".dvi ..
+fi
+
+## on sort du répertoire de travail
+cd ..
+
+## conversion du fichier dvi
+errconvert=0;
+if [ $errbib -ne 1 -a $errindex -ne 1 -a $errcompil -ne 1 -a ! $mode == "pdflatex" -a ! $mode == "dvi" ]
+then
+ echo "> Conversion en cours...";
+ if [ $mode == "dvipdf" ]
+ then
+ dvipdf "$f".dvi "$f".pdf > ./"$f".ShLaTeX/dvipdf.log 2>&1
+ if [ $? -ne 0 ]
+ then
+ echo -ne "\n";
+ cat ./"$f".ShLaTeX/dvipdf.log
+ erreur "problème de conversion PDF !";
+ errconvert=1;
+ fi
+ elif [ $mode == "dvips" -o $mode == "ps2pdf" ]
+ then
+ dvips -Ppdf "$f".dvi -o "$f".ps > ./"$f".ShLaTeX/dvips.log 2>&1
+ if [ $? -ne 0 ]
+ then
+ echo -ne "\n";
+ cat ./"$f".ShLaTeX/dvips.log
+ erreur "problème de conversion PostScript !";
+ errconvert=1;
+ fi
+ if [ $errconvert -ne 1 ]
+ then
+ optpstops="";
+ if [ $sep -eq 1 ]
+ then
+ optpstops="-d";
+ fi
+ if [ $ppf -eq 2 ]
+ then
+ pstops $optpstops "2:0L@.7(21cm,0cm)+1L@.7(21cm,14.85cm)" "$f".ps "$f".2ppf.ps >/dev/null 2>&1
+ mv "$f".2ppf.ps "$f".ps
+ elif [ $ppf -eq 4 ]
+ then
+ pstops $optpstops "4:0@.5(0cm,14.85cm)+1@.5(10.5cm,14.85cm)+2@.5(0cm,0cm)+3@.5(10.5cm,0cm)" "$f".ps "$f".4ppf.ps >/dev/null 2>&1
+ mv "$f".4ppf.ps "$f".ps
+ fi
+ if [ $mode == "ps2pdf" ]
+ then
+ ps2pdf "$f".ps "$f".pdf > ./"$f".ShLaTeX/ps2pdf.log 2>&1
+ if [ $? -ne 0 ]
+ then
+ echo -ne "\n";
+ cat ./"$f".ShLaTeX/ps2pdf.log
+ erreur "problème de conversion PDF !";
+ errconvert=1;
+ fi
+ fi
+ if [ $z -eq 1 ]
+ then
+ rm -f "$f".ps.gz
+ gzip "$f".ps > /dev/null 2>&1
+ fi
+ fi
+ fi
+ rm -f "$f".dvi
+fi
+
+## visualisation du fichier dvi, ps ou pdf
+if [ $errconvert -ne 1 -a $errbib -ne 1 -a $errindex -ne 1 -a $errcompil -ne 1 -a $view -eq 1 ]
+then
+ echo "> Lancement de la visualisation du résultat.";
+ case $mode in
+ "dvi" )
+ $v_dvi "$f".dvi >/dev/null 2>&1 & ;;
+ "dvips" )
+ if [ $z -eq 1 ]
+ then
+ $v_ps "$f".ps.gz >/dev/null 2>&1 &
+ else
+ $v_ps "$f".ps >/dev/null 2>&1 &
+ fi ;;
+ "ps2pdf" | "dvipdf" | "pdflatex" )
+ $v_pdf "$f".pdf >/dev/null 2>&1 & ;;
+ esac
+fi
+
+## affichage des messages d'erreur de compilation
+if [ $errcompil -eq 1 ]
+then
+ if [ $m -eq 0 ]
+ then
+ echo -ne "\n";
+ cat ./"$f".ShLaTeX/latex.log
+ fi
+ erreur "problème de compilation !";
+fi
+
+## suppression des temporaires et sortie
+suppressionTemp;
+fin;
diff --git a/support/shlatex/fr/install b/support/shlatex/fr/install
new file mode 100644
index 0000000000..be336113d2
--- /dev/null
+++ b/support/shlatex/fr/install
@@ -0,0 +1,102 @@
+#!/bin/bash
+# Script d'installation pour ShLaTeX
+# Attention : vous devez être root pour exécuter ce script !
+# Ce script doit être exécuté dans le répertoire de ShLaTeX.
+
+# variables d'installation
+user=`whoami`;
+version="1.2b-fr";
+
+# fichiers d'installation
+gpl="../GPL.TXT";
+src="../src";
+tex8to7="../src/tex8to7.c";
+man="./man/shlatex.1.bz2";
+shlatex="./ShLaTeX";
+todo="../TODO.TXT";
+fichInstall="$gpl $tex8to7 $man $shlatex $todo";
+
+# répertoires d'installation
+cheminMan="/usr/share/man/fr/man1";
+cheminExec="/usr/bin";
+cheminScript="/usr/share";
+repInstall="$cheminMan $cheminExec $cheminScript";
+
+# vérification de l'identité de l'appelant
+if [ ! $user == "root" ]
+then
+ echo -ne "> Erreur : vous devez être 'root' pour exécuter ce script\n";
+ echo -ne " Se reporter au fichier README.TXT pour plus d'informations.\n";
+ exit 1;
+fi
+
+# vérification de l'abscence de cette version n'est pas déjà installée
+if [ -d "$cheminScript/shlatex-$version" ]
+then
+ echo "ShLaTeX $version est déjà installé sur votre système."
+ echo "Pour le réinstaller, veuillez d'abord le désinstaller."
+ exit 2;
+fi
+
+# vérification de l'existence des répertoires cibles, création le cas échéant
+for rep in $repInstall
+do
+ if [ ! -d "$rep" ]
+ then
+ echo -ne "> Avertissement : impossible de trouver \"$rep\", création du répertoire...\n";
+ mkdir -p "$rep"
+ fi
+done
+
+# vérification de l'existence des fichiers d'installation
+for fich in $fichiersInstall
+do
+ if [ ! -f "$fich" ]
+ then
+ echo -ne "> Erreur : impossible de trouver le fichier \"$fich\", ce fichier est nécessaire pour l'installation !\n";
+ exit 3;
+ fi
+done
+
+cat $gpl | more
+
+echo -ne "\n\n"
+
+rpse="-";
+until [ "$rpse" == "o" -o "$rpse" == "n" ]
+do
+ read -p "Êtes-vous d'accord avec les termes de la licence GNU GPL (o/n) ? " rpse
+done
+
+if [ ! "$rpse" == "o" ]
+then
+ echo "> Installation annulée."
+ exit 1;
+fi
+
+clear
+
+echo -ne "> Installation en cours...\n"
+echo -ne "> Compilation en cours...\n"
+gcc $tex8to7 -o tex8to7
+echo -ne "> Installation de tex8to7...\n"
+cp ./tex8to7 "$cheminExec/tex8to7"
+rm -f tex8to7
+chmod 755 "$cheminExec/tex8to7"
+echo -ne "> Installation de la page de man...\n"
+cp $man "$cheminMan/shlatex.1.bz2"
+chmod 644 "$cheminMan/shlatex.1.bz2"
+echo -ne "> Installation du script...\n"
+mkdir "$cheminScript/shlatex-$version"
+cp -fR * $gpl $src $todo "$cheminScript/shlatex-$version"
+chmod -R 755 "$cheminScript/shlatex-$version"
+if [ ! -L "$cheminExec/ShLaTeX" ]
+then
+ ln -s "$cheminScript/shlatex-$version/ShLaTeX" "$cheminExec/ShLaTeX"
+fi
+ln -s "$cheminScript/shlatex-$version/ShLaTeX" "$cheminExec/ShLaTeX-$version"
+echo -ne "> Test en cours...\n"
+cd "$cheminScript/shlatex-$version/test"
+chmod 755 ./test
+./test
+echo -ne "> Terminé.\n\n"
diff --git a/support/shlatex/fr/man/cman b/support/shlatex/fr/man/cman
new file mode 100644
index 0000000000..a0262dd427
--- /dev/null
+++ b/support/shlatex/fr/man/cman
@@ -0,0 +1,21 @@
+#!/bin/bash
+# script de conversion du manuel en PDF et ascii.
+
+if [ ! -f shlatex.1 ]
+then
+ bunzip2 shlatex.1.bz2
+fi
+cp shlatex.1 "shlatex.help"
+groff -mandoc -Tps shlatex.1 > shlatex.ps
+bzip2 shlatex.1
+pstops -pa4 -w21cm -h29.7cm "1:0(-0.3cm,-1.5cm)" shlatex.ps shlatexA4.ps
+mv shlatexA4.ps shlatex.ps
+ps2pdf13 shlatex.ps
+rm -f shlatex.ps
+#acroread shlatex.pdf &
+
+rplc "\\" "\\\\" "`cat shlatex.help`" > "shlatex.help"
+rplc "\"" "\\\"" "`cat shlatex.help`" > "shlatex.help"
+manuel=`cat shlatex.help`;
+echo "echo \"$manuel\";" > "shlatex.help"
+
diff --git a/support/shlatex/fr/man/shlatex.1.bz2 b/support/shlatex/fr/man/shlatex.1.bz2
new file mode 100644
index 0000000000..f4040190a1
--- /dev/null
+++ b/support/shlatex/fr/man/shlatex.1.bz2
Binary files differ
diff --git a/support/shlatex/fr/man/shlatex.pdf b/support/shlatex/fr/man/shlatex.pdf
new file mode 100644
index 0000000000..fbbfbbd3f8
--- /dev/null
+++ b/support/shlatex/fr/man/shlatex.pdf
Binary files differ
diff --git a/support/shlatex/fr/test/biblio.bib b/support/shlatex/fr/test/biblio.bib
new file mode 100644
index 0000000000..d47c006fb7
--- /dev/null
+++ b/support/shlatex/fr/test/biblio.bib
@@ -0,0 +1,7 @@
+@MANUAL{bib:manuel,
+ title= {Manuel d'utilisation\index{M!Manuel d'utilisation}},
+ author= {Mael Hilléreau},
+ month= {Mars},
+ year= {2003},
+ note= {Page de manuel Linux (taper \texttt{man shlatex} pour le consulter)},
+}
diff --git a/support/shlatex/fr/test/externe.tex b/support/shlatex/fr/test/externe.tex
new file mode 100644
index 0000000000..4fc9c38153
--- /dev/null
+++ b/support/shlatex/fr/test/externe.tex
@@ -0,0 +1,2 @@
+\par Il est possible de compiler les documents qui utilisent les commandes
+\verb|\input| et \verb|\include| pour faire référence à des fichiers externes.
diff --git a/support/shlatex/fr/test/test b/support/shlatex/fr/test/test
new file mode 100644
index 0000000000..7d6c9ebe36
--- /dev/null
+++ b/support/shlatex/fr/test/test
@@ -0,0 +1,15 @@
+#!/bin/bash
+# un petit test pour le script ShLaTeX
+
+version="1.2b-fr";
+lignecom="ShLaTeX-$version -bib biblio.bib -toc -idx -dvips -z -2 -sep -no-tmp -no-m -8 -view -v-ps gv test.tex";
+
+$lignecom
+if [ $? -ne 0 ]
+then
+ echo -ne "> Erreur lors du test !\n";
+else
+ echo -ne "> Test OK.\n";
+fi
+
+echo -ne "> Commande utilisée :\n$lignecom\n";
diff --git a/support/shlatex/fr/test/test.tex b/support/shlatex/fr/test/test.tex
new file mode 100644
index 0000000000..759bb34d0b
--- /dev/null
+++ b/support/shlatex/fr/test/test.tex
@@ -0,0 +1,63 @@
+% Un petit test pour ShLaTeX
+\documentclass[a4paper,11pt]{article}
+
+\usepackage[frenchb]{babel}
+\usepackage{makeidx}
+\usepackage{graphicx}
+
+\newcommand{\shlatex}{\raisebox{0.05em}{\rotatebox{-6}{\scalebox{1.1}{S}}}\kern-0.2em\raisebox{-0.115em}{\rotatebox{14}{\scalebox{0.8}{$h$}}}\kern0.05em\LaTeX\xspace}
+
+\makeindex
+
+\title{\shlatex\footnote{Une description complète et à jour est disponible dans \cite{bib:manuel}.
+ }\ -- Script de compilation \LaTeX\ pour Linux.}
+\author{Mael Hilléreau}
+\date{le 12 Mars 2003}
+
+
+\begin{document}
+\maketitle
+\tableofcontents
+
+\section{Nom}
+ \shlatex\index{S!\shlatex}\ -- Script de compilation \LaTeX\index{L!\LaTeX}\ pour Linux.
+
+\section{Synopsis\index{S!Synopsis}}
+\par
+ \texttt{ShLaTeX [}\textit{options}\texttt{]} \texttt{fichierSource.tex}
+
+\section{Description}
+\subsection{Un début}
+
+\par Ce script permet de centraliser les nombreux appels de commandes nécessaires à
+la compilation complète d'un document \LaTeX. Notamment, les appels multiples à
+la commande \texttt{latex} indispensables pour créer une table des matières
+\index{T!Table des matières}, une bibliographie\index{B!Bibliographie} \textsc{Bib}\TeX
+\index{B!\textsc{Bib}\TeX} ou un index\index{I!Index} sont effectuées automatiquement.
+Sont également gérés les appels aux programmes \texttt{bibtex\index{B!bibtex}} et
+\texttt{makeindex\index{M!makeindex}}.
+
+\input{externe.tex}
+
+\subsection{Une suite}
+\par Une fois la compilation effectuée, les fichiers temporaires sont effacés,
+à moins que l'option \textbf{-tmp} n'ait été utilisée. Les fichiers DVI générés par
+\LaTeX\ sont alors directement convertis\index{C!Conversion} au format PostScript ou
+PDF. [\dots]
+
+\subsection{La suite d'une suite}
+\par Ce script prend aussi en charge l'accentuation des caractères français par
+l'intermédiaire d'un programme C externe (nommé \texttt{tex8to7}) et fourni avec
+le script (la gestion des accents est donc transparente). Il gère aussi le "c"
+cédille ainsi que le remplacement des guillemets par les commandes \verb|\og| et
+\verb|\fg| (cela suppose que les guillemets soient appariés).
+
+\subsection{La suite de la suite d'une suite}
+\par Oui mais là je n'ai plus grand chose à dire alors\dots
+
+\newpage
+ \bibliographystyle{alpha}
+ \bibliography{biblio.bib}
+
+\printindex
+\end{document}
diff --git a/support/shlatex/fr/uninstall b/support/shlatex/fr/uninstall
new file mode 100644
index 0000000000..a6e467d611
--- /dev/null
+++ b/support/shlatex/fr/uninstall
@@ -0,0 +1,38 @@
+#!/bin/bash
+# Script de désinstallation pour ShLaTeX
+# Attention : vous devez être root pour exécuter ce script !
+
+user=`whoami`;
+version="1.2b-fr";
+cheminMan="/usr/share/man/fr/man1";
+cheminExec="/usr/bin";
+cheminScript="/usr/share";
+
+if [ ! $user == "root" ]
+then
+ echo "> Erreur : vous devez être 'root' pour exécuter ce script";
+ echo " Se reporter au fichier README.TXT pour plus d'informations.";
+ exit 1;
+fi
+
+if [ ! -d "$cheminScript/shlatex-$version" ]
+then
+ echo "> Avertissement : le script ShLaTeX-$version semble ne pas être installé !";
+fi
+
+echo -ne "\n> Désinstallation en cours...\n"
+cd /
+
+rm -f "$cheminExec/ShLaTeX-$version"
+rm -f "$cheminMan/shlatex.1.bz2"
+rm -fr "$cheminScript/shlatex-$version"
+if [ "`ls $cheminScript | grep "^shlatex-"`" == "" ]
+then
+ rm -f "$cheminExec/tex8to7"
+ rm -f "$cheminExec/ShLaTeX"
+else
+ echo "> Avertissement : une autre version de ShLaTeX semble être présente"
+ echo " Le programme tex8to7 n'a pas été effacé."
+fi
+echo -ne "> Terminé.\n\n"
+cd -
diff --git a/support/shlatex/misc/logo.jpg b/support/shlatex/misc/logo.jpg
new file mode 100644
index 0000000000..49f3fff97e
--- /dev/null
+++ b/support/shlatex/misc/logo.jpg
Binary files differ
diff --git a/support/shlatex/src/tex8to7.c b/support/shlatex/src/tex8to7.c
new file mode 100644
index 0000000000..112cf928c5
--- /dev/null
+++ b/support/shlatex/src/tex8to7.c
@@ -0,0 +1,390 @@
+/*-----------------------------------------------------------------------------
+| |
+| tex8to7 |
+| |
+-------------------------------------------------------------------------------
+| |
+| Auteur: Mael Hilléreau |
+| Mél : mael.hillereau@free.fr |
+| Web : http://mael.hillereau.free.fr |
+| Création : 01/11/2001 |
+| Dernière modif.: 21/08/2003 |
+| Version: 1.1c |
+| Description: Conversion de fichiers sources LaTeX : remplacement des |
+| caractères accentués français par leurs équivalents LaTeX |
+| dans l'encodage 7bits américain. |
+| Création d'un nouveau fichier ayant le même nom que le |
+| fichier de départ augmenté d'un "7". |
+| |
+-------------------------------------------------------------------------------
+| |
+| tex8to7 -- Conversion de fichiers sources LaTeX. |
+| Copyright (C) 2001 Mael Hilléreau |
+| |
+| This program is free software; you can redistribute it and/or |
+| modify it under the terms of the GNU General Public License |
+| as published by the Free Software Foundation; either version 2 |
+| of the License, or (at your option) any later version. |
+| |
+| This program is distributed in the hope that it will be useful, |
+| but WITHOUT ANY WARRANTY; without even the implied warranty of |
+| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+| GNU General Public License for more details. |
+| |
+| You should have received a copy of the GNU General Public License |
+| along with this program; if not, write to the Free Software |
+| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
+| |
+-----------------------------------------------------------------------------*/
+#define _VERSION_ "1.1c"
+#define _DATE_ "21/08/2003"
+
+
+/*----------
+| inclusions
+--*/
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+
+/*----------
+| définitions
+--*/
+#define SEP(buf) ((buf == ' ') || (buf == '\t') || (buf == '\n') || (buf == '\r'))
+#define TAILLE_MAX_PILE 100
+
+
+/*----------
+| variables globales
+--*/
+char *pile;
+int nbChar;
+
+
+/*----------
+| affichage des messages d'aide
+--*/
+void aideRapide()
+{
+ fprintf(stdout,"\nUTILISATION\n\n");
+ fprintf(stdout," tex8to7 [option] <fichier.tex>\n\n");
+ fprintf(stdout," tapez \"tex8to7 -?\" pour une aide complète.\n\n");
+}
+void aideComplete()
+{
+ fprintf(stdout,"\nNOM\n\n");
+ fprintf(stdout," tex8to7 -- Conversion de fichiers sources LaTeX.\n\n");
+ fprintf(stdout,"\nSYNOPSIS\n\n");
+ fprintf(stdout," tex8to7 [option] <fichier.tex>\n\n");
+ fprintf(stdout,"\nDESCRIPTION\n\n");
+ fprintf(stdout," Remplace les caractères accentués par leurs équivalents LaTeX dans\n");
+ fprintf(stdout," l'encodage 7bits américain. Le résultat est placé dans un fichier ayant\n");
+ fprintf(stdout," pour nom <fichier.tex7>.\n\n");
+ fprintf(stdout,"\nOPTIONS\n\n");
+ fprintf(stdout," -?, -h ou --help\n");
+ fprintf(stdout," Affiche cette aide.\n\n");
+ fprintf(stdout," -v ou --version\n");
+ fprintf(stdout," Affiche la version.\n\n");
+}
+void version()
+{
+ fprintf(stdout,"tex8to7 version %s, %s - Conversion de fichiers sources LaTeX.\nCopyright (C) 2003 Mael Hilléreau\n",_VERSION_,_DATE_);
+}
+
+
+/*----------
+| écriture d'une chaine de caractères dans le fichier "fich"
+--*/
+void ecrire(char *buf, FILE *fich, int len)
+{
+ if( !fwrite(buf, sizeof(char), len, fich) )
+ {
+ printf("Erreur d'écriture !");
+ exit(2);
+ }
+}
+
+/*----------
+| fermeture du fichier "fich"
+--*/
+void fermer(FILE *fich, char *nom)
+{
+ if( fclose(fich) )
+ {
+ printf("Erreur lors de la fermeture du fichier %s.\n", nom);
+ exit(3);
+ }
+}
+
+/*----------
+| élimination d'une fin de ligne
+--*/
+void avalerligne(FILE *fich_e, FILE *fich_s, char *pbuf)
+{
+ while(fread(pbuf, sizeof(char), 1, fich_e) && *pbuf != '\n')
+ ecrire(pbuf, fich_s, 1);
+ ecrire(pbuf, fich_s, 1);
+}
+
+/*----------
+| empiler un caractère
+--*/
+void empiler(char c)
+{
+ if( nbChar < TAILLE_MAX_PILE )
+ {
+ pile[nbChar]=c;
+ nbChar++;
+ }
+}
+
+/*----------
+| dépiler un caractère
+--*/
+char depiler()
+{
+ if( nbChar > 0 )
+ {
+ nbChar--;
+ return pile[nbChar];
+ }
+ else
+ return '\0';
+}
+
+/*----------
+| renvoie le caractère en haut de la pile
+--*/
+char tete()
+{
+ if( nbChar > 0 )
+ return pile[nbChar-1];
+ else
+ return '\0';
+}
+
+/*----------
+| fonction principale
+--*/
+main(int argc, char **argv)
+{
+ FILE *fich_e, *fich_s;
+ char *nom_fich_s, *ext;
+ char buf, antebuf;
+
+ ext = (char*) malloc(sizeof(char)*5);
+ strcpy(ext, "7");
+
+ /* vérification de la syntaxe. */
+ if( argc < 2 || argc > 3 )
+ {
+ aideRapide();
+ exit(1);
+ }
+ if( !strcmp(argv[1],"-v") || !strcmp(argv[1],"--version") )
+ {
+ version();
+ exit(0);
+ }
+ if( !strcmp(argv[1],"-?") || !strcmp(argv[1],"-h") || !strcmp(argv[1],"--help") )
+ {
+ aideComplete();
+ exit(0);
+ }
+ if( argc != 2 )
+ {
+ aideRapide();
+ exit(1);
+ }
+
+ /* ouverture du fichier source. */
+ if( !(fich_e = fopen(argv[1], "r")) )
+ {
+ printf("Impossible d'ouvrir le fichier source %s.\n", argv[1]);
+ exit(1);
+ }
+
+ /* création du nouveau fichier source. */
+ nom_fich_s = (char*) malloc((strlen(argv[1])+strlen(ext)+1)*sizeof(char));
+ strcpy(nom_fich_s, argv[1]);
+ strcat(nom_fich_s, ext);
+ if( !(fich_s = fopen(nom_fich_s, "w+")) )
+ {
+ printf("Impossible d'ouvrir le fichier %s en écriture.\n", nom_fich_s);
+ exit(1);
+ }
+
+ /* initialisation de la pile */
+ pile = (char*) malloc(sizeof(char)*TAILLE_MAX_PILE);
+ nbChar = 0;
+
+ /* traduction caractère par caractère. */
+ antebuf = '\0';
+ while(fread(&buf, sizeof(char), 1, fich_e))
+ {
+ if(buf == 'à') /* a */
+ ecrire("\\`{a}", fich_s, 5);
+ else if(buf == 'á')
+ ecrire("\\'{a}", fich_s, 5);
+ else if(buf == 'â')
+ ecrire("\\^{a}", fich_s, 5);
+ else if(buf == 'ã')
+ ecrire("\\~{a}", fich_s, 5);
+ else if(buf == 'ä')
+ ecrire("\\\"{a}", fich_s, 5);
+ else if(buf == 'æ')
+ ecrire("\ae ", fich_s, 4);
+ else if(buf == 'À') /* A */
+ ecrire("\\`{A}", fich_s, 5);
+ else if(buf == 'Á')
+ ecrire("\\'{A}", fich_s, 5);
+ else if(buf == 'Â')
+ ecrire("\\^{A}", fich_s, 5);
+ else if(buf == 'Ã')
+ ecrire("\\~{A}", fich_s, 5);
+ else if(buf == 'Ä')
+ ecrire("\\\"{A}", fich_s, 5);
+ else if(buf == 'Æ')
+ ecrire("\\AE ", fich_s, 4);
+ else if(buf == 'ç') /* c */
+ ecrire("\\c{c}", fich_s, 5);
+ else if(buf == 'Ç') /* C */
+ ecrire("\\c{C}", fich_s, 5);
+ else if(buf == 'è') /* e */
+ ecrire("\\`{e}", fich_s, 5);
+ else if(buf == 'é')
+ ecrire("\\'{e}", fich_s, 5);
+ else if(buf == 'ê')
+ ecrire("\\^{e}", fich_s, 5);
+ else if(buf == 'ë')
+ ecrire("\\\"{e}", fich_s, 5);
+ else if(buf == 'È') /* E */
+ ecrire("\\`{E}", fich_s, 5);
+ else if(buf == 'É')
+ ecrire("\\'{E}", fich_s, 5);
+ else if(buf == 'Ê')
+ ecrire("\\^{E}", fich_s, 5);
+ else if(buf == 'Ë')
+ ecrire("\\\"{E}", fich_s, 5);
+ else if(buf == 'ì') /* i */
+ ecrire("\\`{\\i}", fich_s, 6);
+ else if(buf == 'í')
+ ecrire("\\'{\\i}", fich_s, 6);
+ else if(buf == 'î')
+ ecrire("\\^{\\i}", fich_s, 6);
+ else if(buf == 'ï')
+ ecrire("\\\"{\\i}", fich_s, 6);
+ else if(buf == 'Ì') /* I */
+ ecrire("\\`{I}", fich_s, 5);
+ else if(buf == 'Í')
+ ecrire("\\'{I}", fich_s, 5);
+ else if(buf == 'Î')
+ ecrire("\\^{I}", fich_s, 5);
+ else if(buf == 'Ï')
+ ecrire("\\\"{I}", fich_s, 5);
+ else if(buf == 'ñ') /* n */
+ ecrire("\\~{n}", fich_s, 5);
+ else if(buf == 'Ñ') /* N */
+ ecrire("\\~{N}", fich_s, 5);
+ else if(buf == 'ò') /* o */
+ ecrire("\\`{o}", fich_s, 5);
+ else if(buf == 'ó')
+ ecrire("\\'{o}", fich_s, 5);
+ else if(buf == 'ô')
+ ecrire("\\^{o}", fich_s, 5);
+ else if(buf == 'õ')
+ ecrire("\\~{o}", fich_s, 5);
+ else if(buf == 'ö')
+ ecrire("\\\"{o}", fich_s, 5);
+ else if(buf == 'œ')
+ ecrire("\\oe ", fich_s, 4);
+ else if(buf == 'Ò') /* O */
+ ecrire("\\`{O}", fich_s, 5);
+ else if(buf == 'Ó')
+ ecrire("\\'{O}", fich_s, 5);
+ else if(buf == 'Ô')
+ ecrire("\\^{O}", fich_s, 5);
+ else if(buf == 'Õ')
+ ecrire("\\~{O}", fich_s, 5);
+ else if(buf == 'Ö')
+ ecrire("\\\"{O}", fich_s, 5);
+ else if(buf == 'Œ')
+ ecrire("\\OE ", fich_s, 4);
+ else if(buf == 'ù') /* u */
+ ecrire("\\`{u}", fich_s, 5);
+ else if(buf == 'ú')
+ ecrire("\\'{u}", fich_s, 5);
+ else if(buf == 'û')
+ ecrire("\\^{u}", fich_s, 5);
+ else if(buf == 'ü')
+ ecrire("\\\"{u}", fich_s, 5);
+ else if(buf == 'Ù') /* U */
+ ecrire("\\`{U}", fich_s, 5);
+ else if(buf == 'Ú')
+ ecrire("\\'{U}", fich_s, 5);
+ else if(buf == 'Û')
+ ecrire("\\^{U}", fich_s, 5);
+ else if(buf == 'Ü')
+ ecrire("\\\"{U}", fich_s, 5);
+ else if(buf == 'ý') /* y */
+ ecrire("\\'{y}", fich_s, 5);
+ else if(buf == 'ÿ')
+ ecrire("\\\"{y}", fich_s, 5);
+ else if(buf == 'Ý') /* Y */
+ ecrire("\\'{Y}", fich_s, 5);
+ else if(buf == '"') /* guilemets */
+ {
+ if( antebuf != '\\' )
+ {
+ switch(tete())
+ {
+ case '{' :
+ case '\0' :
+ ecrire("\\og ", fich_s, 4);
+ empiler('<');
+ break;
+ case '<' :
+ ecrire("\\fg ", fich_s, 4);
+ depiler();
+ break;
+ }
+ }
+ else /* doubles-côtes */
+ {
+ ecrire("\"", fich_s, 1);
+ }
+ }
+ else if(antebuf != '\\' && buf == '{') /* accolades */
+ {
+ empiler('{');
+ ecrire(&buf, fich_s, 1);
+ }
+ else if(antebuf != '\\' && buf == '}')
+ {
+ while( (depiler() != '{') && (depiler() != '\0') );
+ ecrire(&buf, fich_s, 1);
+ }
+ else if( antebuf != '\\' && buf == '%' ) /* commentaires */
+ {
+ ecrire(&buf, fich_s, 1);
+ avalerligne(fich_e, fich_s, &buf);
+ }
+ else /* caractères classiques */
+ ecrire(&buf, fich_s, 1);
+ if( antebuf == '\\' && buf =='\\' )
+ antebuf = '\0';
+ else
+ antebuf = buf;
+ }
+
+ /* libération des ressources. */
+ fermer(fich_e, argv[1]);
+ fermer(fich_s, nom_fich_s);
+ printf("le ficher %s a été créé avec succès.\n", nom_fich_s);
+ free(nom_fich_s);
+ free(ext);
+ free(pile);
+
+ exit(0);
+}