LyXConvert "Comment" into "Marginal Note"

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
diegostex
Posts: 2
Joined: Sat Feb 13, 2010 8:20 pm

Convert "Comment" into "Marginal Note"

Post by diegostex »

Hi, using LyX I'm trying to convert the "comments" into "marginal notes".

I tried several things but without luck.

The best shot was like this:

Code: Select all

\makeatletter
\@ifundefined{comment}{}{%
\renewenvironment{comment}[1]%
{\begingroup\marginpar{\bgroup#1\egroup}}%
{\endgroup}}
\makeatother
or like this:

Code: Select all

\@ifundefined{comment}{}{%
\renewenvironment{comment}%
{\marginpar{}%
{}}%
But what I get is only the first character of the text converted. Like in this image:

Image

I searched a lot trying to find how to solve this but without luck. I found the explanation of what is happening here: http://theoval.cmp.uea.ac.uk/~nlct/late ... fonts.html
Unexpected Output
Only one character is in the new font
You thought you changed font over a selection of text, but only the first character has come out in the new font.
You have most probably used a command instead of a declaration. The command should take the text as its argument. If you don't group the text, only the first character will be passed as the argument.
What I don't know and wasn't able to find is how to group the text.

Hope someone could help me :-)

Many thanks.

Best Regards,
Diego
(diegostex)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

diegostex
Posts: 2
Joined: Sat Feb 13, 2010 8:20 pm

Convert "Comment" into "Marginal Note"

Post by diegostex »

Hi, if any one is interested in how to do it here is the answer:

http://stackoverflow.com/questions/2258 ... ginal-note

The user godbyk not only solved my problem but also gives a detailed explanation of whats going on and teach you a new trick (at least for me :-))

Many thanks,
Cheers
Post Reply