Summary of Markup Languages and Data Formats
Markup Languages and Data Formats Explained for Students
Introduction
Markup languages are used to describe the structure and presentation of text documents and graphics using simple text tags. This material focuses on practical approaches, examples, and comparisons of the main types of markup languages used at the university level.
Definition: A markup language is a text format that uses special tags to describe the structure or content of a document so that it can be further processed or displayed.
Key Concepts (Divided Sections)
1) TeX and LaTeX — Typography and Precise Typesetting
- TeX: A programming language for creating professional typesetting; emphasizes precise control over the output.
- LaTeX: A macro package (a set of macro commands) built on TeX, which simplifies common tasks such as chapters, citations, or tables.
Definition: TeX is a low-level language for document typesetting; LaTeX is a library of macros that provides a higher level of abstraction over TeX.
Practical example of a basic LaTeX document:
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[UTF-8]{inputenc}
\usepackage{babel}
\begin{document}
Hello, world!
\end{document}
- Tips: Save the file with a .tex extension and compile it into a PDF using tools like pdfLaTeX or XeLaTeX.
Practical applications:
- Writing scientific articles, theses, books, and mathematical texts.
- Precise page layout settings, support for packages for citations, graphics, and equation typesetting.
2) Markdown — Lightweight Text Markup for Web and Notes
- Markdown is a simple syntax for quickly writing structured text that converts into HTML or other formats.
- Often used for README files, note-taking applications, and Jupyter notebooks.
Practical example (basic syntax):
- Heading: # Heading
- Bold text: bold
- List: - item
Uses:
- Quick documentation in GitHub repositories, writing notes in tools like Obsidian, or inputs/outputs of generative tools.
Interesting fact: Markdown was originally created in 2004, and its standardization was later strengthened by the CommonMark project.
3) SVG — Vector Graphics in Text Form
- SVG (Scalable Vector Graphics) is an XML application for vector graphics; the resulting files are text-based and can be edited in a text editor.
Definition: SVG is a format for describing vector graphics using tags, which maintains quality when scaled.
Key features:
- Smaller file size for simple shapes compared to bitmaps
- Ability to animate, accessibility of text within graphics, use of CSS and scripting
Example of a simple shape (schematically):
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<polyline points="20,20 40,25 60,40" style="fill:none;stroke:black;stroke-width:3" />
</svg>
Methods of embedding in HTML (advantages/disadvantages):
| Method | Advantage | Disadvantage |
|---|---|---|
| <img src="..."> | Simple, commonly supported by browsers | Limited access to internal SVG elements |
| <object data="..."> | Wide support across HTML versions | More complex scripting within the object |
| <iframe src="..."> | Isolated context, good support | Difficult integration with page CSS |
| Embed directly <svg> | Full control and styling | Increases HTML document size, can be challenging to maintain |
Uses:
- Interactive visualizations, diagrams, charts, animations.
Interesting fact: SVG files can be directly edited in both text editors and vector editors, which facilitates the automation of their generation.
4) Other Languages and Examples
- Polyline, path, and text in SVG for drawing and labels.
- KML (Keyhole Markup Language) for geolocating points on maps.
Short KML example:
<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Placemark>
<name>Plzeň</name>
<description>Pilsen is the beer capital of the world.</description>
Already have an account? Sign in
Markup languages — Overview
Klíčové pojmy: TeX is a professional document typesetting tool., LaTeX is a set of macros that simplifies working with TeX., Markdown is a lightweight format for quick writing and conversion to HTML., SVG describes vector graphics in a text-based format., SVG can be embedded into HTML in several ways: img, object, iframe, or inline., Polyline and path are fundamental SVG shapes for drawing paths., KML is used to describe geographical data for maps., The choice of markup language depends on the requirements for precision, interactivity, and simplicity., A LaTeX document begins with \documentclass and ends with \end{document}., Markdown has various dialects; CommonMark aims to unify the syntax., SVG allows for animations, scripts, and text accessibility within graphics., Converting between formats (Markdown → LaTeX/PDF) streamlines the workflow.