I need a word that describes a detached style of writing, like a
textbook or medical journal.
I believe that academic writing is, in fact, the label that suites your requirements by definition: it is the type of writing used in textbooks and journals. See the list of its characteristics below, which, in addition to formal, include objective, balanced and evidenced. These contribute to the "detached/scientific" quality you are looking for.
academic (writing)
What is academic writing?
Academic writing is writing which communicates ideas, information and
research to the wider academic community. It can be divided into two
types: student academic writing, which is used as a form of assessment
at university, as well as at schools as preparation for university
study; and expert academic writing, which is writing that is
intended for publication in an academic journal or book.
Both types of academic writing (student and expert) are expected to
adhere to the same standards, which can be difficult for students to
master. The characteristics of academic writing which together
distinguish it from other forms of writing are that it is:
structured;
evidenced;
critical;
balanced;
precise;
objective;
formal.
"Academic Writing", eapfoundation.com
What is academic writing?
Academic writing is clear, concise, focussed, structured and backed up
by evidence. Its purpose is to aid the reader’s understanding.
It has a formal tone and style, but it is not complex and does not
require the use of long sentences and complicated vocabulary.
Each subject discipline will have certain writing conventions,
vocabulary and types of discourse that you will become familiar with
over the course of your degree. However, there are some general
characteristics of academic writing that are relevant across all
disciplines. "Academic Writing", library.leeds.ac.uk
What is academic writing?
Loosely defined, academic writing is writing for academic
purposes. That is, it is writing that explores or examines some aspect
of knowledge. Generally, it is the kind of writing that scholars or
academics produce (as philosophers, historians, social scientists,
natural scientists, and so forth) as can be seen in academic books
and articles in academic journals. There are of course, differences in
such aspects as organization, vocabulary, and academic conventions
from one discipline to another. Pedro Pak-tao Ng; Effective
Writing (2003)
(Wikipedia gives scholarly writing as a synonym.)
academic (adj.)
Of, relating to, or characteristic of an educational institution or
environment; concerned with the pursuit of research, education, and
scholarship; scholarly, educational, intellectual. (OED)