Text FormattingWhite Border around displayed Formula

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
zhenyaka
Posts: 3
Joined: Fri Mar 29, 2013 1:40 am

White Border around displayed Formula

Post by zhenyaka »

Hello, can you help me with the following problem?

I use LaTeX at my site to insert formulas. Here is the template for it. It works fine, but if I try to insert standalone formula? The preview adds white spaces at left and at right of formula. $\frac{11}{12}$ works good, but in-line formulas has bad radical sign.

I need solution to insert displayed formulas without white spaces, but in-line formulas I need to. Can I solve it with one template or I need to use two different?

Code: Select all

\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}

%русские символы
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}
\usepackage{amsfonts,amsmath,amssymb,latexsym,mathtext}

\begin{document}
\begin{preview}
$$y=5x^2\cdot\frac{abcd}{\sqrt{a}}$$
\end{preview}
\end{document}
Last edited by localghost on Mon Apr 01, 2013 7:51 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

White Border around displayed Formula

Post by Stefan Kottwitz »

Hi Zhenyaka,

welcome to the forum!

You could insert the command \displaystyle right after the $ sign to get the bigger style within inline formulas.

Stefan
LaTeX.org admin
zhenyaka
Posts: 3
Joined: Fri Mar 29, 2013 1:40 am

White Border around displayed Formula

Post by zhenyaka »

Stefan_K wrote:Hi Zhenyaka,

welcome to the forum!

You could insert the command \displaystyle right after the $ sign to get the bigger style within inline formulas.

Stefan
Thank you Stefan.
It will be helpfull!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

White Border around displayed Formula

Post by localghost »

Never use $$ … $$ for unnumbered displayed equations. Use \[ … \] as the correct LaTeX syntax.


Best regards and welcome to the board
Thorsten
zhenyaka
Posts: 3
Joined: Fri Mar 29, 2013 1:40 am

White Border around displayed Formula

Post by zhenyaka »

localghost wrote:Never use $$ … $$ for unnumbered displayed equations. Use \[ … \] as the correct LaTeX syntax.


Best regards and welcome to the board
Thorsten
Why? $$ described in all documentations
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

White Border around displayed Formula

Post by localghost »

zhenyaka wrote:Why? $$ described in all documentations
It is not nearly in all. And you should forget those which recommend it. This environment causes several spacing issues. And the most striking one can easily be demonstrated.

Code: Select all

\documentclass[11pt,fleqn]{article}

\begin{document}
$$ E=mc^2 $$
\[ E=mc^2 \]
\end{document}
This environment simply discards the fleqn option. For correct math typesetting take a look at »Math mode«.
Post Reply