How do I link to a LABEL in org-mode? - hyperlink

In org-mode, I have defined a figure+caption like this:
#+CAPTION: My great figure
#+LABEL: fig:myfigure
[[myfigure.png]]
How do I write "See figure [myfigure]"? I've found the following syntax:
See figure \ref{fig:myfigure}
but this looks ugly in the source file. In particular, you cannot use it for actually jumping to the figure.

You actually don't need '#+NAME', it works fine if you use '#+LABEL', which won't break your short-caption for list of figures.
Orgmode does now offer a 'jumpable', enumerated or link with name of your choice in the exported (latex, html) text if you link with:
see figure [[fig:myfigure]].
or
see figure [[fig:myfigure][figurenameintext]].
I would have added this as a comment, but I don't have the reputation yet.
--
In response to your comment (still can't comment): you do need the '#+NAME' for it to jump within the .org source file; as mentioned in the manual, and i also just confirmed that works. Not sure about the short-captions in the latest version.

With a very recent org-mode, you can use #+name:, see:
http://thread.gmane.org/gmane.emacs.orgmode/62644/focus=62646
#+CAPTION: My great figure
#+LABEL: fig:myfigure
#+name: fig:myfigure
[[test.png]]
See figure [[fig:myfigure][test]].
This works for me to jump from the link , but has no effect when exporting, I'm afraid...

Related

Webmaster Tools doesn't like my page set pattern

I'm trying to use the highlighting feature on Webmaster tools. I got done filling it out for my page, but when I go and try to create the page set, it doesn't find any files matching the pattern.
The default pattern that google chose is:
http://www.example.com/*/*/*/*
That's not good enough because that's everything on my site.
What I want is this:
http://www.example.com/Team/Schedule/*/*
It can't find this. The first asterisk is just the id, and the second * is the name associated with that id.
I tried adding this:
http://www.example.com/Team/Schedule/*
It can't find anything here either.
This DOES work
http://www.example.com/Team/*/*/*
So, why doesn't the pattern that I want get recognized? I've even tried copying and pasting in the "Team/Schedule" portion to make I didn't misspell, but that still doesn't work.
Edit:
the "template" path that I used for the highlighting looks like this:
http://www.example.com/Team/Schedule/105/Bears
And similar pages would be:
http://www.example.com/Team/Schedule/52/Vikings
This was a result of Google containing an old cached version of my page structures. I had just recently updated the structure, and Google had not re-crawled to get those changes.

nokogiri and the href label

I am not sure how to access the label part of the anchor href tag. The other question that looks at this doesnt really answer it for me.
I have this code:
#name = page.css("#content").css("a")[1]
Which gives this result
generation xerox
I want to get at the "generation xerox" bit
I wouldnt mind getting at the href, I dont understand that either. I have read several other SO questions but I can't get it to work
Thanks in advance all
You can access the label with #name.text and the link with #name['href']
See doc

auto_complete_for: prevent the first item from being auto-selected

The auto_complete_for dealio from script.aculo.us is great an all, but is there a way for me to selectively disable the fact that it always auto-selects the first item in the list?
The problem is that, if I want to type my own entry that is new, and novel, I don't want the first item in the list to be auto-selected. The reason is because when I TAB out of the field, it selects, and fills the text box with that first item.
I got around that, somewhat, by making the first item in the list the same as what I'm typing, but that's not perfect either, because the auto_complete list doesn't always update with every keystroke, depending on how fast I type. I've tried setting the list refresh rate to the lowest value (1 millisecond) but no go.
What I really want is an option in "auto_complete_for" that doesn't select that first item at all - the same way that Google Instant doesn't automatically select the first suggested search phrase - you have to arrow-down to select one.
Maybe I can do this via an HTML option that I'm missing?
Looking at the source, there doesn't appear to be an option for that, but I bet if you changed line 284 of controls.js to this.index = -1; it would do what you want.
Otherwise, it might be time to look for a different autocomplete widget.
If your requirements are too far away from the available plugin, then I guess there is no point in tinkering around. Its best to write your own JS code.
You might want to consider this: https://github.com/laktek/jQuery-Smart-Auto-Complete
or this : https://github.com/reinh/jquery-autocomplete
I'll add another alternative that works great with Rails 3:
http://github.com/crowdint/rails3-jquery-autocomplete
I recently implemented auto complete for more than a field for Rails 2.0.2.
The plugin I used is:- https://github.com/david-kerins/auto_complete . Not sure if it supports Rails 3.
I have also encountered issues on implementing the above scenario and have posted questions( Implementing auto complete for more than one field in Rails ; Implementing a OnClick kind of functionality and formatting wrt Rails Partial-Views ) on stackoverflow for the same, I have been lucky on getting things working for me based on my requirement.
Kindly refer to these questions, they might have relevance to your requirement.

ASP.NET MVC JavaScript Routing

Spoiler alert: this is NOW a question, so apologies to anyone that read it purely as a discursive topic :)
Anyway, I was doing a little research today re adding routes via javascript when i thought that a bit of google research wouldn't hurt. Basically, my aim was to do away with the following type of construct within my views:
and replace it with something akin to:
well, i lucked out a little today after finding this fantastic article (which isn't mine nor do i have any affiliation other than respect for the piece of work):
http://weblogs.asp.net/zowens/archive/2010/12/20/asp-net-mvc-javascript-routing.aspx
this really has been a missing link (or so i thought) for me when dealing with routes via javascript. However, the 2nd code example is misleading and actually won't produce what the example leads on. Can anyone suggest a fix for this and/or an alternative solution to allow this fluent convention of js routes within mvc views??
cheers...
[edit] - question edited 22:16 GMT to explore deeper options on this topic, plus changed title (removed OT portion).
So the question is why the second code example won't work as expected. Here's the answer, post currently doesn't return anything. This is an example of a certain developer not looking at the details of the code. When you use homePageUrl, the value will be undefined.
To actually get the home page URL, you'd do the following:
$.routeManager.action({controller:'Home', action:'Index'}).toUrl()
So, the moral of the story is that the code is a bit broken. The post action SHOULD return an object where you can put "toUrl()" right after the post is performed, like this:
$.routeManager.action({controller:'Home', action:'Index'})
.post(function(data){ alert(data); })
.toUrl();
I'll be fixing this bug in a bit!

How do I remove blank pages coming between two chapters in Appendix?

Is there a way to remove blank pages appearing between two chapters, in Appendix?
Your problem is that all chapters, whether they're in the appendix or not, default to starting on an odd-numbered page when you're in two-sided layout mode. A few possible solutions:
The simplest solution is to use the openany option to your document class, which makes chapters start on the next page, irrespective of whether it's an odd or even numbered page. This is supported in the standard book documentclass, eg \documentclass[openany]{book}. (memoir also supports using this as a declaration \openany which can be used in the middle of a document to change the behavior for subsequent pages.)
Another option is to try the \let\cleardoublepage\clearpage command before your appendices to avoid the behavior.
Or, if you don't care using a two-sided layout, using the option oneside to your documentclass (eg \documentclass[oneside]{book}) will switch to using a one-sided layout.
it is very easy:
add \documentclass[oneside]{book}
and youre fine ;)
I tried Noah's suggestion which leads to the best solution up to now.
Just insert \let\cleardoublepage\clearpage before all the parts with the blank pages
Especially when you use \documentclass[12pt,a4paper]{book}
frederic snyers's advice \documentclass[oneside]{book} is also very good and solves the problem, but if we just want to use the book.cls or article.cls, the one would make a big difference presenting your particles.
Hence, Big support to \let\cleardoublepage\clearpage for the people who will ask the same question in the future.
If you specify the option 'openany' in the \documentclass declaration each chapter in the book (I'm guessing you're using the book class as chapters open on the next page in reports and articles don't have chapters) will open on a new page, not necessarily the next odd-numbered page.
Of course, that's not quite what you want. I think you want to set openany for chapters in the appendix. 'fraid I don't know how to do that, I suspect that you need to roll up your sleeves and wrestle with TeX itself
In my case, I still wanted the open on odd pages option but this would produce a blank page with the chapter name in the header. I didn't want the header. And so to avoid this I used this at the end of the chapter:
\clearpage
\thispagestyle{plain}
This let's you keep the blank page on the last even page of the chapter but without the header.
I put the \let\cleardoublepage\clearpage before \makeindex. Else, your content page will display page number based on the page number before you clear the blank page.
One thing I discovered is that using the \include command will often insert and extra blank page. Riffing on the previous trick with the \let command, I inserted \let\include\input near the beginning of the document, and that got rid of most of the excessive blank pages.
You can also use \openany, \openright and \openleft commands:
\documentclass{memoir}
\begin{document}
\openany
\appendix
\openright
\appendixpage
This is the appendix.
\end{document}

Resources