jkitchin / org-ref

org-mode modules for citations, cross-references, bibliographies in org-mode and useful bibtex tools to go with it.
GNU General Public License v3.0
1.36k stars 243 forks source link

Getting brackets for cite: and citep: #1068

Open AdelleBernal opened 1 year ago

AdelleBernal commented 1 year ago

cite:&Smith2008 and citep:&Smith2008 get both exported to C-c C-e r o as a bracketed citation. How to get a non-bracketed citation?

Another issue: When I try to change the cite type from the hydra pressing 't', I get: Wrong type argument: wholenump, -1 In any case, when I manually change the type to other type like citeyear, it works fine.

jkitchin commented 1 year ago

I think what you want is citet for textual citation. citep means a parenthetical (ie bracketed). cite is a generic cite that defaults to bracketed usually. It is a LaTeX command.

For the error, I need a specific example of what you are doing to cause it. I tried it and it works fine for me, so I guess it is some edge case related to a cite position or something.

AdelleBernal commented 1 year ago

Thanks, I'll investigate what might be causing this and get back.

AtomicNess123 commented 1 year ago

I have a similar issue: When I try to use something other than cite:&, export fails.

For example, if i use in my file citep:&Zhang2010, I get this in the error output:

! Undefined control sequence.
l.32 \citep
           {Zhang2010}
? 

However, if i use cite:, I don't get any errors, but I am stuck with not being able to use any other ways to cite.

AdelleBernal commented 1 year ago

I am still having this problem. I can report something else: When I export using C-c C-e r l(latex via org-ref) it renders fine! But not when using C-c C-e l o.

jkitchin commented 1 year ago

\citep is not a native latex command. you probably have to have \usepackage{natbib} or something to get it to work in latex. The reason it works for Cc-C-e rl is that the command is replaced by CSL.

AdelleBernal commented 1 year ago

Thanks. Could this maybe be mentioned (for Latex-non-users like me!) in the manual?

In any case, I don't know how to install Latex packages (export complains that i don't have that package - tried to learn how to install but hard to find easy instructions on for non programmers to understand).

So for the time being, I am stuck using the C-c- c-e p.