我使用tcolorbox
或mdframed
优势几个月来自动标记我的文本,根据贡萨洛·梅迪纳有问题的提示多页上的自动边距花括号文本.但是我想超越不利因素,重新回到社会。
我的问题是什么?首先,decoration
TikZ 库提供的括号选择有限,或者有些括号对学习来说比较复杂。其次,如果我想在句子或段落内进行剪切,使用方框会产生两三个段落(一个在前,一个在方框内,一个在后),我不想这样。但是schemata
,,,等使用方框,当我在里面做标记时minipage
,它们会剪切我的句子和段落。mdframed
tcolorbox
以下是我喜欢的:
- 使用的简单性和灵活性——
\}
或者)
\]
,,……——就像\langle
Vert
安德鲁·斯旺回答文本周围的大括号问题(对我来说,使用大括号、方括号或括号是理想的,就像在音乐或旧版本中一样,但我知道,很难结合印刷质量和长度管理),或者更好; \tikzmark
在文本中尖锐标记的巧妙运用,例如大卫·卡莱尔基本用法带有指向箭头的边注…文章;mdframed
or包开发的四种显示模式的实用性tcolorbox
:单页,或第一部分,中间部分,最后一部分上一个问题中提到过;- 在奇数页和偶数页上使用边注。
我想象我们可以构建一个函数,将括号用法\}
(或类似 musixtex 括号的东西)和\tikzmark{}
或结合起来(\pgfmark{}
如果我不需要)TikZ
。这样,使用计数器,我就可以像 \mark{Note}{Text} 那样标记我的文本。如果文本跨页,我想象 LaTeX 中存在类似finaltextmark
和的东西。一个梦想的例子:begintextmark
\newcounter{mark}\newcommand\complexmark[2]{\setcounter{mark}{0}% counter null
\tikzmark{\thecounter}% mark one
\marginnote[{\{}#2]{{\}}#2}% the margin note & brace between mark \tikzmark{1} & \tikzmark{1}, how?
#1% the texte. if we meet a end page before the mark two, end the brace & open other one in te next page
\tikzmark{\thecounter}}% mark two end.
我在这里说明我的问题。谢谢。
% !TEX TS-program = arara
\documentclass{scrbook}
\usepackage[no-math]{fontspec}% no-math for musixtex
\usepackage{multido,xparse,lipsum,schemata,marginnote}
\usepackage{musixtex}\instrumentnumber{3}\akkoladen{{2}{3}}\setstaffs14
\usepackage{changepage}\strictpagecheck
\usepackage[many]{tcolorbox}
\usepackage{tikz}\usetikzlibrary{calc,arrows,decorations.pathreplacing,tikzmark}\tikzset{remember picture}
% methode 2
\newsavebox{\leftbox} \newsavebox{\rightbox}
\NewDocumentCommand{\lrboxbrace}{s O{\{} O{\}} O{0.1\linewidth} m O{0.8\linewidth} m}{% \lrboxbrace[<lbrace>][<rbrace>][<lwidth>]{<ltext>}[<rwidth>]{<rtext>}
\begin{lrbox}{\leftbox}\IfBooleanTF{#1}{\begin{varwidth}{#4}#5\end{varwidth}}{\begin{minipage}{#4}#5\end{minipage}}\end{lrbox}
\begin{lrbox}{\rightbox}\IfBooleanTF{#1}{\begin{varwidth}{#6}#7\end{varwidth}}{\begin{minipage}{#6}#7\end{minipage}}\end{lrbox}
\ensuremath{\usebox\leftbox\left#2\,\usebox\rightbox\,\right#3}}
% method 4
\NewDocumentCommand \margincallout {O{} m m +m }{% \margincallout{<mark1>}{<mark2>}{<note>}
\marginnote{\begin{tikzpicture}[overlay,remember picture]
\node [anchor=west, text width=\marginparwidth, align=left, font=\small,#1] at (0,0) {#4};
\draw[->] (-0.5,1.94) -- (pic cs:#2); \draw[->] (-0.5,0) -- (pic cs:#3);\draw[decoration=brace,decorate,thick] (-0.3,1.94) -- (-0.3,0); \end{tikzpicture}}}
%method 5
\newtcolorbox{tcbdecor}[1]{%\begin{tcbdecor}{<note>}<text>\end{tcbdecor}
colback=white, boxrule=0pt, colframe=white, arc=0pt, outer arc=0pt, top=0pt, bottom=0pt,%
check odd page,breakable,enhanced jigsaw,oversize,%
overlay={\ifoddpage\draw[decoration={brace,mirror},decorate] (frame.north east) -- node[rotate=90,above=4pt] {#1} (frame.south east);%
\else\draw[decoration={brace,mirror},decorate] (frame.north west) -- node[rotate=90,above=4pt] {#1} (frame.south west);\fi}}
\begin{document}
\paragraph{1}\textsc{Quality and variety of brackets}%
\marginnote{\startextract \emph{Stylish}\zendextract}
\paragraph{MusiX\TeX}\emph{I love typographic quality (9/10) and resizing of curly brackets (2 choices), but I don't know how to use them for text. Look this graceful brackets in margin:}
\paragraph{savebox} \emph{I like the simple use (5/10) on the code of typographic bracket signs (more than 5 choices): [square], (round), {\{}curly{\}}, <angle>, or |vertical bars||. But…}
\lrboxbrace[\Vert][{)}]{\emph{I'm Grouchy Smurf}}{\emph{… it doesn't cross pages and cuts my sentences !} \lipsum[2]}
\paragraph{schemata} \emph{I like (5/10) the use of braces, brackets and parens (3 choices) with the schemata package and his simplicity. But…}
\schema[close]{\emph{… it doesn't cross pages and cuts my sentences !} \lipsum[2]}{\noindent{\emph{This is why\\I don't like boxes}}} %
\paragraph{2}\textsc{Don't cut sentences and cross pages}%
\paragraph{tikzmark} \emph{I discover tikzmark, and I like the fonctionnement. But… I don't want to use the TikZ decorates, I find them (some choices) misfit (3/10). If we can mark the \textbf{beginning}\tikzmark{a} and the end of a page with tikzmark, we save the \emph{cut sentence} problem. (What you see on the sidelines is not so bad) But we stay with two problems:\begin{itemize}
\item how manage cross pages and vertical length?
\item how put the (good) bracket between beginning and \textbf{end}\tikzmark{b} marks in (good) margin?
\margincallout{a}{b}{Tikzmark with marginpar or marginnote doesn't cut anything! But length, automate, insert a good brace, crossing pages without box… seems difficult.}
\end{itemize}}
\paragraph{mdframed, tcolorbox} \emph{I like crossing pages with mdframed or tcolorbox, but…}
\begin{tcbdecor}{I don't like TikZ decorates}\emph{… if it crosses pages, it continues to cut sentences ! I hope you understand my problems, and if if you find something to help me, I would be very happy. Thank you very much!}\
\lipsum[1]\end{tcbdecor}
\end{document}
% arara: xelatex
% arara: xelatex
% arara: xelatex