Bibiliography style with Quarto documents - pandoc

The default way of displaying references with Quarto documents seems to put author names in this format: Last1, First1, First2 Last2, First3 Last3, and First4 Last4. So the first author name is displayed differently than the rest. Is that intentional and is there a way to change that?
Here's an example:
---
project:
type: website
format: html
bibliography: references.bib
---
## Text
#bibitem1
Content of references.bib
#article{bibitem1,
author = {First1 Last1 and First2 Last2 and First3 Last3 and First4 Last4},
title = {Article title},
journal = {Journal name},
year = {2013},
volume = {3},
number = {72},
pages = {14--18}
}
which is displayed as
Last1, First1, First2 Last2, First3 Last3, and First4 Last4. 2013. “Article Title.” Journal Name 3 (72): 14–18.

How your references are displayed is entirely determined by the bibliography format you use. Quarto adopts a default one. You can specify a custom one with the csl option, specified in your YAML header as for example:
csl: biomed-central.csl
Styles for many journals are available with the Zotero project: https://www.zotero.org/styles
These styles are composed using the Citation Style Language. In principle, you could customize such a style (including the default style used by Quarto). It is not that trivial, though, and would require some effort to understand and use the language.

Related

citation style language - extend with an additional field

I produce a bibliography with pandoc from a bibtex file. In my bibtex entries I have the location of the pdf (not an url, just a file reference in a field file). I would like to include this reference in the bibliography, but do not see how to extend the chicago-author-date.csl - I am completely new to CSL...
I assume I have to add something like
<text macro="file" prefix=". "/>
in the layout section. But how to define the macro? How is the connection between the bibtex field and the CSL achieved?
Is there somewhere a "how to" page?
Thank you for help!
An example bibtex entry is:
author = {Frank, Andrew U.},
title = {Geo-Ontologies Are Scale Dependent (abstract only)},
booktitle = {European Geosciences Union, General Assembly 2009, Session Knowledge and Ontologies},
year = {2009},
editor = {Pulkkinen, Tuija},
url = {http://publik.tuwien.ac.at/files/PubDat-175453.pdf},
file = {docs/docs4/4698_GeoOntologies_abstarct_EUG_09.pdf},
keywords = {Onto},
owner = {frank},
timestamp = {2018.11.29},
}
the file entry should be inserted in the output as a relative web reference (clickable) - in addition to the usual output from the chicago-author-data style.
I add a list of nocite to the markdown text (read in from file) and process it (in Haskell) with the API
res <- processCites' markdownText
It works ok, I miss only the file value.

MediaWiki - How to use all images from a Category in a gallery

