Use arbitrary LaTeX itemize in Org Mode - emacs

If I want to export a itemized list from Org to LaTeX, is there a way to set arbitrary itemization? The usual Org plain list, i.e. - item will result in an \begin{itemize} environment, but I would like to set arbitrary itemization. For example, is there any kind of Org list markup that will output this kind of LaTeX list environment?
\begin{itemize}
\item[2013]
This item happened in 2013
\item[2012]
This item happened in 2012
\end{itemize}
Edit:
The problem is that Org is recognising the years as inactive timestamps or footnote references and this is screwing up the LaTeX export. Solution below.

I can't tell whether it's what you're looking for, but
- 2013 :: This happened in 2013
- 2012 :: This happened in 2012
will produce
\begin{description}
\item[2013] This happened in 2013
\item[2012] This happened in 2012
\end{description}
I haven't tried, but according to this WikiBook it seems as though there will be no dot trailing the year.

Following fniessen's suggestion below I found the solution to produce an itemize environment without having the years turn into inactive timestamps or footnote references. The key is to insert or surround the year with spaces, which will be ignored by the TeX conversion.
- [ 2013 ] This item happened in 2013
- [ 2012 ] This item happened in 2012
If there is a more official way to do this I'd like to here it.
The other answers provide great solutions for creating both enumerate and description environments, but it was specifically itemize I was after.

