Selasa, 02 Juli 2024

Latex Document Class Standalone 1

Writing Hello World in Document Class Standalone

type this following latex code in latex editor:

\documentclass{standalone}
\standaloneconfig{border=4mm}
\begin{document}
 Hello World
\end{document} 

Notes

  • Latex option code \standaloneconfig{border=4mm} allows to specify the whitespace margin around the following page.
  • Alternative name of this option is margin.
  • The syntax:
    • border=length (all sides)〉
    • border={〈length (left/right)〉 〈length (bottom/top)〉}
    • border={〈length (left)〉 〈length (bottom)〉 〈length (right)〉 〈length (top)〉}

Drawing Tikz Picture in Document Class Standalone

type this following latex code in latex editor:

\documentclass[tikz]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=1.0]
% Draw the axes with node anchor

% draw x axes / horizontal line
\draw[->, very thick](0,0) -- (4,0) node[below]{\large{$x$}};
% draw y axes / vertical line
\draw[->, very thick](0,0) -- (0,4) node[left]{\large{$y$}};
\end{tikzpicture}
\end{document}

Result



Notes

change picture between \begin{tikzpicture}[scale=1.0]  and \end{tikzpicture} with your tikz picture.

How to make extra margin / white space around the object in Document Class Standalone click on Latex Standalone Margin hyperlink.

Bibliography

https://www.overleaf.com/

https://www.sagemath.org/

Related Post

Tidak ada komentar:

Posting Komentar