< colored text > latex matrices
## set margin in latex

How to set margin in latex? The easiest way is to use usepackage geometry, because it allows esay changing of the different margins which are normally used within latex.
### set margin latex example

### change textwidth

Usepackage geometry also allows an esay way to change the textwidth as the next exmaple would show us:
### set textwidth latex example

### Online Generator

custom paper size and margins in LaTeX - online

\documentclass{article} \usepackage[left=2cm, right=5cm, top=2cm]{geometry} \begin{document} Some text … left margin is 2 cm, right margin 5 cm and the top margin is 2 cm. \end{document}

\documentclass{article} \usepackage[textwidth=5cm]{geometry} \begin{document} Some text … which now got the width of 5 cm \end{document}Finally set margin and set textwidth could be combined:

\documentclass{article} \usepackage[left= 2cm, textwidth=10cm]{geometry} \begin{document} Some text … which now got the width of 10 cm and a left margin with a width of 2cm. \end{document}