In a Scala String need to include this literal verbatim: \usepackage{x}
. Thus, desired would be that for
val s = """ ... \usepackage{X} ... """
println(s)
... \usepackage{X} ...
Attempts so far include,
scala> """\usepackage{X}"""
<console>:1: error: error in unicode escape
"""\usepackage{X}"""
^
scala> raw"""\usepackage{X}"""
<console>:1: error: error in unicode escape
raw"""\usepackage{X}"""
^
Single double-quoted strings prove unsuccessful as well.
Following http://docs.scala-lang.org/overviews/core/string-interpolation.html , a working example includes
scala> raw"a\nb"
res1: String = a\nb
which does not cover unicode cases.