1\documentclass[12pt, a4paper]{article}
2\usepackage[margin=1in]{geometry}
3\usepackage{multicol}
4\usepackage{fancyhdr}
5\usepackage{lipsum}
6
7\pagestyle{fancy}
8\fancyhf{}
9\fancyhead[L]{Layout Demo}
10\fancyhead[R]{\thepage}
11\renewcommand{\headrulewidth}{0.4pt}
12
13\title{Page Layout in LaTeX}
14\author{sublimated}
15\date{}
16
17\begin{document}
18\maketitle
19\thispagestyle{fancy}
20
21\section{Page Setup}
22
23This document uses \texttt{geometry} for margins and \texttt{fancyhdr} for headers.
24
25\begin{verbatim}
26\documentclass[12pt, a4paper]{article}
27\usepackage[margin=1in]{geometry}
28\end{verbatim}
29
30Common paper sizes: \texttt{a4paper}, \texttt{letterpaper}, \texttt{a5paper}.
31
32\section{Two-Column Layout}
33
34\begin{multicols}{2}
35Two-column layout is common in academic papers. The \texttt{multicol} package provides
36flexible column support with automatic balancing.
37
38Text flows naturally from the left column to the right column. You can use
39\verb|\columnbreak| to force a break.
40
41\columnbreak
42
43This text starts in the second column. Many conference templates (IEEE, ACM)
44use two-column layout by default with \verb|\documentclass[twocolumn]{article}|.
45
46sublimated renders multi-column layouts correctly in both PDF and HTML views.
47\end{multicols}
48
49\section{Vertical Spacing}
50
51Normal paragraph spacing.
52
53\bigskip
54After \verb|\bigskip| --- large vertical space.
55
56\medskip
57After \verb|\medskip| --- medium vertical space.
58
59\smallskip
60After \verb|\smallskip| --- small vertical space.
61
62Custom: \verb|\vspace{1cm}| adds exactly 1cm.
63
64\section{Horizontal Spacing}
65
66Normal\hspace{2cm}two centimeters gap.
67
68Left\hfill Right --- \verb|\hfill| pushes content to edges.
69
70\section{Boxes}
71
72\fbox{This text is in a frame box.}
73
74\bigskip
75
76\framebox[0.8\textwidth][c]{Centered in a fixed-width frame.}
77
78\bigskip
79
80\parbox{0.45\textwidth}{
81 A \texttt{parbox} for multi-line content. Useful for side-by-side layouts
82 without the full figure environment.
83}
84\hfill
85\parbox{0.45\textwidth}{
86 Second parbox next to the first. Both are 45\% of the text width with
87 \texttt{hfill} spacing between them.
88}
89
90\section{Centering and Alignment}
91
92\begin{center}
93 This text is centered.
94\end{center}
95
96\begin{flushleft}
97 This text is left-aligned (default).
98\end{flushleft}
99
100\begin{flushright}
101 This text is right-aligned.
102\end{flushright}
103
104\section{Page Breaks}
105
106Use \verb|\newpage| or \verb|\clearpage| to force a page break.
107\verb|\clearpage| also flushes all pending floats (figures, tables).
108
109\end{document}