A quick question: in the standard Rstudio "Textmate" theme, markdown citations (the square brackets followed by # i.e, [#Judge2001] are highlighted. I have no found no other theme (dark or bright) that does that.
Q: How can I edit the themes so that I can see the citations in other colors within Rmarkdown text?
You can add:
.ace_list, .ace_markup.ace_list, .ace_storage {
color: #66db80;
}
to any .rstheme file you want and choose the color of your preference to highlight citation keys.
Adding to Diego's response, the selectors .ace_list .ace_markup did it for me. (Perhaps it was just a typo.) They are the classes used in the <span> around citations when you look at them in 'Inspect element'.
.ace_list, .ace_markup {
color: #66db80;
}
(I would've posted this as a comment, but apparently I'm too disreputable.)
Related
This question already has answers here:
Bold italic in ReStructuredText
(3 answers)
Closed 2 years ago.
Is it possible to have subscript inside of bold text in restructured text?
i.e.
**H :sub:`2` O**
Will render as `H :sub:`2` O in bold instead of H2O (with subscript 2)
I'm guessing from this thread it isn't:
Bold italic in ReStructuredText
I'm converting html files into rst and stripping all the subscript elements out of bold text is inconvenient!
Short answer is it's not possible with reStructuredText. You cannot have inline element inside another inline element, i.e. you can't have bold sentence with bold and emphasised word inside it. Or, your case - subscript within bold text. details
However, if you target to HTML, there is workaround based on raw role.
.. role:: raw-html(raw)
:format: html
Water formula is :raw-html:`<strong>H<sub>2</sub>O</strong>`.
Another alternative is use math role and type chemical formulas as math formula. If your case, water written using amslatex syntax is
:math:`H_2O`.
The manual here shows links as square brackets, but I need round for Harvard citations. Is there a way to change this setting please?
Have you heard of asiidoctor-bibtex? It is an extension to asciidoctor which supports different citation styles.
I have an R Markdown Document i want to embed in a shiny app based on the prettydoc engine. I have seen a tutorial about using the cayman theme for my document. The problem is i want to change the gradient in the header to be sunkist based on the gradient sheet here. Does anyone know how to achieve this. Is it a setting in the YAML
In the example supplied you type something like
---
title: Nineteen Years Later
author: Harry Potter
date: July 31, 2016
output:
prettydoc::html_pretty:
theme: cayman
highlight: github
---
An Additional information on the cayman theme can be found here
Changing the theme in YAML will not achieve what you intend to do. These themes are prebuilt and unless one of them already have the Sunskit gradient set, the outcome won't be what you desire.
An alternate approach would be to make the change in the stylesheet of the theme. For example:- In the cayman theme, you could open the cayman.css and this to the bottom.
.page-header {
background-color: #F2994A; /* fallback for old browsers */
background-image: -webkit-linear-gradient(to right, #F2C94C, #F2994A);
background-image: linear-gradient(to right, #F2C94C, #F2994A);
}
This would change the gradient in the header.
Within a Markdown editor I want to support text highlight, not in the sense of code highlighting, but the type of highlighting people do on books.
In code oriented sites people can use backquotes for a grey background, normally inline code within a paragraph. However on books there is the marker pen for normal text within a paragraph. That is the classical black text on yellow background.
Is there any syntax within Markdown (or its variants) to specify that the user want that type of highlight? I want to preserve the backquotes syntax for code related marking, but also want a way to enable highlighted user text
My first thought is just using double backquotes, since triple backquotes are reserved for code blocks. I am just wondering if other implementations have already decided a syntax for it... I would also appreciate if someone could justify if this is a very bad idea.
As the markdown documentation states, it is fine to use HTML if you need a feature that is not part of Markdown.
HTML5 supports
<mark>Marked text</mark>
Else you can use span as suggested by Rad Lexus
<span style="background-color: #FFFF00">Marked text</span>
I'm late to the party but it seems like a couple of markdown platforms (Quilt & iA Writer) are using a double equal to show highlighting.
==highlight==
Typora is also using double equal for highlighting. It would be nice it that becomes a CommonMark standard, as mentioned by DirtyF. It would be nice for those who use it frequently, since it is only 4 repeated chars: ==highlight==
If you want the option to use multiple editors, it may be best to stick with <mark>highlight</mark> for now, as answered by Matthias.
Here is the latest spec from CommonMark, "which attempts to specify Markdown syntax unambiguously". Currently "highlighting" is not included.
Editors using ==highlight== from comments mentioned previously:
Typora
Obsidian
Quilt
IA Writer
Feel free to add to this list.
You can use the Grave accent (backtick) ` to highlight text in markdown
Highlighted text
Also works with VS Code extension markdownlint
Grey-colored Higlighting Solution
A possible solution is to use the <code> element:
This solution works really well on git/github, because git/github doesn't allow css styling.
OBS!:
Using the code-element for highlighting is not semantic.
However, it is a possible solution for adding grey-colored highlighting to text in markdown.
Markdown/HTML
<code> <i>This text will be italic</i> <b>this text will be bold</b> </code>
Output
This text will be italic this text will be bold
Roam markdown uses double-caret: ^^highlight^^. Andrew Shell's answer mentions double-equals.
The accepted and clearly correct answer is <mark> from Matthias above, but I thought I had seen carets in some other flavor of markdown. Maybe not. I want to transform my ^^highlights^^ to <mark>highlights</mark> in pandoc conversion to html, and somehow ended up here...
Probably best bet is just use html e.g
<pre><b>Hello</b> is higlighted</pre>
Hello is higlighted
Remember nearly all html is valid in markdown too.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am currently writing a formal research report, and I'll be including code with this report.
Question: Is there an accepted way of displaying code in research reports? I'm thinking both in terms of font, spacing, et cetera, and whether the code should be displayed inside the document, or in an appendix.
The code will be JavaScript and PHP. None of the sections of code will be more than 25 lines (so they're mere snippets). There will be approximately half a dozen snippets. Each of the snippets will have a couple of paragraphs explaining what is happening in the code, and a discussion on its pros/cons.
I have no contact with the body to whom the report will be submitted to, and they have no published guidelines on how to format code (please do not question these points).
Well it depends on which style guide your paper is being written to comply to...
Usually code should be written in a monotype font so that it is easily readable (E.g. Lucida Sans Console or Courier New). This means that all letters take up the same space on the page.
When I have written bits for publishing I have indented the code 2.5cm from the side and given it a light grey background, in a Lucida Sans Console font... Following C style code indenting.
I would ask your institution if they have a style guide, but as you have a lack of this ability go with a popular style guide such as the Harvard system and make sure you follow the same format throughout.
Here is a list of journals from Google Scholar which display style:
http://scholar.google.com.au/scholar?hl=en&q=PHP+SQL+programming+journal&btnG=Search&as_sdt=2000&as_ylo=&as_vis=0
This is my preference:
When writing inline, get rid of code that is irrelevant to the explanation (such as import
statements as previously mentioned, but potentially also variable declarations that are "obvious" and the like). The goal of code placed inline should be for easy crossreference with the paragraph describing that code block.
Code placed in appendices should be complete (as in - you can put this into your compiler and press go).
Don't be scared of placing heavily cut down code in snippets, along with a reference to the appendix containing the full code - the appendix code is for someone to read/run separately. the inline code is for people to glance at and help understand the specific point of that section.
I would say Courier font with standard text spacing and standard line spacing, all black text, proper indentation.
In terms of the code itself, omit import statements, comments are okay. You may want to add foot notes like {1}, {2}, inline in the code as a comment and reference below in the text that explains the code.
This paper has an example on page 6:
http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-1.pdf
I realise that this is an old question, but do not forget to number the lines in your code! For one-liners, it's okay to skip numbers, but anything larger, they're almost required.
If you are writing a research report, you should be using LaTeX.
I typically use the LaTeX vancyvrb package and the Verbatim.
However, another option is to use the listings package. It can input a file directly using the lstinputlisting command. It automatically numbers your lines and uses the _ character instead of the space character, but this is programmable. It's really quite nice.
What JD and Ben said.
You should use appropriate, established syntax highlighting. Latex's listings package, mentioned by vy32, has syntax highlighting styles for both Javascript and PHP, as does the Pygments program, which outputs to, among others, Latex, HTML, and RTF.