die Grammatik
grammar
The rule system of a language that describes how words are combined into sentences.
Die deutsche Grammatik ist für viele Lernende eine Herausforderung.
German grammar is a challenge for many learners.

grammar
Loading your saved state.
grammar
The rule system of a language that describes how words are combined into sentences.
Die deutsche Grammatik ist für viele Lernende eine Herausforderung.
German grammar is a challenge for many learners.

You can often distinguish the two meanings by the article and the verb. 'Die Grammatik' (the grammar, with the definite article) usually means the rule system. 'Eine Grammatik' (a grammar book, with the indefinite article) or verbs like 'kaufen' (to buy) or 'nachschlagen' (to look up) point to the textbook.
Die Grammatik dieser Sprache ist sehr logisch aufgebaut.
The grammar of this language is structured very logically.
The word family includes the adjective 'grammatisch' (grammatical) or 'grammatikalisch' (grammatical). It is used to refer to the rules of grammar.
Der Satz ist zwar verständlich, aber er enthält einen grammatischen Fehler.
The sentence is understandable, but it contains a grammatical error.
When referring to the rule system, 'Grammatik' (grammar) is often combined with verbs such as 'lernen' (to learn), 'üben' (to practice), 'verstehen' (to understand), or 'erklären' (to explain). People also speak of 'deutsche/englische/… Grammatik' (German/English/... grammar).
Im Sprachkurs üben wir heute die Grammatik zum Thema Konjunktiv II.
In the language course, we are practicing grammar on the topic of the subjunctive II today.
textbook
'die Grammatik' and 'das Lehrbuch' can both mean a book for learning. That is why they can be confused. However, 'die Grammatik' often first means the rules of a language, such as word order, cases, or tenses. In addition, 'eine Grammatik' can also be a grammar book that explains exactly these rules. 'das Lehrbuch' is more general: it can be for German, mathematics, history, or many other subjects. When you are talking about language rules themselves, 'Grammatik' fits. When you are talking about a learning book for a subject, 'Lehrbuch' fits.

Für die Prüfung wiederholt sie die Grammatik der deutschen Nebensätze.
For the exam, she reviews the grammar of German subordinate clauses.
Am Morgen lesen wir im Lehrbuch ein neues Kapitel über die deutsche Geschichte.
In the morning, we read a new chapter about German history in the textbook.