Citation Style Language "if then" - csl

I try to modificate csl style (Specification) fore Zotero. I don't know how to do next:
if I have more then 4 authors, I need to insert one text.
How can I do it?
I try next, but it is not work...
<else-if type="chapter paper-conference" match="any">
<choose>
<if variable="name" et-al-min="4">
<text value="ONE TEXT"/>
</if>
</choose>
</else-if>

The current version of CSL (1.0.1) probably doesn't allow for this, although it's very hard to tell without a concrete example.
The only thing that comes close is that it's possible to redefine the "et-al" and "and others" terms that follow et-al-abbreviated name lists. So if an existing CSL style produces "Smith, Johnson, Williams, Jones, et al.", you could change this to "Smith, Johnson, Williams, Jones, ONE TEXT". It's not clear if that's what you want, though.
(this same question was asked at https://github.com/citation-style-language/styles/issues/2092)

Related

GitHub markdown indent hanging indent

I am trying to make a webpage using github. But I got stuck when trying to make a hanging indent
I want to make a reference list using apa format. (In Normal Text, Not in Code)
A., B., & C., D. (2020, August 1). Name of the paper. Name of the paper Name of the paper
Name of the paper Name of the paper. Journal of ABC. Retrieved from
https://doi.org/1.1.2.2.2./deew/37.4.433
I have been looking around, but I could not find a way to do this.
Finally, this is what I found
A., B., & C., D. (2020, August 1). Name of the paper. Name of the paper Name of the paper Name of the paper <br> Name of the paper. Journal of ABC. Retrieved from https://doi.org/1.1.2.2.2./deew/37.4.433
Which produce the following
A., B., & C., D. (2020, August 1). Name of the paper. Name of the paper Name of the paper Name of the paper Name of the paper. Journal of ABC. Retrieved from https://doi.org/1.1.2.2.2./deew/37.4.433
But I think this is not a very efficient way to do. I wonder if you have any better ideas? Thanks!
Please let me know if you need more information. I am still trying to learn github.
Sorry about the late response but this is for others with the same problem
The hanging indent that you want is somewhat the handling that you see after a list item and in the next line adding spaces before the text
1. List item itself
(space)(space)Hanging indent that is handled to make nice multiline list items
2. Next list item
Is is usually not possible in markdown itself. In HTML+CSS you can do this:
<p style="padding-left: 2em; text-indent: -2em;">(a) in relation to an exempt payment service provider mentioned in subsection (1)(a), means any of the following payment services:</p>
But is is not always that you can use the CSS in Markdown supported HTML.
Some of the solutions have been explored [here] [https://serial-comma.com/blog/posts/2020-09-13-hanging-paragraphs-in-markdown.html]

How to require tab-indentation with CheckStyle?

In CheckStyle there is a module (File Tab Character) that checks that there are not tab-characters in the source code. Their rationale is:
Developers should not need to configure the tab width of their text editors in order to be able to read source code.
From the Apache jakarta coding standards: In a distributed development environment, when the commit messages get sent to a mailing list, they are almost impossible to read if you use tabs.
To ensure there is the correct number of spaces, there is an additional module (Indentation).
I prefer using tabs for indentation and want to add this requirement to my CheckStyle-file. My rationale:
Developers should have the opportunity to configure the space used for indentation
Tabs are a logical and configurable unit for indentation, n spaces is just an arbitrary number of spaces.
Unfortunately I could not find a way to do this with CheckStyle.
There is no ready-made check which does this, but you can configure the RegexpSinglelineJava check accordingly. The following configuration goes into your checkstyle.xml under TreeWalker:
<module name="RegexpSinglelineJava">
<property name="format" value="^\t* "/>
<property name="message" value="Indent must use tab characters"/>
<property name="ignoreComments" value="true"/>
</module>
It checks if there are spaces in the indent. Setting ignoreComments eliminates the problem that Javadoc comments often have at least one space before the asterisk.
We can also configure RegexpSinglelineJava check with the below regular expression in the format field-
<property name="format" value="^[\t]*[" "]+([\t]*|[" "]+)[a-zA-Z0-9]"/>
This checks for all whitespaces before the first word

Change "and" between Authors in Citation Style Files (csl)

I tried a lot to change the word "and" between two Authors using a citation programm (Papers2, Mac) and a specific citation style file (.csl), but my efforts doesnt work.
What I want to do is changing the "and" in the German "und", in both the citation inline and the reference list:
[Shaw and Riha, 2012]
Shaw, S. B., and S. J. Riha (2012), Title, J.
Hydrol., 434-435(C), 46–54, doi:10.1016/j.jhydrol.2012.02.034.
Does anybody know how I can configure this delimiter-word in the style file?
Thanks in advance!
Micha
Probably the best and easiest way to do this is to set the "default-locale" of this style to "de-DE" (for German), which should automatically result in the use of "und" instead of "and". See http://citationstyles.org/downloads/specification.html#the-root-element-cs-style .
Which style are you using?
It is likely that the CSL file was not properly loaded into Papers. As #RintzeZelle suggested, please make sure to change both the ID and the title in your new style. To override a built-in style in Papers (as coming from the official repo), you need to keep both the title and the ID, or else change both to create a separate style. In your case, it makes sense to have a separate style for the German version. I suggest to use the id http://www.zotero.org/styles/american-geophysical-union-german and the title American Geophysical Union (German).

How to add HTML section in Perl POD using Pod::Weaver

I use Pod::Weaver with Dist::Zilla. It does several good things for me. It adds POD section VERSION, AUTHOR, LICENSE automatically, and in my source code I can use simple POD syntax, I can write "=method new" and it will be converted to correct POD.
Now I wanted to add an image to the POD. To do it I need to add some HTML. So I'm writing in my source code:
=begin HTML
<p>
<a href="http://upload.bessarabov.ru/bessarabov/031VBX4pHw_ALPcxRTVjflnAWuc.png">
<img src="http://upload.bessarabov.ru/bessarabov/VdagpUXEQdMslOqUyOAzwa-DOaU.png" width="500" height="125" alt="Status board graph sample" />
</a>
</p>
=end HTML
Then I write dzil release and release the module on CPAN. After uploading to CPAN I recognize that my HTML POD was changed by Pod::Weaver and now it looks like:
=for HTML <p>
<p>
<a href="http://upload.bessarabov.ru/bessarabov/031VBX4pHw_ALPcxRTVjflnAWuc.png">
<img src="http://upload.bessarabov.ru/bessarabov/VdagpUXEQdMslOqUyOAzwa-DOaU.png" width="500" height="125" alt="Status board graph sample" />
</a>
</p>
And this HTML part has been moved in the POD. I wanted it to be just after SYNOPSIS part, but not it is after the last method.
I still want to use Pod::Weaver, because it does a lot of good things, but I want HTML to be put in the exact place of the POD and not to be converted.
How can I do it?
After much reading of perldoc perlpod and testing, the following things are apparent:
According to spec, =begin html segments can be translated safely to =for html segments.
However, this may only occur when the body of the segment contains segments that are grouped in paragraphs. So foo\nbar can be translated, but foo\n\nbar cannot.
The module that is doing the transformation from =begin to =for, when seeing a double \n in its body, refuses to emit =for, and instead, reverts to emitting =begin.
Given what number 3 Here is, If you want to force it to emit =begin html, simply spicing it up with a few extra \n's will do the trick.
However, the problem remains, that for whatever reason, what appears to be valid POD format given, is not rendering as intended.
Either
A. The Pod2HTML layer is not coded right to respond to =for ( in which case, a few extra \n's to force an =begin may help.
B. There's a security level thats preventing you from using complex HTML ( which may entail hyperlinks in images, which could be an XSS security threat )
If the problem is B, then you're not going to get around that by being tricky.
Though I assure you, displaying images IS doable, I do it myself

Multi-Line (separate lines) output in AIML?

I want the user to ask a question, and then the chat bot responds in different lines but in order.
Depending on the interpreter, you may be able to use the line break tags that HTML uses.
<br/>
They can be used like this:
<category>
<pattern>WHO INVENTED LINUX</pattern>
<template>
Linus Torvalds, along with many open source developers, and the Free Software Foundation, GNU invented Linux.<br/>
Linus Torvalds invented Linux in 1991.
<think>
<set name="topic">computers</set>
</think>
</template>
</category>
For newer AIML versions, considering the age and still relevance of this question, is still valid, and the use of could be combined with it in the templates.
However, be careful that these responses (utterances) will include the break-tags and other things, making context with painful to debug.