-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathget_total_height.template
More file actions
59 lines (50 loc) · 1.58 KB
/
get_total_height.template
File metadata and controls
59 lines (50 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
%%% Based on the script by Paolo Brasolin:
%%% \url{http://tex.stackexchange.com/a/285774}
%%% See V. Eijkhout, TeX by Topic, A TeXnician's Reference, 5.9.6;
%%% V. Eijkhout, ``Unusual paragraph shapes,'' TUGboat 11: 51--53.
\documentclass{tufte-book}
\usepackage{calc}
\usepackage{fontspec}
\usepackage[Latin,Greek,Mathematics,Symbols]{ucharclasses}
% Greek fonts
\newfontfamily\greekfont[ItalicFont={Latin Modern Roman 10 Italic},
ItalicFeatures={FakeSlant=0},
FakeSlant=0.15,
Ligatures=TeX]{Latin Modern Math}
\setTransitionsForGreek{\greekfont}{}
% Math fonts
\newfontfamily\mathsfont[ItalicFont={Latin Modern Roman 10 Italic}, Ligatures=TeX]{Latin Modern Math}
\setTransitionsForSymbols{\mathsfont}{}
\setTransitionsForMathematics{\mathsfont}{}
\setTransitionsForGreek{\mathsgreek}{}
\setTransitionsForMathematics{\mathsgreek}{}
\setTransitionsForSymbols{\mathsgreek}{}
\newdimen\lhTOP
\newdimen\htALL
\newif\ifoutput
\newbox\tempbox
\newbox\linebox
\def\measure#1\par{
\setbox\tempbox\vbox{#1\par\eat}
\settoheight{\global\htALL}{\vbox{#1}}
\ifoutput\box\tempbox\fi
}
\def\eat{{
\setbox\linebox\lastbox
\ifvoid\linebox
\else
\settoheight{\global\lhTOP}{\vbox{\unhcopy\linebox}}
\unskip\unpenalty\unskip\unpenalty\unskip\unpenalty\unskip\eat
\ifoutput
\noindent\box\linebox\rlap{~\,~\,~\,~\the\lhTOP}
\fi
\fi
}}
\begin{document}
$sethsize
\setlength{\parindent}{0pt}
\outputfalse
\measure $tex_to_measure \par
\showthe\dimexpr\htALL-\dimexpr\lhTOP
\showthe\dimexpr\baselineskip
\end{document}