\documentclass{article}
\usepackage{linguex}
\begin{document}
\ex. Some Example French sentence \hfill(French)\\
This is the gloss\\
`the interpretation'
\exg. Some Example French sentence \hfill(French)\\
This is the gloss\\
`the interpretation'
\end{document}
例 2 中的 (French) 應該向右齊平;就像第一個例子。
似乎存在某種衝突前命令。請提供任何協助
答案1
該\exg
命令比 複雜得多\eg
,因為它解析文字以水平對齊兩行的單字。
一些 TeX 引擎(pdfTeX、LuaTeX、XeTeX)支援「savepos」功能。它允許記錄文件中的當前位置(單位是 sp),.aux
以便在下次 TeX 運行時進行評估。
以下範例將此功能與 一起使用zref
,該軟體包提供比標準\label
/\ref
提供的更靈活的標籤/引用系統。
\RequirePackage{ifluatex}
\ifluatex
\IfFileExists{luatex85.sty}{\RequirePackage{luatex85}}{}
\fi
\documentclass[twoside]{article}
\usepackage[
a6paper,
landscape,
vmargin=1cm,
includeheadfoot,
showframe, % for reviewing
]{geometry}
\usepackage{linguex}
\usepackage{zref-savepos}
\makeatletter
\zref@newprop*{PageValue}[1]{\the\c@page}%
% Counter
\newcount\eolpos@cnt
\eolpos@cnt=\z@
\newcommand*{\eolpos@label}{eolpos\the\eolpos@cnt}
\newcommand*{\eolpos}{}
\protected\def\eolpos#1{%
\leavevmode
\rlap{%
% Unique label names
\global\advance\eolpos@cnt\@ne
% Save the current horizontal position along
% with the value of the page counter
\zref@savepos
\zref@labelbyprops{\eolpos@label}{posx, PageValue}%
% Measure part
\sbox\z@{#1}%
\dimen@=\z@
\zifrefundefined{\eolpos@label}{%
}{%
\dimen@=\dimexpr
\expandafter\ifx\csname pdfhorigin\endcsname\relax
1in%
\else
\pdfhorigin
\fi
+%
\ifodd\zref@extractdefault{\eolpos@label}{PageValue}\@ne
\oddsidemargin
\else
\evensidemargin
\fi
+\textwidth
-\wd\z@
-\zref@extractdefault{\eolpos@label}{posx}{0}sp%
\relax
}%
% Set space
\ifdim\dimen@<\z@
\typeout{`eolpos` warning: Text sticks to the left by \the\dimen@}%
\fi
\kern\dimen@
% Place user text
\usebox\z@
}%
}
% \z@ = 0 or 0pt
% \@ne = 1
% \dimen@ = \dimen0
\makeatother
\begin{document}
\ex. Some Example French sentence \hfill(French)\\
This is the gloss\\
`the interpretation'
\exg. Some Example French sentence \eolpos{(French)}\\
This is the gloss\\
`the interpretation'
\newpage
\ex. Some Example French sentence \hfill(French)\\
This is the gloss\\
`the interpretation'
\exg. Some Example French sentence \eolpos{(French)}\\
This is the gloss\\
`the interpretation'
\end{document}
第 1 頁:
第2頁:
答案2
\hfill 僅適用於第三行linguex 的註解範例,這可能是您的一個選擇。或者,Brian Buccola 在他的網站上有一個解決方法這裡。