LaTeX2Web specific environments and commands

CSV tables

CSV tables are tables that are imported directly from a CSV file. The columns of the table are sortable.

Here is an example code:

\begin{csv}
\label{csvTable}
\caption{A sample table parsed from a CSV file.}
\url{test.csv}
\end{csv}

Here \url points to a local file, but a valid URL can be used to fetch a remote CSV file.

The slider environment

This environment is useful to display a slideshow in your page. Each slide can contain just about anything, except a slider or a section.

The syntax is very simple:

\begin{slider}\label{optional label for the slider}
\caption{optional caption for the slider}
\begin{slide}
... content ...
\end{slide}
\begin{slide}
... more content ....
\end{slide}
... maybe more slides
\end{slider}

You can put anything into a slide except

  • another slider
  • a section

The slider environment is great if you want to make a presentation.

The grid environment

The LaTeX grid environment lets you put successive blocks of content one after another, in such a way that this "line" of blocks wrap around the page when necessary.

Syntaxically, the grid environment is very similar to the slider environment. It works like this:

\begin{grid}
\begin{gridItem}
... content ...
\end{gridItem}
\begin{gridItem}
... more content ....
\end{gridItem}
... maybe more grid blocks
\end{grid}

You can put anything into a grid except

  • another grid
  • a theorem
  • a slider
  • a section

Videos

Video objects can be incorporated in LaTeX2Web.

The videos can be of two types:

  • standalone videos in the mp4 format
  • YouTube videos

The syntax is the following:

\begin{video}\label{}
\url{the URL to your video}
\caption{}
\type{}
\height{}
\theme{}
\end{video}

If the label is specified, there will be a number attached to the video. caption works like for images or tables.

If the type is not specified, it defaults to mp4. The other type is youtube.

The height is an integer specifying the height of the video in pixels. If not specified, the height defaults to 700.

If specified, a theme can be applied to the video player. There are four available:

  • city
  • fantasy
  • forest
  • sea

In LaTeX2Web, images can be turned into links.

Images can be turned into links. The images can be remote or local. Here is an example

\begin{imageLink}
\url{https://latex2web.app/}
\imageUrl{https://www.dropbox.com/scl/fi/9fya4wgacqow8enzfks7q/Logo-LaTeX2Web.jpeg?rlkey=0g316mrra2mo2ciicvuc1yv30&raw=1}
\alt{The LaTeX2Web logo}
\end{imageLink}

This code displays the LaTeX2Web logo, and when you click on it, you are redirected to the LaTeX2Web home page.

\imageUrl contains either a valid link to an image, or the name of an image file that belongs to your LaTeX2Web project.

\alt is the text that will be displayed if the image is missing.

The \refInput command

The \refInput commands is designed to import a part of an external document into the current document flow. This is possible only if you are the owner or the co-author of a document.

The command is designed to create composite documents which has parts that come from other documents.

The mandatory parameter of the \refinput command is the identifier of the remote document block.

This identifier consists of two parts

  • the identification of the document
  • the identifier of the block within this document

This document identifier is the last component of the URL that is used for displaying a document. The block identifier can be two things:

  • if a label command has been use to reference the block, the command parameter (aka label) will be used
  • if no label has been defined by the \label command, a generic label will be generated by LaTeX2Web for the block. Be aware that this label is valid as long as the hierarchy of abjects that contain the block has not been changed. So, you are an author and plan to share some content, you should rather use the \label command.

Example

\begin{import}
\refInput{Empirical-averaging-in-deterministic-optimal-control/kJdefinition}
\refInput{Empirical-averaging-in-deterministic-optimal-control/mainAssumption}
\refInput{Empirical-averaging-in-deterministic-optimal-control/Empirical-averaging-in-deterministic-optimal-control/section-5/section-1}
\end{import}

How to get an object identifier

To fetch the identifier of a box, check the Fetch labels option in the status bar at the bottom of the page. After that, clicking anywhere in the document will propose you a list of objects for which you can fetch a label. When a genuine label exists, the object is followed by the 🏷️ tag emoji. After you select an object, its identifier is put into the clipboard.

When your done, uncheck the Fetch labels options in the status bar.