mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] hidden text


Chronological Thread 
  • From: "Sam Liddicott" <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] hidden text
  • Date: Tue, 09 Aug 2011 13:56:40 +0100
  • Envelope-to:
  • Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAAXNSR0IArs4c6QAAADxQTFRF NTdQY2Z/i286eHFugnNXoJBwm5GCs5VeoqO0ua+fwLCQ4c2q19C81NDF4eLr/unQ/PTf/fXW+/rq /f/7XKo76wAAAAlwSFlzAAALEwAACxMBAJqcGAAAAi9JREFUSMetloGSqyAMRVsFNAQkxP//15cE 62rFdt/MZqbTVu/hBhLEx/qf8fgDIAN455wHyPk7wCIe9nA+fwGSH87hgD8AHPfRpy2GwdMtcBh+ mg4Ech9Ih+RNixJKDLEL0GF8VLkSojePHrDlryNijbFW8zBg8PUKbBOI6D1WCV5Rf2DzxCtgBlMs tRRVW5LyVW3ew1TfAZZ6RcQicpb4yZmaC74DJADK6BdATOrUAbJzsZie+K22ZnEBknNYysvhVH6u 1X8CqAe4DuANoPoOrAbsHXUARJ5knc5z4EyyTnHoAqj7xvkYIdk65AwhyEZKMusOIDV2QQQaCnDQ gBiDR3RdIEb5CBESt2wgQJI0Yx/Agphg1MgNsD+QkszM9wHVPx/PeQOW+fmcR9DF8+4CyCJhCuP8 fDzmBbLqs8JzMODqYNfDvKhoGYM2lDosy5jlRozccRAgrPM8iygQS3Mv87IugUgKlC7NZ6liuy4r uresVq5QuQAr09ZKEga8OkluyKXeQ6Bs3SrtqgC1pWLNqAfwDhBnB+sK8OrVL4D4h1B4zWPWhJhu gPUHKA5EwSMYUMsdQK+UKDhIOTSHeg+8HCoTOGtB/gwcl4mSdGybwXegPWhM/RHYKwchkckhUNMX 6j7ueQNScLbZZOPRxaADyO2UQCJpl7wbnE6gQ+ksWjpngxOwF1tF5ecP3R6KB+AQxPfHLncQ+nKw 06fhu68OTIfJ869eTtg22l+9zfwDK3mKl5BFHMYAAAAASUVORK5CYII=


Just to summarise on this, you are getting blank paragraphs because the paragraph is not being hidden because the paragraph is part of your document. Only the text within the paragraph is being hidden.

To hide the paragraph, it must be generated by your macro and not in the document tree. A macro cannot generate a newline or start a new paragraph. A macro can emit paragraphs as part of a "document" tag so you could introduce multiple paragraphs where there was one paragraph, but your macro would still be inserted into a top level document paragraph.

If you insert your document inside a concat (as you have been) you will get long up-wrapped lines and a multi-paragraph (with short lines) will look even funnier - for what will happen, the dudas while by typeset to make a block, and within the concat that block will be set as if it were a single character - as a rect.

Therefore your solution is either to stop texmacs typesetting blank paragraphs or pas the dudas comments to a macro along with the preceding paragraph to the same macro - i.e. a macro which takes some text AND the dudas.

Maybe we can mix these ideas:

<new-remark|dudaux|Duda>

<assign|dud-true|<\macro|x|d>
<arg|x>

<compound|dudaux|<arg|d>>
</macro>>

<assign|dud-false|<\macro|x|d>
<arg|x>
</macro>>

<assign|duda|<macro|x|d|<compound|<merge|dud-|<value|mostrar-dudas>>|<arg|x>|<arg|d>>>>

<assign|mostrar-dudas|true>

<duda|blag sfdg asdg sadg sdablah|dusfdag sfdg .a,sfd sdf sd agf s dg s g,
asdg askdmgf ajksdhgf ;sajkld;ghasdlkgjh sadgsahd gkljs ads>

So this works by choosing which document tree duda will expand to - one has two members and one has only one member. But it means that the duda value and the previous text should be an argument to the same macro.

If you want more than one duda, then remove <duduax|<arg|d>> and replace with <arg|d> and then use dudaux directly in your document (as the second argument to the duda macro)


On 03/08/11 12:06, Pablo S. Casas wrote:
From: "Sam Liddicott"<address@hidden>
Subject: Re: [TeXmacs] hidden text
Date: Tue, 02 Aug 2011 13:04:27 +0100

I think you made an error in your if clause by referring to
<mostrar-dudas> where you probably meant<value|mostrar-dudas> -
otherwise it works fine for me, and if not for you then you need to
give an example document that uses the macro duda.
From: Miguel de Benito Delgado<address@hidden>
Subject: Re: [TeXmacs] hidden text
Date: Tue, 2 Aug 2011 14:37:35 +0200

Sorry, but your code doesn't work for me and I'm not sure I understand what
you expect it to do

1. Should your dudas be hidden when mostrar-dudas is false, including the
body of the duda (i.e. the remark itself)? Then I'd do something like:



<assign|duda2|<macro|texto|<if|<value|mostrar-dudas>|<dudaux|<arg|texto>>|<value|nada>>>>

And no unnecessary paragraphs are inserted.
Thank you for your replies Sam and Miguel. I attach an example
document to show more precisely what I intend to do. At the beginning
of the document they are the macro definitions: dudaux (text always
visible), duda2 (written by myself), duda3 (by Sam) and duda4 (by
Miguel).

If "mostrar-dudas = true" the 4 macros show the same text, but
duda4 generates non-justified text and an indented paragraph, so it's
not correct.

When "mostrar-dudas = false" dudaux still shows the text as
expected. On the other hand duda2, duda3 and duda4 hide the text as
intended but they introduce a new line in a new paragraph, which is
what I'm trying to avoid. Is there a way for not introducing any text
and any space at all?



--
[FSF Associate Member #2325] <http://www.fsf.org/register_form?referrer=2325>

<http://www.openrightsgroup.org/>



Archive powered by MHonArc 2.6.19.

Top of page