3

It's code, thanks for @Harish Kumar,

\documentclass{book}
\usepackage{mathtools}
\usepackage{xcolor}
\definecolor{background}{RGB}{255,255,170}
\usepackage{empheq}
\newcommand*\mybox[1]{%
\colorbox{background}{\hspace{1em}#1\hspace{1em}}}
\usepackage{kantlipsum}
\usepackage[fulladjust]{marginnote}
\setlength{\marginparsep}{5mm}
\setlength{\marginparwidth}{1in}
\begin{document}
\begin{empheq}[box=\mybox]{align}R_A+R_B &=\frac{R_3(R_1+R_2){R_1+R_2+R_3}\marginnote{Some margin note here}
\end{empheq}
\clearpage
\begin{empheq}[box=\mybox]{align}R_A+R_B &=\frac{R_3(R_1+R_2)}{R_1+R_2+R_3}\marginnote{Some margin note here}
\end{empheq}
\end{document}

It's code very well working. That I want add to colored mark in margin notes in the middle of the \marginparsep. Odd page \blacktriangleleft and even page \blacktriangleright. Like that,

\checkoddpage
\ifoddpage
\newcommand{\marginmacro}{\marginnote{ {\color{red}$\blacktriangleleft$} Some margin note here}}
\else
\newcommand{\marginmacro}{\marginnote{Some margin note here {\color{red}$\blacktriangleright$}}}
\fi

That is, add first attach red color \blacktriangleleft in the middle of \marginparsep add second attach margin not in the \marginnote area in the odd pages. In the other hand, add first attach margin not in the \marginnote area, add second attach red color \blacktriangleleft in the middle of \marginparsepin the even pages.

For example, for odd pages. enter image description here

I'm sure this is a duplicate of another question that I just can't find. So, does anyone know how to fix it?

1 Answer 1

3

There you go again:

\documentclass{book}
\usepackage{mathtools,amssymb,ifoddpage,showframe}   %% remove showframe.

\usepackage{xcolor}
\definecolor{background}{RGB}{255,255,170}
\usepackage{empheq}
\newcommand*\mybox[1]{%
\colorbox{background}{\hspace{1em}#1\hspace{1em}}}
\usepackage{kantlipsum}
\usepackage[fulladjust]{marginnote}
\setlength{\marginparsep}{5mm}
\setlength{\marginparwidth}{1in}
\newcommand{\mymarginnote}[1]{%
\checkoddpage
\ifoddpage
\marginnote{\hspace*{-0.55\marginparsep}\makebox[0pt]{\textcolor{red}{$\blacktriangleleft$}}\hspace{0.55\marginparsep}#1}
\else
\marginnote{\makebox[0pt][l]{\makebox[\dimexpr\marginparwidth+0.77\marginparsep\relax][r]%
 {\textcolor{red}{$\blacktriangleright$}}}\hfill#1}
\fi
}
\begin{document}
  \kant[1]
  \begin{empheq}[box=\mybox]{align}
     R_A+R_B &=\frac{R_3(R_1+R_2)}{R_1+R_2+R_3}\mymarginnote{Some margin note here}
  \end{empheq}
  \kant[2]
  \clearpage
  \kant[1]
  \begin{empheq}[box=\mybox]{align}
     R_A+R_B &=\frac{R_3(R_1+R_2)}{R_1+R_2+R_3}\mymarginnote{Some margin note here again}
  \end{empheq}
  \kant[2]

\end{document}

enter image description here

2
  • it's perfect working. Thanks for your helping me and everone. I would like to thank you for support, new beginners like us. I hope, one day I will help everyone as/(like) that you do.
    – Özgür
    Sep 2, 2014 at 7:41
  • But \usepackage{kantlipsum} not working. Error: Emergency stop. When click, l3int.sty line:58 \cs_new_eq:NN \if_case:w \tex_ifcase:D. I erased about with all <kant>. When erased, not problem, it's working. It doesn't matter it for me. Because kernel source is working.
    – Özgür
    Sep 2, 2014 at 7:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .