Transclusion

from Wikipedia, the free encyclopedia
B has been transcluded into document A.

In computer science , a designated Transclusion (Engl. Transclusion ) the acquisition of an electronic document or parts thereof, in one or more other documents by hypertext - link .

In contrast to the hyperlink , which allows the optional jump to another place or to another document, a transclusion is normally carried out automatically when the target document is displayed. The result is an independent document that is only put together from various sources when it is called up.

Transclusion enables the modular structure of documents: digital data (e.g. text modules ) are stored in one place, but can be used in any number of documents, i. H. be integrated . Updates and corrections made to the source data are automatically adopted in all target documents. The mechanism is functionally similar to normalization when modeling relational databases .

A transclusion is to be distinguished from an immersion , in which the boundaries between two documents are dissolved.

development

Ted Nelson's Xanadu project contains transclusions. In his original draft for hypertext, which he presented in his book Literary Machines in 1980, Ted Nelson assumed that readers of a document would automatically reward the author (s) through micropayment , regardless of how many fragments it was composed of . Since this remuneration model is not provided for in today's hypertext systems such as the World Wide Web , transclusion is a fundamental copyright problem.

atomization

The idea of ​​transclusion requires that the parts of a text can be written atomized so that the content of one part does not contradict the content of another part. For example, the following formulations, which can often be found in linear texts, are not possible in an atomized text:

  • An explanation follows below .
  • You can find an explanation in the previous section .
  • As mentioned earlier ...
  • As we already mentioned ...
  • We will deal with this question in detail later .

Since one does not know where the atomized text fragment will appear, one cannot refer to parts outside the fragment.

example

For example, by transclusion, an article on a country could include a table or paragraph describing that country's agricultural exports from another article on agriculture. Instead of duplicating the included data and storing it in two places, a transclusion allows it to be stored and managed centrally in one place; a corrected or updated version then appears in all documents that transclude the data.

syntax

In contrast to a hyperlink , another document is not just referenced. Rather, the other document is inserted as a whole - or a defined part of it.

Transclusions are used in many wikis and the TeX typesetting system. For example, if the content of the TeX source file is Werk.texa character string of the shape

Beginning\input Literaturend

and the string ‹ literature › is the content of Literatur.tex, then is processed Werk.texwith the same result as a file, the content of which is the string

Beginning › ‹ Literature › ‹ End

is. LaTeX variants of \inputare described below .

The function is similar to an include in server-side scripting languages such as ASP , JSP , PHP or server-side includes and an HTML frameset .

Example commands in LaTeX

With the TeX format LaTeX is used instead of “ \input Literatur” in the TeX example above

  1. " \input{Literatur}" For additional log functionality (list entry) and changed error handling;
  2. " \include{Literatur}" To only insert the content of in the editingLiteratur.tex phase if the user has set this in the LaTeX preamble.
  3. \InputIfFileExists{Literatur}{Pre-read in}{otherwise}” enables variations of “ \input{Literatur}”;
  4. the internal (authors inaccessible) command \@inputonly logs the missing target file without \inputthrowing an error message.
  5. LaTeX offers further transclusion commands such as \documentclassand \usepackage/ \RequirePackageto the content of pure value assignment files (formatting settings - "package files") such as article.clsor doc.stywith access to internal commands, version control, error handling, log function and selective integration ( package options only select parts of the target file for integration) and not to be inserted several times .

Individual evidence

  1. ^ Robert J. Glushko: Robert J. Glushko (Ed.): The Discipline of Organizing . MIT Press, Cambridge, Massachusetts 2013, ISBN 978-0-262-51850-5 , p. 231.