how to get parentheses to change to brackets when citation is in parentheses?
When I cite something within parentheses, I need the parentheses to (automatically) change to brackets. For example,
Prayer : A Critical Anthology, ed. Mark Kiley (London: Routledge, 1997)
within parentheses needs to look like this:
(See Prayer from Alexander to Constantine: A Critical Anthology, ed. Mark Christopher Kiley [London: Routledge, 1997])
How do I do this?
Miryam
Prayer : A Critical Anthology, ed. Mark Kiley (London: Routledge, 1997)
within parentheses needs to look like this:
(See Prayer from Alexander to Constantine: A Critical Anthology, ed. Mark Christopher Kiley [London: Routledge, 1997])
How do I do this?
Miryam
http://www.zotero.org/support/dev/creating_citation_styles
I assume that the parens are either in the text (written with the word processor, outside of Zotero) or in the prefix/suffix fields to a Zotero cite. In the former case, this behavior would be extremely difficult to support, and almost certainly never will be. In the latter case, it would at least be possible in principle, in the medium to long term. It's not a quick or simple item, though, unfortunately.
It's a bit technical, but two steps would be needed to implement this. Currently, the parens (or brackets) around the publisher + year string in your example are hard-coded as literal text strings into the CSL style file that defines the formatting. There really isn't any way to alter those strings (apart from editing the citation after it has been generated by Zotero). However (this would be step one), there is movement toward introducing "flip-flop" formatting into CSL. This will make it possible, for example, for an (italicized) title inside another (italicized) title to appear in roman typeface. That is a very similar case to yours, at least at the foundation. However (this would be step two), applying "flip-flop" functionality to parens would require that, in the CSL files that define citation styles, they be cast not as simple text strings (as they are at present) but as formatting attributes (like "italic", "bold", or "superscript") -- and that would require changes to all of the (hundreds of) CSL styles used by Zotero. It's not impossible to do, but it would be a pretty sweeping change, and wouldn't be introduced lightly, I think.
If you're very keen to see this functionality implemented eventually, it would help the case for adoption to establish that it is a general need. Can you provide a pointer to a style manual or a set of guidelines to authors that requires it?
Miryam - If you are reasonably tech savvy it should probably be possible to do a couple of hours reading on regular expressions and macros (unless you are already familiar) in the documentation for either Word or OpenOffice and write or record a macro that replaces all the "nested" parens with brackets on a single mouse click after finishing a document. I can't guarantee this is possible, and I haven't thought through the logic, but it seems like something regular expressions should be able to manage.
Something very vaguely related has been done at this thread.
Edit: Things would become a bit more tricky if you had other "nested" parens in the document that needed to be treated differently to nested references.
I'll also look for a style guide that points to this, although I was a bit surprised to find that no-one else in the forums had this problem. It's considered basic in my field, and I assumed it was so for all of humanities.
Thanks again,
Miryam
http://word.mvps.org/FAQs/General/UsingWildcards.htm
"6.102 Parentheses within parentheses. Athough the use of parentheses within parentheses (usually for bibliographic purposes) is permitted in some publications -- especially in law -- Chicago prefers brackets within parentheses (see 6.106)."...
and p. 268:
[under section "Brackets, Square Brackets"]:
"6.106. Within Parentheses. Square brackets are used as parentheses within parentheses, usually for bibliographic purposes."...
Thanks for this reference, I see this should be bumped up the priority list. In-field markup with flip-flop functionality is on the todo list for the new Zotero CSL citation formatter. We will already need support for quotes, and mixing in parens should not be too much extra trouble. It will take awhile, but support in the formatter will arrive in due course.
I have to say, I'm really uncomfortable with adding this sort of feature; seems at first glance another case of marginal value and unnecessary complexity.
If, as I can only guess, the user has placed a citation within parentheses that are part of the document, then I consider that by definition out of scope for CSL.
If OTOH the parentheses are part of the style definition, then the brackets can and should be defined in the style; e.g. no changes needed.
In either case, from my reading, this isn't an issue for either CSL or a CSL processor.
Or am I just missing something (perfectly possible)?
1. Style guidance. "jhy001" has quoted the Chicago Manual of Style as a good source for flip-flopping between parentheses and square brackets when dealing with multiple levels of parentheses. This has been my personal practice and has been used by professional typesetters that I have worked with. I see it as similar to flip-flopping between single and double quotation marks.
2. Need. I regularly find that I have multiple levels of parentheses in footnotes. In particular, one professional typesetter I used on a book project preferred a style like this in explanatory footnotes: "This metaphor reflects what von Rad (Deuteronomy: A Commentary [Old Testament Library; London: SCM, 1966], 197) terms the 'tradition of the finding' more than the exodus..." While multiple levels of parentheses can be avoided, sometimes it creates more confusion than it saves.
3. Technical difficulty. I'm not sure what was decided here, whether trivial or impossible, but I implemented this feature in my own bibliographic system. I could share the code if anyone is interested, but it basically searched the MSWord text leading up to the particular citation field to see what sort of parenthesis/bracket came before the field, stopping at a hard line-break. Not overwhelmingly robust, but authors of malformed texts take their own chances!
If this issue has been resolved elsewhere, my apologies, but thought I'd chime in.
Thanks, as always, for a great project!
--Rob
Your example is new to us, I think. Is there a style guide that gives fuller treatment of the range of citation forms into which this example fits?
PS: Re CMS, the general rule that flip-flopping should be performed applies to the document text as a whole, as I understand it. The citation formatter only knows about its own local context, as far as the textual context goes. Passing a hint from the plugin about parens nesting level would indeed be technically difficult, and may not be worth the cost in maintenance time and reliability/stability that would likely come with it, at least at present.
I'm wondering if a simpler solution would be to add a toggle box, like the "Suppress Author" box, that turns parenthesis into brackets. Of course, this wouldn't be as nice as something automatic, but I assume it would be much easier to implement. And it would do the job.
(Probably a user option to toggle citation parens to braces is the best that can be done for this, though. If we try to do it automagically in the processor, it will sometimes work, sometimes not, depending on whether the enclosing parens are inside or outside of the citation controlled by the processor. That would probably cause more consternation than not.)
52. Assuming 3 m. between rows (Varro, De Agricultura 1.8.5) and between 1.0 and 1.83 m. between plants (Carey Walsh, The Fruit of the Vine: Viticulture in Ancient Israel and the Hebrew Bible [Winona Lake, Ind., Eisenbrauns, 2000], 110), one hectare would hold between 1650 and 3333.5 vines.
When I do this sort of thing, I enter the outer parentheses in Word, then change the inner parentheses generated by Zotero to brackets using the citation editor. That works, but it's tedious, and it "freezes" the citation: If the author of n. 52 above had used that method, then decided to cite Walsh's book in n. 12, the citation above would not have adjusted to "short title" format.
Does that clarify?
yeah - that's the issue that Frank describes as almost impossible to solve (and while a "flip parentheses" button is an option it would be a button for a tiny fraction of users, so I'm not sure that's a great idea).
If you entered all of this as one single Zotero citation, using the suffix and prefix fields, that is more likely to be feasible.
11. Carey Walsh, The Fruit of the Vine: Viticulture in Ancient Israel and the Hebrew Bible (Winona Lake, Ind., Eisenbrauns, 2000), 110.
Rob, could you share your "search" solution?
I paste in the full code below (in a Java-ized form of MSWord VBA). But the basic idea is that I do two searches that begin from the citation that I'm trying to format.
The first search begins from the left side of the citation and searches backward through the text, looking for either a paren or a paragraph break.
The second search looks from the right side of the citation and searches forward through the text, looking for the same things.
If the first search finds a '(' and the second search finds a ')', then it concludes the citation is within parentheses and then swaps all of the parenthesis and bracket characters within the citation.
In my experience, this has accomplished the automatic formatting that I need. Comments welcome.
Thanks for your interest!
--Rob
------------------------
Here's a macro that detects whether the selection lies within parentheses (and thus requires swapping of parens and brackets within the selection) and pops up a message box about what it found.
If it's helpful, I uploaded a Word document with the macro already in it that you can play with. It's available at: http://coffeewithbarretts.com/uploads/SearchParens.docm
(see Ackerman, 2009); (e.g., Ackerman, 2009)
but the citation populates as:
(see (Ackerman, 2009)
Which is incorrect. Any ideas on how this can be fixed?
Thanks!
Thanks, Ryan