Skip to Content.
Sympa Menu

texmacs-users - Re: [TeXmacs] Hidden comments in a TeXmacs document

Subject: mailing-list for TeXmacs Users

List archive

Re: [TeXmacs] Hidden comments in a TeXmacs document


Chronological Thread 
  • From: Martial Tarizzo <address@hidden>
  • To: Basile Audoly <address@hidden>
  • Cc: address@hidden
  • Subject: Re: [TeXmacs] Hidden comments in a TeXmacs document
  • Date: Thu, 13 Oct 2016 16:19:53 +0200

See attached file.

HTH

Martial Tarizzo

Le mardi 11 octobre 2016 à 16:21 +0200, Basile Audoly a écrit :
> I have just started using TeXmacs a month ago and it has been
> wonderful so far.
>
>
> I am writing up lecture notes and I would like to include comments in
> the document, which I can hide when printing for the students, or make
> appear when printing for myself, preferably based on a single switch.
>
>
> Can anyone recommend a way of doing this?
>
>
> Thanks in advance,
>
>
> Basile Audoly
> Laboratoire de Mécanique des Solides / CNRS et École polytechnique
>
>

Attachment: notes.pdf
Description: Adobe PDF document

<TeXmacs|1.99.4>

<style|<tuple|generic|french>>

<\body>
  <\hide-preamble>
    <assign|note|1>

    <assign|note-visible|<macro|x|<with|color|red|<arg|x>>>>

    <assign|note-invisible|<macro|x|>>

    <assign|note-part|<macro|x|<compound|<if|<equal|<value|note>|1>|note-visible|note-invisible>|<arg|x>>>>
  </hide-preamble>

  <\with|color|blue>
    <\em>
      In the preamble, a variable <verbatim|note> is defined, used as a
      switch to control comments display.

      To change the behavior, assign anything but 1 to <verbatim|note>
      (nothing is fine...). See document tree. If you do it at the top of the
      document, no comment will be shown in the whole doc.

      A little drawback of this solution : hidden paragraphs are replaced by
      blank lines in the uncommented document.\ 

      A \S productivity \T tip : to quickly switch between
      doc_view/tree_view, insert a keyboard shortcut in your \S
      my-init-texmacs.scm \T. In my own file : ("C-!" (toggle-preamble))
    </em>
  </with>

  <frame|<em|text with comments>>

  Normal text. blah blah blah ... <note-part|This is a comment inside the
  paragraph... >Normal text again.

  A normal paragraph : Duis eni nisi cras rhoncus mi, nec. Velit curabitur
  erat vel porta elit. Mollis justo commodo tellus massa diam, taciti
  tristique lacus a mattis. A litora nisl, aliquam tempor, dui. Auctor,
  sociosqu curae.

  <\note-part>
    <strong|hidden paragraph>s :\ 

    Duis eni nisi cras rhoncus mi, nec.

    <\equation*>
      a*x<rsup|2>+b*x+c=0\<Rightarrow\><application-space|1em>x=<frac|-b\<pm\><sqrt|b<rsup|2>-4*a*c>|2*a>
    </equation*>

    Velit curabitur erat vel porta elit. Mollis justo commodo tellus massa
    diam, taciti tristique lacus a mattis. A litora nisl, aliquam tempor,
    dui. Auctor, sociosqu curae.
  </note-part>

  Another normal paragraph : Duis eni nisi cras rhoncus mi, nec. Velit
  curabitur erat vel porta elit. Mollis justo commodo tellus massa diam,
  taciti tristique lacus a mattis. A litora nisl, aliquam tempor, dui.
  Auctor, sociosqu curae.

  <assign|note|><em|<frame|Same text without displayed comments :
  <verbatim|note> assigned to nil>>

  Normal text. blah blah blah ... <note-part|This is a comment inside the
  paragraph... >Normal text again.

  A normal paragraph : Duis eni nisi cras rhoncus mi, nec. Velit curabitur
  erat vel porta elit. Mollis justo commodo tellus massa diam, taciti
  tristique lacus a mattis. A litora nisl, aliquam tempor, dui. Auctor,
  sociosqu curae.

  <\note-part>
    <strong|hidden paragraph>s :\ 

    Duis eni nisi cras rhoncus mi, nec.\ 

    <\equation*>
      a*x<rsup|2>+b*x+c=0\<Rightarrow\><application-space|1em>x=<frac|-b\<pm\><sqrt|b<rsup|2>-4*a*c>|2*a>
    </equation*>

    Velit curabitur erat vel porta elit. Mollis justo commodo tellus massa
    diam, taciti tristique lacus a mattis. A litora nisl, aliquam tempor,
    dui. Auctor, sociosqu curae.
  </note-part>

  Another normal paragraph : Duis eni nisi cras rhoncus mi, nec. Velit
  curabitur erat vel porta elit. Mollis justo commodo tellus massa diam,
  taciti tristique lacus a mattis. A litora nisl, aliquam tempor, dui.
  Auctor, sociosqu curae.
</body>

<\initial>
  <\collection>
    <associate|page-type|user>
    <associate|preamble|false>
  </collection>
</initial>



Archive powered by MHonArc 2.6.19.

Top of Page