This commit is contained in:
2026-06-19 17:59:47 +03:00
parent b376777a66
commit 4fe967e289
2 changed files with 49 additions and 17 deletions
+40 -10
View File
@@ -14,10 +14,9 @@
inherit (pkgs.texlive) inherit (pkgs.texlive)
scheme-small scheme-small
latexmk latexmk
# Hebrew + encoding # Hebrew + multilingual (XeLaTeX path)
babel-hebrew bidi
hebrew-fonts polyglossia
ucs
# Page layout # Page layout
fancyhdr fancyhdr
setspace setspace
@@ -31,12 +30,13 @@
mathtools mathtools
amsmath amsmath
amscls amscls
was gensymb
# Text # Text
enumitem enumitem
footmisc footmisc
csquotes csquotes
# Theorems + algorithms # Theorems + algorithms
relsize
ntheorem ntheorem
chngcntr chngcntr
algorithm2e algorithm2e
@@ -44,28 +44,58 @@
natbib natbib
tocbibind tocbibind
# Cross-references # Cross-references
zref
ifoddpage
cleveref cleveref
# Misc # Misc
silence silence
; ;
}; };
fontsConf = pkgs.makeFontsConf {
fontDirectories = [ pkgs.culmus ];
};
in in
{ {
devShells.${system}.default = pkgs.mkShell { devShells.${system}.default = pkgs.mkShell {
buildInputs = [ (pkgs.texlive.combine texPkgs) ]; buildInputs = [ (pkgs.texlive.combine texPkgs) pkgs.culmus pkgs.fontconfig ];
shellHook = ''
export FONTCONFIG_FILE="${fontsConf}"
'';
}; };
packages.${system}.default = pkgs.stdenvNoCC.mkDerivation rec { packages.${system}.default = pkgs.stdenvNoCC.mkDerivation rec {
name = "roll-thesis"; name = "roll-thesis";
src = self; src = self;
buildInputs = [ pkgs.coreutils (pkgs.texlive.combine texPkgs) ]; buildInputs = [
pkgs.coreutils
pkgs.fontconfig
(pkgs.texlive.combine texPkgs)
pkgs.culmus
];
phases = [ "unpackPhase" "buildPhase" "installPhase" ]; phases = [ "unpackPhase" "buildPhase" "installPhase" ];
buildPhase = '' buildPhase = ''
export PATH="${pkgs.lib.makeBinPath buildInputs}"; export PATH="${pkgs.lib.makeBinPath buildInputs}";
mkdir -p .cache/texmf-var mkdir -p .cache/texmf-var .cache/fontconfig
# Build a fontconfig pointing at culmus with a writable cache
FCACHE="$(pwd)/.cache/fontconfig"
cat > .cache/fonts.conf <<EOF
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>${pkgs.culmus}/share/fonts/truetype</dir>
<cachedir>$FCACHE</cachedir>
</fontconfig>
EOF
export FONTCONFIG_FILE="$(pwd)/.cache/fonts.conf"
export FONTCONFIG_CACHE="$FCACHE"
fc-cache -f 2>/dev/null || true
env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \ env TEXMFHOME=.cache TEXMFVAR=.cache/texmf-var \
latexmk -pdf --interaction=nonstopmode \ latexmk -xelatex -f --interaction=nonstopmode \
main.tex main.tex || true
test -f main.pdf
''; '';
installPhase = '' installPhase = ''
mkdir -p $out mkdir -p $out
+9 -7
View File
@@ -1,5 +1,4 @@
\documentclass[12pt,a4paper,oneside,onecolumn]{book} \documentclass[12pt,a4paper,oneside,onecolumn]{book}
\usepackage[utf8x]{inputenc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% remove unnecessary warnings % remove unnecessary warnings
@@ -7,10 +6,15 @@
\WarningFilter{caption}{Unknown document class} \WarningFilter{caption}{Unknown document class}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Tell babel to not use hyphenation for Hebrew % Hebrew + English via XeLaTeX:
\makeatletter\let\l@hebrew\l@nohyphenation\makeatother \usepackage{fontspec}
% Add Hebrew: \usepackage{polyglossia}
\usepackage[hebrew,english]{babel} \setmainlanguage{english}
\setotherlanguage{hebrew}
% Culmus OpenType fonts for Hebrew (exact fc family names)
\newfontfamily\hebrewfont[Script=Hebrew]{Frank Ruehl CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Miriam CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Set page numbering with no headers (according to guidelines): % Set page numbering with no headers (according to guidelines):
@@ -153,8 +157,6 @@
} }
\makeatother \makeatother
\PrerenderUnicode{א}
\newcommand{\onlythesecnum}{\arabic{section}} \newcommand{\onlythesecnum}{\arabic{section}}
\newcommand{\onlythesubsecnum}{\arabic{subsection}} \newcommand{\onlythesubsecnum}{\arabic{subsection}}