> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/da/matematik/07-operators.md).

# Operatorer

Tegn i matematisk tilstand vises normalt i kursiv, men nogle gange kræver visse funktionsnavne en anden formatering, hvilket kan opnås ved at bruge operatorer defineret i LaTeX.

## Introduktion

Trigonometriske funktioner, logaritmer og andre kan skrives i et dokument ved hjælp af nogle særlige kommandoer, som vist i følgende eksempel:

```latex
Eksempler på matematiske operatorer:
\[
    \sin(a + b) = \sin a \cos b + \cos a \sin b
.\]
```

[Åbn dette eksempel i Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Mathematical+operators+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0AExamples+of+mathematical+operators%3A%0A%5C%5B%0A++++%5Csin%28a+%2B+b%29+%3D+%5Csin+a+%5Ccos+b+%2B+%5Ccos+a+%5Csin+b%0A.%5C%5D%0A%5Cend%7Bdocument%7D)

Dette eksempel giver følgende output:

![Newsincos.png](/files/8e19b1d641469b9d49be8e0bddb4724d9d8d509b)

Kommandoerne vil udskrive funktionsnavnet i opret (romersk) tekst i stedet for kursiv.

## Operatorer i forskellige sammenhænge

Nogle operatorer kan tage parametre, som håndteres på en særlig måde, f.eks. grænseværdier.

```latex
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Test af notation for grænseværdier
\[
    \lim_{h \to 0 } \frac{f(x+h)-f(x)}{h}
.\]
Denne operator ændrer sig, når den bruges sammen med
tekst \( \lim_{h \to 0} (x-h) \).
\end{document}
```

[Åbn dette eksempel i Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Mathematical+operators+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamsmath%7D%0A%5Cbegin%7Bdocument%7D%0ATesting+notation+for+limits%0A%5C%5B%0A++++%5Clim_%7Bh+%5Cto+0+%7D+%5Cfrac%7Bf%28x%2Bh%29-f%28x%29%7D%7Bh%7D%0A.%5C%5D%0AThis+operator+changes+when+used+alongside+%0Atext+%5C%28+%5Clim_%7Bh+%5Cto+0%7D+%28x-h%29+%5C%29.%0A%5Cend%7Bdocument%7D)

Dette eksempel giver følgende output:

![OperatorsEx2.png](/files/217b3f79a76520a64d114e8b2c12eed2e80d3d56)

Pakken `amsmath` er nødvendig for makroen `\to`; uden denne pakke, `\rightarrow` skal bruges.

Bemærk, hvordan grænseværdideklarationen kan omfatte et indeks. Se [referencevejledningen](#reference-guide) for en komplet liste over tilgængelige operatorer.

Nogle sprog kan tilføje eller ændre nogle kommandoer; se [hovedsiden](/latex/da/readme.md) for sprogspecifikke artikler.

## Definering af dine egne operatorer

Hvis du har brug for at tilføje en egendefineret operator, der skal vises i romersk skrifttype i stedet for kursiv, skal du bruge `\DeclareMathOperator`

```latex
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\arctg}{arctg}
\begin{document}
Brugerspecificeret operator for arktangens:
\[
    \arctg \frac{\pi}{3} = \sqrt{3}
.\]
\end{document}
```

[Åbn dette eksempel i Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+defining+an+operator\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamsmath%7D%0A%5CDeclareMathOperator%7B%5Carctg%7D%7Barctg%7D%0A%5Cbegin%7Bdocument%7D%0AUser-defined+operator+for+arctangent%3A%0A%5C%5B%0A++++%5Carctg+%5Cfrac%7B%5Cpi%7D%7B3%7D+%3D+%5Csqrt%7B3%7D%0A.%5C%5D%0A%5Cend%7Bdocument%7D)

Dette eksempel giver følgende output:

![OperatorsEx3.png](/files/f1beeebd574e98723ed536777dec6079ac32c569)

Kommandoen `\DeclareMathOperator` tager to parametre, hvor den første er navnet på den nye operator, og den anden er teksten, der skal vises. For at denne kommando skal virke, skal du importere pakken **amsmath** i præamblen med

```latex
\usepackage{amsmath}
```

Kommandoen kan ændres en smule, hvis du har brug for, at din definerede operator bruger indeks, som `\lim` operatoren; i så fald skal du bruge `\DeclareMathOperator*`.

## Referencevejledning

**Komplet liste over matematiske operatorer**

| Operator  | Vises som   |
| --------- | ----------- |
| `\cos`    | $$\cos$$    |
| `\csc`    | $$\csc$$    |
| `\exp`    | $$\exp$$    |
| `\ker`    | $$\ker$$    |
| `\limsup` | $$\limsup$$ |
| `\min`    | $$\min$$    |
| `\sinh`   | $$\sinh$$   |
| `\arcsin` | $$\arcsin$$ |
| `\cosh`   | $$\cosh$$   |
| `\deg`    | $$\deg$$    |
| `\gcd`    | $$\gcd$$    |
| `\lg`     | $$\lg$$     |
| `\ln`     | $$\ln$$     |
| `\Pr`     | $$\Pr$$     |
| `\sup`    | $$\sup$$    |
| `\arctan` | $$\arctan$$ |
| `\cot`    | $$\cot$$    |
| `\det`    | $$\det$$    |
| `\hom`    | $$\hom$$    |
| `\lim`    | $$\lim$$    |
| `\log`    | $$\log$$    |
| `\sec`    | $$\sec$$    |
| `\tan`    | $$\tan$$    |
| `\arg`    | $$\arg$$    |
| `\coth`   | $$\coth$$   |
| `\dim`    | $$\dim$$    |
| `\liminf` | $$\liminf$$ |
| `\max`    | $$\max$$    |
| `\sin`    | $$\sin$$    |
| `\tanh`   | $$\tanh$$   |

## Yderligere læsning

For mere information, se

* [Matematiske udtryk](/latex/da/matematik/01-mathematical-expressions.md)
* [Nedsænkede og hævede tegn](/latex/da/matematik/02-subscripts-and-superscripts.md)
* [Brøker og binomialer](/latex/da/matematik/05-fractions-and-binomials.md)
* [Mellemrum i matematisk tilstand](/latex/da/matematik/08-spacing-in-math-mode.md)
* [Integraler, summer og grænser](/latex/da/matematik/09-integrals-sums-and-limits.md)
* [Display-stil i matematisk tilstand](/latex/da/matematik/10-display-style-in-math-mode.md)
* [Den ikke helt korte introduktion til LaTeX2ε](http://www.ctan.org/tex-archive/info/lshort/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/da/matematik/07-operators.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
