NoTeX 1.0.0
A modern noteworthy LaTeX template
Loading...
Searching...
No Matches
notex::Environment Class Reference

Represents the surrounding system as NoTeX perceives it: where TeX expects user files to live, and whether NoTeX is installed. More...

#include <notex/environment.hpp>

Public Member Functions

 Environment (std::filesystem::path start_dir=std::filesystem::current_path())
 Resolves TEXMFHOME and checks start_dir for a local installation.
const std::filesystem::path & texmf_home () const noexcept
const std::filesystem::path & global_latex_dir () const noexcept
const std::filesystem::path & global_fonts_dir () const noexcept
const std::filesystem::path & local_latex_dir () const noexcept
const std::filesystem::path & local_fonts_dir () const noexcept
InstallationType installation_type () const noexcept

Detailed Description

Represents the surrounding system as NoTeX perceives it: where TeX expects user files to live, and whether NoTeX is installed.

An Environment holds no project state and never modifies anything on disk; it is a read-only snapshot that the rest of the program consults. It resolves TEXMFHOME by honouring the TEXMFHOME environment variable first and, only if that is absent, falling back to kpsewhich -var-value=TEXMFHOME.

Definition at line 35 of file environment.hpp.

Constructor & Destructor Documentation

◆ Environment()

notex::Environment::Environment ( std::filesystem::path start_dir = std::filesystem::current_path())
explicit

Resolves TEXMFHOME and checks start_dir for a local installation.

Parameters
start_dirDirectory checked for a local installation (<start_dir>/settings/notex.cls); defaults to the current working directory.
Exceptions
EnvironmentErrorif TEXMFHOME cannot be resolved from either the environment variable or kpsewhich.

Definition at line 61 of file environment.cpp.

References notex::GLOBAL, notex::LOCAL, notex::NONE, and notex::to_string().

Member Function Documentation

◆ global_fonts_dir()

const std::filesystem::path & notex::Environment::global_fonts_dir ( ) const
inlinenoexcept
Returns
Where a global installation's fonts live: <texmf_home>/fonts/truetype/notex.

Definition at line 62 of file environment.hpp.

Referenced by notex::Installer::install_global(), and notex::Installer::uninstall_global().

◆ global_latex_dir()

const std::filesystem::path & notex::Environment::global_latex_dir ( ) const
inlinenoexcept
Returns
Where a global installation's class and style files live: <texmf_home>/tex/latex/notex.

Definition at line 56 of file environment.hpp.

Referenced by notex::Installer::install_global(), and notex::Installer::uninstall_global().

◆ installation_type()

InstallationType notex::Environment::installation_type ( ) const
inlinenoexcept
Returns
Whether a local, global, or no installation was detected relative to start_dir. A local installation takes precedence over a global one when both are present.

Definition at line 81 of file environment.hpp.

◆ local_fonts_dir()

const std::filesystem::path & notex::Environment::local_fonts_dir ( ) const
inlinenoexcept
Returns
Where a local installation's fonts would live: <start_dir>/fonts.

Definition at line 74 of file environment.hpp.

◆ local_latex_dir()

const std::filesystem::path & notex::Environment::local_latex_dir ( ) const
inlinenoexcept
Returns
Where a local installation's class and style files would live: <start_dir>/settings.

Definition at line 68 of file environment.hpp.

◆ texmf_home()

const std::filesystem::path & notex::Environment::texmf_home ( ) const
inlinenoexcept
Returns
The resolved TEXMFHOME directory.

Definition at line 50 of file environment.hpp.

Referenced by notex::Installer::install_global(), and notex::Installer::uninstall_global().


The documentation for this class was generated from the following files: