这条线索是这个的延续问答格式采用双栏吗?但重点关注两列之间的动态。
代码:
\documentclass{article}
\usepackage{paracol}
\begin{document}
\begin{paracol}{2}
Penicillin
Amoksilav
Cephasporin 1st gen
Cephalosporin 2nd gen
\switchcolumn
Benzylpenicillin 600 mg/2/day,
Oxacillin 1 g/2/day.
Amoxilav 500 mg/2/day.
cefacetrile 500 mg/2/day,
cefradine 500 mg/2/day.
cefaclor 250 mg/3/day,
cefonicid 500
\end{paracol}
\end{document}
输出:
但我想要:
- 青霉素与苄青霉素同属一类......
- Amoksilav 与 Amoxilav 属于同一系列......
- 头孢菌素1st与头孢曲松同系列...
- 第二代头孢菌素与头孢克洛属于同一系列……
touhami 的输出
但代码包括很多switchcolumns
:
\begin{paracol}{2} Penicillin \switchcolumn Benzylpenicillin 600 mg/2/day, Oxacillin 1 g/2/day. \switchcolumn* Amoksilav \switchcolumn Amoxilav 500 mg/2/day. \switchcolumn* Cephasporin 1st gen \switchcolumn cefacetrile 500 mg/2/day, cefradine 500 mg/2/day. \switchcolumn* Cephalosporin 2nd gen \switchcolumn cefaclor 250 mg/3/day, cefonicid 500 \end{paracol}
如何让两列的对应行相互匹配?我不喜欢使用表格格式。我非常喜欢这个 paracol 的语法。
答案1
问题标题提到了问答内容,图片显示了一个常规列表。列表通常使用列表环境来完成,这次使用labeling
KOMA-script 提供的列表环境。
有时,tabular
环境也可以用来做类似列表的事情。
\documentclass{article}
\usepackage{scrextend}
\usepackage{tabularx}
\begin{document}
\begin{labeling}{Cephalosporin 2nd gen}
\item [Penicillin]
Benzylpenicillin 600 mg/2/day,\\
Oxacillin 1 g/2/day.
\item [Amoksilav]
Amoxilav 500 mg/2/day.
\item [Cephasporin 1st gen]
cefacetrile 500 mg/2/day,\\
cefradine 500 mg/2/day.
\item [Cephalosporin 2nd gen]
cefaclor 250 mg/3/day,\\
cefonicid 500
\end{labeling}
\bigbreak\noindent\rule{.5\textwidth}{.4pt}\bigbreak
\noindent
\begin{tabularx}{\textwidth}{lX}
Penicillin &
Benzylpenicillin 600 mg/2/day,
\newline Oxacillin 1 g/2/day. \\
Amoksilav & Amoxilav 500 mg/2/day. \\
Cephasporin 1st gen &
cefacetrile 500 mg/2/day,
\newline cefradine 500 mg/2/day. \\
Cephalosporin 2nd gen & cefaclor 250 mg/3/day,
\newline cefonicid 500
\end{tabularx}
\end{document}