问答格式采用双栏吗?

问答格式采用双栏吗?

期望输出

在此处输入图片描述

数据

What is your name?  Ka jus sauc?
How old are you? Cik jums ir gadu? 
When were you born?  Kad jus esat dzimi? 
What do you work with? Ar ko jus stradajat? 

我可以使用 Pandoc/markdown 逻辑表,但我想直接在 LaTeX 中执行此操作。我可以在英语和拉脱维亚语版本之间添加分隔符。

更大的数据

\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 mg/day. 
\end{paracol}

输出结果如下。此输入还给出了以下没有多余空行的输入,这很奇怪:

\begin{paracol}{2}
-- same as above --
\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 mg/day. 
\end{paracol}

输出:

在此处输入图片描述

我希望左列与右列进行调整,以便材料位于相应的行上。

如何获得双列所需的输出?

答案1

这是并行排版的版本paracolparallel

\documentclass{article}

\usepackage{parallel}
\usepackage{paracol}

\begin{document}

\begin{paracol}{2}
What is your name?     

How old are you?       

When where you borned? 

What do you work with? 
\switchcolumn
 Ka jus sauc?

 Cik jums ir gadu? 

 Kad jus esat dzimi? 

 Ar ko jus stradajat? 
\end{paracol}

\fbox{Now with parallel package:}

\begin{Parallel}{0.4\textwidth}{0.4\textwidth}
\ParallelLText{%
What is your name?     

How old are you?       

When where you borned? 

What do you work with? 
}

\ParallelRText{%
 Ka jus sauc?

 Cik jums ir gadu? 

 Kad jus esat dzimi? 

 Ar ko jus stradajat? 
}

\end{Parallel}

\end{document}

在此处输入图片描述

答案2

您可以使用tabular环境:

\begin{tabular}{ll}
What is your name? &  Ka jus sauc? \\
How old are you? & Cik jums ir gadu? \\
When where you borned? &  Kad jus esat dzimi? \\ 
What do you work with? & Ar ko jus stradajat? \\
\end{tabular}

梅威瑟:

\documentclass{article}

\usepackage[latvian]{babel}
\begin{document}
\begin{tabular}{ll}
What is your name? &  Ka jus sauc? \\
How old are you? & Cik jums ir gadu? \\
When where you borned? &  Kad jus esat dzimi? \\ 
What do you work with? & Ar ko jus stradajat? \\
\end{tabular}
\end{document}

输出: 在此处输入图片描述

答案3

以下是该作业的宏版本:

\documentclass{article}
\usepackage{paracol}

\newcommand{\qa}[2]{%
  \begin{paracol}{2}
  \noindent
  #1
  \switchcolumn
  \noindent
  #2
  \end{paracol}
  }
\begin{document}

\qa{What is your name? How old are you? How old are you? How old are you?}{Ka jus sauc?}

\qa{How old are you?}{Cik jums ir gadu?}

\qa{When where you borned?}{Kad jus esat dzimi?}

\qa{What do you work with?}{Ar ko jus stradajat?}


\end{document}

在此处输入图片描述

相关内容