1

I am defining my own margin notes command and I have a question about making a command "transparent".

To be more clear, I have the following code :

\documentclass{article}
\usepackage[absolute]{textpos}

\newcommand{\notes}[2]{#2 \begin{textblock*}{2.5cm}[0.5,0.5](1.5cm,2cm)#1\end{textblock*}}

\begin{document}

This text is a \notes{a note}{test} in order to try something.

\end{document}

I want it to be executed as if it was this code

\documentclass{article}
\usepackage[absolute]{textpos}

\newcommand{\notes}[2]{#2 \begin{textblock*}{2.5cm}[0.5,0.5](1.5cm,2cm)#1\end{textblock*}}

\begin{document}

This text is a test in order to try something.

\notes{a note}{}

\end{document}

I want to make the textblock environment "transparent" in the text (for example compiled at the end).

Thank you by advance for your answers.

  • What are you trying to do exactly? That is, why not use the existing facilities to create the margin note? Right now, it looks as though you are just trying to make life difficult for yourself. It that's because you are trying to learn something, that's fine. But it will probably help if you give a bit of background so people have a better sense of the constraints. – cfr Jul 18 '14 at 21:45
  • As @cfr said, it's not completely clear what you're aiming to do. The textpos package doesn't have a notion of 'transparency' as such, though in absolute mode the textblock contents are put on the page first, so are overlaid with other text, so will be 'transparent' (see also the package's overlay option). Or do you mean 'transparent' as in 'taking up no space on the page'? – Norman Gray Jul 21 '14 at 10:45
  • Thank you for your answers. For @cfr, I'm working for one month on a complicated document (a book with very specific constraints) and for the moment nothing convinced me about the position of margin notes. For me, the position of margin notes are totally approximative and this is because I decided to make my "own" margin notes environment. The code is a bit ugly but now makes exactly what I want except on one point. To explain more clearly what I want, when I put a textpos environment, the line goes back to the left (without indentation). I want it not to do this. – D.J. Aug 3 '14 at 22:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.