LyX: citation style author, year - lyx

I would like to use the citation style: author, year. Which configuration do I have to use? If I do \usepackage[comma]{natbib} it collides with the preferences where I can only chose between numerical and author-year.
It does not need to be natbib, I even prefer the Standard plain style, but simply would have author,year instead of [1].
Would be thankful for any help.

Maybe you'd like style authordate1, see here for sme examples: http://www.cs.stir.ac.uk/~kjt/software/latex/showbst.html

Nothing bibliography related has to be written to the preamble. Select natbib/plainnat and author-year in Documents -> Settings -> Bibliography. Then, right-click on inserted references and select desired citation style.

Related

can we use cartouches instead of quotation marks to delineate inner syntax in jEdit Isabelle/HOL sessions

In typing statements of a proof into an Isabelle (2020) theory file, e.g.,
from ‹prime p › have p: "1 < p "
the jEdit interface application pops up a tooltip offering to insert an open cartouche command \<open> when I type a quotation mark. As you can see in the line above, I have been allowing this and it seems to be permitted. The Isabelle documentation seems to view inner syntax as category embedded, which seems to permit delineation with quotation marks or with the cartouche enclosure \<open ... \<close>.
Is there a down side to doing this? The imports statement requires quoting a reference to a theory file "HOL-Computational_Algebra.Primes" with module.theory format and will not accept cartouche there, but in theory statements it certainly appears to be equivalent.
Cartouches vs quotes is currently a matter of style, except for imports, syntax definitions, and for some command arguments (like nitpick[eval=".."]).
Remark that some keyboard layouts make it possible to type them directly (e.g., mac US international).
I believe that Makarius would like to deprecate the quotes eventually. This would allow users to write "a" instead of ''a'' for strings). But don't expect that to happen anytime soon.
So: Write what you like most!

Create new emphasis command R Markdown

In R Markdown, to make a text bold, we just need to do:
**code**
The the word code shows in bold.
I was wondering if there is a way to create a new command, let's say:
***code***
That would make the text highlighted?
Thanks!
It is not easily possible to create new markup, but one can change the way existing markup commands are rendered. Text enclosed by three stars is interpreted as emphasized strong emphasis. So one has to change that interpretation and change it to something else. One way to do so is via pandoc Lua filters. We just have to match on pandoc's internal representation of emphasized strong text and convert it to whatever we want:
function Strong (strong)
-- if this contains only one element, and if that element
-- is emphasized text, convert it to highlighted text.
local element = #strong.content == 1 and strong.content[1]
if element and element.t == 'Emph' then
table.insert(element.content, 1, pandoc.RawInline('html', '<mark>'))
table.insert(element.content, pandoc.RawInline('html', '</mark>'))
return element.content
end
end
The above works for HTML output. One would have to define what "highlighted text" means for each targeted format.
See this and this question for other approaches to the problem, and for details of how to use the filter with R Markdown.

Bookdown "Remark" environment

I'm trying to add numbered remarks (like in the definition or theorem environments) that I could referenced in a bookdown document. Something like:
```{remark, mylab}
my comment
```
In Remark \#ref(rem:mylab) we discussed...
which would produce:
Remark 1.1 my comment
In Remark 1.1 we discussed ...
Would anyone know if this is possible? Also, is it possible to change the numbering to A, B and so on? That is to have instead:
Remark A my comment
In Remark A we discussed ...
Thank you very much!
The general solution is:
Choose one of the predefined theorem like environments that you are not using otherwise, e.g. example.
Redefine the printed name for that environment in _bookdown.yml (c.f. https://bookdown.org/yihui/bookdown/internationalization.html) via:
language:
label:
exm: 'Remark '
In your Rmd files use
```{example, mylab}
my comment
```
In Remark \#ref(exm:mylab) we discussed...
Note that you have to use example and the correspoding label prefix exm.
I do not know of a general solution to use alphabetic instead of numeric numbering. I am sure that this would be possible if one would use only LaTeX/PDF output.

In reStructuredText, how do I use emphasis and superscript at the same time?

The following piece of reStructuredText does not give the result I expect.
*:sup:`superscript`*
Expected result: superscript
Actual result: :sup:`superscript`
The reason why it is happening is clear (reST text roles cannot be nested), however how can I obtain the expected result?
As specified in a FAQ, this is not currently possible without using the raw directive or without using a custom, ad-hoc directive.
You can use substitution:
The chemical formula for pure water is |H2O|.
.. |H2O| replace:: H\ :sub:`2`\ O
See the reStructuredText spec for further information on character-level markup and the substitution mechanism.

Teach Notepad++ to fold new multiline comment (R)

Can I teach Notepad++ that it should apply a fold whenever it sees a multi-line comment, where comments start with the hash mark and multi-line comments are hash marks on consecutive lines?
# This is a comment
# It continues on the next line
# and the next
# I want to fold this block
Edit
I submitted a fix to the R lexer to support multi-line comments. It includes the fix to source as well as a compiled SciLexer.dll for those who are eager to use this feature. Simply replace SciLexer.dll in the NPP folder with the one attached to the bug:
https://sourceforge.net/tracker/?func=detail&aid=3485870&group_id=95717&atid=612385
I've tested your multi-line comment with notepad++ 5.9.8 and it correctly fold as a single entity as long as there is a non-comment line between the comment groups and that the language selected has comments starting with '#' (eg: sh).
EDIT:
This seem to be language specific.
I've looked at the xml files that configure the behavior of notepad++ and it seem that this mechanic is hardcoded inside the program.
EDIT2:
The author of the question has just added comment folding support for the R languange!

Resources