\documentclass[a4paper,11pt]{book}
\usepackage[left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=5.5cm,marginparsep=1cm,outer=8cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[svgnames]{xcolor}
\usepackage{amssymb}
\usepackage[fulladjust]{marginnote}
\usepackage{ifoddpage}
\usepackage{showframe}
\newcommand{\arrow}[1]{%
\checkoddpage
\ifoddpage
\marginnote{\hspace*{-.5\marginparsep}\makebox[0pt]{\textcolor{red}{$\blacktriangleleft$}}\hspace{.5\marginparsep}#1}
\else
\marginnote{\makebox[0pt][l]{\makebox[\dimexpr\marginparwidth+0.6\marginparsep\relax][r]%
{\textcolor{red}{$\blacktriangleright$}}}\hfill#1}
\fi
}
\begin{document}
TEXT\arrow{\textbf High \textbf Frequency\newline \textbf Very \textbf High \textbf Frequency \newline \textbf Ultra \textbf High \textbf Frequency\newline \textbf Super \textbf High \textbf Frequency}
\newpage
TEXT\arrow{\textbf High \textbf Frequency\newline \textbf Very \textbf High \textbf Frequency \newline \textbf Ultra \textbf High \textbf Frequency\newline \textbf Super \textbf High \textbf Frequency}
\end{document}
표시
.
홀수 페이지에서는 문제가 없습니다. 짝수 페이지와 추가 \newline
명령에만 공백이 있습니다. 그렇다면 고치는 방법을 아는 사람이 있나요?
답변1
는 or \\
와 \newline
함께 를 사용해야 합니다 .\raggedright
\raggedleft
코드도 단순화했습니다.
\documentclass[a4paper,11pt]{book}
\usepackage[
left=1.5cm,
right=1cm,
top=3cm,
bottom=1.5cm,
marginparwidth=5.5cm,
marginparsep=1cm,
outer=8cm,
]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[svgnames]{xcolor}
\usepackage{amssymb}
\usepackage[fulladjust]{marginnote}
\usepackage{ifoddpage}
\usepackage{showframe}
\newcommand{\printarrow}[2]{%
\makebox[0pt][#1]{\makebox[\marginparsep]{\color{red}$#2$}}%
}
\newcommand{\arrow}[1]{%
\checkoddpage
\ifoddpage
\marginnote{%
\printarrow{r}{\blacktriangleleft}%
\parbox[t]{\marginparwidth}{\raggedright #1}%
}%
\else
\marginnote{%
\parbox[t]{\marginparwidth}{\raggedleft #1}%
\printarrow{l}{\blacktriangleright}%
}
\fi
}
\begin{document}
TEXT\arrow{\textbf{H}igh \textbf{F}requency\\
\textbf{V}ery \textbf{H}igh \textbf{F}requency \\
\textbf{U}ltra \textbf{H}igh \textbf{F}requency\\
\textbf{S}uper \textbf{H}igh \textbf{F}requency}
\newpage
TEXT\arrow{\textbf{H}igh \textbf{F}requency\\
\textbf{V}ery \textbf{H}igh \textbf{F}requency\\
\textbf{U}ltra \textbf{H}igh \textbf{F}requency\\
\textbf{S}uper \textbf{H}igh \textbf{F}requency}
\end{document}
메모.paperheight=8cm
예제는 한 그림에 두 페이지를 모두 표시하기 위해 준비되었습니다 .
답변2
나는 잠재적으로 문제가 있어 보이는 2개의 여백 노트를 사용하는 것을 포함하기 때문에 이것을 권장하지 않지만 다음과 같은 종류의 작업이 가능합니다.
\documentclass[a4paper,11pt]{book}
\usepackage[showframe,left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=5.5cm,marginparsep=1cm,outer=8cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[svgnames]{xcolor}
\usepackage{amssymb}
\usepackage[fulladjust]{marginnote}
\usepackage{ifoddpage}
\newcommand{\arrow}[1]{%
\checkoddpage
\ifoddpage
\marginnote{\hspace*{-.5\marginparsep}\makebox[0pt]{\textcolor{red}{$\blacktriangleleft$}}\hspace*{.5\marginparsep}#1}%
\else
\marginnote{%
\makebox[0pt]{\hspace*{.6\marginparsep}\textcolor{red}{$\blacktriangleleft$}}%
}%
\marginnote{#1}%
\fi}
\begin{document}
TEXT\arrow{%
\textbf{H}igh \textbf{F}requency\\\textbf{V}ery \textbf{H}igh \textbf{F}requency \\\textbf{U}ltra \textbf{H}igh \textbf{F}requency\\\textbf{S}uper \textbf{H}igh \textbf{F}requency}
\newpage
TEXT\arrow{%
\textbf{H}igh \textbf{F}requency\\\textbf{V}ery \textbf{H}igh \textbf{F}requency\\\textbf{U}ltra \textbf{H}igh \textbf{F}requency\\\textbf{S}uper \textbf{H}igh \textbf{F}requency}
\end{document}