This is my script:
var="lalallalal"
tee file.tex <<'EOF'
text \\ text \\
$var
EOF
Need to use 'EOF' (with quotes) because I can not use double slash (//) otherwise.
However, if I use the quotes, the $var variable is not expanded.
If you quote EOF, variables won't be expanded, as you found out. This is documented in the Here Documents section of man bash:
No parameter and variable expansion, command substitution, arithmetic
expansion, or pathname expansion is performed on word. If any part of
word is quoted, the delimiter is the result of quote removal on word,
and the lines in the here-document are not expanded. If word is
unquoted, all lines of the here-document are subjected to parameter
expansion, command substitution, and arithmetic expansion, the charac‐
ter sequence \<newline> is ignored, and \ must be used to quote the
characters \, $, and `.
The other thing explained there is that you can still use\, you just need to escape it: \\. So, since you want two \, you need to escape each of them: \\\\. Putting all this together:
#!/bin/bash
var="lalallalal"
tee file.tex <<EOF
text \\\\ text \\\\
$var
EOF
It seems you want to have expansion enable only for part of document, or only on some of special characters ($ yes, \ no). In the first case you may want to divide here-document into two, and in the second case let me propose non-standard approach: treat \ as a variable:
var="lalallalal"
bs='\'; #backslash
tee file.tex <<EOF
text $bs$bs text $bs$bs
$var
EOF
One option would be to simply replace the variable after you create the string. I know this is kind of manual variable expansion, but it is a solution.
# Set variables
var="lalallalal"
read -rd '' tex_data <<'EOF'
text \\ text \\
${var}
EOF
# Expand variable
tex_data="${tex_data//\$\{var\}/$var}"
printf "%s" "$tex_data" | tee file.tex