如何\marginpar
在自定义命令中定义选项以使其不影响使用其他命令\marginpar
?
这是我尝试过的,但问题仍然存在:
\documentclass[a4paper,12pt,twoside]{report}
\usepackage[a4paper,width=159.2mm,top=25.4mm,bottom=25.4mm]{geometry}
\usepackage{blindtext}
%Paragraph number
\newcounter{parnum}
\newcommand{\n}{
\refstepcounter{parnum}\leavevmode
\marginpar[\scriptsize\S\theparnum\hfill]{\scriptsize\hfill\centering\S\theparnum}
\marginparwidth=15pt
\marginparsep=15pt
}
%Todonotes
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{ifthen}
\usepackage{calc}
\usepackage{xcolor}
\usepackage{xkeyval}
\usepackage[
colorinlistoftodos,
prependcaption,
textsize=scriptsize,
textwidth=2.5cm]{todonotes}
% Defining custom todo
\newcommand{\note}[1]{
\todo[linecolor=orange,backgroundcolor=orange!25,bordercolor=orange]{#1}
\marginparwidth=2.5cm
\marginparsep=0.4cm
}
\begin{document}
\chapter{Chapter One}
\n \blindtext %Without todonotes
\n \blindtext\note{Just a todo test!}
\n \blindtext\note{Another todo test!}
\newpage %for behaviour both in right and left side
\chapter{Chapter Two}
\n \blindtext %Without todonotes
\n \blindtext\note{Just a todo test!}
\n \blindtext\note{Another todo test!}
\end{document}
谢谢您的帮助和关注!