2

thank you for your time.

I wonder if it is possible to render one phrase only in latex and make sure the document is wrapped around the phrase (no bigger that it need to be)? I know you can set the size of a document with the package geometry but I would prefer for it to be somewhat automatic as I want to incorporate this in a script.

example being the entire document: this the entire document Thank you for you time and help

3
  • 3
    sounds like you are looking for the standalone documentclass. Can you post the code for your equation? Commented Oct 13, 2018 at 14:34
  • this is exactly that. Thank you, I had no clue such thing existed, I thought that latex was only an article like document maker. I(ve put your answer.
    – NRagot
    Commented Oct 13, 2018 at 15:03
  • never underestimate the abilities of latex :) Commented Oct 13, 2018 at 15:11

1 Answer 1

3

Ok, the comment from samcarter allowed me to find what I needed on the internet. The standalone document class is the one. This page has everything : How to make a standalone document with one equation?.

Thank you

Even though the one in the link seems awfully similar to mine, I wont erase my question since to find the one in the link you have to know the standalone class (Unless asked otherwise of course). Good day to all.


edit: As requested, here is the result enter image description here
from

\documentclass{standalone}
\begin{document}
$
\displaystyle
\int_a^x f(t)dt = \lim_{n \rightarrow +\infty} \sum_{k=0}^n \frac{x - a}{n} f\left(k \frac{x - a}{n} + a\right)
$
\end{document}

Notice the use of $ \displaystyle ... $ instead of $$ ... $$; it is because the standalone class doesn't accept $$ by default for being in crop mode. Going into preview mode only wrap the text vertically and not horizontally which is even better for me. If that is no problem for you however, just replace the line \documentclass{standalone} by \documentclass[preview]{standalone} from which the class allow the use of $$.

6
  • you should show us your solution ...
    – Zarko
    Commented Oct 13, 2018 at 15:04
  • very well, I'll update immediately
    – NRagot
    Commented Oct 13, 2018 at 15:05
  • even better, ask @samcarte that (s)he extend her/his comment to an answer ...
    – Zarko
    Commented Oct 13, 2018 at 15:11
  • @S.lama Not necessary to ask me, I'm fine with you posting an answer yourself. As a improvement you could include a small sample document with the formula from your question. Commented Oct 13, 2018 at 15:12
  • @S.lama Nice answer! You might want to avoid $$ altogether, see tex.stackexchange.com/questions/503/why-is-preferable-to Commented Oct 13, 2018 at 15:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .