Customize the CSL style for APA 7th edition showing "et al." always in italic - styles

I use Mendeley and I'm trying to create a customized CSL style for my citations for research papers. "et al." must be italicized.
I know it is possible, because I searched and had find a post here about it - Is it possible to italicize "et al.".
However, I can't put it to work adjusting APA 7th edition custom citation style, that is the style I need to customize.
I think I have to change the code around line 388.
I even understood that I have to use editor.citationstyles.org because csl.mendeley.com has a bug and is not working, but I don't get any results changing the code to:
<names variable="author">
<name and="symbol" delimiter=", " initialize-with=". "/>
<substitute>
<text macro="title-intext"/>
</substitute>
<name and="text"/>
<et-al font-style="italic"/>
</names>
I opted to maintain part of the existing code for the block names variable="author" because I don't know what it makes.
Can you help?

Related

IntelliJ inspection to find tags without 'id' attribute

I need to setup an inspection in IntelliJ that will find xhtml/html/jsf page elements without an `id attribute.
<h:outputText value="myOutputValue"
styleClass="someStyle"/>
<h:outputText value="myOtherOutputValue" />
I tried setting up a code inspection in intelliJ under "Structural search". With the following regexp however I can't configure it properly. Any help would be appreciated.
<(?:h:inputText|h:outputText)(?:\s+(?!id\b)[\w\-.:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[\w\-.:]+))?)*\s*/?>
I know the regexp works because it will find the occurrences in my file when entered into the find box.
One last thing, in the end I'll want to expand (?:h:inputText|h:outputText) to include numerous tags so if using variables in the inspection or something else in intelliJ then that solution would be best. We want to make sure all developers put id attributes on all applicable page elements to aide in testing ease. (JSF tags are hideous)
You can use a Structural Search pattern like the following:
<$name$ $id$>
Remember to set the correct file type. Click Edit Variables... and give $name$ the following constraints:
Text/regexp: h:inputText|h:outputText
Give $id$ the following constraints:
Text/regexp: id
Occurrences count: 0,0
This will find all <h:inputText> and <h:outputText> tags without id attribute.

Targeting a g id in an SVG for rollovers

I'm working with an SVG file that has been output from Adobe Illustrator, so there is probably quite a bit of unnecessary code. After searching and searching I was able to come up with this.
<?xml-stylesheet type="text/css" href="SVG_css.css"?>
path:hover{
fill:#005289;
}
which gets the rollovers to work from the external stylesheet, but it of course targets every path as a rollover.
For instance, I need to target paths in a group so three elements highlight when rolled over. here is the code structure from Illustrator.
<g id="WIRE_ROOM">
<path fill="#BCBEC0" d="M357.3,24.4c0,0.6-0.6,1-1.4,1h-8.1c-0.8,0-1.4-0.5-1.4-1v-8.9c0-0.6,0.6-1,1.4-1h8.1c0.8,0,1.4,0.5,1.4,1
V24.4z"/>
<path fill="#BCBEC0" d="M357.3,51.4c0,0.6-0.6,1-1.4,1h-8.1c-0.8,0-1.4-0.5-1.4-1v-8.9c0-0.6,0.6-1,1.4-1h8.1c0.8,0,1.4,0.5,1.4,1
V51.4z"/>
<path fill="#BCBEC0" d="M376.7,24.4c0,0.6-0.6,1-1.4,1h-8.1c-0.8,0-1.4-0.5-1.4-1v-8.9c0-0.6,0.6-1,1.4-1h8.1c0.8,0,1.4,0.5,1.4,1
V24.4z"/>
</g>
I've tried associating the ID to the stylesheet, and didn't have any luck...I also tried associating a class directly into the SVG.
If I add class="locations" to the path it of course only rolls over that one element and not the group of elements. When I added the class like this nothing happened. g id="WIRE_ROOM" class="locations"
I would appreciate if someone could assist me with this, as I've searched and tried everything I know to try.
So in the case of "WIRE_ROOM" those are different pieces of equipment, and I need the hover to highlight all 3 of those areas to signify one common area. Thank you!
For future reference, the selector you're looking for is g#WIRE_ROOM:hover path or g.locations:hover path (I'd recommend using the class instead of an ID).
The hover state on the group is triggered when any of the child elements are moused-over, and then the selector applies the hover style to all the child paths.
You have to specifically mention the paths in the selector -- you can't rely on inheritance -- because your file directly sets fill colors on the paths, which takes precedence over any inherited style.

NullPointerException on gephi SVG export

Similarly to this forum thread, I'm getting a NullPointerException when exporting a graph to SVG. It doesn't happen with all graphs, but once it happens for a particular graph, no amount of closing and re-opening the .gephi file will let me export.
Unlike the forum thread, getting rid of spaces in node labels doesn't help me. In the log file, there's a very suspicious line:
***** CSSEngine: exception property.syntax.error:org.w3c.dom.DOMException: The "stroke-width" property does not support dimension values.
AttrValue:3.7186165E-4
Exception:org.w3c.dom.DOMException
Since SVG is all about web pages, this looks like a plausible issue. This forum post seems relevant. Here's a quote from it:
Batik is correct in rejecting the content, although it is a bit
confused in the error message. 'stroke-width' is a CSS property and
as such can not use scientific notation, as you quoted (silly yes, but
that is what CSS2 has said for a long time). The error comes because
Batik is trying to interpret 'e-03' as a unit (like 'em' for example).
Any thoughts on how I can export my beautiful Gephi image to SVG?
The number values in SVG properties (as with CSS properties) do not support scientific notation.
The error message indicates that somewehere in your file you have that stroke-width value (3.7186165E-4).
This is obviously a bug in the gephi SVG exporter. You should report it to them.
In the meantime you could fix it with a text editor. In the above example you would need to find the element with:
stroke-width="3.7186165E-4"
and change it so that it doesn't use scientific notation:
stroke-width="0.00037186165"
Note that if there is one, there may be others. Hopefully not too many! Note that other occurrences may not necessarily be on a stroke-width attribute.

Reference and Guidelines for Dynamic Layout using JavaFX

I am using FXML via Scene Builder to establish some JavaFX scenes and formatting templates. Having scanned the web and Oracle tutorials, I still find determining the 'rules' around how layouts size/wrap/fit-contents/etc. and spacing between elements and compoents to be 90% a black art to me. What I'm missing is the "layout overview" (missing chapter) that puts FXML (and JavaFX) layouts all together. If you've come across such a creature, please share link(s).
To date I've only found small bits of information. For example the:
JavaFX References
JavaFx JavaDocs
Java CSS Reference
Give some useful infomation on one attribute, parameter or characteristic. There seems to be nothing outlining the big picture nor making an effort to connect the dots between say "font-family" to (what are) "valid fonts"?
Also I'm looking for some examples that do more business or applications type work. More real-world(tm) examples like a data entry form that takes details with text fields, comboboxes, radio buttons, etc. Doing 'normal' on-screen things not just looking shiny graphics to show what JavaFX might do.
The main thing that I see as missing is a description relating the different JavaFX containers and elements and relating them together for formatted-appearance, formatted-layout, rendered-sizing relating to each other.
Forgive me for giving an example that sounds like a critism, it isn't intended to be I simply haven't found the information to let me satisfy some simple requirements:
Want a dynamic layout that will work on different sized displays/windows.
Some screne areas will need to size according to the content. More or less what I'd describe as, fit-to-content.
Other areas may need to be fixed width or height (as constraints).
The remaining parts of the formetted-layout would shrink or grow depending on the size and capacity of the window.
I want this in FXML: so that we can have a menu of layout styles with the same information (as views). That way we are expecting to match display with the best layout.
I can list the main, specific roadblocks I've come across (next). The thing I accept is that there are gaps in my knowldge and in what I'm reading about how containter work, how do min-prefered-max widths and heights work? How to they interact, etc.? That may be too large a question for now. I can give an example and some specifics to follow and leave it to the wisdom of the crowd ...
Example
| col-01 | col-02 | col-03 | col-04 | col-04 |
| | | | | |
| expand | fixed | scale | expand | fit |
| | percent |conetnet| | content |
| | | | | |
Specifics:
If I used a GridPane, there is NO properties or style field in SceneBuilder for the columns or rows.
Question: can I code style for GridPane rows and columns in the FXML file?
Percentages are not valid in most places (Java CSS Reference). Where can we use a percent and not use percent.
I want the columns with "expand" to grow/shrink according to the display size.
Fit content shouldn't expand (or only expand moderately).
Scale content should expand/shrink to suit the 'remaining space' and at the same time I want the content to 'fit-space' (which will normally be a graphic or other media)
What are the VALID CSS styles for elements.
What are the VALID values for the different JavaFX CCS styles?
Which style (path) selectors and combination work for JavaFX?
I still believe these constraints are do-able with JavaFX. I want the "outline rules" for my layout to be set-up in FXML. I feel that FXML should capable of doing what's needed provided I get the inforation about how to combine and set-up my layouts to satisfy the deploymed display constraints.
I'm expecting all these answers are not all in one place. As this is my second time (project) where I needed to know these things. I would prefer to get things working with a little less brute force this time because we want the flexibility offered with FXML definitions. I also think lots of us want to know how to do this but JavaFX styling is not the same as HTML. My thanks in advance.
see also:
FXML Guice, could be very useful.
Almost all of your specific questions can be answered by using the ColumnConstraints on a GridPane. Have a look at the "Work with layouts" chapter in the official tutorial.
Note that, unlike HTML (where CSS is used for both style and layout), in JavaFX CSS is not really intended to be used for layout, but just for the "look" of the application. (Clearly, there are some gray areas here, such as borders etc, but in my opinion there's a genuine difference in approach.) I think the question on percentages in CSS values becomes a moot point once you realize this difference.
For your specific example, and just off the top of my head, so this may not be exactly correct, you can do something like:
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="ALWAYS">
<maxWidth><Double fx:constant="POSITIVE_INFINITY" /></maxWidth>
</ColumnConstraints>
<ColumnConstraints percentWidth="20"/>
<ColumnConstraints hgrow="SOMETIMES" fillWidth="true"/>
<ColumnConstraints hgrow="ALWAYS">
<maxWidth><Double fx:constant="POSITIVE_INFINITY" /></maxWidth>
</ColumnConstraints>
<ColumnConstraints hgrow="NEVER" />
</columnConstraints>
<!-- Nodes... -->
</GridPane>
In SceneBuilder (screenshot is from 2.0, but this worked in 1.1 too), click on the "header tabs" for a column and under layout on the right you will be able to set the column constraints for that column. In this screen shot, column 1 is selected (its "header tabs" are yellow):
For your specific question 6, about css styles, I've found the CSS reference is pretty explicit about that, once you figure out how it's laid out. It lists the types and the values they take, then lists nodes, the attributes that can be used with them, and their type. The selectors are the standard css selectors, with a few pseudoclasses not being supported (documented in the introduction of the reference).
One thing that's not stated explicitly in the reference is that the "substructure" section for each Node is listing css classes. So, for example, ScrollBar (which has css class scroll-bar) has "track" listed under its substructure as a StackPane. StackPane is listed as defining a property -fx-alignment as well as inheriting all the properties of Pane, which in turn inherits all the properties of Region, such as -fx-background-color. So if I want really ugly scroll bars, I can do
.scroll-bar .track {
-fx-background-color: purple ;
}
And if I want one particular scroll bar to be ugly, I can give it a style class (say "ugly") and do
.scroll-bar.ugly .track {
-fx-background-color: purple ;
}
(So the usual selection rules for css apply.)
While the reference is pretty good, I do quite often dip into the default stylesheet source code to see how things are done there. This is a useful resource, and Oracle seem to actively encourage you to look at this. As well as the link from before, you can just extract it from the jfxrt.jar file with
jar xf JAVA_HOME/jre/lib/ext/jfxrt.jar com/sun/javafx/scene/control/skin/modena/modena.css

Writing a custom text at an arbitrary position in a chart

I've created a nice chart but there's one thing missing. I'd like to be able to set a text somewhere in it. The optimal solution would be e.g. the current date smacked in huge yellow letters right in the middle of my graph.
I've googled for such a thing but none of the links (proof that I've googled #1, proof that I've googled #2) gave any hints on whether it's possible or not. In fact, the mock-up image in the second link would be something for me if the descriptions and arrows weren't drawn afterwards in an image processor.
NB. It's not a report at all. It's just a chart - a single, lonely chart - that displays values of a couple of series. I get to control the appearance, the legend etc. However, I'd like to put a floating text object (DIV formatable by CSS would be perfect), sprite, overlay, call it whatever you'd like, that will get its value from a given field (e.g. the current date).
And if I can position it freely anywhere over the graph, that'd be even "perfecter" but I'd settle for placement on form "top-right" or such. Alternatively, if there's an option to combine two "views" on top of each other or anything like that (I'm beating around the bushes with this).
Is that achievable and if so how?
Right, I've had a play, a good dig around with the SDK, a bit of a google and this is the best I can come up with.
I know how to place text at arbitary positions on the chart, but only with static text, e.g. I don't know how to bind the text dynamically to anything - I suspect this is more to do with CRM than Charts, I couldnt find much documentation for CRM and Charts.
So I've found that TextAnnotation allow you to bascially place text wherever you like. This is contained within theAnnotations collections.
For example:
<Chart>
...
<Annotations>
<TextAnnotation Text="This is an annotation" Name="TextAnnotation1" X="20" Y="50">
</TextAnnotation>
</Annotations>
...
</Chart>
So important to note that the position of the TextAnnotation is relative, e.g. the annotation will appear 20% of the width of the chart from the left. 0,0 is the top left corner. The MSDN has some more detail on positioning.
So I can create a chart like this:
HELLO WORLD! is the annotation.
Using this xml:
<Chart Palette="None" PaletteCustomColors="55,118,193; 197,56,52; 149,189,66; 117,82,160; 49,171,204; 255,136,35; 97,142,206; 209,98,96; 168,203,104; 142,116,178; 93,186,215; 255,155,83">
<Series>
<Series ShadowOffset="0" IsValueShownAsLabel="True" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PieLabelStyle=Inside, PieDrawingStyle=Default" ChartType="pie">
<SmartLabelStyle Enabled="True" />
</Series>
</Series>
<ChartAreas>
<ChartArea>
<Area3DStyle Enable3D="false" />
</ChartArea>
</ChartAreas>
<Legends>
<Legend Alignment="Center" LegendStyle="Table" Docking="right" IsEquallySpacedItems="True" Font="{0}, 11px" ShadowColor="0, 0, 0, 0" ForeColor="59, 59, 59" />
</Legends>
<Titles>
<Title Alignment="TopLeft" DockingOffset="-3" Font="{0}, 13px" ForeColor="0, 0, 0"></Title>
</Titles>
<Annotations>
<TextAnnotation Text="HELLO WORLD!" Font="Stencil, 15.75pt, style=Bold, Italic, GdiCharSet=0" Name="TextAnnotation1" X="20" Y="50" ForeColor="Orange">
</TextAnnotation>
</Annotations>
</Chart>
If that doesnt achieve your requirements I would suggest having a look at an SSRS report or some other custom piece IFramed into the dashboard.
You might want to check this link where they put descriptive text on a map. I haven't got that to work (didn't try very hard, either) but it's pretty easy to set just some text instead of a graph by the following code.
<visualization>
<primaryentitytypecode>blobb</primaryentitytypecode>
<name>My custom name</name>
<webresourcename>MyCustomHttpFile</webresourcename>
</visualization>
I would be nice indeed to surprise a customer with a flash text sometimes so the idea is worth exploring. Strangely, I haven't found any good guide on how to do that.

Resources