Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RPTU-Design
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mischke
RPTU-Design
Commits
6a43dd77
Unverified
Commit
6a43dd77
authored
5 months ago
by
Patrick Mischke
Browse files
Options
Downloads
Patches
Plain Diff
Make font detection more failproof
parent
d674241e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
LaTeX-Baposter/rptu-poster.sty
+53
-9
53 additions, 9 deletions
LaTeX-Baposter/rptu-poster.sty
with
53 additions
and
9 deletions
LaTeX-Baposter/rptu-poster.sty
+
53
−
9
View file @
6a43dd77
...
...
@@ -77,15 +77,39 @@
{
#1
}
%
}
%
%
\def\redhattext
{
Red Hat Text
}
%
\def\redhattextalt
{
RedHatText
}
%
\def\redhatmono
{
Red Hat Mono
}
%
\def\redhatmonoalt
{
RedHatMono
}
%
\def\fontfallback
{
PT Sans
}
%
\def\monofallback
{
PT Mono
}
%
\ifXeTeX
%
%% works only with XeLaTeX
\RequirePackage
{
fontspec
}
%
\RequirePackage
{
unicode-math
}
%
\setmainfont
{
Red Hat Text
}
%
\setsansfont
{
Red Hat Text
}
%
\setmonofont
{
Red Hat Mono
}
%
% sometimes Red Hat Text is installed using the name "RedHatText", sometimes "Red Hat Text".
% We check which one we can find. We treat PTsans as fallback
\IfFontExistsTF
{
\redhattext
}{}
%
{
\IfFontExistsTF
{
\redhattextalt
}{
\let\redhattext
=
\redhattextalt
}
%
{
\let\redhattext
=
\fontfallback
%
\typeout
{
Red Hat Text not found!
}}}
%
\IfFontExistsTF
{
\redhatmono
}{}
%
{
\IfFontExistsTF
{
\redhatmonoalt
}{
\let\redhatmono
=
\redhatmonoalt
}
%
{
\let\redhatmono
=
\monofallback
%
\typeout
{
Red Hat Mono not found!
}}}
%
\setmainfont
{
\redhattext
}
%
\setsansfont
{
\redhattext
}
%
\setmonofont
{
\redhatmono
}
%
\setmathfont
{
latinmodern-math.otf
}
% Some reasonable fallback
\setmathfont
{
Red Hat T
ext
}
[
%
\setmathfont
{
\redhatt
ext
}
[
%
range=
{
up/
{
latin,Latin,num
}}
%
]
%
\setmathfont
{
RedHatText-Italic
}
[
%
...
...
@@ -96,11 +120,29 @@
%% I lied. It works also with LuaTex.
\RequirePackage
{
fontspec
}
%
\RequirePackage
{
unicode-math
}
%
\setmainfont
{
Red Hat Text
}
%
\setsansfont
{
Red Hat Text
}
%
\setmonofont
{
Red Hat Mono
}
%
% sometimes Red Hat Text is installed using the name "RedHatText", sometimes "Red Hat Text".
% We check which one we can find. We treat PTsans as fallback
\IfFontExistsTF
{
\redhattext
}{}
%
{
\IfFontExistsTF
{
\redhattextalt
}{
\let\redhattext
=
\redhattextalt
}
%
{
\let\redhattext
=
\fontfallback
%
\typeout
{
Red Hat Text not found!
}}}
%
\IfFontExistsTF
{
\redhatmono
}{}
%
{
\IfFontExistsTF
{
\redhatmonoalt
}{
\let\redhatmono
=
\redhatmonoalt
}
%
{
\let\redhatmono
=
\monofallback
%
\typeout
{
Red Hat Mono not found!
}}}
%
\setmainfont
{
\redhattext
}
%
\setsansfont
{
\redhattext
}
%
\setmonofont
{
\redhatmono
}
%
\setmathfont
{
latinmodern-math.otf
}
% Some reasonable fallback
\setmathfont
{
Red Hat T
ext
}
[
%
\setmathfont
{
\redhatt
ext
}
[
%
range=
{
up/
{
latin,Latin,num
}}
%
]
%
\setmathfont
{
RedHatText-Italic
}
[
%
...
...
@@ -110,9 +152,11 @@
% fallback for pdflatex: Don't bother using RedHatText
\typeout
{
Using RedHatText as font requires "XeLaTeX" or "LuaLaTeX"
Using RedHatText as font requires "XeLaTeX" or "LuaLaTeX"
. Using PT Sans instead.
}
%
\let\redhatmono
=
\monofallback
%
\let\redhattext
=
\fontfallback
%
% To prevent users from loading the wrong math packages, we load amsmath
% instead of unicode-math here (as unicode-math is not available with pdflatex)
\RequirePackage
{
amsmath
}
%
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment