Not an issue, but I found it useful to add explicit "LaTeX" dimensions as in
enum Dim {
case CM(x: Double)
case MM(x: Double)
case PT(x: Double)
case EM(x: Double)
override def toString: String = this match {
case CM(x) => s"${x}cm"
case MM(x) => s"${x}mm"
case PT(x) => s"${x}pt"
case EM(x) => s"${x}em"
}
}
import Dim.toString
extension (x: Double) {
def pt: Dim = Dim.PT(x)
def mm: Dim = Dim.MM(x)
def cm: Dim = Dim.CM(x)
def em: Dim = Dim.EM(x)
}
and then let LaTeX commands like
textSize(7.5.pt,10.5.pt)
space(2.cm)
take these Dim(ensions) as arguments. In this way one does not need to hardcode pt's and em's. The definition for textSize becomes
Not an issue, but I found it useful to add explicit "LaTeX" dimensions as in
and then let LaTeX commands like
take these Dim(ensions) as arguments. In this way one does not need to hardcode pt's and em's. The definition for textSize becomes
Maybe of help. Christian