Download the PHP package dagstuhl/latex without Composer

On this page you can find all versions of the php package dagstuhl/latex. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package latex

The Dagstuhl LaTeX project

This project is a php class framework developed and used by Dagstuhl Publishing for handling LaTeX submissions on the Dagstuhl Submission Server. A large part is about parsing metadata from LaTeX files. Since the metadata information comes as the content of style-specific LaTeX macros (e.g. \title{...}, \author{...}), or environments (e.g. \begin{abstract}...\end{abstract}), we provide...

(these two may be useful in a wider context) and

Dagstuhl Publishing removes all comments from LaTeX files first, so the methods work best with comment-free LaTeX code.

Installation: composer require dagstuhl/latex

1. Generic methods for parsing LaTeX files

To get to know the basic methods, let's have a look at the LIPIcs example file.

Parsing macros

The above file contains the macro \documentclass[a4paper,UKenglish,cleveref, autoref, thm-restate]{lipics-v2021} specifying the underlying style file and the applied options.

To read out this information in a structured way, just do the following:

If a macro may occur several times, apply $latexFile->getMacros('...') and you will get an array of LatexMacro-objects

If a macro has more than one argument, use the $macro->getArguments() method to get its arguments as an array of strings. As an example, take the first author macro from the LIPIcs file:

To split it into the different parts, just do:

Parsing Environments

To read environments as LatexEnvironment objects from a LaTex-file, use $latexFile->getEnvironment('...');' or $latexFile->getEnvironments('...');'.

E.g. $latexFile->getEnvironment('abstract') will read the abstract, while $latexFile->getEnvironments('figure') will return the array of all figure-environments.

The contents of an environment (i.e. what is between \begin{...} and \end{...}) can be catched using the $environment->getContents() method.

To get the total LaTeX code of the environment (including the begin/end) use $environment->getSnippet().

Note: The getter-Methods for macros/environments remove %...-like comments from the LaTex file internally. Therefore, the LaTeX snippets they return by the ->getSnippet() method differ by the comments

2. LaTeX to UTF8 conversion

Converting metadata from LaTeX files to UTF8 can be arbitrarily complicated, depending on the structure of the underlying LaTeX file and the contents of the string to be converted. In most of the cases, MetadataString::toUtf8String() should do the job.

(As a second argument the MetadataString constructor accepts a LaTex file which will be used to resolve unknown macros.)

The other direction, namely UTF8 to LaTeX, is established by the Converter class:

(Note that math environments cannot be reconstructed from the UTF8 code, so this is essentially limited to plain-text conversion.)

3. Metadata-Reader

After a style-description php-class (see src/Styles/StyleDescriptions) has been configured for a certain LaTeX documentclass, the metadata extraction and conversion is as simple as it can be:

4. Integration into laravel projects

When used inside a laravel project, the Storage class is used for interactions with files. To interact with your LaTeX installation (e.g., via the LatexCompiler class), you must add a config file named config/latex.php provide the following values:

Outside a laravel project, write a global config function like so:

Note: The config keys related to the LaTeX compiler class have changed in version 2.6. The old keys latex.paths.latex-bin, latex.paths.bibtex-bin, latex.paths.www-data-path, latex.paths.www-data-home are deprecated (but still supported temporarily by the LegacyProfile, which can be applied by instantiating the compiler class as follows


All versions of latex with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-mbstring Version *
ext-simplexml Version *
ext-json Version *
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dagstuhl/latex contains the following files

Loading the files please wait ....