
나는 @cmhughes의 MWE로 플레이를 시도했습니다.이 주제, 그리고 안에 있는 단어가 \marginpar
제대로 포장되지 않는다는 것을 발견했습니다. MWE는 다음과 같습니다.
\documentclass[12pt,openany,oneside,a4paper]{report}
\usepackage{tikz}
\usepackage{lipsum}
\let\oldmarginpar\marginpar
\renewcommand{\marginpar}[2][rectangle,draw,fill=black, text=white ,rounded corners]{
\oldmarginpar{
\scriptsize \tikz \node at (0,0) [#1]{#2};}
}
\begin{document}
\lipsum[1]
\marginpar{margin text here, but it doesnt wrap like it should!!!}
\lipsum[2]
\end{document}
$$m = 0$$
또한 예를 들어 안에 넣으면 \marginpar{}
원래대로 새 줄로 들어가지 않는다는 것도 발견했습니다.
답변1
text width
노드 옵션에 사용하세요 . ( text width= 2cm,
귀하의 요구 사항에 따라 변경할 수 있는 여기를 사용했습니다 .)
\documentclass[12pt,openany,oneside,a4paper]{report}
\usepackage{tikz}
\usepackage{lipsum}
\let\oldmarginpar\marginpar
\renewcommand{\marginpar}[2][rectangle,draw,fill=black, text=white,text width= 2cm,rounded corners]{
\oldmarginpar{
\scriptsize \tikz \node at (0,0) [#1]{#2};}
}
\begin{document}
\lipsum[1]
\marginpar{margin text here, but it doesnt wrap like it should!!!}
\lipsum[2]
\end{document}