有一个更好的方法吗?
活动视频:
\documentclass[a4paper,11pt]{isov2}
\usepackage[UKenglish]{babel}
\usepackage{lipsum}
\usepackage[toc,acronym,nonumberlist]{glossaries}
\makeglossaries
\newenvironment{changemargin}[2]{%
\list{}{\rightmargin#2\leftmargin#1
\parsep=0pt\topsep=0pt\partopsep=0pt}
\item[]}
{\endlist}
\newglossaryentry{accreditation}{name={accreditation},
description={procedure by which an authoritative
body gives formal recognition that a body or person is
competent to carry out specific tasks (ISO/IEC Guide 2)
\begin{note} note one
\begin{example}
Should be indented!
\end{example}
\end{note}
\begin{note} note two
\begin{changemargin}{2ex}{0}
\begin{anexample}
Now indented!
\end{anexample}
\end{changemargin}
\end{note}
}
}
\newglossaryentry{latex}{name=latex,
description={Is a mark up language specially suited
for scientific documents (Latexbook)
\setcounter{note}{0}
\begin{note} note one\end{note}
\begin{note} note two\end{note}
}
}
\newacronym{dc}{d.c.}{direct current}
\newacronym{ac}{a.c.}{alternating current}
\newacronym{DC}{DC}{direct current, d.c. is preferred}
\newacronym{AC}{AC}{alternating current, a.c. is preferred}
\begin{document}
\clause{Terms, definitions and abbreviations}
\renewcommand{\glossarysection}[2][]{}
\glsaddall
\sclause{Terms and definitions}
\printglossary
\sclause{Abbreviations}
\printglossary[type=\acronymtype]
\clause{Section}
\lipsum[1-30]
\end{document}
答案1
我只是修补example
并anexample
设置一个非零值\leftmargin
。
\documentclass[a4paper,11pt]{isov2}
\usepackage[UKenglish]{babel}
\usepackage{lipsum}
\usepackage[toc,acronym,nonumberlist]{glossaries}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\example}
{\@setnoteparams}
{\@setnoteparams\setlength{\leftmargin}{2em}}
{}{}
\patchcmd{\anexample}
{\@setnoteparams}
{\@setnoteparams\setlength{\leftmargin}{2em}}
{}{}
\makeatother
\makeglossaries
\newglossaryentry{accreditation}{name={accreditation},
description={procedure by which an authoritative
body gives formal recognition that a body or person is
competent to carry out specific tasks (ISO/IEC Guide 2)
\begin{note} note one
\begin{example}
Should be indented! \lipsum[1]
\end{example}
\end{note}
\begin{note} note two
\begin{anexample}
Now indented!
\end{anexample}
\end{note}
}
}
\newglossaryentry{latex}{name=latex,
description={Is a mark up language specially suited
for scientific documents (Latexbook)
\setcounter{note}{0}
\begin{note} note one\end{note}
\begin{note} note two\end{note}
}
}
\newacronym{dc}{d.c.}{direct current}
\newacronym{ac}{a.c.}{alternating current}
\newacronym{DC}{DC}{direct current, d.c. is preferred}
\newacronym{AC}{AC}{alternating current, a.c. is preferred}
\begin{document}
\clause{Terms, definitions and abbreviations}
\renewcommand{\glossarysection}[2][]{}
\glsaddall
\sclause{Terms and definitions}
\printglossary
\sclause{Abbreviations}
\printglossary[type=\acronymtype]
\clause{Section}
\lipsum[1-30]
\end{document}
如果example
只应在环境内部缩进note
,则只能在内部对其进行修补note
。
\documentclass[a4paper,11pt]{isov2}
\usepackage[UKenglish]{babel}
\usepackage{lipsum}
\usepackage[toc,acronym,nonumberlist]{glossaries}
\usepackage{etoolbox}
\makeatletter
\newcommand{\patchexamples}{%
\patchcmd{\example}
{\@setnoteparams}
{\@setnoteparams\setlength{\leftmargin}{2em}}
{}{}%
\patchcmd{\anexample}
{\@setnoteparams}
{\@setnoteparams\setlength{\leftmargin}{2em}}
{}{}%
}
\AtBeginEnvironment{note}{\patchexamples}
\makeatother
\makeglossaries
\newglossaryentry{accreditation}{name={accreditation},
description={procedure by which an authoritative
body gives formal recognition that a body or person is
competent to carry out specific tasks (ISO/IEC Guide 2)
\begin{note} note one
\begin{example}
Should be indented! \lipsum[1]
\end{example}
\end{note}
\begin{note} note two
\begin{anexample}
Now indented!
\end{anexample}
\end{note}
}
}
\newglossaryentry{latex}{name=latex,
description={Is a mark up language specially suited
for scientific documents (Latexbook)
\setcounter{note}{0}
\begin{note} note one\end{note}
\begin{note} note two\end{note}
}
}
\newacronym{dc}{d.c.}{direct current}
\newacronym{ac}{a.c.}{alternating current}
\newacronym{DC}{DC}{direct current, d.c. is preferred}
\newacronym{AC}{AC}{alternating current, a.c. is preferred}
\begin{document}
\clause{Terms, definitions and abbreviations}
\renewcommand{\glossarysection}[2][]{}
\glsaddall
\sclause{Terms and definitions}
\printglossary
\sclause{Abbreviations}
\printglossary[type=\acronymtype]
\clause{Section}
\begin{anexample}
text
\end{anexample}
\lipsum[1-30]
\end{document}