wildgoat的个人空间 https://blog.eetop.cn/wildgoat [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

[ZZ] [LaTeX] Nice marginpars

已有 1032 次阅读| 2013-1-6 14:27 |个人分类:Latex相关

The standard and the updated marginpar commands

As you probably know, LaTeX offers the possibility of writing information in the margin, in a very simple way, using the \marginparcommand. I personally use it to make keywords stand out, to give  grammatical information about a difficult foreign word, and to write  other kinds of personal comments to a text. But I think the usual  appearance of the margin paragraphs is kind of ugly. First of all, the  font size is too large. A smaller font makes it easier to see the  difference between the body text and the comment. Second, LaTeX tries to  stretch and hyphenate the text so it can be justified between the  margins, which most of the time is impossible to do nicely within that  limited space.

I always redefine my margin paragraphs. I adjust the width of the  paragraph, the font size, and I make the text left-justified on a right  page, and right-justified on a left page (when the twosideoption is used), to make it 'cling to' the body text.

In my example, I make the margin paragraph 1.2 inches wide, and set  the font to footnote size. Adjust these settings so they fit your  purposes.

\documentclass[twoside]{article}
\setlength{\marginparwidth}{1.2in}
\let\oldmarginpar\marginpar
\renewcommand\marginpar[1]{\-\oldmarginpar[\raggedleft\footnotesize #1]%
{\raggedright\footnotesize #1}}
\begin{document}
\begin{flushright}
This is some text.\oldmarginpar{This is the old marginpar command.
This is the old marginpar command.}
\vspace{2cm}

This is some other text.\marginpar{This is the new marginpar command.
This is the new marginpar command.}
\end{flushright}
\end{document}



点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 122

    粉丝
  • 42

    好友
  • 273

    获赞
  • 118

    评论
  • 22104

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-26 19:51 , Processed in 0.017093 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部