Skip to main content
\\
Source Link
David Carlisle
  • 828.7k
  • 74
  • 1.7k
  • 2.6k

applying the method used in an answer to this question to the original example, here is an approach that gives an improved result.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \newdimen{\lcellwd} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\baselineskip11pt\vspace*{3pt}\raggedright#2\strut\par}$} \setlength{\extrarowheight}{1pt} \begin{document} \setlength{\lcellwd}{.5\textwidth-6\tabcolsep-8em} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & \lcell{Lorem ipsum dolor sit amet, consectetur adipisici elit}&\ &\\  B & \lcell{% An\\even\\higher\\row\\with\\linebreaks}&\ &\\  2 & Short Entry\strut & \\\bottomrule \end{tabular} \end{document} 

enter image description here

EDIT: by moving the \baselineskip instruction to just before \par in the definition of \lcell it is possible to introduce a variable that can be set externally:

\newlength{\lcbaseline} \setlength{\lcbaseline}{11pt} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\vspace*{3pt}\raggedright#2\strut\baselineskip\lcbaseline\par}$} 

this will adjust the baselines of continuous text, as in group "A", since the baselines currently in force are used when a paragraph is "wrapped". however, it breaks down when \\ is used, and i haven't figured out where \\ "freezes" the current baseline value. using \break instead of \\ does produce the adjusted baselines, but it isn't very latexy; including the \baselineskip instruction in two places would overcome that problem, but it's inelegant.

applying the method used in an answer to this question to the original example, here is an approach that gives an improved result.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \newdimen{\lcellwd} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\baselineskip11pt\vspace*{3pt}\raggedright#2\strut\par}$} \setlength{\extrarowheight}{1pt} \begin{document} \setlength{\lcellwd}{.5\textwidth-6\tabcolsep-8em} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & \lcell{Lorem ipsum dolor sit amet, consectetur adipisici elit}&\  B & \lcell{% An\\even\\higher\\row\\with\\linebreaks}&\  2 & Short Entry\strut & \\\bottomrule \end{tabular} \end{document} 

enter image description here

EDIT: by moving the \baselineskip instruction to just before \par in the definition of \lcell it is possible to introduce a variable that can be set externally:

\newlength{\lcbaseline} \setlength{\lcbaseline}{11pt} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\vspace*{3pt}\raggedright#2\strut\baselineskip\lcbaseline\par}$} 

this will adjust the baselines of continuous text, as in group "A", since the baselines currently in force are used when a paragraph is "wrapped". however, it breaks down when \\ is used, and i haven't figured out where \\ "freezes" the current baseline value. using \break instead of \\ does produce the adjusted baselines, but it isn't very latexy; including the \baselineskip instruction in two places would overcome that problem, but it's inelegant.

applying the method used in an answer to this question to the original example, here is an approach that gives an improved result.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \newdimen{\lcellwd} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\baselineskip11pt\vspace*{3pt}\raggedright#2\strut\par}$} \setlength{\extrarowheight}{1pt} \begin{document} \setlength{\lcellwd}{.5\textwidth-6\tabcolsep-8em} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & \lcell{Lorem ipsum dolor sit amet, consectetur adipisici elit}&\\  B & \lcell{% An\\even\\higher\\row\\with\\linebreaks}&\\  2 & Short Entry\strut & \\\bottomrule \end{tabular} \end{document} 

enter image description here

EDIT: by moving the \baselineskip instruction to just before \par in the definition of \lcell it is possible to introduce a variable that can be set externally:

\newlength{\lcbaseline} \setlength{\lcbaseline}{11pt} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\vspace*{3pt}\raggedright#2\strut\baselineskip\lcbaseline\par}$} 

this will adjust the baselines of continuous text, as in group "A", since the baselines currently in force are used when a paragraph is "wrapped". however, it breaks down when \\ is used, and i haven't figured out where \\ "freezes" the current baseline value. using \break instead of \\ does produce the adjusted baselines, but it isn't very latexy; including the \baselineskip instruction in two places would overcome that problem, but it's inelegant.

replaced http://tex.stackexchange.com/ with https://tex.stackexchange.com/
Source Link

applying the method used in an answer to this questionan answer to this question to the original example, here is an approach that gives an improved result.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \newdimen{\lcellwd} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\baselineskip11pt\vspace*{3pt}\raggedright#2\strut\par}$} \setlength{\extrarowheight}{1pt} \begin{document} \setlength{\lcellwd}{.5\textwidth-6\tabcolsep-8em} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & \lcell{Lorem ipsum dolor sit amet, consectetur adipisici elit}&\ B & \lcell{% An\\even\\higher\\row\\with\\linebreaks}&\ 2 & Short Entry\strut & \\\bottomrule \end{tabular} \end{document} 

enter image description here

EDIT: by moving the \baselineskip instruction to just before \par in the definition of \lcell it is possible to introduce a variable that can be set externally:

\newlength{\lcbaseline} \setlength{\lcbaseline}{11pt} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\vspace*{3pt}\raggedright#2\strut\baselineskip\lcbaseline\par}$} 

this will adjust the baselines of continuous text, as in group "A", since the baselines currently in force are used when a paragraph is "wrapped". however, it breaks down when \\ is used, and i haven't figured out where \\ "freezes" the current baseline value. using \break instead of \\ does produce the adjusted baselines, but it isn't very latexy; including the \baselineskip instruction in two places would overcome that problem, but it's inelegant.

applying the method used in an answer to this question to the original example, here is an approach that gives an improved result.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \newdimen{\lcellwd} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\baselineskip11pt\vspace*{3pt}\raggedright#2\strut\par}$} \setlength{\extrarowheight}{1pt} \begin{document} \setlength{\lcellwd}{.5\textwidth-6\tabcolsep-8em} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & \lcell{Lorem ipsum dolor sit amet, consectetur adipisici elit}&\ B & \lcell{% An\\even\\higher\\row\\with\\linebreaks}&\ 2 & Short Entry\strut & \\\bottomrule \end{tabular} \end{document} 

