Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I also abbreviate proceedings titles (but not titles of other books)? #34

Open
logological opened this issue Sep 17, 2022 · 8 comments

Comments

@logological
Copy link

I'm using Biblatex and I'd like to apply ISO 4–style abbreviations to the titles of conference proceedings (i.e., the booktitle field of @inproceedings entries and the title field of @proceedings entries). What's the right way of doing this with jabbrv? Using \DeclareFieldInputHandler{booktitle}{\def\NewValue{\JournalTitle{#1}}} works great except that it also affects titles of @inbook entries, which I don't want. Using \DeclareFieldFormat[inproceedings]{booktitle}{\JournalTitle{#1}} instead results in a Missing \endcsname inserted. compilation error. What am I missing here?

Further details (including a minimal example) are also available in a TeX Stack Exchange question.

@compholio
Copy link
Owner

It looks like you came up with a solution that I didn't notice until I posted my own. It's possible that there are better solutions, but hopefully the solution you came up with is doing the trick for you.

@logological
Copy link
Author

Thanks for your contribution! My own solution has so far held up. Yours looks like it could also work, though I haven't tested it extensively.

@compholio
Copy link
Owner

The new solution from moewe is probably the best/simplest one for this:

\DeclareFieldInputHandler{booktitle}{%
  \iffieldequalstr{entrytype}{inproceedings}
    {\def\NewValue{\JournalTitle{#1}}}
    {\def\NewValue{#1}}}

Can you give that a try and let me know how it works out for you?

@logological
Copy link
Author

I've now tested more thoroughly. It seems to perform identically to my own solution, and is much simpler. I've marked that answer as accepted.

@cruyffturn
Copy link

@compholio Thank you for creating this package! I would like to abbreviate proceedings titles as well but using bibtex. Is there a similar solution?

@logological
Copy link
Author

@cruyffturn I think this would be a fairly simple change to whatever .bst file you are using. You just need to look for every place the style outputs a proceedings title, and change it so that the title gets wrapped in \JournalTitle{…}. In some cases, the same function is used to output book titles and proceedings titles, so if you don't want book titles to be abbreviated as well, you need to make a separate copy of that function, modify it so that it applies the wrapping, and make sure it gets called instead of the original in the right places.

Here's an untested patch showing the changes to jabbrv_plain.bst:

--- /home/psy/git/jabbrv/jabbrv_plain.bst       2021-03-08 16:53:30.133299361 -0600
+++ /tmp/jabbrv_plain.bst       2024-11-28 17:16:05.646327841 -0600
@@ -283,6 +283,10 @@
 { title emphasize
 }
 
+FUNCTION {format.ptitle}
+{ "\JournalTitle{" title * "}" * emphasize
+}
+
 FUNCTION {tie.or.space.connect}
 { duplicate$ text.length$ #3 <
     { "~" }
@@ -423,6 +427,17 @@
   if$
 }
 
+FUNCTION {format.in.ed.procbooktitle}
+{ booktitle empty$
+    { "" }
+    { editor empty$
+       { "In \JournalTitle{" booktitle * "}" * emphasize * }
+       { "In " format.editors * ", \JournalTitle{" * booktitle * "}" * emphasize * }
+      if$
+    }
+  if$
+}
+
 FUNCTION {empty.misc.check}
 { author empty$ title empty$ howpublished empty$
   month empty$ year empty$ note empty$
@@ -673,7 +688,7 @@
   format.title "title" output.check
   new.block
   crossref missing$
-    { format.in.ed.booktitle "booktitle" output.check
+    { format.in.ed.procbooktitle "booktitle" output.check
       format.bvolume output
       format.number.series output
       format.pages output
@@ -787,7 +802,7 @@
     { format.editors output.nonnull }
   if$
   new.block
-  format.btitle "title" output.check
+  format.ptitle "title" output.check
   format.bvolume output
   format.number.series output
   address empty$

@cruyffturn
Copy link

cruyffturn commented Nov 29, 2024

@logological Thank you for your lightning response, it worked! For people using "jabbrv_IEEEtran.bst", here is my work around:

I have made two changes:
-called the function jabbrv where inproceedings booktitle is edited,
-moved the definition of jabbrv earlier part of the code:

FUNCTION {format.in.booktitle}
{ booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$
{ this.to.prev.status
this.status.std
select.language
jabbrv
intype missing$
{ emphasize
bbl.in " " *
}
{ intype " " * }
if$
swap$ *
cap.status.std
}
if$
}

@compholio
Copy link
Owner

@cruyffturn, do you think that it would be useful to others to update the version included with jabbrv with this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants