/usr/lib/libreoffice/share/extensions/DmathsAddon/CmathOOo/mFormuleOOo2Tex.xba is in libreoffice-dmaths 3.4+dfsg1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="mFormuleOOo2Tex" script:language="StarBasic">'***** BASIC *****
'CmathOOo
'Copyright (C) 2005 Christophe devalland
'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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
' substitutions
Option explicit
public sOOoKey() as String
public sLatexKey() as String
' opérateurs
public sOOoOperator() as String
public sLatexOperator() as String
public iTypeOperator() as Integer
const cFRAC=0
const cINT=1
const cNROOT=2
const cLIMIT=3
const cLEFT=4
const cMATRIX=5
const cABS=6
const cSTACK=7
const cBINOM=8
const cDELETE=9
const cALIGN=10
const cOVER=11
const cUNDER=12
const cDELETE0=13
const cDELETE1=14
const cFUNC=15
const cBRACE=16
const cLSUP=17
const cCSUB=18
const cFACT=19
sub InitVariablesOOo2TeX
' les mots-clés qui ne demandent qu'une traduction
' il faut se contenter d'un language TeX basique : par exemple \geqslant n'est pas reconnu
sOOoKey=Array("im","re","arcosh","arcoth","aleph","and","approx","arccos","arccot",_
"acute","arcsin","arctan","arsinh","artanh","backepsilon","bar",_
"breve","bslash","cdot","check","circ","circle","coprod",_
"cos","cosh","cot","coth","dddot","ddot","def","div","divides",_
"dlarrow","dlrarrow","dot","dotsaxis","dotsdiag","dotsdown",_
"dotslow","dotsup","dotsvert","downarrow","drarrow","emptyset",_
"equiv","exists","exp","forall","ge","geslant","gg","grave",_
"gt","hat","hbar","in","infinity","infty","intersection",_
"le","leftarrow","leslant","ll","ln","log",_
"lt","minusplus","mline","nabla","ndivides","neg","neq",_
"ni","notin","nsubset","nsupset","nsubseteq","nsupseteq",_
"odivide","odot","ominus","oplus","or","ortho","otimes",_
"owns","parrallel","partial","phantom","plusminus","prop",_
"rightarrow","rsub","rsup","setC","setN","setQ","setR","setZ",_
"setminus","sim","simeq","sin","sinh","slash","sqrt","sub","subset",_
"subseteq","sup","supset","supseteq","tan","tanh","tilde","times",_
"toward","union","uparrow","vec",_
"wp","left","right","none","lbrace","rbrace","langle","rangle",_
"lceil","rceil","ldbracket","rdbracket","ldline","rdline","lfloor","rfloor",_
"lline","rline",_
"%alpha","%ALPHA","%bêta","%BÊTA","%gamma","%GAMMA","%delta","%DELTA",_
"%epsilon","%EPSILON","%zêta","%ZÊTA","%êta","%ÊTA","%thêta","%THÊTA",_
"%iota","%IOTA","%kappa","%KAPPA","%lambda","%LAMBDA","%mu","%MU",_
"%nu","%NU","%xi","%XI","%omicron","%OMICRON","%pi","%PI","%rhô","%RHÔ",_
"%sigma","%SIGMA","%tau","%TAU","%upsilon","%UPSILON","%phi","%PHI",_
"%khi","%KHI","%psi","%PSI","%oméga","%OMÉGA","%varepsilon","%varthêta",_
"%varpi","%varrhô","%varsigma","%varphi","%infini")
sLatexKey=Array("\Im","\Re","\textrm{arcosh}","\textrm{arcoth}","\aleph","\wedge","\approx","\arccos","\arccot",_
"\acute","\arcsin","\arctan","\textrm{arsinh}","\textrm{artanh}","\backepsilon","\bar",_
"\breve","\backslash","\cdot","\check","\circ","\overset{\circ}","\coprod",_
"\cos","\cosh","\cot","\coth","\dddot","\ddot","\defeq","\div","|",_
"\leftarrow","\Leftrightarrow","\dot","\cdots","\ddotsup","\ddots",_
"\ldots","\ddotsup","\vdots","\downarrow","\Rightarrow","\emptyset",_
"\equiv","\exists","\exp","\forall","\geq","\geq","\gg","\grave",_
">","\hat","\hbar","\in","\infty","\infty","\cap",_
"\leq","\leftarrow","\leq","\ll","\ln","\log",_
"<","\_mp","\left | \right. ","\nabla","\nmid","\neg","\neq",_
"\ni","\notin","\not\subset","\not\supset","\nsubseteq","\nsupseteq",_
"\oslash","\odot","\ominus","\oplus","\vee","\perp","\otimes",_
"\ni","\parallel","\partial","\phantom","\pm","\propto",_
"\rightarrow","_","^","\mathbb{C}","\mathbb{N}","\mathbb{Q}","\mathbb{R}","\mathbb{Z}",_
"\setminus","\sim","\simeq","\sin","\sinh","/","\sqrt","_","\subset",_
"\subseteq","^","\supset","\subseteq","\tan","\tanh","\tilde","\times",_
"\to","\cup","\uparrow","\vec",_
"\wp","\left","\right",".","\{","\}","\langle","rangle",_
"\lceil","\rceil","\llbracket","\rrbracket","\|","\|","\lfloor","\rfloor",_
"|","|",_
"\alpha","A","\beta","B","\gamma","\Gamma","\delta","\Delta",_
"\epsilon","E","\zeta","Z","\eta","H","\theta","\Theta",_
"\iota","I","\kappa","K","\lambda","\Lambda","\mu","M",_
"\nu","N","\xi","\Xi","\omicron","O","\pi","\Pi","\rho","P",_
"\sigma","\Sigma","\tau","T","\upsilon","\Upsilon","\phi","\Phi",_
"\khi","X","\psi","\Psi","\omega","\Omega","\varepsilon","\vartheta",_
"\varpi","\varrho","\varsigma","\varphi","\infty")
' les opérateurs qui demandent une réorganisation des arguments
sOOoOperator=Array("over","int","iint","iiint","lim","matrix","abs","stack","binom",_
"nroot","sum","prod","alignl","alignr","alignc","overbrace",_
"underbrace","size","func","color","font","lsup","lsub",_
"widevec","widehat","widetilde","nitalic","overline",_
"underline","italic","csub","csup","fact")
sLatexOperator=Array("\frac","\int","\int\!\!\!\!\int","\int\!\!\!\!\int\!\!\!\!\int","\lim","\matrix","\left|","\matrix","\matrix",_
"\sqrt","\sum","\prod","","","","\overbrace",_
"\underbrace","size","\textrm","\color","font","{}^","{}_",_
"\overrightarrow","\widehat","\widetilde","\mathrm","\overline",_
"\underline","\mit","\matrix","\matrix","!")
iTypeOperator=Array(cFRAC,cINT,cINT,cINT,cLIMIT,cMATRIX,cABS,cSTACK,cBINOM,_
cNROOT,cINT,cINT,cALIGN,cALIGN,cDELETE0,cOVER,_
cUNDER,cDELETE1,cFUNC,cFUNC,cDELETE1,cLSUP,cLSUP,_
cFUNC,cFUNC,cFUNC,cFUNC,cFUNC,_
cFUNC,cFUNC,cCSUB,cCSUB,cFACT)
end sub
function sFormuleOOo2TeX(oEmbeddedObject as Object) as String
dim sLatex as string, sMotAChercher as string, sFormuleOOo as string
dim i as integer, j as integer, k as integer
dim iArg1Debut as integer, iArg1Fin as integer
dim iArg2Debut as integer, iArg2Fin as integer
' if UBound(sOOoKey())<0 then
' initialisation des variables si besoin
' end if
sFormuleOOo=oEmbeddedObject.Formula
sLatex=oEmbeddedObject.Formula
' détection d'un commentaire
if Instr(sLatex,"%%")>0 then sLatex=left(sLatex,Instr(sLatex,"%%")-1)
' suppression des \
i=Instr(sLatex,"\")
do while i>0
sLatex=left(sLatex,i-1) & mid(sLatex,i+1)
i=Instr(sLatex,"\")
loop
' détection d'une petite espace
i=Instr(sLatex,"`")
do while i>0
sLatex=left(sLatex,i-1) & "\, " & mid(sLatex,i+1)
i=Instr(sLatex,"`")
loop
' détection d'une grande espace
i=Instr(sLatex,"~")
do while i>0
sLatex=left(sLatex,i-1) & "\ " & mid(sLatex,i+1)
i=Instr(sLatex,"~")
loop
' changement d'orthographe
i=1
' parcours linéaire de la formule
do while i<=len(sLatex)
'rechercher le début d'une expression
do while (bEstCeDelimiteurSubstitutions(mid(sLatex,i,1)) or bEstCeChiffreOuVirgule(mid(sLatex,i,1))) and (i<=len(sLatex))
'si zone de texte
if mid(sLatex,i,1)="""" then
' mettre \text{}
sLatex=left(sLatex,i-1) & "\textrm{" & mid(sLatex,i+1)
i=i+7
do
i=i+1
if i>len(sLatex) then
msgbox("Erreur de guillemets dans la formule !")
stop
end if
loop while mid(sLatex,i,1)<>""""
sLatex=left(sLatex,i-1) & "}" & mid(sLatex,i+1)
end if
' test des caractères à substituer
select case mid(sLatex,i,1)
case "("
'mettre \left( si left n'est pas présent
if i<5 then
sLatex=left(sLatex,i-1) & "\left( " & mid(sLatex,i+1)
i=i+7
else
iArg1Fin=i-1
iArg1Debut=i-1 'inconnu à ce moment
bTrouveExpressionGauche(sLatex,iArg1Debut,iArg1Fin)
if mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1)<>"left" then
sLatex=left(sLatex,i-1) & "\left( " & mid(sLatex,i+1)
i=i+7
end if
end if
case ")"
' mettre \right)
iArg1Fin=i-1
iArg1Debut=i-1 'inconnu à ce moment
bTrouveExpressionGauche(sLatex,iArg1Debut,iArg1Fin)
if mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1)<>"right" then
sLatex=left(sLatex,i-1) & "\right) " & mid(sLatex,i+1)
i=i+7
end if
end select
i=i+1
loop
'parcours de l'expression
j=i
do while not(bEstCeDelimiteurSubstitutions(mid(sLatex,j,1)) or bEstCeChiffreOuVirgule(mid(sLatex,j,1))) and (j<=len(sLatex))
j=j+1
loop
' recherche de substitution
sMotAChercher=mid(sLatex,i,j-i)
if sMotAChercher<>"" then
for k=0 to UBound(sOOoKey())
if sMotAChercher=sOOoKey(k) then
sLatex=left(sLatex,i-1)&sLatexKey(k)&mid(sLatex,j)
j=j+len(sLatexKey(k))-len(sOOoKey(k))
exit for
end if
next k
end if
i=j
loop
' changement de grammaire
' parcours récursif et conversion de la formule
sLatex=sFormatLatex(sLatex)
' renvoie de la formule convertie
if oEmbeddedObject.isTextMode=True then
sFormuleOOo2TeX="$\textstyle{"+sLatex+"}$"
else
sFormuleOOo2TeX="$"+sLatex+"$"
end if
end function
function bEstCeDelimiteurSubstitutions(char as String) as boolean
bEstCeDelimiteurSubstitutions=(InStr(" +-*/=#"&""""&">"&"<"&"&"&"|"&"("&")"&"{"&"}"&"~"&"^"&"_"&"["&"]"&"\"&";",char)>0)
end function
function bEstCeDelimiteurOperateurs(char as String) as boolean
bEstCeDelimiteurOperateurs=(InStr(" +-*/=#"&""""&">"&"<"&"&"&"|"&"("&")"&"{"&"}"&"~"&"["&"]"&"\"&";",char)>0)
end function
function bEstCeChiffreOuVirgule(char as String) as boolean
bEstCeChiffreOuVirgule=(InStr("0123456789.,",char)>0)
end function
function sFormatLatex(sLatex as String) as String
dim i as integer, iNiveau as integer
dim j as integer, k as integer
dim sFormuleTraitee as string, sMotAChercher as string, sResteFormuleLatex as string
dim iArg1Debut as integer, iArg1Fin as integer
dim iArg2Debut as integer, iArg2Fin as integer
dim iArg3Debut as integer, iArg3Fin as integer
dim sArg1 as string, sArg2 as string, sArg3 as string
i=1
j=1
' parcours récursif de la formule
do while bTrouveExpressionSuite(sLatex,i,j)
sFormuleTraitee=sFormatLatex(mid(sLatex,i+1,j-i-1))
sLatex=left(sLatex,i) & sFormuleTraitee & mid(sLatex,j)
i=i+len(sFormuleTraitee)+2
loop
'chercher les mots-clés
i=1
' parcours linéaire de la formule en évitant les expressions entre {}
do while i<=len(sLatex)
'rechercher le début d'une expression
iNiveau=0
do while (bEstCeDelimiteurSubstitutions(mid(sLatex,i,1)) or bEstCeChiffreOuVirgule(mid(sLatex,i,1))) and (i<=len(sLatex))
'si zone déjà traitée
if mid(sLatex,i,2)="\{" then i=i+2
if mid(sLatex,i,1)="{" then
iNiveau=iNiveau+1
do while iNiveau>0
i=i+1
if mid(sLatex,i,1)="{" and mid(sLatex,i-1,2)<>"\{" then
iNiveau=iNiveau+1
elseif mid(sLatex,i,1)="}" and mid(sLatex,i-1,2)<>"\}" then
iNiveau=iNiveau-1
end if
loop
end if
i=i+1
loop
'parcours de l'expression
j=i
do while not(bEstCeDelimiteurSubstitutions(mid(sLatex,j,1)) or bEstCeChiffreOuVirgule(mid(sLatex,j,1))) and (j<=len(sLatex))
j=j+1
loop
' recherche d'opérateur
sMotAChercher=mid(sLatex,i,j-i)
if sMotAChercher<>"" then
for k=0 to UBound(sOOoOperator())
if Lcase(sMotAChercher)=sOOoOperator(k) then
' changement de grammaire
select case iTypeOperator(k)
case cFRAC
'********************* Type Fractions *************************************
' {A}OOoOperator{B} -> LatexOperator{A}{B}
iArg1Debut=1 'inconnu actuellement
iArg1Fin=i-1
if not(bTrouveExpressionGauche(sLatex,iArg1Debut,iArg1Fin)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg1Debut-1) & "{" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "}" & mid(sLatex,iArg1Fin+2)
iArg1Fin=iArg1Fin+2
i=i+2
j=j+2
end if
iArg2Debut=j
iArg2Fin=len(sLatex) 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg2Debut,iArg2Fin,sArg2)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg2Debut-1) & "{" & mid(sLatex,iArg2Debut,iArg2Fin-iArg2Debut+1) & "}" & mid(sLatex,iArg2Fin+1)
iArg2Fin=iArg2Fin+2
end if
sLatex=left(sLatex,iArg1Debut-1) & sLatexOperator(k) & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & mid(sLatex,j)
j=iArg2Fin+len(sLatexOperator(k))-len(sOOoOperator(k))+1
case cINT
'********************* Type Intégrale *************************************
' OOoOperator from{A}to{B}{C} -> \LatexOperator _{A}^{B}{C}
iArg1Debut=i+len(sOOoOperator(k))
iArg1Fin=iArg1Debut 'inconnu actuellement
'passer le from ou le "_"
bTrouveExpressionDroite(sLatex,iArg1Debut,iArg1Fin,sArg1)
if sArg1="from" then
' il y a un from
iArg1Debut=iArg1Fin+1
if not(bTrouveExpressionDroite(sLatex,iArg1Debut,iArg1Fin,sArg1)) then
' pas d'accolades : on en rajoute en supprimant les espaces
sArg1="{" & sArg1 & "}"
end if
else
' il n'y a pas de from
sArg1="{}"
iArg1Debut=i+len(sOOoOperator(k))
iArg1Fin=iArg1Debut-1
end if
'passer le to ou le ^
iArg2Debut=iArg1Fin+1
iArg2Fin=len(sLatex) 'inconnu actuellement
bTrouveExpressionDroite(sLatex,iArg2Debut,iArg2Fin,sArg2)
if sArg2="to" then
' il y a un to
iArg2Debut=iArg2Fin+1
if not(bTrouveExpressionDroite(sLatex,iArg2Debut,iArg2Fin,sArg2)) then
' pas d'accolades : on en rajoute
sArg2="{" & sArg2 & "}"
end if
else
' il n'y a pas de to
sArg2="{}"
iArg2Debut=iArg1Fin+1
iArg2Fin=iArg2Debut-1
end if
iArg3Debut=iArg2Fin+1
iArg3Fin=len(sLatex) 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg3Debut,iArg3Fin,sArg3)) then
' pas d'accolades : on en rajoute
sArg3="{" & sArg3 & "}"
end if
sResteFormuleLatex=mid(sLatex,iArg3Fin+1)
sLatex=left(sLatex,i-1) & sLatexOperator(k) & "_" & sArg1 & "^" & sArg2 & mid(sLatex,iArg3Debut,iArg3Fin-iArg3Debut+1)
j=len(sLatex)+1
sLatex=sLatex & sResteFormuleLatex
Case cLIMIT
'********************* Type Limite ****************************************
' lim from{A}{B} -> \lim _{A}{B}
iArg1Debut=i+len(sOOoOperator(k))
iArg1Fin=iArg1Debut 'inconnu actuellement
'passer le from
bTrouveExpressionDroite(sLatex,iArg1Debut,iArg1Fin,sArg1)
if sArg1="from" then
' il y a un from
iArg1Debut=iArg1Fin+1
if not(bTrouveExpressionDroite(sLatex,iArg1Debut,iArg1Fin,sArg1)) then
' pas d'accolades : on en rajoute
sArg1="{" & sArg1 & "}"
end if
else
' il n'y a pas de from
sArg1="{}"
iArg1Debut=i+len(sOOoOperator(k))
iArg1Fin=iArg1Debut-1
end if
iArg2Debut=iArg1Fin+1
iArg2Fin=len(sLatex) 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg2Debut,iArg2Fin,sArg2)) then
' pas d'accolades : on en rajoute
sArg2="{" & sArg2 & "}"
end if
sResteFormuleLatex=mid(sLatex,iArg2Fin+1)
sLatex=left(sLatex,i-1) & sLatexOperator(k) & "_" & sArg1 & sArg2
j=len(sLatex)+1
sLatex=sLatex & sResteFormuleLatex
' Case cLEFT
'********************* Type Left *************************************
' Select case mid(sLatex,i+len(sOOoOperator(k)),1)
' Case " "
' Select Case mid(sLatex,i+len(sOOoOperator(k))+1,4)
' Case "lbra"
' sLatex=left(sLatex,i-1) & sLatexOperator(k) & "\{" & mid(sLatex,i+len(sOOoOperator(k))+7)
' j=j+len(sLatexOperator(k))-len(sOOoOperator(k))+2
' Case "rbra"
' sLatex=left(sLatex,i-1) & sLatexOperator(k) & "\}" & mid(sLatex,i+len(sOOoOperator(k))+7)
' j=j+len(sLatexOperator(k))-len(sOOoOperator(k))+2
' Case "llin","rlin"
' sLatex=left(sLatex,i-1) & sLatexOperator(k) & "|" & mid(sLatex,i+len(sOOoOperator(k))+6)
' j=j+len(sLatexOperator(k))-len(sOOoOperator(k))+1
' Case "ldli","rdli"
' sLatex=left(sLatex,i-1) & sLatexOperator(k) & "\|" & mid(sLatex,i+len(sOOoOperator(k))+7)
' j=j+len(sLatexOperator(k))-len(sOOoOperator(k))+2
' Case "none"
' sLatex=left(sLatex,i-1) & sLatexOperator(k) & "." & mid(sLatex,i+len(sOOoOperator(k))+5)
' j=j+len(sLatexOperator(k))-len(sOOoOperator(k))+1
' end select
' Case "["
' sLatex=left(sLatex,i-1) & sLatexOperator(k) & "[" & mid(sLatex,i+len(sOOoOperator(k))+1)
' j=j+len(sLatexOperator(k))-len(sOOoOperator(k))+1
' Case "]"
' sLatex=left(sLatex,i-1) & sLatexOperator(k) & "]" & mid(sLatex,i+len(sOOoOperator(k))+1)
' j=j+len(sLatexOperator(k))-len(sOOoOperator(k))+1
' Case "("
' sLatex=left(sLatex,i-1) & sLatexOperator(k) & "(" & mid(sLatex,i+len(sOOoOperator(k))+1)
' j=j+len(sLatexOperator(k))-len(sOOoOperator(k))+1
' Case ")"
' sLatex=left(sLatex,i-1) & sLatexOperator(k) & ")" & mid(sLatex,i+len(sOOoOperator(k))+1)
' j=j+len(sLatexOperator(k))-len(sOOoOperator(k))+1
' end select
'
'********************* Type Matrix *************************************
Case cMATRIX
iArg1Debut=i+len(sOOoOperator(k))
iArg1Fin=iArg1Debut 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg1Debut,iArg1Fin,sArg1)) then
' pas d'accolades : ne doit pas arriver si formule créée avec CmathOOo
end if
iArg1Debut=iArg1Debut+1
iArg1Fin=iArg1Fin-1
iSubstitue(sLatex,iArg1Debut,iArg1Fin,"##"," \cr ")
iSubstitue(sLatex,iArg1Debut,iArg1Fin,"#"," & ")
sLatex=left(sLatex,i-1) & sLatexOperator(k) & mid(sLatex,iArg1Debut-1,iArg1Fin-iArg1Debut+2) & mid(sLatex,iArg1Fin+1)
j=iArg1Fin+len(sLatexOperator(k))-len(sOOoOperator(k))+2
'********************* Type Stack *************************************
Case cSTACK
iArg1Debut=i+len(sOOoOperator(k))
iArg1Fin=iArg1Debut 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg1Debut,iArg1Fin,sArg1)) then
' pas d'accolades : ne doit pas arriver si formule créée avec CmathOOo
end if
iArg1Debut=iArg1Debut+1
iArg1Fin=iArg1Fin-1
iSubstitue(sLatex,iArg1Debut,iArg1Fin,"#"," \cr ")
sLatex=left(sLatex,i-1) & sLatexOperator(k) & mid(sLatex,iArg1Debut-1,iArg1Fin-iArg1Debut+2) & mid(sLatex,iArg1Fin+1)
j=iArg1Fin+len(sLatexOperator(k))-len(sOOoOperator(k))+2
'********************* Type Csub *************************************
' {A}OOoOperator{B} -> \LatexOperator{A \cr B}
' traduction en matrice à 1 colonne : ce n'est pas l'idéal mais je ne trouve rien avec TeX
Case cCSUB
iArg1Debut=1 'inconnu actuellement
iArg1Fin=i-1
if not(bTrouveExpressionGauche(sLatex,iArg1Debut,iArg1Fin)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg1Debut-1) & "{" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "}" & mid(sLatex,iArg1Fin+2)
iArg1Fin=iArg1Fin+2
i=i+2
j=j+2
end if
iArg2Debut=j
iArg2Fin=len(sLatex) 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg2Debut,iArg2Fin,sArg2)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg2Debut-1) & "{" & mid(sLatex,iArg2Debut,iArg2Fin-iArg2Debut+1) & "}" & mid(sLatex,iArg2Fin+1)
iArg2Fin=iArg2Fin+2
end if
sLatex=left(sLatex,iArg1Debut-1) & sLatexOperator(k) & "{" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & " \cr " & mid(sLatex,iArg2Debut,iArg2Fin-iArg2Debut+1) & "}" & mid(sLatex,iArg2Fin+1)
j=iArg2Fin+len(sLatexOperator(k))-len(sOOoOperator(k))+6
'********************* Type ABS ****************************************
' abs{A} -> \left|{A}\right|
Case cABS
iArg1Debut=i+len(sOOoOperator(k))
iArg1Fin=iArg1Debut 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg1Debut,iArg1Fin,sArg1)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg1Debut-2) & "{" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "}" & mid(sLatex,iArg1Fin+2)
iArg1Fin=iArg1Fin+1
iArg1Debut=iArg1Debut-1
' sLatex=left(sLatex,iArg1Debut-1) & "{" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "}" & mid(sLatex,iArg1Fin+1)
' iArg1Fin=iArg1Fin+2
end if
sLatex=left(sLatex,i-1) & "\left|" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "\right|" & mid(sLatex,iArg1Fin+1)
j=iArg1Fin+2*len(sLatexOperator(k))-len(sOOoOperator(k))+2
Case cBINOM
'********************* Type Binom ****************************************
' binome{A}{B} -> \matrix{{A} \cr {B}}
iArg1Debut=i+len(sOOoOperator(k))
iArg1Fin=iArg1Debut 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg1Debut,iArg1Fin,sArg1)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg1Debut-2) & "{" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "}" & mid(sLatex,iArg1Fin+2)
iArg1Fin=iArg1Fin+1
iArg1Debut=iArg1Debut-1
' sLatex=left(sLatex,iArg1Debut-1) & "{" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "}" & mid(sLatex,iArg1Fin+1)
' iArg1Fin=iArg1Fin+2
end if
iArg2Debut=iArg1Fin+1
iArg2Fin=len(sLatex) 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg2Debut,iArg2Fin,sArg2)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg2Debut-2) & "{" & mid(sLatex,iArg2Debut,iArg2Fin-iArg2Debut+1) & "}" & mid(sLatex,iArg2Fin+2)
iArg2Fin=iArg2Fin+1
iArg2Debut=iArg2Debut-1
' sLatex=left(sLatex,iArg2Debut-1) & "{" & mid(sLatex,iArg2Debut,iArg2Fin-iArg2Debut+1) & "}" & mid(sLatex,iArg2Fin+1)
' iArg2Fin=iArg2Fin+2
end if
sLatex=left(sLatex,i-1) & sLatexOperator(k) & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut) & " \cr " & mid(sLatex,iArg2Debut+1,iArg2Fin-iArg2Debut) & mid(sLatex,iArg2Fin+1)
j=iArg2Fin+len(sLatexOperator(k))-len(sOOoOperator(k))+3
' si ams-latex est supporté par le serveur générant les formules TeX, remplacer les deux lignes précédentes
' par les deux situées juste après ce commentaire.
' en attendant, la fonction limite, s'il y a deux indices, ne s'affichera pas proprement.
'sLatex=left(sLatex,i-1) & "\genfrac{}{}{0}{1}" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & mid(sLatex,iArg2Debut,iArg2Fin-iArg2Debut+1) & mid(sLatex,iArg2Fin+1)
'j=iArg2Fin+len("\genfrac")-len(sOOoOperator(k))+16
Case cNROOT
'********************* Type Nroot ****************************************
' nroot{A}{B} -> \sqrt[{A}]{B}
iArg1Debut=i+len(sOOoOperator(k))
iArg1Fin=iArg1Debut 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg1Debut,iArg1Fin,sArg1)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg1Debut-1) & "{" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "}" & mid(sLatex,iArg1Fin+1)
iArg1Fin=iArg1Fin+2
end if
iArg2Debut=iArg1Fin+1
iArg2Fin=len(sLatex) 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg2Debut,iArg2Fin,sArg2)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg2Debut-1) & "{" & mid(sLatex,iArg2Debut,iArg2Fin-iArg2Debut+1) & "}" & mid(sLatex,iArg2Fin+1)
iArg2Fin=iArg2Fin+2
end if
sLatex=left(sLatex,i-1) & sLatexOperator(k) & "[" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "]" & mid(sLatex,iArg2Debut,iArg2Fin-iArg2Debut+1) & mid(sLatex,iArg2Fin+1)
j=iArg2Fin+len(sLatexOperator(k))-len(sOOoOperator(k))+3
Case cALIGN
'********************* Type Align ****************************************
' si alignl, alignr, cherche s'il y a un système, sinon ignore
' {alignl left lbrace stack{{{x}={1}}#{{j}={G}}} right none}
' ${ { \begin{cases}{{{2 a}={2}}\cr {a+{2 b}={7} \cr {c+{b}={5}}}\end{cases} }$
Select case sOOoOperator(k)
case "alignl"
sLatex=left(sLatex,i-1) & sLatexOperator(k) & mid(sLatex,j)
iArg1Debut=instr(mid(sLatex,i),"stack")
j=j-6
if iArg1Debut>0 then 'and iArg1Debut=instr(sLatex,"{")-5 then
iArg1Debut=iArg1Debut+5
iArg1Fin=iArg1Debut
bTrouveExpressionDroite(sLatex,iArg1Debut,iArg1Fin,sArg1)
iArg1Debut=iArg1Debut+1
iArg1Fin=iArg1Fin-1
iSubstitue(sLatex,iArg1Debut,iArg1Fin,"#","\hfill #")
sLatex=left(sLatex,iArg1Fin) & "\hfill" & mid(sLatex,iArg1Fin+1)
end if
case "alignr"
sLatex=left(sLatex,i-1) & sLatexOperator(k) & mid(sLatex,j)
iArg1Debut=instr(mid(sLatex,i),"stack")
j=j-6
if iArg1Debut>0 then 'and iArg1Debut=instr(sLatex,"{")-5 then
iArg1Debut=iArg1Debut+5
iArg1Fin=iArg1Debut
bTrouveExpressionDroite(sLatex,iArg1Debut,iArg1Fin,sArg1)
iArg1Debut=iArg1Debut+1
iArg1Fin=iArg1Fin-1
sLatex=left(sLatex,iArg1Debut-1) & "\hfill " & mid(sLatex,iArg1Debut)
iSubstitue(sLatex,iArg1Debut,iArg1Fin+6,"#","#\hfill ")
end if
end select
Case cDELETE0
'********************* Type Delete 0 ****************************************
' opérateur non traduit et effacé, sans argument
sLatex=left(sLatex,i-1) & mid(sLatex,j)
j=i
Case cDELETE1
'********************* Type Delete 1 ****************************************
' opérateur non traduit et effacé, avec 1 argument
iArg1Debut=i+len(sOOoOperator(k))
iArg1Fin=iArg1Debut 'inconnu actuellement
bTrouveExpressionDroite(sLatex,iArg1Debut,iArg1Fin,sArg1)
sLatex=left(sLatex,i-1) & mid(sLatex,iArg1Fin+1)
j=i
case cOVER
'********************* Type Over *************************************
' {A}OOoOperator{B} -> \LatexOperator{A}^{B}
iArg1Debut=1 'inconnu actuellement
iArg1Fin=i-1
if not(bTrouveExpressionGauche(sLatex,iArg1Debut,iArg1Fin)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg1Debut-1) & "{" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "}" & mid(sLatex,iArg1Fin+2)
iArg1Fin=iArg1Fin+2
i=i+2
j=j+2
end if
iArg2Debut=j
iArg2Fin=len(sLatex) 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg2Debut,iArg2Fin,sArg2)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg2Debut-1) & "{" & mid(sLatex,iArg2Debut,iArg2Fin-iArg2Debut+1) & "}" & mid(sLatex,iArg2Fin+1)
iArg2Fin=iArg2Fin+2
end if
sLatex=left(sLatex,iArg1Debut-1) & sLatexOperator(k) & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "^" & mid(sLatex,j)
j=iArg2Fin+len(sLatexOperator(k))-len(sOOoOperator(k))+2
case cUNDER
'********************* Type Under *************************************
' {A}OOoOperateur{B} -> \LatexOperateur{A}_{B}
iArg1Debut=1 'inconnu actuellement
iArg1Fin=i-1
if not(bTrouveExpressionGauche(sLatex,iArg1Debut,iArg1Fin)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg1Debut-1) & "{" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "}" & mid(sLatex,iArg1Fin+2)
iArg1Fin=iArg1Fin+2
i=i+2
j=j+2
end if
iArg2Debut=j
iArg2Fin=len(sLatex) 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg2Debut,iArg2Fin,sArg2)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg2Debut-1) & "{" & mid(sLatex,iArg2Debut,iArg2Fin-iArg2Debut+1) & "}" & mid(sLatex,iArg2Fin+1)
iArg2Fin=iArg2Fin+2
end if
sLatex=left(sLatex,iArg1Debut-1) & sLatexOperator(k) & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "_" & mid(sLatex,j)
j=iArg2Fin+len(sLatexOperator(k))-len(sOOoOperator(k))+2
case cFUNC
'********************* Type Func *************************************
' OOoOperator A -> LatexOperator{A}
iArg1Debut=i+len(sOOoOperator(k))
iArg1Fin=iArg1Debut 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg1Debut,iArg1Fin,sArg2)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg1Debut-1) & "{" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "}" & mid(sLatex,iArg1Fin+1)
iArg1Fin=iArg1Fin+2
end if
sLatex=left(sLatex,i-1) & sLatexOperator(k) & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & mid(sLatex,iArg1Fin+1)
j=iArg1Fin+len(sLatexOperator(k))-len(sOOoOperator(k))+1
case cFACT
'********************* Type Factoriel *************************************
' OOoOperator A -> {A}LatexOperator
iArg1Debut=i+len(sOOoOperator(k))
iArg1Fin=iArg1Debut 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg1Debut,iArg1Fin,sArg2)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg1Debut-1) & "{" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "}" & mid(sLatex,iArg1Fin+1)
iArg1Fin=iArg1Fin+2
end if
sLatex=left(sLatex,i-1) & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & sLatexOperator(k)& mid(sLatex,iArg1Fin+1)
j=iArg1Fin+len(sLatexOperator(k))-len(sOOoOperator(k))+1
case cLSUP
'********************* Type Lsup *************************************
' {A}OOoOperator{B} -> LatexOperator{B}{A}
iArg1Debut=1 'inconnu actuellement
iArg1Fin=i-1
if not(bTrouveExpressionGauche(sLatex,iArg1Debut,iArg1Fin)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg1Debut-1) & "{" & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & "}" & mid(sLatex,iArg1Fin+2)
iArg1Fin=iArg1Fin+2
i=i+2
j=j+2
end if
iArg2Debut=j
iArg2Fin=len(sLatex) 'inconnu actuellement
if not(bTrouveExpressionDroite(sLatex,iArg2Debut,iArg2Fin,sArg2)) then
' pas d'accolades : on en rajoute
sLatex=left(sLatex,iArg2Debut-1) & "{" & mid(sLatex,iArg2Debut,iArg2Fin-iArg2Debut+1) & "}" & mid(sLatex,iArg2Fin+1)
iArg2Fin=iArg2Fin+2
end if
sLatex=left(sLatex,iArg1Debut-1) & sLatexOperator(k) & mid(sLatex,iArg2Debut,iArg2Fin-iArg2Debut+1) & mid(sLatex,iArg1Debut,iArg1Fin-iArg1Debut+1) & mid(sLatex,iArg2Fin+1)
j=iArg2Fin+len(sLatexOperator(k))-len(sOOoOperator(k))+1
end select
exit for
end if
next k
end if
i=j
loop
sFormatLatex=sLatex
end function
function bTrouveExpressionSuite(sLatex as string,i as integer,j as integer) as boolean
' cherche une expression entre {} à partir de la position i
' renvoie true s'il en existe, faux sinon
Dim iNiveau as integer, k as integer, iPos as integer
Dim sCarac as String
iPos=i
do
sCarac=mid(sLatex,iPos,1)
if sCarac="{" then
if iPos=1 then
exit do
elseif mid(sLatex,iPos-1,2)<>"\{" then
exit do
end if
end if
iPos=iPos+1
loop while iPos<=len(sLatex)
if iPos<=len(sLatex) then
iNiveau=1
k=iPos+1
do while k<=len(sLatex) and iNiveau>0
sCarac=mid(sLatex,k,1)
if sCarac="{" and mid(sLatex,k-1,2)<>"\{" then
iNiveau=iNiveau+1
elseif sCarac="}" and mid(sLatex,k-1,2)<>"\}" then
iNiveau=iNiveau-1
end if
k=k+1
loop
if iNiveau>0 then
msgbox("Erreur d'accolades dans la formule.")
stop
end if
j=k-1
i=iPos
bTrouveExpressionSuite=True
else
bTrouveExpressionSuite=False
end if
end function
function bTrouveExpressionGauche(sLatex as string,i as integer,j as integer) as boolean
' cherche une expression dans la chaine sLatex située à gauche de la position j
' renvoie true si l'expression trouvée est entre {}, faux sinon
Dim iNiveau as integer, k as integer, iPos as integer, jtemp as integer
Dim sCarac as String
iPos=j
do while mid(sLatex,iPos,1)=" "
iPos=iPos-1
loop
j=iPos
if mid(sLatex,j,1)="}" then
' expression avec {}
iNiveau=1
k=j-1
do while k>0 and iNiveau>0
sCarac=mid(sLatex,k,1)
if sCarac="}" then
iNiveau=iNiveau+1
elseif sCarac="{" then
iNiveau=iNiveau-1
end if
k=k-1
loop
if iNiveau>0 then
msgbox("Erreur d'accolades dans la formule.")
stop
end if
i=k+1
bTrouveExpressionGauche=True
else
'expression sans {}
k=iPos
do while k>1 and not bEstCeDelimiteurOperateurs(mid(sLatex,k,1))
if instr("_^",mid(sLatex,k,1))>0 then
k=k-1
jtemp=k
bTrouveExpressionGauche(sLatex,k,jtemp)
end if
k=k-1
loop
if not bEstCeDelimiteurOperateurs(mid(sLatex,k,1)) then
' début de la formule
i=1
else
i=k+1
end if
bTrouveExpressionGauche=False
end if
end function
function bTrouveExpressionDroite(sLatex as string,i as integer,j as integer,optional sArgument as string) as boolean
' cherche une expression dans la chaine sLatex située à droite de la position i
' renvoie true si l'expression trouvée est entre {}, faux sinon
Dim iNiveau as integer, k as integer, iPos as integer, itemp as integer
Dim sCarac as String
iPos=i
do while mid(sLatex,iPos,1)=" "
iPos=iPos+1
loop
i=iPos
if mid(sLatex,i,1)="{" then
' expression avec {}
iNiveau=1
k=i+1
do while k<=len(sLatex) and iNiveau>0
sCarac=mid(sLatex,k,1)
if sCarac="{" and mid(sLatex,k-1,2)<>"\{" then
iNiveau=iNiveau+1
elseif sCarac="}" and mid(sLatex,k-1,2)<>"\}" then
iNiveau=iNiveau-1
end if
k=k+1
loop
if iNiveau>0 then
msgbox("Erreur d'accolades dans la formule.")
stop
end if
j=k-1
bTrouveExpressionDroite=True
else
'expression sans {}
k=iPos+1
do while k<=len(sLatex) and not bEstCeDelimiteurOperateurs(mid(sLatex,k,1))
if instr("_^",mid(sLatex,k,1))>0 then
k=k+1
itemp=k
bTrouveExpressionDroite(sLatex,itemp,k)
end if
k=k+1
loop
j=k-1
bTrouveExpressionDroite=False
end if
if not(IsMissing(sArgument)) then
sArgument=mid(sLatex,i,j-i+1)
end if
end function
function iSubstitue(sChaine as String, i as integer, j as integer, sChercher as String, sRemplacer as String) as integer
' cherche et remplace dans sChaine de la position i à j la chaine sChercher par sRemplacer
' en évitant les {} (déjà traités par récursivité)
' renvoie le nombre de remplacements effectués
dim k as integer, iNb as integer, jtemp as integer, iNiveau as integer
iNb=0
k=i
jtemp=j
iNiveau=0
do while k<=jtemp-len(sChercher)+1
if mid(sChaine,k,1)="{" then
iNiveau=iNiveau+1
do while iNiveau>0
k=k+1
if mid(sChaine,k,1)="{" and mid(sChaine,k-1,2)<>"\{" then
iNiveau=iNiveau+1
elseif mid(sChaine,k,1)="}" and mid(sChaine,k-1,2)<>"\}" then
iNiveau=iNiveau-1
end if
loop
end if
if mid(sChaine,k,len(sChercher))=sChercher then
sChaine=left(sChaine,k-1) & sRemplacer & mid(sChaine,k+len(sChercher))
jtemp=jtemp+len(sRemplacer)-len(sChercher)
k=k+len(sRemplacer)-1
iNb=iNb+1
end if
k=k+1
loop
j=jtemp
iSubstitue=iNb
end function
</script:module>
|