enter image description here

EDIT: by moving the \baselineskip instruction to just before \par in the definition of \lcell it is possible to introduce a variable that can be set externally:

\newlength{\lcbaseline} \setlength{\lcbaseline}{11pt} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\vspace*{3pt}\raggedright#2\strut\baselineskip\lcbaseline\par}$} 

this will adjust the baselines of continuous text, as in group "A", since the baselines currently in force are used when a paragraph is "wrapped". however, it breaks down when \\ is used, and i haven't figured out where \\ "freezes" the current baseline value. using \break instead of \\ does produce the adjusted baselines, but it isn't very latexy; including the \baselineskip instruction in two places would overcome that problem, but it's inelegant.

applying the method used in an answer to this question to the original example, here is an approach that gives an improved result.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \newdimen{\lcellwd} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\baselineskip11pt\vspace*{3pt}\raggedright#2\strut\par}$} \setlength{\extrarowheight}{1pt} \begin{document} \setlength{\lcellwd}{.5\textwidth-6\tabcolsep-8em} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & \lcell{Lorem ipsum dolor sit amet, consectetur adipisici elit}&\ B & \lcell{% An\\even\\higher\\row\\with\\linebreaks}&\ 2 & Short Entry\strut & \\\bottomrule \end{tabular} \end{document} 

enter image description here

EDIT: by moving the \baselineskip instruction to just before \par in the definition of \lcell it is possible to introduce a variable that can be set externally:

\newlength{\lcbaseline} \setlength{\lcbaseline}{11pt} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\vspace*{3pt}\raggedright#2\strut\baselineskip\lcbaseline\par}$} 

this will adjust the baselines of continuous text, as in group "A", since the baselines currently in force are used when a paragraph is "wrapped". however, it breaks down when \\ is used, and i haven't figured out where \\ "freezes" the current baseline value. using \break instead of \\ does produce the adjusted baselines, but it isn't very latexy; including the \baselineskip instruction in two places would overcome that problem, but it's inelegant.

added alternative for more general adjustment of baselines
Source Link
barbara beeton
  • 91.1k
  • 19
  • 246
  • 563

applying the method used in an answer to this question to the original example, here is an approach that gives an improved result.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \newdimen{\lcellwd} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\baselineskip11pt\vspace*{3pt}\raggedright#2\strut\par}$} \setlength{\extrarowheight}{1pt} \begin{document} \setlength{\lcellwd}{.5\textwidth-6\tabcolsep-8em} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & \lcell{Lorem ipsum dolor sit amet, consectetur adipisici elit}&\ B & \lcell{% An\\even\\higher\\row\\with\\linebreaks}&\ 2 & Short Entry\strut & \\\bottomrule \end{tabular} \end{document} 

enter image description here

EDIT: by moving the \baselineskip instruction to just before \par in the definition of \lcell it is possible to introduce a variable that can be set externally:

\newlength{\lcbaseline} \setlength{\lcbaseline}{11pt} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\vspace*{3pt}\raggedright#2\strut\baselineskip\lcbaseline\par}$} 

this will adjust the baselines of continuous text, as in group "A", since the baselines currently in force are used when a paragraph is "wrapped". however, it breaks down when \\ is used, and i haven't figured out where \\ "freezes" the current baseline value. using \break instead of \\ does produce the adjusted baselines, but it isn't very latexy; including the \baselineskip instruction in two places would overcome that problem, but it's inelegant.

applying the method used in an answer to this question to the original example, here is an approach that gives an improved result.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \newdimen{\lcellwd} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\baselineskip11pt\vspace*{3pt}\raggedright#2\strut\par}$} \setlength{\extrarowheight}{1pt} \begin{document} \setlength{\lcellwd}{.5\textwidth-6\tabcolsep-8em} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & \lcell{Lorem ipsum dolor sit amet, consectetur adipisici elit}&\ B & \lcell{% An\\even\\higher\\row\\with\\linebreaks}&\ 2 & Short Entry\strut & \\\bottomrule \end{tabular} \end{document} 

enter image description here

applying the method used in an answer to this question to the original example, here is an approach that gives an improved result.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \newdimen{\lcellwd} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\baselineskip11pt\vspace*{3pt}\raggedright#2\strut\par}$} \setlength{\extrarowheight}{1pt} \begin{document} \setlength{\lcellwd}{.5\textwidth-6\tabcolsep-8em} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & \lcell{Lorem ipsum dolor sit amet, consectetur adipisici elit}&\ B & \lcell{% An\\even\\higher\\row\\with\\linebreaks}&\ 2 & Short Entry\strut & \\\bottomrule \end{tabular} \end{document} 

enter image description here

EDIT: by moving the \baselineskip instruction to just before \par in the definition of \lcell it is possible to introduce a variable that can be set externally:

\newlength{\lcbaseline} \setlength{\lcbaseline}{11pt} \newcommand{\lcell}[2][\lcellwd]{% $\vcenter{\hsize#1\vspace*{3pt}\raggedright#2\strut\baselineskip\lcbaseline\par}$} 

this will adjust the baselines of continuous text, as in group "A", since the baselines currently in force are used when a paragraph is "wrapped". however, it breaks down when \\ is used, and i haven't figured out where \\ "freezes" the current baseline value. using \break instead of \\ does produce the adjusted baselines, but it isn't very latexy; including the \baselineskip instruction in two places would overcome that problem, but it's inelegant.

Source Link
barbara beeton
  • 91.1k
  • 19
  • 246
  • 563
Loading