Formula wrapping method in Latex table

Source: Internet
Author: User

formula in Latex table to implement line wrapping method simple Two-step walk:
    • 1. First place the following statement in the introductory area of the Latex body:
\newcommand{\tabincell}[2]{\begin{tabular}{@{}#[email protected]{}} #2 \end{tabular} }% placed in the introductory area
    • 2. Then insert the contents in the grid inside the tabular using \tabincell{c}{} , and you can wrap the text in the table automatically
Here is an example that can be saved directly as a. tex file compilation run: \documentclass[a4paper,12pt]{article}
\begin{document}%-------------------------------------------------------------------------------------------------
\begin{table}
\newcommand{\tabincell}[2]{\begin{tabular}{@{}#[email protected]{}} #2 \end{tabular}}% introductory area
\centering\begin{tabular}{|c|c|c|}\hline
1 & \tabincell{c}{the first line \ \ The next\\the next\\ last} & \ Tabincell{c}{one \ \ One}\% newline, each element inside the cell is \tabincell{c}{with the table contents}\hline
2 & \tabincell{c}{hello\\ aha\\ ok \\yes \\en} & \ Tabincell{c}{two \ \ "\" \ "\ \" \ \\hline
\end{tabular}%--------------------------------------------------------------------------------------------------
\caption{longtitle}
\end{table}\end{document} results such as:

Formula wrapping method in Latex table

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.