Use something such as:
1. [#2013] This item happened in 2013
2. [#2012] This item happened in 2012

The solution appointed by the org-mode manual is ::, so:
Important actors in this film are:
- Elijah Wood :: He plays Frodo
- Sean Astin :: He plays Sam, Frodo's friend.
by the way, [ text ] didn't work for me.

If as me you don't like the decription style with "- ::" syntax (that produces weird latex export) a workaround is simply to use
- ##latex:[2013]## This item happened in 2013
- ##latex:[2012]## This item happened in 2012
and, more generally,
- ##latex:[yourcustomitem]## blah blah

Related

emacs semantic windows inconsistent

At work we have quite a large code base and I am really, really trying to get Semantic to just work. Yesterday it seemed to have parsed the file I was working on as well as the non-system includes: Great. I could create an instance of a class which is defined in another include file and after construction I could browse through all the functions etc with a key binded to semantic-ia-complete-symbol-meu.
Firstly, I am using:
Emacs 24.3.1 with
CEDET bzr version: rev_8678.tar.gz and, all of this is running on
Windows 7 (unfortunately).
MinGW and MSYS installed
Microsoft Visual Studio 10
In my .emacs (related to CEDET stuff):
;; MODE: CEDET
(load-file "~/.emacs.d/cedet/cedet-devel-load.el") ;; This is the latest dev' version ~~ 26th Sept 2014
;; Add further minor-modes to be enabled by semantic-mode.
;; See doc-string of `semantic-default-submodes' for other things
;; you can use here.
(add-to-list 'semantic-default-submodes 'global-semantic-idle-summary-mode t)
(add-to-list 'semantic-default-submodes 'global-semantic-idle-completions-mode t)
(add-to-list 'semantic-default-submodes 'global-cedet-m3-minor-mode t)
(semantic-mode 1)
(global-ede-mode 1)
;(global-semantic-decoration-mode)
;(setq semanticdb-default-save-directory "~/.emacs.d/.semanticdb/")
;(add-to-list 'magic-fallback-mode-alist '("^// " . c++-mode))
;(add-to-list 'magic-fallback-mode-alist '("^#include" . c++-mode))
;(semantic-add-system-include "c:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/include" 'c++-mode)
;(semantic-add-system-include "/usr/include/c++/3.4.4")
Therefore, my default semantic database location is ~/.emacs.d/semanticdb
I come in today and find that when I load the same file up I keep on getting three errors (both of which I have searched for but nothing matches my issue):
Parsing main.cpp (LL)...
Idle Parse Error: "#<buffer main.cpp> - End of buffer"
And
Save Error: nil: c:/Users/[MY_USER]/.emacs.d/semanticdb/!drive_[STUFF_HERE]!semantic.cache
And
Idle Service Error semantic-idle-summary-idle-function: "#<buffer main.cpp> - End of buffer"
As I said, this was working yesterday, so why not today? (PS: Btw, this only happens with main.cpp - when I search for definitions of functions using xcscope and open the definition up the file is parsed correctly with CEDET and local includes are parsed and I can symbol-lookup, it seems to just be main.cpp for some reason.)
PS: I have just read a similar problem that someone has with MATLAB. The solution was to either create the directory stated in the matlab-include path, or change the list in the path. But, this does not make sense to my situation because this was working yesterday and I have not touched CEDET since yesterday at all.
semantic-c-dependency-system-include-path is a variable defined in `c.el'.
Its value is ("/usr/include")
semantic-dependency-include-path is a variable defined in `dep.el'.
Its value is nil
Local in buffer main.cpp; global value is the same.
Both of these are the same as yesterday.
PS: Also, when semantic-mode is enabled I am no longer to use (imenu-add-to-menubar) - I only get the option to rescan everything. However, when I do not have semantic-mode enabled then this works fine. I did not know that semantic messed with imenu unless you told it to?
It is all a little annoying because I really like the potential of CEDET/Semantic and appreciate the work that has been put into it. Emacs is already powerful, but with a fully working CEDET its power tends to over 9000!
I believe the developers involved with CEDET should run tests on a Windows machine so that any bugs can be found with Windows issues. I know the OS is horrible but some developers are forced to use it in the workplace. I have never found an issue with CEDET so far on my Linux machines because things are in standard places! But, this is about Windows.
PS: If it is any help a very simple project works fine with this set up and CEDET. I have, in a completely different place:
emacs_test_semantic> ls -l
total 103
-rw-r--r-- 1 [USER] Administrators 43 Oct 2 17:28 Makefile
-rw-r--r-- 1 [USER] Administrators 158 Oct 8 12:04 main.cpp
-rw-r--r-- 1 [USER] Administrators 247 Oct 1 12:51 myClass.cpp
-rw-r--r-- 1 [USER] Administrators 159 Oct 1 12:51 myClass.hpp
-rwxr-xr-x 1 [USER] Administrators 99862 Oct 2 17:28 output.exe
And, in the main:
#include <list>
#include "myClass.hpp"
using namespace std;
int main() {
MC CLASS( 3, 5 );
list<MC> myList;
myList.
return 0;
}
So, I am able to complete symbols of the MC class, however, not the STL list. BUT, this is topic is not about being able to complete STL functions/templates because there are many questions on this.
This small project, even though with (global-semantic-decoration-mode) enabled and a RED over #include <vector> does not give the same three errors described above. Also, imenu works!
===
In summary, I am somewhat confused as to the inconsistency, here. The fact that in the large code base things worked yesterday, but now I have these three errors that I didn't get before!
===
PS: Just after I wrote this I load up that same file and this time global-decoration-mode shows that the local includes are actually now understood! Even though I have changed nothing. So now it seems to work again - but it is this inconsistency which is not understandable.
Well, it works for one branch and not for another. Interestingly, in the branch that gives me the three errors (indicated above) I have a DB file (and imenu does not work, and nor is decoration-mode visable:
-rw-r--r-- 1 [USER] Administrators 449 Oct 8 13:42 !drive_d![SOME_STUFF]!semantic.cache
Compared to the one that works which is (where, global-decoration-mode is visible and imenu works):
-rw-r--r-- 1 [USER] Administrators 555184 Oct 8 13:51 !drive_d![SOME_STUFF]!semantic.cache
You can see the big difference in size. And these two branches only differ in a completely different location in the code base. So, just some extra information.
===
As a user of CEDET/semantic (albeit, not a very good one) I would really like to know a way to manually FORCE the parsing of all files in a given list that is wrote to the DB rather than relying on semantic to do it. This has been requested before and people have created some hack lisp, but with CEDET ever changing from 1.1 the code does not work.
===
PS: Latest edit: Out of no where the errors have gone away, the only thing I can remember doing is saving the buffer. You can tell when the errors have gone away because the global-decaration's start to show - i.e. the underlines and highlighted include files. Is this because I saved the buffer? I am unsure. I cannot recall if I was saving it before. Also, the file save of the DB has increased and the last modification of the DB file was a few minutes ago from this post:
What was before:
-rw-r--r-- 1 [USER] Administrators 449 Oct 8 13:42 !drive_d![SOME_STUFF]!semantic.cache
Is now:
-rw-r--r-- 1 [USER] Administrators 158327 Oct 8 15:38 !drive_d![SOME_STUFF]!semantic.cache
Having just messed about at work a lot of the glitches that I originally found are starting to make sense and are appearing to be just my lack of understanding of the product. There is no problem parsing system includes (such as STL) or local includes anymore on Windows and this is mainly down the the brilliant feature of: global-semantic-decoration-mode. It makes it clear if a source file has been parsed or not, etc etc. So now, I use this in my .emacs.
The problem of inconsistency (which I have found is not inconsistency, see below) - I have found - arises when the parser comes across a line of code like this:
#if defined(X)
//hundreds of lines of code
#endif /* define(X) */
I can half understand it. Unless X has been defined then don't bother parsing. But, I still want CEDET/Semantic to work on all of the code. I still might want to use completion if I am working in a function that exists in an area non-existent because of something undefined.
I say, naively, that semantic/cedet should parse code regardless of whether something is defined or not. However, perhaps this was a premeditated feature?
Thanks.

Run-time error '509': this command is not available- WordBasic for Word 2013

I have a macro code which has following line of Wordbasic call:
WordBasic.FormatFont Font:='Courier New', Points:=8
I have run the code, it gives runtime error 509 in this command in word 2013.
Whereas I have written individual macro in word 2013 for wordbasic.Formatfont, it ran absolutely fine. I don't know what is the issue behind it.
I don't find any rectifying way in google. Is there any other way to resolve wordBasic call in Microsoft Word 2013?
WordBasic returns an Automation object (Word.Basic) that includes methods available in Word version 6.0. It is obsolete. Use instead Visual Basic objects and methods.
WordBasic:
WordBasic.FormatFont Font:='Courier New', Points:=8
in VBA is
With Selection.Font
.Name = "Courier New"
.Size = 8
End With
This answer is not exactly what are you asking for, rather a workaround. But IMHO it is the best way - I suggest not to use WordBasic, use VBA. See Converting WordBasic Macros to Visual Basic at msdn.com.

org-mode recurring events on different days and at different times

I have a class that meets regularly on Mondays/Wednesdays from 12:00-12:50 and on Thursdays from 16:00-16:50. I'd like to keep all the notes together, because it's all for the same class, but I don't know how I would set up this recurring event.
There is an easy-enough way to define arbitrary date ranges, but nothing I can see for time ranges that would also show up correctly in the agenda. They're also in different rooms, so if it's possible I'd like to add something denoting the room number. If it were just dates (at the same time as well), I would go ahead and just
(and (org-class 2013 1 21 2013 5 9 1) (org-class 2013 1 21 2013 5 9 3))
and it would be fine. Is there a(n org-mode) function to describe times? Is there a way to add notes (like the room number)? I'm not quite aware of how this whole section of org-mode works (although my guess would be that if the sexp evaluates to non-nil, then the event is active).
So, in summary, I'd like a way to be able to assign arbitrary collections of date-time-range objects to org-mode events, ideally with the notes I was talking about.
EDIT
As a secondary (but obviously related) question, what's the sexp way of specifying time?
You can use multiple time-stamps within the same entry.
For example:
C-c.mon 12:00-12:50RET will produce <2013-01-28 Mon 12:00-12:50>. You can then edit it to add a repeater +1w. The final time-stamp looks like <2013-01-28 Mon 12:00-12:50 +1w>.
I don't know how you can manage the class room though.
Wouldn't creating subtrees for the two rooms and then a third subtree for the notes themselves?
For example (see Org-FAQ for details on putting time in the same line. I think adding the time within the <> will add it to the time, but not entirely sure, otherwise add it afterwards and it should still include it within the information.
* Math Class
:PROPERTIES:
:CATEGORY: Math Class
:END:
** Room #1
<%%(and (org-class 2013 1 21 2013 5 9 1) (org-class 2013 1 21 2013 5 9 3)) 12:00-- 12:50>
** Room #2
<%%(org-class 2013 1 21 2013 5 9 4) 16:00--16:50>
** Notes

Possible bug in Org Mode export of item with `(*)`

I'm using org mode to make a list that I would like exported to PDF. some items in the list have the combination (*) and this seems to throw org mode off.
This MWE
#+TITLE: Bug?
#+OPTIONS: *:nil toc:nil author:nil
- hello (*) I would like to have two items
- may (*) I please?
results in
even though the #+OPTIONS: *:nil part was obviously read and understood (the part between the stars is not bold as it would be had that line been missing.
Is this is bug? Am I doing something wrong? Is there a workaround?
The *:nil option is not the problem here.
The problem comes from the fact that the * in (*) actually do emphasize the text (it is in bold font in the buffer). Given that, the exporter does its best, which is not very good.
The bug here is to allow multiline fontification over distinct list items -- we'll try to fix it, but that's a rather complex issue.
On top of the workaround above, have a look at `org-emphasis-regexp-components', thru which you can prevent parentheses as post/pre-characters in a fontified string.
I found a work-around for this behavior (bug?): add an empty line between the two offending lines:
#+TITLE: Workaround!
#+OPTIONS: toc:nil author:nil
- hello (*) I would like to have two items
- may (*) I please?
gives:
Thus allowing the string (*) to exist in an item (or rather in two consecutive items)
I'm not certain if this is a bug or not. I was able to reproduce it, however if I escaped the * the export occurred as expected.
#+TITLE: Bug?
#+OPTIONS: toc:nil author:nil
- hello (\*) I would like to have two items
- may (\*) I please?
Latex created:
\begin{itemize}
\item hello (\*) I would like to have two items
\item may (\*) I please?
\end{itemize}
I will however post the question to the mailing to confirm whether this is the expected behaviour or not in this situation. The thread for this question is HERE.
EDIT I edited to correct the LaTeX that was exported (needed to add this as 1 char is not enough, feel free to remove this line.)

Emacs Org-mode: How to include properties in diary anniversaries?

I am trying to have the "Birthday" and "Name" properties of an Org-mode entry added to the agenda automatically:
* John
:PROPERTIES:
:Name: John
:Birthday: (5 4 1900)
:END:
I found a way to add an entry at the correct anniversary date in the agenda by inserting the following line right after the properties:
%%(apply 'diary-anniversary (read (org-entry-get nil "Birthday"))) John
However, using this code, I still have to enter the name manually. Is there a way to have the value of the "Name" property added to the diary text automatically for all entries?
EDIT 1: the example did not work before, now added parantheses around the value of the birthday property
Maybe https://julien.danjou.info/projects/emacs-packages#org-contacts is the solution to your problem. org-contacts is a address book for org-mode.
It is probably better to ask this at the Org mailing list, they are very active, and Carsten Dominik (the creator of org-mode) usually answers posts on this list almost immediately (BTW, this is the main list email.
Perhaps you a taking a path which requires you to write some lisp to get what you want. The org-mode manual gives an example of something similar, but I'm guessing you wanted a simpler format, when it describes the calendar/agenda integration http://www.gnu.org/software/emacs/manual/html_node/org/Weekly_002fdaily-agenda.html
* Birthdays and similar stuff
#+CATEGORY: Holiday
%%(org-calendar-holiday) ; special function for holiday names
#+CATEGORY: Ann
%%(diary-anniversary 14 5 1956) Arthur Dent is %d years old
%%(diary-anniversary 2 10 1869) Mahatma Gandhi would be %d years old
I would think you have other options if you want a custom setup: either a new type of export or dynamic blocks might be used. This may highlight the different use-case of agenda over the diary. The agenda seems more geared towards day to day tasks.