# 3 Creating content

## 3.1 Basics

The directory for the content is versions/\$(VERSIONNBR)/content followed by a language code. In the configuration file user_settings.php (See here 2.2) it can be determined which languages are available. Take care that the codes are valid country codes defined in ISO 639-1.

WebLTX processes normal HTML, extended with embedded PHP function calls. Every language directory may contain one or more HTML files. The rule is that everything what is inside of a HTML file is also visible together in the browser window. That is even true if a HTML file contains more than one chapter or only parts of them. Expressed in a different way, a HTML file can be considered as the same as what a page represents in a book. Contrary to a book, WebLTX pages can have very different sizes.

If there is more than one HTML file, the alphabetical order of the file names determines the order of headlines and sections. For this reason it is recommended to give every file a page number prefix.

## 3.2 Available Functions

### 3.2.1 Captions

There are four levels of captions:

• chapters
• sections
• subsections
• sub-subsections

Chapters can be defined with

<?php DefChapter('Name','Shortname','Label')?>

Name is in this context the full caption of the chapter and used in the text body. The Shortname is optional and intended for the menu on the left side. The Label is optional too. Without label the caption has no number and cannot be referenced or linked (Note, that it is however possible to jump to the caption if you define a hidden anchor with DefHiddenAnchor).

Sections can be defined with

<?php DefSection('Name','Shortname','Label')?>

and subsections with
<?php DefSubSection('Name','Shortname','Label')?>

The parameters have the same meaning like in DefChapter.

### 3.2.2 Formulas and mathematical Expressions

Like in LaTeX, there are two different types of formulas in WebLTX:

• text formulas which are embedded in the floating text and
• equation blocks with numbering.

A text formula is usually short and normally it is used only for simple relations. Often it consists only of a single symbol for a physical quantity or something comparable.

You can define a text formula with

<?php DefEqn('a^2 = b^2 + c^2')?>

The output appears in the floating text like this one: $a^2 = b^2 + c^2$. It contains no numbering. The syntax is the same like in LaTeX.

If you want to give an equation a number for a later reference, you can define the formula with:

<?php DefEqnB('f(x) = \sqrt{1 -x^2}','Label')?>

The output looks like:
 $$f(x) = \sqrt{1 -x^2}$$ (3.2.2.1)
By the way, a block formula can be emphasised with DefEqnBImp. The formula appears in the block form:
 $$E = m\,c^2$$ (3.2.2.2)

Block formulas can be referenced from everywhere in the text. See section References and Links for details.

### 3.2.3 Figures and Pictures

A picture is worth a thousand words. But nevertheless pictures should always have a description text and a number. In WebLTX figures are inserted with

<?php DefFigure('Filename','Description','Format-Options','Label')?>

It is important to mention that the path and the name of the image file Filename has to be given relative to the content directory. The parameters Description and Label are self-descriptive. With parameter Format-Options the appearance of the picture can be controlled in large scale, because this string is appended at the HTML style variable.

Here an example. The code

<?php DefFigure('../../images/example.svg','Description','width:60%;margin-left:10%','figure1')?>

results in
Figure 3.2.3.1: Description

By the way, the image itself was created with the program ipe. It is very well suited for the generation of scalable vector graphics in EPS and PDF. A conversion to SVG is also possible (with iperender -svg). An especially useful feature of ipe is the possibility to embed LaTeX code in the image.

Every object with a number can be referenced and linked in different ways. The methods vary in the link's description text. For example, it is possible to refer to the same caption via title Available Functions, short title Functions, number 3.2 or with a freely chosen text.

Here are the corresponding PHP codes:

<?php RefByTitle('Funktionen')?>

<?php RefByShortname('Funktionen')?>

<?php Ref('Funktionen')?>

<?php RefFree('Funktionen','with a freely chosen text')?>


### 3.2.5 Anchors

Anchors are invisible markers in the text. Currently, there are only two different functions.

Bookmarks for the topmost horizontal menu bar can be defined with DefTopAnchor. For example, the leftmost entry was created with

<?php DefTopAnchor('Introduction','Introduction',1)?>

By clicking this link you will come to the point where the anchor was defined. The number (here 1) is important for the order of the book marks.

The second possible anchor type is the hidden anchor, which can be defined by DefHiddenAnchor. With the hidden anchor it is possible to link to a page, which would be otherwise unreachable. An example for the usage of a hidden anchor is the page Impressum.

### 3.2.6 Bibliography

WebLTX makes it easy to cite literature. With

<?php Cite('Feynman1985')?>

it is everywhere possible to insert a marker like this [Feynman1985]. The label 'Feynman1985' must exist in a BibTeX file. Path and name of the BibTeX file has to be set in the configuration file user_settings.php.

The output of the bibliography occurs when the function

<?php Bibliography()?>

appears. The output looks like this
 [Feynman1985] Richard P. Feynman: QED - The Strange Theory of Light and Matter. Princeton University Press, Princeton 1985, 1985
The bibliography contains only such entries which was cited in the text with Cite or NoCite. That means that the BibTeX file can contain many more entries, than the final bibliography has.