I wanted to create a new comment environment with special format of comments to a text. Here is the MWE:
\documentclass[french, 11pt, a4paper, titlepage]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage{fontawesome}
\newenvironment{commentaire}[1]
{
\paragraph{\faCommentsO}
}
{
~(#1)
}
\begin{document}
text above
\begin{commentaire}{author}
comment
\end{commentaire}
text bellow
\end{document}
Got those two errors
- Illegal parameter number in definition of \endcommentaire line 12
- You can't use 'macro parameter character #' in horizontal mode. line 18
I don't understand, especially because my new environment seems to feature the recquirements Thank you !
\newcommand{\commarg}{}\newenvironment{commentaire}[1] {\renewcommand*{\commarg}{#1}\paragraph{\faCommentsO}} {~(\commarg)}probably being the easiest. – moewe Jun 19 '18 at 09:56\NewDocumentEnvironmentfrom the xparse package. I allows to use the argument in the end code. – Ulrike Fischer Jun 19 '18 at 10:08