我怎样才能在 LaTeX 中重新创建这个表格?

我怎样才能在 LaTeX 中重新创建这个表格?

我想用 LaTeX 重新创建下表。

这是一张横向的 A4 纸。

在此处输入图片描述

我在 LibreOffice Writer 中采用的方式是使用隐藏边框的嵌套表格。在下图中,您可以看到隐藏的表格边框:

在此处输入图片描述

我想知道是否有办法在 LaTeX 中重新创建此文档。我不一定想使用隐藏边框的表格。如果有其他方法可以通过某种定位来实现这一点,那就太好了。我只是使用了表格,因为我看不到在 LibreOffice 中创建布局的其他方法。

您能否给我一些建议来帮助我入门,以及我应该考虑使用哪些软件包?我的目标是将最终的 LaTeX 文档导出为 PDF。它必须是一页文档(A4/横向)。如果您有任何建议,我将不胜感激。

我可以创建两个平行表,一个用于元音,一个用于辅音。

\documentclass[a4paper, 12pt]{article}
\usepackage[landscape]{geometry}
\geometry{a4paper, left=1in, right=1in, top=0.5in, bottom=0.65in}

\begin{document}
    % Vowels
    \begin{tabular}{|p{5cm}|p{5cm}|}
        \hline
        Vowels & Vowels \\
    \end{tabular}
    \quad
    % Consonants
    \begin{tabular}{|p{5cm}|p{5cm}|}
        \hline
        Consonants & Consonants \\
    \end{tabular} 
\end{document}

在此处输入图片描述

但我不知道接下来该如何进行。

答案1

一个例子是 和 的tabularx方法,与表格非常不同,multicols。请注意,在这种情况下,即使行数明显相同,平衡列和垂直粘连的机制也会对列的水平对齐产生影响,这可能是一个缺点/优势,具体取决于您的特定需求。

姆韦

\documentclass[landscape]{article}
\usepackage[table]{xcolor}
\usepackage{geometry,lipsum,booktabs}
\usepackage{multicol,tabulary,tabularx}
\def\mg#1{\colorbox{gray!20}{\makebox[\linewidth]{\strut #1}}}
\def\mb#1{\colorbox{black}{\makebox[1.5em]{\color{white}\strut #1}}}
\def\empty{\mbox{\strut}\par}
\def\R#1#2{\multicolumn{#1}{c}{\cellcolor{gray!20}\strut #2}}
\def\N#1{\multicolumn{1}{c}{\colorbox{black}{\makebox[1.5em]{\color{white}\strut #1}}}}
\begin{document}
\lipsum[2][1-4]

{
\sffamily\bfseries\parskip 1ex plus 0ex minus 1ex
\noindent\begin{tabularx}{\linewidth}{*{15}X}
\addlinespace
\R{7}{VOWELS} & & \R{7}{CONSONANTS} 
\\\addlinespace
\R{5}{The simple words} && \R{1}{The Diphtongs}  & &  \R{3}{Stop Consonants} &&  \R{3}{The Glide Sounds}  
\\\addlinespace
& \N{a} && \N{b} &&& \N{aa}  &&  \R{1}{Voiceless} && \R{1}{Voiced} &&  \R{1}{Voiceless} && \R{1}{Voiced}
\\\addlinespace
& \N{c} && \N{d} &&& \N{bb} & &  \N{p} && \N{b} && \N{h}  && \N{a} 
\\\addlinespace
& \N{d} && \N{e} &&& \N{cc} & & \R{3}{Continuant Consonats}  
\\\addlinespace\addlinespace
\end{tabularx}}

\lipsum[2][1-4]

\bigskip
\noindent
\begin{minipage}{\linewidth}
\sffamily\bfseries\parskip 1ex plus 0ex minus 1ex
\setlength\columnsep{2em}\raggedbottom
\begin{multicols}{2}
\centering
\mg{VOWELS}
\begin{multicols}{2}
\mg{The Simple Vowels}

