Manual:$wgUseTeX/hu

Részletek
A beállítás a MediaWiki 1.18 és későbbi verziójában nem használt, funkcionalitása a Math kiterjesztésbe került át.

A MediaWiki 1.17 és korábbi verzióiban a változó engedélyezi a (TeX) címkék használatát.

A TeX használatához szükséges a texvc fordítása (a MediaWiki „math” könyvtárában), továbbá szükséges hozzá a latex, dvips, gs (ghostscript) és convert (ImageMagick) telepítése és a PATH-ben történő definiálása. További információkért lásd a math/README fájlt.

Interpretáció
A $wgUseTeX a LocalSettings.php-ban definiált változó, melynek „true” értéke szükséges a matematikai formulák megjelenítéséhez. A beállítás szintaxisa: $wgUseTeX = "true";  A beállítás nélkül a következő címkék: $$ and $$ nem lesznek parancsként értelmezve.

Ez a beállítás a működéshez szükséges, de nem elégséges. Számos más dolog betöltésére, telepítésére, beállítására és a szerver egyedi paramétereihez való igazítására van szükség egy hozzáértő által. Ezeket kiterjesztéseknek hívjuk. A beállítás leírását a Kiterjesztés:WikiTeX lapon találod.

== Felismerés =

A $wgUseTeX értékének ellenőrzéséhez írj be bármilyen matematikai formulát egy wikilapra, például a következőt:
 * $$O$$

A kódnak a dőlt O betűt kell megjelenítenie. A wiki jelenlegi beállításaiban ez a következőképpen néz ki:


 * $$O$$

If the variable $wgUseTeX is not set to true, the line appears as it is typed. If the variable is assigned, then the result depends on the setting of other variables and correctness of other files, in particular, those outside the wiki directory.

Diagnostics
The errors of the installation of the required extensions are reported with the red messages
 * (1) '''Failed to parse (Cannot write to or create math temp directory)

or
 * (2) Failed to parse (Missing texvc executable; please see math/README to configure.)

or
 * (3) Failed to parse (PNG conversion failed; check for correct installation of latex, dvips, gs, and convert):

In the case (1), it may help to make the math directory writable with the command
 * chmod 777 math

In the case (2), it may help to set variable $wgTexvc in the LocalSetting.php in the following way:
 * $wgTexvc = '/math/texvc' ; 

In the case (3), one should verify the existence of the commands latex, dvips, gs, and convert at the server, check that they work properely, and assign the corresponding variables in the LocalSetting.php the appropriate values. This is the most difficult and painful part of the installation of MediaWiki.

Check for latex
The existing of latex at the server can be detected with the simple code, for example, let the file 0.tex contains the four lines below: \documentstyle[12pt]{article} \begin{document} $x^2$ \end{document} Then, at the command line, the command
 * latex 0

should produce the file 0.dvi

Check for the dvips
If the dvips is installed, then, after the test above, the command
 * dvips -o 0.ps 0.dvi

should produce the file 0.ps

Check for the gs
If the check for latex and the check for dvips above did not cause the error messages, then one may test them together with the gs command typing in the command line
 * gs 0.ps

If at the console, this should produce a frame with image, showing the simple formula, indicating the square of variable x.

Check for the convert
After the tests above, the program convert and be checked with the command
 * convert 0.ps 0.png

At the correct installation of the convert (if the tests above passed well), the file 0.png should appear, and, in principle, this file already can be glued into the html document (although the formula occupies very small part of the areas of the frame). However, the software is supposed to do such operations automatically, with correct setting, providing the beautiful formula in the displayed text. (Up to year 2011, the vector mode of displaying of mathematical formulas is not realized, so, for wiki, the formulas are stored as png images, and such images are supported by the most of browsers.)

Location
For the use of MediaWiki, the commands mentioned above should be located, id est, the programmed should know the full path to each of them. This can be realized in the command line with commands
 * which latex
 * which dvips
 * which gs
 * which convert

Each of this commands is supposed to type at the screen the full path to each of the executables required. Let the corresponding outputs are p_1, p_2,p_3 and p_4.

Correction
Yet, there is no robot to perform the automatic installing of the software. Assume that all the directories required have the mode access 777, and the only problem is that MediaWiki cannot find the support for the conversion of formulas to the images. The programmer should find the corresponding variables in the MediaWiki package and assign them the required values. In some cases, this can be done, editing the LocalSetting.php

The names of variable for latex is already known; so, the corresponding line may have format
 * $wgLatexCommand = "p_1";

however, the p_1 should be substituted to value returned by the which latex command; for example, for some servers, it may have form
 * $wgLatexCommand = "/usr/texbin/latex";

Unfortunately, the names of other variables that need to be assigned are not yet reported. There is hypothesis, that the correct name for the convert program is $wgImageMagickConvertCommand = "p_4"; where p_4 should be substituted to the value specific for the custom server; doe example, for some servers, it may have form
 * $wgImageMagickConvertCommand = "/usr/local/bin/convert";

The confirmation of the name of variable for the path of the program convert and search for the names of variables for the programs dvips and gs may be matter for the future research. The assignment of appropriate values to these variables is expected to make the installation of mediaviki usable.

This text is expected to be updated according to the recommendations of more successful wiki-specialists.

The manual about the use of the variable $wgUseTeX and all the requirement accessories is expected to appear at Manual:$wgUseTeX; currently there is only a stab there.