I'd like to insert a numbered (or other, I'm not picky) footnote in my doxygen output. The list of special commands doesn't include anything that I could identify as enabling this. I was hoping for something like:
This is my text.\footnote{This is my footnote}
which would produce
This is my text.1
and then
1: This is my footnote
at the bottom of the page. Is there a way to accomplish this or something functionally equivalent?
Good question! What follows is a bit of a hack but might serve your needs.
Start from the footnote text at the bottom of your page and use an \anchor to mark it.
\anchor wibble 1. Wibble is an unusual shade of pink.
You can then link to the footnote using a \ref
Amongst the odder plants of the upper Amazon basin is the wibble rose (\ref wibble "1"). Water buffalo are particularly fond of wibble roses.
should produce
Amongst the odder plants of the upper Amazon basin is the wibble rose
(1). Water buffalo are particularly fond of wibble roses.
Wibble is an unusual shade of pink.
Yes, you are having to do rather too much manually, but at least this gives some form of hyperlinked footnote.
You can define your own \footnote command via the ALIASES option in doxygen's configuration file like this:
ALIASES = footnote{1}="\latexonly\footnote\{\1\}\endlatexonly\htmlonly<sup title=\"\1\">*</sup>\endhtmlonly"
This will produce a real footnote in the LaTeX output and a * with a tooltip in the HTML output.
To produce footnotes in HTML I currently use a mixture of ALIASES commands and some custom JS.
The command looks like this:
ALIASES += "myFootnote{1}=<span class=\"footnote\">\1</span>"
You might want to improve this alias to also cover footnotes in LaTeX through a \latexonly and \htmlonly.
In the header.html for my project I add the script found here. http://www.planetholt.com/articles/jQuery-Footnotes
To initialize the footnotes I also add the following code inside a script tag to header.html:
$(document).ready(function() {
$("#doc-content").append('<ol id="autoFootnotes0" class="footnotesList"></ol>');
$("body").footnotes();
});
Related
I'm making a custom .tmLanguage file to highlight the syntax I'm using correctly and generally make coding with it easier. I'm almost done, and I got the autocompletion working using a .sublime-completions file.
There's just one minor flaw I'd like to change. I have a pretty long list of functions, and almost all of them contain an abbreviation of the word 'parameter', PAR. When I start typing that word, the following are all in the list of completions:
PAR command
DEFPAR command
JDATA command (because the description contains PAR)
SPAA command (because there's a P in the command and an A and an R in the description)
What I want is only for the commands that begin with PAR to show up, so from the list above, only the first item.
So, like this:
In other words, I want the completions to show up based on the literal string I'm typing, and only from the trigger part of my completions file, before the \t only.
That completions file looks like this:
Highlighted in orange is what I want my completions list to be based on.
I hope this is understandable. Any help is greatly appreciated.
This is not possible. By design Sublime's autocomplete feature uses fuzzy matching, so if there are a number of options that all contain the same pattern, but you don't quite remember which one you want, you can type the pattern and have all of the options available. The more you type, the smaller the list of possible options becomes. This is a good thingĀ®, otherwise you'd have to remember the exact command you're looking for, which kind of defeats the purpose of autocomplete and code hinting.
S5 is a sparse specification for slide presentations that run in the browser. It looks quite nice, and there's a couple of exporters for org-mode.
I am running Org 7.9.2 in Emacs 23, and I have a nearly working example:
* Joint diagonalization
Why does this work?
- Covariance matrices are commuting normal matrices
\begin{equation*}
(A^*A)
\end{equation*}
This produces one slide, but the equation snippets don't appear as evaluated.
Figured it out as I was writing the question, but it's worth mentioning as I couldn't find the answer anywhere else. As given in this page, the standard way for org-mode to export math into HTML is to use MathJax, set up to connect to the org-mode website to get at the script. This applies as well for S5.
That means you have to have a working connection to render that, or you have to set the path option in your org file like this: #+HTML_MATHJAX: path:"/MathJax/MathJax.js"
Also, if you run NoScript like me, you also have to make sure the domain specified is allowed to run scripts in your browser, or it'll never work ;)
I'm looking for a way to generate and insert header comment blocks above my functions in Emacs (in any mode), with the default contents of the comment automatically based on the function's signature (i.e. the correct number of #param place-holders).
Doxymacs is a nice candidate. But I prefer another way works without the necessary libs. Can anyone recommend some others ways for adding smart comments for functions in Emacs? Thanks.
Edit:
Now I found this: http://nschum.de/src/emacs/doc-mode/, but it seems that it does not work well after I require it into my .emacs and add hook for js-mode. Doesn't it support js functions ?
I don't know of any general-purpose approach.
Csharp-mode has a defun that is bound to / , which tries to generate comments appropriate for C#. The way it works: Every time you type a slash, it looks to see if it is the third slash in a row. (In C#, three slashes are used to denote comments that produce documentation). If it is the third slash, then it looks at the surrounding text and inserts a comment skeleton or fragment that is appropriate.
It is not generalized in any way to support javascript or other language syntaxes. But you might be able to build what you want, if you start with that.
here's the excerpt:
http://pastebin.com/ATCustgi
I've used doxymacs in the past and I've found it useful
http://doxymacs.sourceforge.net/
Is there column based narrowing in emacs.
I tend narrow in one everything between script tags but that still keeps the original indent (space before var).
It would be great if I could actually column narrow to the the beginning of the indent since otherwise the electrict indent tries to bring it to column 0.
<some html></some html>
<script>
var foo = 1;
var bar = 2;
</script>
<some html></some html>
Alternate solution could be to mark the starting indents as uneditable, but I am also not sure how to do this.
P.S.
I am aware of MMM and NXHTML and html-helper-modes, but I am not looking to use them due to complexities.
Can you put { and } around the code within the script tags? It's not ideal but should keep the same semantics for the code and allow for the indenting (assuming you want one level of indent like in the example you gave).
The table.el package might be a solution. I haven't tested it, so can't be sure that it provides the solution you're looking for, but here's a quote from the mailing-list thread rectangle operations - narrowing?:
there's a package, table.el, which does some stuff that's related, though coming from a different direction. it's concerned with rectangular regions that are delineated by particular characters - but it provides for things like auto-fill and motion commands that are constrained to the bounds of those rectangles.
(i mention this in the hopes that there's some unification of effort possible. i am frustrated by the lack of control of the auto-fill in table.el, for instance, and would love to have it and related functionality generalized as you're suggesting, to generic emacs operations confined to rectangular regions. it's too hard to get the current, specialized operations to do what i need.)
And here's a quote from narrow-to-region for a rectangle:
If one is interested in working with rectangles - edit text (with filling, justification, what not), narrow it (and have regexp matchers ^, $ do the expected) then one can look at table.el and extract portions of it to the Emacs "core".
Remember, rectangle is but a table cell (possibly with no "geometric rectangle" surrounding it.)
I want to fully-justify latex code on EMACS so that my latex code will look better. For example, I remember my advisor sending me latex in fully justified way like this:
In ~\cite{Hummel2004}, authors described an approach for harvesting
software components from the Web. The basic idea is to use the Web as
the underlying repository, and to utilize standard search engines,
such as Google, as the means of discovering appropriate software
assets. Other researchers have crawled through Internet publicly
available CVS repositories to build their own source code search
engines (e.g., SPARS-J)~\cite{Matsushita2005}.
I suppose that his column-width is set to 70 columns.
Could someone give me a hint?
The standard fill.el package includes the command justify-current-line which is part of what you need. From the function help:
Do some kind of justification on this line.
Normally does full justification: adds spaces to the line to make it end at
the column given by `current-fill-column'.
Optional first argument how specifies alternate type of justification:
it can be `left', `right', `full', `center', or `none'.
If how is t, will justify however the `current-justification' function says to
And other posters have already given you the magicall invokation:
M-x set-justification
As a philosophical side note, the point of fixed-wdith text justification is to fake real typography on a inflexible output device. So applying it to LaTeX source seems a little odd to me. Moreover, I have been using the "one sentence to a line" approach to LaTeX documents for some months now, and find that it really does improves both the editability and the source-control behavior of LaTeX, so I would recommend against doing this.
If you select the region, and then press Ctrl-u M-x fill-region you get "full justification".
M-x set-justification-full
Use Refill mode afterwards to not have to run the command again after typing.
To get line wrap in the file itself (as opposed to something like longlines-mode that does not alter the structure of the file), I use auto-fill-mode, which automatically applies M-q (fill-paragraph) to each paragraph. For example, I use auto-fill-mode in mail-mode. You could do something similar with your LaTeX mode with a hook like this:
(add-hook 'TeX-mode-hook 'turn-on-auto-fill)
Assuming your TeX mode's hook is TeX-mode-hook.