3

For my project, I need a macro which has the following properties:

\begin{tabular}{ll}
\texit{abc} & \\
\textsc{abc} & \textit{def} \\
\textsc{abc} & \textit{def}
\end{tabular}

The macro should always have two columns and the first two lines. The font styles should always be as in my example. The table should also be able to vary such that it can have several lines. Could someone help me? Thank you in advance for your help!

4

Instead of \textit and \textsc you can use the corresponding declarations in the column specification with the help of array.

If you need to override the font choice in a cell, use \multicolumn.

\documentclass{article}
\usepackage{array}

\begin{document}

\begin{tabular}{ >{\scshape}l >{\itshape}l }
\multicolumn{1}{l}{\itshape abc} & \\
abc & def \\
abc & def \\
abc & def \\
abc & def \\
\end{tabular}

\end{document}

enter image description here

1
  • 1
    Works like a charm! Thank you very much!
    – pahohu
    Oct 24 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.