Skip to Content.
Sympa Menu

texmacs-users - Re: [TeXmacs] hidden text

Subject: mailing-list for TeXmacs Users

List archive

Re: [TeXmacs] hidden text


Chronological Thread 
  • From: "Pablo S. Casas" <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] hidden text
  • Date: Sun, 18 Sep 2011 00:51:50 +0200 (CEST)

Can someone give me a hand on writing this macro? I think there
must be a way of hiding text without introducing a new paragraph. But
in my humble opinion, this problem is beyond a simple TeXmacs user.
So I appeal TeXmacs experts. Thank you again.

From: "Pablo S. Casas" <address@hidden>
Subject: Re: [TeXmacs] hidden text
Date: Fri, 09 Sep 2011 00:09:32 +0200 (CEST)

> From: "Sam Liddicott" <address@hidden>
> Subject: Re: [TeXmacs] hidden text
> Date: Tue, 09 Aug 2011 13:56:40 +0100
>
>> 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.
>
> Hi Sam:
>
> I'm very grateful for your ideas: they solve the problem partially.
> The dependence of the "duda" macro of a paragraph is a bit annoying,
> because sometimes the associated paragraph can be very long. In other
> occasions I have the need to include 2 or 3 consecutive "duda" macro
> without available paragraph to attach to. In this last case is where
> the macro you proposed is problematic.
>
> So my question is: Is it possible to write a macro which according
> to some true or false value of a variable, includes a remark or leaves
> the text untouched respectively?
>
>> 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