答案1
一个简单的解决方案可能是将边注(\marginnote
来自marginnote
包的命令)与突出显示(\hl
来自soul
包的命令)一起使用。您可以定义一个新命令,其中包含三个参数,分别为颜色、要突出显示的主文本和注释:
\newcommand{\codedtext}[3]{%
\sethlcolor{#1}%
\marginnote{\hl{#3}}\hl{#2}%
}
由于页边距注释是在页边距中排版的,因此页面会有点不对称。为了解决这个问题,您可以加载包geometry
以将左边距设置为小于右边距,并增加页边距注释的宽度。示例图片似乎还有 1.5 倍的正文行距和 1.0 倍的注释行距,您可以使用包来实现setspace
。
如果您想将采访作为较大文档的一部分,那么您可能不希望文档中常规页面的边距受到采访设置的影响。您geometry
可以更改每个页面的设置,这些设置将对所有后续页面有效,直到您再次更改设置。出于某种原因,应用此功能的直接方法,即在序言中设置默认设置,更改采访页面,然后重置,在示例中不起作用(边距计算不正确)。但是,反过来做却有效,因此将特殊设置放在序言中,立即为第一页更改它们,恢复采访页面的默认设置,然后对采访页面之后的页面重新应用更改。
梅威瑟:
\documentclass{article}
\usepackage{xcolor}
\usepackage{soul}
\usepackage{marginnote}
\usepackage{setspace}
% margin settings for interview pages
\usepackage[left=1in,right=2.5in,marginparwidth=1.5in]{geometry}
\newcommand{\codedtext}[3]{%
\sethlcolor{#1}%
\marginnote{\setstretch{1}\hl{#3}}\hl{#2}%
}
\begin{document}
% margin settings for regular pages
\newgeometry{left=1in,right=1in,marginparwidth=1in}
This is a normal page with margins set by the \texttt{\textbackslash newgeometry} command.
This settings will be in effect until \texttt{\textbackslash restoregeometry} is
used. The following page shows a coded interview with adjusted margins.
\newpage
% restore to margin settings defined in preamble
\restoregeometry
\onehalfspacing
\noindent\textbf{Data}\marginnote{\textbf{Codes}}\\
\rule{1.3\textwidth}{1pt}
\textbf{(Q1) Moderator:} What do you think about the apparel industry in
Sri Lanka? Who are the customers, competitors, suppliers and influential
parties and \textit{what} is their influence on the business and
management controls of the business?\\
\textbf{Finance Director:} Global competition and \codedtext{yellow}{GSP plus
[Generalized System of Preferences] and the Trans-Pacific Trade Partnership
have a direct impact on our operations, and on management controls}{Global
statutory rules}. More than \codedtext{green}{60\% of Sri Lankan apparel
exports are to the United States and other Western countries. Our operations
and controls have to focus on their domands in order to survive in the market.}{Customer
regulatory demands} In the meantime, \codedtext{pink}{competition
in the industry is increasing from emerging countries like Laos, Cambodia and
Vietnam. So, our controls have always to focus on reducing costs and producing
products at competitive prices.}{Influence of changing market conditions} The
economic environment of our country too is not supportive of the apparel
industry because other industries such as tourism and hospitality are growing.
Thus finding \codedtext{cyan}{labour for the apparel industry will be difficult
in about another five years because they expect}{Facing changes in the
local industry}
\newpage
\newgeometry{left=1in,right=1in,marginparwidth=1in}
This page has the same margins as the first page.
\end{document}
结果(运行两次以确保注释正确定位):