It's time to set some environment variables. This is where quite a lot of the “magic” is hidden! Although they are mentioned somewhere in the respective manpages, a newcomer will have probably never heard of them. The result: images cannot be found, no matter how “right” you did it, as well as some other annoyances regarding font mappings. This is because different tools read different environment variables for the same information, ignoring all the others! There is probably no way to accomodate this - other than write all relevant variables down correctly - since TeX/LaTeX were created in a different time, for different needs than SGML parsers or PDF software.
Since we entered the names of images without any path information in LyX, openjade needs to be informed of their location with the environment variable SGML_SEARCH_PATH:
# Environment variables # openjade needs this! # Both absolute and relative paths work! # SGML_SEARCH_PATH="$PWD/images" SGML_SEARCH_PATH="./images" export SGML_SEARCH_PATH |
pdftex (and pdfjadetex) will look at a different environment variable for the location of the image files: TEXPSHEADERS. For some reason which I don't fully understand, \ includegraphics with pdftex uses the TEXPSHEADERS environment variable for the additional paths to search. Also: TEXPSHEADERS contains the search path where pdftex looks up for font mapping file (pdftex.map) and encoding files (*.enc):
# pdftex (and pdfjadetex) need this.
# In my system pdftex.map is located in /var/lib/texmf/dvips/config/,
# while the .enc files are under /usr/share/texmf/dvips/base/.
# TEXPSHEADERS=":${PWD}/images//:/var/lib/texmf/dvips/config/:/usr/share/texmf/dvips/base/"
TEXPSHEADERS=":${PWD}/images//"
export TEXPSHEADERS
|
LaTeX, on the other side, will look at still another variable for the path to images: TEXINPUTS (TEXINPUTS is also defined in the texmf.cnf file, usually located in the directory pointed to by the TEXMFCNF environment variable):
# <application>LaTeX</application> & Co. need this!
# A relative path does NOT work!
# TEXINPUTS="$PWD/images:$TEXINPUTS"
TEXINPUTS=":${PWD}/images//"
export TEXINPUTS
|
The TEXMFCNF environment variable points to the directory that contains the configuration files for TeX:
TEXMFCNF="/etc/texmf/" export TEXMFCNF |
In /etc/texmf/texmf.cnf we read:
% pdfjadetex: Search path for font metric (.tfm) files. TEXFONTS = .;$TEXMF/fonts/tfm// |
The next environment variable we will have to set, is the one that passes options to thumbpdf (see Section 3.7), for the case that you wish to do so:
# You can pass options to thumbpdf through this environment variable THUMBPDF="" export THUMBPDF |
Last but not least, openjade needs to know the locations of the SGML catalog files (see Section 4.5):
SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.iso_ent" SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.docbook-dsssl-stylesheets" SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.mathml-2.0" SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.svg-1.1" SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/CATALOG.docbook_4" SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/sgml/openjade/catalog" SGML_CATALOG_FILES="$SGML_CATALOG_FILES:/usr/share/refdb/refdb.cat" export SGML_CATALOG_FILES |
The SP_ENCODING environment variable tells Openjade in which encoding the input file is written in:
SP_ENCODING="ISO-8859-1" export SP_ENCODING |
Encoding names are case insensitive. The following named encodings are available (see Handling of character sets in OpenSP):
Each character is represented by a variable number of bytes according to UCS Transformation Format 8 defined in Annex P to be added by the first proposed drafted amendment (PDAM 1) to ISO/IEC 10646-1:1993.
Each character is represented by a variable number of bytes according to UCS Transformation Format 16 defined in Annex O to be added by the first proposed drafted amendment (PDAM 1) to ISO/IEC 10646-1:1993.
iso-10646-ucs-2 This is ISO/IEC 10646 with the UCS-2 transformation format. Each character is represented by 2 bytes. No special treatment is given to the byte order mark character.
utf-32 This is ISO/IEC 10646 with the UCS-4 transformation format. Each character is represented by 4 bytes.
Each character is represented according to the utf-16 encoding. The bytes representing the entire storage object may be preceded by a pair of bytes representing the byte order mark character (0xFEFF). The bytes representing each character are in the system byte order, unless the byte order mark character is present, in which case the order of its bytes determines the byte order. When the storage object is read, any byte order mark character is discarded.
This is equivalent to the Extended_UNIX_Code_Packed_Format_for_Japanese Internet charset. Each character is encoded by a variable length sequence of octets.
This is ASCII and KSC 5601 encoded with the EUC encoding as defined by KS C 5861-1992.
gb2312 This is ASCII and GB 2312-80 encoded with the EUC encoding. It is equivalent to the CN-GB MIME charset defined in RFC 1922.
shift_jis This is equivalent to the Shift_JIS Internet charset. Each character is encoded by a variable length sequence of octets. This is Microsoft's standard encoding for Japanese.
This is equivalent to the CN-Big5 MIME charset defined in RFC 1922.
n can be any single digit other than 0. Each character in the repertoire of ISO 8859-n is represented by a single byte.
koi8 The koi8-r encoding as defined in RFC 1489.
On input, this uses XML's rules to determine the encoding. On output, this uses UTF-8.
Specify this encoding when a storage object is encoded using your system's default Windows character set. This uses the so-called ANSI code page.
This uses the unicode encoding if the storage object starts with a byte order mark and otherwise the windows encoding. If you are working with Unicode, this is probably the best value for SP_ENCODING.
Specify this encoding when a storage object (file) uses the OEM code page. The OEM code-page for a particular machine is the code-page used by FAT file-systems on that machine and is the default code-page for MS-DOS consoles.
For OpenSP, a suite of SGML/XML processing tools related to Openjade, there are two other environment variables that are related to SP_ENCODING (see Handling of character sets in OpenSP):
If this variable is 1 or YES, then OpenSP will operate in fixed character set mode.
This identifies the system character set. When in fixed character set mode, this character set is used as the internal character set. When not in fixed character set mode this character set is used as the internal character set until the document character set has been read, at which point the document character set is used as the internal character set. The only currently recognized value for this is JIS. This refers to a character set which combines JIS X 0201, JIS X 0208 and JIS X 0212 by adding 0x8080 to the codes of characters in JIS X 0208 and 0x8000 to the codes of characters in JIS X 0212. The default system character set is Unicode 2.0.
But since lyxtox does not use OpenSP, we don't need to care about these two, as the manual page of Openjade asserts:
![]() |
Openjade does not use SP_CHARSET_FIXED and SP_SYSTEM_CHARSET |
|---|---|
|
OpenJade ignores the SP_CHARSET_FIXED and SP_SYSTEM_CHARSET environment variables and always uses Unicode as its internal character set, as if SP_CHARSET_FIXED was 1 and SP_SYSTEM_CHARSET was unset. Thus only the SP_ENCODING environment variable is relevant to OpenJades handling of character sets. |
| Last updated Mon Sep 24 01:19:25 CEST 2007 | Permalink: http://www.karakas-online.de/mySGML/explain-environment-variables.html | All contents © 2002-2007 Chris Karakas |