我正在雙語兩欄文章中編譯一些拉丁文文本及其葡萄牙語翻譯,如下:
我在 Windows 上使用 MiKTeX 與 TeXworks 的組合XeLaTex+MakeIndex+BibTex
。
右欄是葡萄牙語的。正如您所看到的,第二段有一個奇怪的縮排。為什麼是這樣?我怎麼才能把它變成左邊(拉丁文)的呢?
程式碼如下:
\documentclass[10pt,twoside,a5paper]{article}
\usepackage{fontspec}
\usepackage{color}
\usepackage{lettrine}
\usepackage[a5paper]{geometry}
\setmainfont[%
Ligatures={TeX,Common,Contextual,Discretionary,Rare,Historic}
,RawFeature={+cv01}
,Contextuals={Alternate, WordInitial, WordFinal, LineFinal, Inner, Swash}
]{EB Garamond}
\newfontfamily\portFont[
Ligatures={TeX,Common,Contextual,Discretionary,Rare,Historic}
,Contextuals={Alternate, WordInitial, LineFinal, Inner, Swash}
]{EB Garamond}
\usepackage{polyglossia}
\setmainlanguage{latin}
\setotherlanguage{portuguese}
\usepackage{paracol}
\renewcommand{\LettrineFontHook}{\color{red}}
\newcommand{\port}[1]{%
\selectlanguage{portuguese}{{\portFont#1}}
}
\newcommand{\addchunck}[6]{%
\lettrine{#1}{\color{red}#2}#3%
\bigskip%
\switchcolumn%
\lettrine{#4}{\color{red}#5}\port{#6}%
\bigskip%
\switchcolumn*%
}
\setlength{\columnsep}{1.75pc}
\title{The article has a title}
\author{Jorge Gomes Raimundo}
\begin{document}
\begin{paracol}{2}[\begin{center}\Large{\textsc{Wonderful title}}\bigskip\end{center}]
\addchunck{L}{orem ipsum}{ dolor sit amet, consectetur adipiscing elit. Morbi ut lacinia est. Vestibulum efficitur tortor a nisl placerat pellentesque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nam a lectus sed velit viverra dictum a sit amet mi. Sed accumsan ullamcorper leo sed malesuada.
Cras semper auctor diam et rhoncus. Ut fringilla tincidunt ante ac vestibulum. Nulla facilisi. Nunc dapibus dolor vel libero rutrum vestibulum. Nam nec ex felis. Suspendisse ultricies congue nibh. Integer feugiat vehicula dui, vitae condimentum nulla tempor quis.}
{L}{orem ipsum}{ dolor sit amet, consectetur adipiscing elit. Morbi ut lacinia est. Vestibulum efficitur tortor a nisl placerat pellentesque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nam a lectus sed velit viverra dictum a sit amet mi. Sed accumsan ullamcorper leo sed malesuada.
Cras semper auctor diam et rhoncus. Ut fringilla tincidunt ante ac vestibulum. Nulla facilisi. Nunc dapibus dolor vel libero rutrum vestibulum. Nam nec ex felis. Suspendisse ultricies congue nibh. Integer feugiat vehicula dui, vitae condimentum nulla tempor quis.}
\end{paracol}
\end{document}
答案1
我不知道為什麼,但\par
在最後一個參數後面添加一個會使結果正常:
\documentclass[10pt,twoside,a5paper]{article}
\usepackage{fontspec}
\usepackage{color}
\usepackage{lettrine}
\usepackage[a5paper]{geometry}
\setmainfont[%
Ligatures={TeX,Common,Contextual,Discretionary,Rare,Historic}
,RawFeature={+cv01}
,Contextuals={Alternate, WordInitial, WordFinal, LineFinal, Inner, Swash}
]{EB Garamond}
\newfontfamily\portFont[
Ligatures={TeX,Common,Contextual,Discretionary,Rare,Historic}
,Contextuals={Alternate, WordInitial, LineFinal, Inner, Swash}
]{EB Garamond}
\usepackage{polyglossia}
\setmainlanguage{latin}
\setotherlanguage{portuguese}
\usepackage{paracol}
\renewcommand{\LettrineFontHook}{\color{red}}
\newcommand{\port}[1]{%
\selectlanguage{portuguese}{{\portFont#1}}
}
\newcommand{\addchunck}[6]{%
\lettrine{#1}{\color{red}#2}#3%
\bigskip%
\switchcolumn%
\lettrine{#4}{\color{red}#5}\port{#6\par}%
\bigskip%
\switchcolumn*%
}
\setlength{\columnsep}{1.75pc}
\title{The article has a title}
\author{Jorge Gomes Raimundo}
\begin{document}
\begin{paracol}{2}[\begin{center}\Large{\textsc{Wonderful title}}\bigskip\end{center}]
\addchunck{L}{orem ipsum } {dolor sit amet, consectetur adipiscing elit. Morbi ut lacinia est. Vestibulum efficitur tortor a nisl placerat pellentesque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nam a lectus sed velit viverra dictum a sit amet mi. Sed accumsan ullamcorper leo sed malesuada.
Cras semper auctor diam et rhoncus. Ut fringilla tincidunt ante ac vestibulum. Nulla facilisi. Nunc dapibus dolor vel libero rutrum vestibulum. Nam nec ex felis. Suspendisse ultricies congue nibh. Integer feugiat vehicula dui, vitae condimentum nulla tempor quis. }
%
{L}{orem ipsum } {dolor sit amet, consectetur adipiscing elit. Morbi ut lacinia est. Vestibulum efficitur tortor a nisl placerat pellentesque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nam a lectus sed velit viverra dictum a sit amet mi. Sed accumsan ullamcorper leo sed malesuada.
Cras semper auctor diam et rhoncus. Ut fringilla tincidunt ante ac vestibulum. Nulla facilisi. Nunc dapibus dolor vel libero rutrum vestibulum. Nam nec ex felis. Suspendisse ultricies congue nibh. Integer feugiat vehicula dui, vitae condimentum nulla tempor quis. }
%%%%%%
\end{paracol}
\end{document}