Use the standalone
rather than the article
document class. Among other things, it will crop rather tightly the output of your (pdf)latex run. E.g., the following modification of your example code (I've mainly stripped out some unneeded \usepackage
instructions),
\documentclass[10pt,a4paper]{standalone}
\begin{document}
\section{One document to display}
How to produce output without any margin.
\noindent
$ E = m c^2 $ but it seems that we can have $ v > c $.
\end{document}
will produce the following output (one can't see that the image is cropped tightly, so you'll have to take my word for it):

Addendum: If you want to restrict the width of the pdf file produced with the document class set as standalone
, say to the width of a known string of text, you can do so by using the \settowidth
command in the preamble. In the example you provided, the relevant string is the content of the section header -- the numeral 1, a space (of width \quad
), and the string "One document to display", all set in bold in the font size \Large
. Hence, you'd type
\settowidth{\textwidth}{\Large\textbf{1\quad One document to display}}
to set the \textwidth
macro.
Obviously, the macro \textwidth
should be set to the width of the single longest string of text you anticipate having. I recommend you first comment out the \settowidth
instruction in the preamble, optimize the document to your liking, then figure out what the longest string is, and finally make that string the second argument of the \settowidth
command. Happy TeXing!