On 10/17/18 7:09 PM, Richard Kimberly Heck wrote:
On 10/17/18 2:35 PM, Paul A. Rubin wrote:
On 10/17/18 11:24 AM, Richard Kimberly Heck wrote:
On 10/17/18 9:30 AM, Paul A. Rubin wrote:
On 10/16/18 10:24 PM, Andrew Parsloe wrote:
On 17/10/2018 4:47 a.m., Paul A. Rubin wrote:
Dear devs,
I'm struggling to cobble together a module supporting the
pseudocode features of the algorithmicx package. As a disclaimer,
I'm trying to avoid flex insets and stick to environments as much
as possible, because there's less mousery switching an
environment than insert an inset.
Right now, I'm tripping over the for block, which it implements
by two LaTeX commands: \For{<conditions>} and \EndFor. I can
treat those as command styles and get the correct output, but the
GUI is confusing to the user because nothing displays in the line
ending the loop (it looks like a blank line to the user) and the
condition appears in the starting line with no visible prefix (so
it looks like any random statement in the algorithm, unless you
notice what the environment select box is displaying.
So what I'm looking for right now is a way to display a
tag/prefix/symbol at the start of a command style that appears in
the GUI but /not/ in the compiled output. The "handle" for an
inset would be fine, as would something like a bullet that was
GUI-only. Can this be done with the current layout/module system?
TIA,
Paul
Is this what you are wanting (from Customization manual 5.3.7)? (I
experimented with this a couple of years ago, so my memory of the
exact effect is somewhat hazy.)
Andrew
|LabelType|
[|/No_Label/, Manual, Static, Above,
Centered, Sensitive, Enumerate,
Itemize, Bibliography|]
|Static|
means the label is simply what is declared as
|LabelString|. This will be displayed “inline”, at the
beginning of the paragraph. If the |LatexType| is
|Environment|, then it will be displayed only in the first
paragraph of any sequence of paragraphs with the same |Style|.
|Above| and |Centered|
are special cases of |Static|. The label will be printed
above the paragraph either at the beginning of the line or
centered.
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
Virus-free. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Thanks for the reply, but no, that doesn't work. With a command
type style (and combined with a LabelString argument) it does not
seem to do anything in either the GUI or the output. I tried it
with an environment, and I believe the label string showed up in
the output but not the GUI. (I would have to double-check that.)
Try this in Local Layout (to test):
Format 66
Style ForLoop
LatexType Command
LabelType Static
LabelString "ForLoop: "
EndLabelType Static
Margin Static
LeftMargin "ForLoop: "
LabelFont
Color red
Series bold
EndFont
EndLabelString " EndForLoop"
LatexName forloop
End
The margin always throws me off. If it's wrong, the label is off
screen to the left.
You could also try "LabelType Above" and remove the margin stuff.
Riki
Thanks Riki! That at least gets me headed in the right direction. I
don't know why I wasn't getting the label string to display before --
maybe because I failed to specify the Margin, LeftMargin or
LabelFont? (I did specify LabelType and LabelString, with no luck.)
The margin business is going to be interesting. Your code has the
correct left margin when select the ForLoop style from the
environment list, but when I nest it (inside an algorithmicx
environment) the label moves to the left (I would have expected
right) and blows the left margin. I expect that an exhaustive try of
all choices will eventually find one that works.
It would not surprise me if there were a bug here about margin
handling. Can you send an MWE? Put any new layout code into Local Layout.
Riki
An addendum to my MWE: by experimenting, I found that "Margin Manual"
fixes the problem of the ForLoop label breaking the left margin (when
embedded in an algorithm environment but not when out in the open). On
the other hand, I have another LaTeX command style that introduces a
LaTeX command with a single required argument (similar to \dummy in my
MWE). To get the label on that to work, "Margin Manual" was the wrong
choice; I needed "Margin Dynamic". Why the two styles differ in the
margin they need is yet another mystery to me.
Paul