I would like to override a installed package's snippet with my own snippet. For example LatexTools package provides following snippet.
\section{section name} % (fold)
\label{sec:section_name}
% section section_name (end)
I would like to override it with following snippet.
\section{section name} % (fold)
\label{section-section_name}
% section section_name (end)
I'd recommend using https://github.com/skuroda/PackageResourceViewer. You can use this to navigate to the snippet you want. In ST3, it'll place the file in the proper location to override any installed packages.
If you place your modified snippet in:
~/Library/Application Support/Sublime Text 3/Packages/LaTeX/
Sublime Text should pick it up and override the default package snippet.
The path above is correct for Sublime Text version 3. It might be different is you're using on older version.
Related
I would like to get autocomplete suggestions of my custom css class when I'm using emmet in HTML files
so when I type div.[suggestions with my CSS classes] like when the suggestions I get when inside of class attribute <div class=" ">
like in here but when using emmet
I've found a quriky solution to it, but not as elegent
Download IntelliSense for CSS class names in HTML
open vscode go to settings by ctrl + ,
go the JSON file from top right corner
add that line "html-css-class-completion.enableEmmetSupport": true,
It will be used in the following order
typing a tag (e.g div) followed by .
choosing the class
pressing ctrl + space again to get emmet abbreviation option
choosing the emmet snippet
voila!
I'm using Doxygen to generate an html user manual from markdown files. I'd like to give instructions such as "Click on the [image.png] button" and have the png image appear in the line of text in the generated html.
According to Doxygen's documentation, images can be added as follows:
\image['{'[option]'}'] <format> <file> ["caption"] [<sizeindication>=<size>]
The documentation also says that "Currently only the option inline is supported. In case the option inline is specified the image is placed "in the line", when a caption s present it is shown in HTML as tooltip (ignored for the other formats)." This sounds like what I want to do.
I've tried several variations of the \image command with no luck. These successfully produce an image, but on its own line:
!["caption"](image.png)
\image html image.png "caption"
and these commands fail:
\image inline html image.png "caption"
\image{inline} html image.png "caption"
Does anyone know if it's possible to do what I'm trying to achieve? Am I just getting the syntax wrong?
The {inline} option with the \image command is introduced in version 1.8.15
The version:
\image{inline} html image.png "caption"
does work in 1.8.15.
OP used an older version and will have got warnings like:
warning: image type inline specified as the first argument of inline
is not valid warning: expected whitespace after { command
I was having this problem too. This line fixed it for me:
\image html name.png width=800cm height=600cm
I am using JSF (PrimeFaces) tag p:textEditor for my forum. This tag use Quill rich text editor. Default behavior is wrapping every line in blocks (wraping in paragraphs tags p /p):
<p>line1</p>
<p>line2</p> ....
And it does not looks nice, because of output too much spaces between lines.
Instead, I need to get like this (use tag br/ between lines):
<br/> line1
<br/>line2 .....
For example, PrimeFaces extension has tag pe:ckEditor, that use ckEditor (rich text editor). And I can change its behavior just adding "config.enterMode = CKEDITOR.ENTER_BR;" in config.js file.
Is there in p:textEditor and its Quill (rich text editor) same ability or some another way that can fix my problem?
I was looking into feedback of Quills owner -
https://github.com/quilljs/quill/issues/1074 . And I checked all new versions after this feedback.
So yet Quill does not has this ability. The owner suggests to use css-style for fixing this behaviour (adjust paddings). Yes, it can resolve a problem of big spaces, but:
1) this way is not so comfortable;
2) this way is not suitable for forums quotations, because separate every line in own quote.
Here the problem is discussed and here is some js approach to fix it. But I am not going to use it because I use Quill built in JSF library. So I switch to pe:ckEditor and ckEditor rich text editor
I have been following the lessons on HTML and CSS provided by Jeffery Way on Tuts+:
http://learncss.tutsplus.com/
I got to the video on Zen Coding:
http://learncss.tutsplus.com/lesson/zen-coding/
I tried installing Zen Code to Sublime Text 2 but couldn't get it to work. I looked around on the web and found Emmet, which seemed like the new best thing. So I installed through the Command Pallete>"Package Install">"Emmet". It works great, the only issue is a snippet I used before is overwritten by Emmet.
The Snippet I used:
<snippet>
<content><![CDATA[
<li type="square">${1:Item} ${2:}
]]></content>
<tabTrigger>li</tabTrigger>
</snippet>
li + Tab would trigger:
<li type="square">
Is there a way for me to add this to Emmet in Sublime Text 2? Or use Emmet to accomplish this tag? I found this guide to Emmet tabtriggers, but could not find this one:
http://docs.emmet.io/cheat-sheet/
You can either create your own snippet in Emmet:
http://docs.emmet.io/customization/snippets/
http://docs.emmet.io/abbreviations/types/
...or disable li snippet from being handled by Emmet:
https://github.com/sergeche/emmet-sublime/blob/master/Emmet.sublime-settings#L55
...or disable Emmet tab trigger and use Ctrl+E:
https://github.com/sergeche/emmet-sublime/blob/master/Preferences.sublime-settings#L14
...or rename your ST snippet to something like li2, lit, etc.
Is there a way to set the color of single words (or characters) in sphinx? I'm pretty sure there should be some markup tag, like HTML's font tag.
On my Sphinx-powered website, I use a combination of:
A restructuredText file containing roles definitions, one for each color - see .special.rst (BitBucket link)
A CSS file containing color rules for each role - see the first lines of hacks.css (BitBucket link)
Then, in every rST file where I need colors, I first import .special.rst at the top, either manually:
.. include:: .special.rst
Or with the rst_epilog configuration variable in Sphinx's conf.py file:
rst_epilog = "\n.. include:: .special.rst\n"
And then each role can be used easily in pure rST syntax:
This is :red:`red !` And :blue:`this part is blue`.
More details are given on this page (in French, sorry).
It works perfectly well for html output (and html-like), but not for PDF. Refer to the first answer above for producing a PDF with colors.
If you want to do this without being tied to html, try applying a different style than normal body text to your word.
In this example adapted from the rst2pdf manual, I apply the existing rubric style which is red in the backend that I am using:
Before red.
.. role:: rubric
I like color :rubric:`rubric`.
After red.
The actual look of the word will depend on how the style you choose is defined in the stylesheet that you use when generating your document.
If you want blue text, make a blue text style and derive it from the normal text style.
The stylsheet is backend-specific and you may be using the default.
To print the default for rst2pdf.py, do this (from the rst2pdf manual):
rst2pdf --print-stylesheet
Continuing the example for a rst2pdf stylesheet, add this to your stylesheet to have a blue text style:
bluetext:
parent: bodytext
textColor: blue
In the document you can reference this style to get a blue word.
Note this bit is generic, and should make blue text if you define a blue style in your html or whatever backend's stylesheet.
Before blue.
.. role:: bluetext
I like color :bluetext:`blue`.
After blue.
The generated pdf has the coloured words:
Sphinx already supports colors with the s5defs.txt standard definition file intended for inclusion (but is missing the CSS file):
Create/append this text to the value of rst_epilog
sphinx configuration, in your docs/conf.py file:
rst_prolog = """
.. include:: <s5defs.txt>
"""
Follow Sphinx's instructions to add a css with the colors
(e.g. adopt the hack.css from #Næreen's answer):
Place your css file into e.g. _static/css/s4defs-roles.css;
append it's path into shtml_css_files sphinx configuration:
html_css_files = ['css/s4defs-roles.css']
You may then use:
Some :red:`colored text` at last!
TIP:
Read this SO if you also want the styling to appear in Latex output.
This works, but leaves the HTML in a separate paragraph.
.. raw:: html
<font color="blue">Blue word,</font>
And a word without color
If anyone has a better answer, I will accept it.
Just a quick note because I landed here looking for something similar for html.
This works on Sphinx v2.0.1 for me. This uses the concept reported by #adam-matan but doesn't cause any formatting issues (i.e. the paragraph problem).
reference: reStructuredText Directives
.. role:: raw-html(raw)
:format: html
:raw-html:`<font color="blue">Blue word,</font>` And a word without color