If I insert a math mode environment inside a table cell, then the output will show no vertical space between the borders and the equation, here is an example:
Is there any way that will make the borders have more vertical space from the formula?
lyxtablesvertical alignment
If I insert a math mode environment inside a table cell, then the output will show no vertical space between the borders and the equation, here is an example:
Is there any way that will make the borders have more vertical space from the formula?
The simplest way to add some vertical space between the two logical tables while having the same column width is to only use one real table and add the vertical white space as \multicolumn
row which includes a \vspace
to make it as high as required. Note that the \multicolumn
is required to disable the vertical borders in the normal cells. Without this a simple empty cell with \vspace
would be enough.
You can adjust the white space with the argument of \vspace{<distance>}
. The value wont be the exact distance because the cell \strut
is also in effect, which adds also a certain depth. If you need exact distances you have to calculate this in.
\documentclass{article}
\begin{document}
\begin{tabular}[b]{|c|c|c|c|}
\hline
\textbf{Item-No.} & \textbf{name} & \textbf{cross section} & \textbf{grade}\\
\hline
\textbf{W1} & Z-column & HN350x175 -- 346x174 & Q235\\
\hline
\textbf{W17} & Horiz. support transversal hoist beam & HW100x100 & Q235\\
\hline
%
\multicolumn{4}{c}{\vspace{1cm}}\\
%
\hline
\textbf{P11} & longitudinal hoist beam & HN300x150 -- 300x150 & Q235\\
\hline
\end{tabular}
\end{document}
This picture is slightly different to the OP's one. The suggestions given below are used. The LaTeX code generated by LyX (with a few lines deleted) is:
\documentclass[12pt]{article}
\setlength{\parindent}{0pt}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{setspace}
\doublespacing
\begin{document}
each $j$. Given any integer $m$, $\left\langle m;b_{1},b_{2},\ldots\right\rangle _{\theta}:=\left(m\theta+\sum_{j=1}^{\infty}b_{j}n_{j}\theta\right)\mod1$
defines a point of $X$. Veech {[}4{]} defines
\begin{multline*}
K_{0}(\theta)=\left\{ \langle m;b_{1},b_{2},\ldots\rangle_{\theta}:b_{j}\,\text{is eventually even and }\lim_{j\to\infty}b_{j}n_{j}\left\Vert n_{j}\theta\right\Vert =0\right\} ,\\
K_{1}(\theta)=\left\{ \langle m;b_{1},b_{2},\ldots\rangle_{\theta}:\sum_{j=1}^{\infty}|b_{j}|n_{j}\left\Vert n_{j}\theta\right\Vert <\infty\right\} .
\end{multline*}
We have, corresponding to our elements of $K_{0}(\theta)$, a subset
of $\mathbb{R}$ which is a generalization of the Cantor set construction.
Define
\end{document}
First, looking at your LaTeX code, as Torbjørn T. and David Carlisle mentioned, the increased vertical space between the line containing "Veech [4]" and the multiline environment comes from a new line. In LyX you can make end of paragraphs visible under "Tools > Look & Feel > Display" otherwise the new line is invisible. Anyway, put the cursor directly after the s
in "Veech [4] defines" and press Delete once to delete the new line. Note (or messure) that the distance between the baselines of "Veech [4]" and "K_0(\theta)" is the same as the distance between "K_1(\theta)" and "We have, corresponding...".
Second, looking into my crystal ball I tend to see
that the LaTeX code and the picture do not match, that is, for the picture the new lines in front of and after the multiline environment were removed;
that the font size is set to "Large" for parts of your document (or your entire document?) (font size "Large" in LyX corresponds to \large
in LaTeX, as "Larger" corresponds to \Large
...);
that the line spacing is set to "Double".
that matching parentheses / delimiters were forgotten.
Not sure whether all points are true; just my guess. My suggestions are
(In LyX, there is also "View Source" to see the generated LaTeX code.) If there were a mismatch, maybe update the question.
Instead of using "Large" font size, "Reset" the font size to use "Normal" font and change "Fonts > Base Size" under "Document > Settings..." to 12pt. The default size corresponds usually to 10pt. Hence, the font size will not change ("10pt + \large = 12pt", see also here) but the width of the document will be adjusted differently for 12pt.
There are several rules in typography to make a text look better, although one might object to them at first. LaTeX (well, LyX is generating LaTeX code) knows about them and thinks some space around display math (e.g. multiline environment) looks better. This could also be a reason.
You have operators like "sum" in the formulas. Instead of using (
and )
you should consider using delimiters in math mode. (Use "Insert > Math > Delimiters" or simple the short cuts Alt+M
(
or Alt+M
<
...). Then the parentheses will be scaled and also some (a tiny) space will be inserted. Especially, this should be done with the ||norm||. Otherwise how to read your formula:
this way | b |n| |n\theta| |
or that way |b| n ||n\theta||
??
Best Answer
A rather simple workaround can be constructed using plain TeX/LaTeX
boxes
handling; since LaTeX's cell vertical space takes no account for the command\displaystyle
, one solution is to avoid it "a priori" by inserting the equation inside aparbox
environment:Firstly, the
alignment
andarrangement
parameters are set centered (c
); the interesting dimensional arguments areheight
andwidth
: since the equation will have stored its specific height (above the baseline), depth (below the baseline) and width, these dimensions could be easily substituted inside parbox's optional/mandatory arguments usingcalc
's commands:noticing that this setting can be applied to both any text or math inside the box, a useful macro
\mytabspace{⟨your equation⟩}
could be created, defined by:Another equivalent solution would be storing the content of the sub-cell inside a temporary box
\@tempboxa
; therefore there would be no worries about repetitive implementation inside the document, because if the box dimensions are defined inside a group, once outside the command they reset to the new box contents:Seeing it in action with a simple MWE paids off all the work behind:
With the output shown, it can be observed that
mytabspace
applies no modifications to any vertical spacing, as a demonstration to its versatility:Moving on with LyX, accessing the menu
Document → Settings → LaTeX preamble
any\mytabspace
macro definition shown can be pasted; because the program itself adds automatically\makeatletter
and\makeatother
inside the white preamble (the second code should not be pasted with those two commands, they'll be redundant).At this point, the desired math environment can be delimited by a simple ERT:
Giving the final, expected output:
In addition, I'd like to thank @DavidCarlisle for the useful tips (but, only for the second code
=P
); and more importantly:booktabs
!I too encountered this issue when I was just getting started with LyX (as example, I didn't even know what did "control sequence" mean back then); but I've been able to face it just now.