\mb{a}\quad
\mb{b}\par
\mb{c}\quad
\mb{d}\par
\mb{e}\quad
\mb{f}\par
\mb{g}\quad
\mb{h}\par
\mb{i}\quad
\mb{j}\par
\newcolumn
\mg{The Diphtongs}\par
\mb{aa}\par
\mb{ae}\par
\empty
\mb{ai}\par
\mb{ao}\par
\end{multicols}
\phantom{}
\newcolumn\par
\mg{CONSONANTS}
\begin{multicols}{2}
\mg{Stop Consonants}\par
\begin{multicols}{2}
\mg{Voiceless}\par
\mb{p}\par
\mb{t}\par
\mb{k}\par
\newcolumn
\mg{Voiced}\par
\mb{b}\par
\mb{d}\par
\mb{g}\par
\end{multicols}
\mg{Continuant Consonants}\par
\begin{multicols}{2}
\mb{f}\par
\newcolumn
\mb{v}\par
\end{multicols}
\newcolumn
\mg{The Glide Sounds}\par
\begin{multicols}{2}
\mg{Voiceless}\par
\mb{h}\par
\newcolumn
\mg{Voiced}\par
\mb{r}\par
\mb{l}\par
\mb{w}\par
\empty
\end{multicols}
\end{multicols}
\end{multicols}
\end{minipage}
\bigskip

\lipsum[2][1-4]

\end{document}

答案2

看来您选择将音标设置为黑底白字。使用喷墨打印机打印时,效果可能不太好。

\hbox如果您喜欢走痛苦的路,那么您可以只放置es 和s来完成\vtop- 对于音标,我使用了 tipa 包,但我不能保证我一切都正确。

\documentclass[a4paper, landscape]{article}

% ---- Layout ----------------------------------------------------------------------
%      The code for changing the layout is not of importance to you.
%      It is messy and only suits the need of having this example fit on one page
\pagestyle{plain}
\csname @ifundefined\endcsname{pagewidth}{}{\pagewidth=\paperwidth}%
\csname @ifundefined\endcsname{pdfpagewidth}{}{\pdfpagewidth=\paperwidth}%
\csname @ifundefined\endcsname{pageheight}{}{\pageheight=\paperheight}%
\csname @ifundefined\endcsname{pdfpageheight}{}{\pdfpageheight=\paperheight}%
\textwidth=\paperwidth
\advance\textwidth-3cm
\evensidemargin=\dimexpr-1in+1.5cm\relax
\oddsidemargin=\dimexpr-1in+1.5cm\relax
\marginparsep=2mm
\marginparwidth=\dimexpr1.5cm-2\marginparsep\relax
\textheight=\paperheight
\advance\textheight-3cm
\topmargin=\dimexpr-1in+1.5cm\relax
\headheight=0pt
\headsep=0pt
{\normalfont
 \setbox\csname @tempboxa\endcsname\hbox{0123456789}%
 \global\footskip=\dimexpr .75cm -.5\dp\csname @tempboxa\endcsname
                               +.5\ht\csname @tempboxa\endcsname\relax
}%
\parindent=0pt
\flushbottom
% ---- END OF LAYOUT ---------------------------------------------------------------


\usepackage{xcolor}
\definecolor{mylightgray}{cmyk}{0,0,0,.06}

\usepackage[T1]{tipa}

\newlength\mycolumnsep
\setlength\mycolumnsep{2em}
\newbox\scratchbox

