对齐文本中的括号(非数学)

对齐文本中的括号(非数学)

这就是我所做的

\documentclass[11pt]{book}
\usepackage[polutonikogreek,english]{babel}
\newcommand*{\tg}[1]{\textgreek{#1}}
\usepackage{ledmac}
\usepackage{fancyhdr}
\pagestyle{myheadings}
\textheight = 180.5 mm
\textwidth = 108.5 mm
\pagenumbering{arabic}

\usepackage{multind} 
\makeindex{nominum}
\makeindex{rerum}

.....

\begin{displaymath}
\mathrm{\rhet{Gradation}{\textbf{Medley's?} compare Vincentius Beluacensis, \textit{De morali principis institutione} cap 9 linea 46} \ thus\index{rerum}{period!of four members!with gradation}}\left\{ \begin{array}{ll}
\textrm{\textit{Industria Virtutem parit:}}\\
\textrm{\textit{Virtus Laudem excibat:}}\\
\textrm{\textit{Laus adfert honorem:}}\\
\textrm{\textit{Honoris socia est, et comes AEmulatio}}\\
\end{array} \right.
\end{displaymath}

\begin{displaymath}
\mathrm{\rhet{Commutation}{\textit{Rhet. Her}. 4.28.39} \ thus\index{rerum}{period!of four members!with commutation}}\left\{ \begin{array}{ll}
\textrm{\textit{Quae de illo dicuntur; }\textasciicircum{}\textit{dici non}\textasciicircum{}\textit{}}\\
\textrm{\textit{ dici non possunt:}}\\
\textrm{\textit{quae dici possunt:}}\\
\textrm{\textit{non dicuntur:}}\\
\end{array} \right.
\end{displaymath}

\begin{displaymath}
\mathrm{\rhet{Distribution}{\textit{Rhet. Her}. 4.35.47} \ thus\index{rerum}{period!of four members!with distribution}}\left\{ \begin{array}{ll}
\textrm{\textit{consilio ciuitatem inuare:}}\\
\textrm{\textit{Senatus officium est:}}\\
\textrm{\textit{Magistratus officium est:}}\\
\textrm{\textit{opera \& diligentia, consequi senatus Voluntatem}}\\
\end{array} \right.
\end{displaymath}

\begin{displaymath}
\mathrm{\rhet{Diuision}{\textit{Rhet. Her}. 4.40.52} \ thus\index{rerum}{period!of four members!with division}}\left\{ \begin{array}{ll}
\textrm{\textit{Si probus es:}}\\
\textrm{\textit{non meruisti:}}\\
\textrm{\textit{sin improbus:}}\\
\textrm{\textit{non commoVeris:}}\\
\end{array} \right.
\end{displaymath}

\begin{displaymath}
\mathrm{\rhet{Similitude}{\textit{Rhet. Her}. 4.48.61} \ thus\index{rerum}{period!of four members!with similitude}}\left\{ \begin{array}{ll}
\textrm{\textit{Vt hirundines estiuuo tempore, presto sunt}}\\
\textrm{\textit{frigore pulsae recedunt:}}\\
\textrm{\textit{Ita falsi amici amici: sereno Vitae tempore, presto sunt}}\\
\textrm{\textit{Simulatque hyemem fortunae dederint Auolant omnes}}\\
\end{array} \right.
\end{displaymath}

\begin{displaymath}
\mathrm{\rhet{Exposition}{\textit{Rhet. Her}. 4.43.55, `studiose suscipiat et libenter subeat?'} \ thus\index{rerum}{period!of four members!with exposition}}\left\{ \begin{array}{ll}
\textrm{\textit{Qui est tam tenui cogitatione praeditus:}}\\
\textrm{\textit{cuius animus, tantis angustiis invidiae continentur:}}\\
\textrm{\textit{Qui non hunc hominem, studiosissime Laudet,}}\\
\textrm{\textit{et sapientissimum iudicet:}}\\
\textrm{\textit{Qui pro salute patriae, pro incolumitate ciuitatis}}\\
\textrm{\textit{pro Repub: fortunis, quamuis magnum atque}}\\
\textrm{\textit{atrox periculum, studiose subeat?}}\\
\end{array} \right.
\end{displaymath}

但花括号没有对齐,这非常烦人。

答案1

另一个解决方案可能是包schemata。编码并不复杂,但为了方便起见,在 MWE 中将其简化为\AB{left}{rigth}宏。默认对齐是文本宽度的 50%,但可以根据最长的左侧部分或其他长度为每个分支组进行更改,如 MWE 中所示:

在此处输入图片描述

\documentclass[10pt]{article}
\usepackage{schemata}
\newlength{\mylength}
\setlength{\mylength}{.5\textwidth} % default align

\newcommand\AB[2]{
  \schema{\schemabox[\mylength]{\hfill #1}}
  {\em \schemabox{#2}}}
\begin{document}

\noindent
{\bfseries Braces group alienated with the longest word}
\bigskip

\settowidth{\mylength}{Commutation}

\AB{Gradation}{
    Industria Virtutem parit: \\
    Virtus Laudem excibat: \\
    Laus adfert honorem: \\
    Honoris socia est, et comes \AE mulatio}

\AB{Commutation}{
    Quae de illo dicuntur; \^{}dici non\^{} \\
    non possunt: \\
    quae dici possunt: \\
    non dicuntur:}

\AB{Distribution}{
    consilio ciuitatem inuare: \\
    Senatus officium est: \\
    Magistratus officium est: \\
    opera \& diligentia, consequi senatus Voluntatem}

\bigskip
\noindent
{\bfseries Braces group, alienated at 25\% of the text width}\bigskip

\setlength{\mylength}{.25\textwidth}

\AB{Division}{
    Si probus es: \\
    non meruisti: \\
    sin improbus: \\
    non commoVeris:}

\AB{Similitude}{  
    Vt hirundines estiuuo tempore, presto sunt \\
    frigore pulsae recedunt: \\
    Ita falsi amici amici: sereno Vitae tempore, presto sunt \\
    Simulatque hyemem fortunae dederint Auolant omnes}

\AB{Exposition}{  
    Qui est tam tenui cogitatione praeditus: \\
    cuius animus, tantis angustiis invidiae continentur: \\
    Qui non hunc hominem, studiosissime Laudet, \\
    et sapientissimum iudicet:
    Qui pro salute patriae, pro incolumitate ciuitatis \\
    pro Repub: fortunis, quamuis magnum atque \\
    atrox periculum, studiose subeat?}

\end{document}

答案2

删除代码中所有不必要的部分,括号对齐仍然基于使用数学环境。例如,我建议align*使用amsmath

在此处输入图片描述

\documentclass[10pt]{article}
\usepackage{array}% http://ctan.org/pkg/array
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\usepackage[textheight=180.5mm,textwidth=108.5mm]{geometry}% http://ctan.org/pkg/geometry
%\pagenumbering{arabic}
\newcolumntype{L}{>{\itshape}l}
\begin{document}

\begin{align*}
  \text{Gradation} & \left\{\begin{tabular}{L}
    Industria Virtutem parit: \\
    Virtus Laudem excibat: \\
    Laus adfert honorem: \\
    Honoris socia est, et comes AEmulatio
  \end{tabular} \right. \\[\normalbaselineskip]
  \text{Commutation} & \left\{ \begin{tabular}{L}
    Quae de illo dicuntur; \textasciicircum{}dici non\textasciicircum{} \\
    dici non possunt: \\
    quae dici possunt: \\
    non dicuntur:
  \end{tabular} \right. \\[\normalbaselineskip]
  \text{Distribution} & \left\{ \begin{tabular}{L}
    consilio ciuitatem inuare: \\
    Senatus officium est: \\
    Magistratus officium est: \\
    opera \& diligentia, consequi senatus Voluntatem
  \end{tabular} \right. \\[\normalbaselineskip]
  \text{Division} & \left\{ \begin{tabular}{L}
    Si probus es: \\
    non meruisti: \\
    sin improbus: \\
    non commoVeris:
  \end{tabular} \right. \\[\normalbaselineskip]
  \text{Similitude} & \left\{ \begin{tabular}{L}
    Vt hirundines estiuuo tempore, presto sunt \\
    frigore pulsae recedunt: \\
    Ita falsi amici amici: sereno Vitae tempore, presto sunt \\
    Simulatque hyemem fortunae dederint Auolant omnes
  \end{tabular} \right. \\[\normalbaselineskip]
  \text{Exposition} & \left\{ \begin{tabular}{L}
    Qui est tam tenui cogitatione praeditus: \\
    cuius animus, tantis angustiis invidiae continentur: \\
    Qui non hunc hominem, studiosissime Laudet, \\
    et sapientissimum iudicet:
    Qui pro salute patriae, pro incolumitate ciuitatis \\
    pro Repub: fortunis, quamuis magnum atque \\
    atrox periculum, studiose subeat?
  \end{tabular} \right.
\end{align*}
\end{document}

请注意,您可以使用tabular内部数学模式,它会自动将您切换到文本模式,无需使用\textrm进行切换。此外,array包裹提供定义新列类型的功能。我使用此功能定义了L将其内容设置l为左对齐,但在每个条目\itshape之前插入(感谢>)。最后,我在条目之间插入了一个\normabaselineskip类似于空行的视觉间隙。

如果需要,还可以将“Gradation”、“Commutation”、“Division”等单词左对齐,以及更改括号周围的间距。

答案3

由于这似乎是您多次使用的东西,我建议您定义自己的自定义宏并让其控制所有格式化功能。下面,我定义了\AlignedBrace{}{},它接受两个参数,第一个是标签,第二个是文本。然后,您将其用作:

\AlignedBrace{Gradation}{%
    Industria Virtutem parit: \\
    Virtus Laudem excibat: \\
    Laus adfert honorem: \\
    Honoris socia est, et comes AEmulatio
}

结果(仅显示前两部分):

在此处输入图片描述

我已经在下面的 MWE 中对括号标签侧的宽度进行了硬编码,但另一种选择是允许根据您打算使用的最大标签来计算该宽度:

\newcommand*{\WidestLeftSide}{Commutation}%
\newlength{\LeftWidth}%
\settowidth{\LeftWidth}{\WidestLeftSide}%

代码:

改编自 Werner 的解决方案:

\documentclass{article}

\newcommand*{\LeftWidth}{3.0cm}%
\newcommand*{\RightWidth}{\dimexpr\linewidth-\LeftWidth-2em\relax}%
\newcommand{\AlignedBrace}[2]{%
    \medskip\par\noindent%
    \makebox[\LeftWidth][r]{\textbf{#1}~}%
    $\left\{~\parbox{\RightWidth}{\strut\textit{#2}\strut}\right.$%
}%

\begin{document}
\AlignedBrace{Gradation}{%
    Industria Virtutem parit: \\
    Virtus Laudem excibat: \\
    Laus adfert honorem: \\
    Honoris socia est, et comes AEmulatio
}
\AlignedBrace{Commutation}{%
    Quae de illo dicuntur; \textasciicircum{}dici non\textasciicircum{} \\
    dici non possunt: \\
    quae dici possunt: \\
    non dicuntur:
}
\AlignedBrace{Distribution}{%
    consilio ciuitatem inuare: \\
    Senatus officium est: \\
    Magistratus officium est: \\
    opera \& diligentia, consequi senatus Voluntatem
}
\AlignedBrace{Division}{%
    Si probus es: \\
    non meruisti: \\
    sin improbus: \\
    non commoVeris:
}
\AlignedBrace{Similitude}{%
    Vt hirundines estiuuo tempore, presto sunt \\
    frigore pulsae recedunt: \\
    Ita falsi amici amici: sereno Vitae tempore, presto sunt \\
    Simulatque hyemem fortunae dederint Auolant omnes
}
\AlignedBrace{Exposition}{%
    Qui est tam tenui cogitatione praeditus: \\
    cuius animus, tantis angustiis invidiae continentur: \\
    Qui non hunc hominem, studiosissime Laudet, \\
    et sapientissimum iudicet:
    Qui pro salute patriae, pro incolumitate ciuitatis \\
    pro Repub: fortunis, quamuis magnum atque \\
    atrox periculum, studiose subeat?
}
\end{document}

相关内容