I have set a description on the file:
{{Information
|description = A cheeky description
}}
I have tried to use this CategoryGallery successfully, but I cannot get the descriptions to work:
I have also used the required extra extension, they talk about short_summary, however this does not exist as far as i can see in Information template
<catgallery cat="Aubry" bpdcaption="short_summary" />
So how do I use category images in a gallery with MediaWiki?
Cargo may be overkill for this (you didn't mention that you are saving any metadata for all the images).
I personally uses DPL, which allows you do to some cool tricks with categories, you can check the manual, but as for your case:
{{#dpl:
category=all_photos
|mode=gallery
}}
that very simple example, but you can control the output format within the query (read at the manual i've mentioned).
DPL is built for this scenarios.
If you didn't mind using a different extension, Cargo can do this pretty easily (and lots of other useful stuff as well).
In Template:Artwork do something like:
<noinclude>
{{#cargo_declare: _table = artworks
| description = Wikitext
| artist = Page
}}
</noinclude><includeonly>
{{#cargo_store: _table = artworks
| description = {{{description|}}}
| artist = {{{artist|}}}
}}
</includeonly>
; Description
: {{{description}}}
; Artist
: [[{{{artist}}}]]
And then where you want the gallery (e.g. on a page for an artist), do something like:
{{#cargo_query: tables = artworks
|fields = _pageName, description, artist
|where = artist = '{{PAGENAME}}'
|format = gallery
|caption field = description
|show filename = 0
|show dimensions = 0
|show bytes = 0
}}
This assumes that the Artwork template is used on files' pages; if you wanted a mainspace page for each artwork, you could still do something similar but would have to introduce a separate image field that points to the actual file.
With a little prep, you should be able to use '_categories' if you have set up the wiki's cargo to store categories using "$wgCargoPageDataColumns[] = 'categories';" in the LocalSettings.php
example...
{{#cargo_query:
tables=MyTable
|where=MyTable._categories HOLDS 'Foo'
|fields=MyTable._pageName
}}
The above should give the name of the files in the category 'Foo'.
To show the images, change the fields to...
|fields=CONCAT( '[[file:', MyTable._pagename, '|thumb]]' )

How can I configure the separator character used for :menuselection:?

I am using Sphinx to generate HTML documentation for my project. Under Inline Markup, the Sphinx documentation discusses :menuselection: for marking a sequence of menu selections using markup like:
:menuselection:`Start --> Programs`
This results in the following HTML:
<span class="menuselection">Start ‣ Programs</span>
i.e. the --> gets converted to the small triangle, which I've determined is U+2023, TRIANGULAR BULLET.
That's all well and good, but I'd like to use a different character instead of the triangle. I have searched the Sphinx package and the theme package (sphinx-bootstrap-theme) somewhat exhaustively for 'menuselection', the triangle character, and a few other things, but haven't turned up anything that does the substitution from --> to ‣ (nothing obvious to me, anyway). But something must be converting it between my .rst source and the html.
My question is: what, specifically is doing the conversion (sphinx core? HTML writer? Theme JS?)?
The conversion is done in the sphinx.roles.menusel_role() function. You can create your own version of this function with a different separator character and register it to be used.
Add the following to your project's conf.py:
from docutils import nodes, utils
from docutils.parsers.rst import roles
from sphinx.roles import _amp_re
def patched_menusel_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
text = utils.unescape(text)
if typ == 'menuselection':
text = text.replace('-->', u'\N{RIGHTWARDS ARROW}') # Here is the patch
spans = _amp_re.split(text)
node = nodes.emphasis(rawtext=rawtext)
for i, span in enumerate(spans):
span = span.replace('&&', '&')
if i == 0:
if len(span) > 0:
textnode = nodes.Text(span)
node += textnode
continue
accel_node = nodes.inline()
letter_node = nodes.Text(span[0])
accel_node += letter_node
accel_node['classes'].append('accelerator')
node += accel_node
textnode = nodes.Text(span[1:])
node += textnode
node['classes'].append(typ)
return [node], []
# Use 'patched_menusel_role' function for processing the 'menuselection' role
roles.register_local_role("menuselection", patched_menusel_role)
When building html, make sure to make clean first so that the updated conf.py is re-parsed with the patch.

Newly added translation is not shown

On a Typo3 4.4.2 with existing translations I wanted to add a new one. But the text element is only displayed on the default language and not on the English page. Then I tried to add a content element on the English page. Here it will be shown but only in English. It seems that the translations are completely separated from each other ...
Here is the TS:
config {
linkVars = L
sys_language_mode = content_fallback
sys_language_overlay = hideNonTranslated
sys_language_uid =
language = de
locale_all = de_DE
doctype = xhtml_trans
htmlTag_langKey = de
}
[globalVar = GP:L = 1]
config.sys_language_uid = 1
page.config.language = en
page.config.locale_all = en_EN
[global]
What is here wrong? Deleting the cache had no success so it is another problem.
Please use the "Copy default content elements" option for translating default content elements to English language.
Make sure to translate the page with the content element too. Otherwise the content element can not be saved.
If the mapping between the translation is lost, then you have to fix this in the database or with the extension languagevisibility.

Displaying Docbook section titles in TextMate's function popup

I'm working on a bundle for DocBook 5 XML, which frequently includes content like:
<section>
<title>This is my awesome Java Class called <classname>FunBunny</classname></title>
<para>FunBunny is your friend.</para>
</section>
I want the titles for sections to appear in the function popup at the bottom of the window. I have this partially working using the following bundle items.
Language Grammar:
{ patterns = (
{ name = 'meta.tag.xml.docbook5.title';
match = '<title>(.*?)</title>';
/* patterns = ( { include = 'text.xml'; } ); */
},
{ include = 'text.xml'; },
);
}
Settings/Preferences Item with scope selector meta.tag.xml.docbook5.title:
{ showInSymbolList = 1;
symbolTransformation = 's/^\s*<title\s?.*?>\s*(.*)\s*<\/title>/$1/';
}
The net effect of this is that all title elements in the document are matched and appear in the function popup, excluding the <title></title> tag content based on the symbolTransformation.
I would be happy with this much functionality, since other interesting things (like figures) tend to have formal titles, but there is one issue.
The content of the title tags is not parsed and recognized according to the rest of the text.xml language grammar. The commented-out patterns section in the above language grammar does not have the desired effect of fixing this issue -- it puts everything into the meta.tag.xml.docbook5.title scope.
Is there a way to get what I want here? That is, the content of the title elements, optionally just for section titles, in the function popup and recognized as normal XML content by the parser.
In TextMate grammars you need to use the begin/end type rules instead of match type rules, if you want to 'match within a match'. (You can actually use a match as well, but then you need to use currently undocumented behavior, available only for TextMate 2)
{ patterns = (
{ name = 'meta.tag.xml.docbook5.title';
begin = '<title>';
end = '</title>';
patterns = ( { include = 'text.xml'; } );
},
{ include = 'text.xml'; },
);
}
This has the added benefit of allowing <title>...</title> that span more than one line.

Resources