\newcommand\sethboxwidth[1]{%
  \setbox\scratchbox=\vbox{\baselineskip=0pt #1}%
}%
\newcommand\centeredcolorboxofsetwidth[2]{%
  \hbox{\colorbox{#1}{\hbox to\wd\scratchbox{\hfill#2\hfill}}}%
}%
\newcommand\centeredhboxofsetwidth[1]{%
  \hbox to\wd\scratchbox{\hfill#1\hfill}%
}%
\newcommand\surroundbox[3]{%
  \sethboxwidth{\hbox{#3}}\wd\scratchbox=\dimexpr\wd\scratchbox-2\fboxsep\relax\hbox{#1}\kern#2\relax\hbox{#3}%
}%
\newcommand\phoneticbox[1]{%
   \vbox{%
     \kern.25\baselineskip
     \hbox{%
       \colorbox{black}{\hbox to 3ex{\hfill\textcolor{white}{\vphantom{XVIpg}\textipa{#1}}\hfill}}%
     }%
   }%
}%

\begin{document}

\par
\sffamily
\hbox{%
\vtop{%
  \surroundbox{\centeredcolorboxofsetwidth{mylightgray}{\textbf{\Large VOWELS}}}{.5\baselineskip}{%
    \sethboxwidth{%
      \hbox{\textbf{\vphantom{XVIpg} The Simple Vowels}}%
      \hbox{\textbf{\vphantom{XVIpg} The Diphthongs}}%
    }%
    \hbox{%
      \vtop{%
        \centeredcolorboxofsetwidth{mylightgray}{\textbf{\vphantom{XVIpg}The Simple Vowels}}%
        \centeredhboxofsetwidth{\phoneticbox{@}\hfill\phoneticbox{A}}%
        \centeredhboxofsetwidth{\phoneticbox{2}\hfill\phoneticbox{O}}%
        \centeredhboxofsetwidth{\phoneticbox{i}\hfill\phoneticbox{U}}%
        \centeredhboxofsetwidth{\phoneticbox{\normalfont\textsci}\hfill\phoneticbox{u}}%
        \centeredhboxofsetwidth{\phoneticbox{E}\hfill\phoneticbox{@r}}%
        \centeredhboxofsetwidth{\phoneticbox{\ae}\hfill\phoneticbox{\textrevepsilon r}}%
      }%
      \kern\mycolumnsep
      \vtop{%
        \centeredcolorboxofsetwidth{mylightgray}{\textbf{\vphantom{XVIpg}The Diphthongs}}%
        \centeredhboxofsetwidth{\phoneticbox{e\normalfont\textsci}}%
        \centeredhboxofsetwidth{\phoneticbox{a\normalfont\textsci}}%
        \centeredhboxofsetwidth{\phoneticbox{oU}}%
        \centeredhboxofsetwidth{\phoneticbox{aU}}%
        \centeredhboxofsetwidth{\phoneticbox{O\normalfont\textsci}}%
      }%
    }%
  }%
}%
\kern\mycolumnsep
\vtop{%
\surroundbox{\centeredcolorboxofsetwidth{mylightgray}{\textbf{\Large CONSONANTS}}}{.5\baselineskip}{%
\hbox{%
\vtop{%
  \surroundbox{\centeredcolorboxofsetwidth{mylightgray}{\textbf{\vphantom{XVIpg}Stop Consonants}}}{.25\baselineskip}{%
    \sethboxwidth{%
      \hbox{\textbf{~~Voiceless~~}}%
      \hbox{\textbf{~~Voiced~~}}%
    }%
    \hbox{%
      \vtop{%
        \centeredcolorboxofsetwidth{mylightgray}{\textbf{~~Voiceless~~}}%
        \centeredhboxofsetwidth{\phoneticbox{p}}%
        \centeredhboxofsetwidth{\phoneticbox{t}}%
        \centeredhboxofsetwidth{\phoneticbox{k}}%
      }%
      \kern\mycolumnsep
      \vtop{%
        \centeredcolorboxofsetwidth{mylightgray}{\textbf{~~Voiced~~}}%
        \centeredhboxofsetwidth{\phoneticbox{b}}%
        \centeredhboxofsetwidth{\phoneticbox{d}}%
        \centeredhboxofsetwidth{\phoneticbox{g}}%
      }%
    }%
  }%
  \kern.375\baselineskip
  \surroundbox{\centeredcolorboxofsetwidth{mylightgray}{\textbf{\vphantom{XVIpg}Continuant Consonants}}}{.25\baselineskip}{%
    \sethboxwidth{%
      \hbox{\textbf{~~Voiceless~~}}%
      \hbox{\textbf{~~Voiced~~}}%
    }%
    \hbox{%
      \vtop{%
        \centeredcolorboxofsetwidth{mylightgray}{\textbf{~~Voiceless~~}}%
        \centeredhboxofsetwidth{\phoneticbox{f}}%
        \centeredhboxofsetwidth{\phoneticbox{\texttheta}}%
      }%
      \kern\mycolumnsep
      \vtop{%
        \centeredcolorboxofsetwidth{mylightgray}{\textbf{~~Voiced~~}}%
        \centeredhboxofsetwidth{\phoneticbox{v}}%
        \centeredhboxofsetwidth{\phoneticbox{D}}%
      }%
    }%
  }%
  \kern.375\baselineskip
  \surroundbox{\centeredcolorboxofsetwidth{mylightgray}{\textbf{\vphantom{XVIpg}The Sibilant Sounds}}}{.25\baselineskip}{%
    \sethboxwidth{%
      \hbox{\textbf{~~Voiceless~~}}%
      \hbox{\textbf{~~Voiced~~}}%
    }%
    \hbox{%
      \vtop{%
        \centeredcolorboxofsetwidth{mylightgray}{\textbf{~~Voiceless~~}}%
        \centeredhboxofsetwidth{\phoneticbox{s}}%
        \centeredhboxofsetwidth{\phoneticbox{\textesh}}%
        \centeredhboxofsetwidth{\phoneticbox{t\textesh}}%
      }%
      \kern\mycolumnsep
      \vtop{%
        \centeredcolorboxofsetwidth{mylightgray}{\textbf{~~Voiced~~}}%
        \centeredhboxofsetwidth{\phoneticbox{z}}%
        \centeredhboxofsetwidth{\phoneticbox{Z}}%
        \centeredhboxofsetwidth{\phoneticbox{dZ}}%
      }%
    }%
  }%
}%
}%
\kern\mycolumnsep
\hbox{%
\vtop{%
  \surroundbox{\centeredcolorboxofsetwidth{mylightgray}{\textbf{\vphantom{XVIpg}The Glide Sounds}}}{.25\baselineskip}{%
    \sethboxwidth{%
      \hbox{\textbf{~~Voiceless~~}}%
      \hbox{\textbf{~~Voiced~~}}%
    }%
    \hbox{%
      \vtop{%
        \centeredcolorboxofsetwidth{mylightgray}{\textbf{~~Voiceless~~}}%
        \centeredhboxofsetwidth{\phoneticbox{h}}%
      }%
      \kern\mycolumnsep
      \vtop{%
        \centeredcolorboxofsetwidth{mylightgray}{\textbf{~~Voiced~~}}%
        \centeredhboxofsetwidth{\phantom{\phoneticbox{x}}}%
        \centeredhboxofsetwidth{\phoneticbox{r}}%
        \centeredhboxofsetwidth{\phoneticbox{l}}%
        \centeredhboxofsetwidth{\phoneticbox{w}}%
        \centeredhboxofsetwidth{\phoneticbox{j}}%
      }%
    }%
  }%
  \kern.375\baselineskip
  \surroundbox{\centeredcolorboxofsetwidth{mylightgray}{\textbf{\vphantom{XVIpg}The Nasal Sounds}}}{.25\baselineskip}{%
    \sethboxwidth{%
      \hbox{\textbf{~~Voiceless~~}}%
      \hbox{\textbf{~~Voiced~~}}%
    }%
    \hbox{%
      \vtop{%
        \centeredcolorboxofsetwidth{mylightgray}{\textbf{~~Voiceless~~}}%
      }%
      \kern\mycolumnsep
      \vtop{%
        \centeredcolorboxofsetwidth{mylightgray}{\textbf{~~Voiced~~}}%
        \centeredhboxofsetwidth{\phoneticbox{m}}%
        \centeredhboxofsetwidth{\phoneticbox{n}}%
        \centeredhboxofsetwidth{\phoneticbox{N}}%
      }%
    }%
  }%
}%
}%
}%
}%
}%

\end{document}

在此处输入图片描述

答案3

要绘制你的框,可以采用如下方法:

\documentclass{standalone}
\usepackage{tikz}

\begin{document}

\newcommand*\rectangle[1]{\tikz[baseline=(char.base)]
{   \node[shape=rectangle,fill=black,
     text=white,draw,line width=1.5pt,inner sep=3pt] (char) {#1};}
}

\rectangle{\huge ð}

\end{document}

相关内容