Suppressing a symbol when a parameter is empty

Sep 3, 2011 at 7:07 PM

Hi there,

Thanks for bibword and the guide, has made word's bibliog feature useable for me - otherwise it would have been completely useless.

I have a minor issue.  I have tweaked one of the existing citation styles to get as close as I can to the pubmed/medline citation style, which looks a bit like this:

Andersen LO, Husted H, Otte KS, et al. High volume infiltration analgesia in total knee arthroplasty: a randomized double-blind placebo-controlled trial Acta Anaesthesiol Scand 2008;52:1331–5.

However just occasionally I have a citation which I have no volume or issue number for, just year and page number.  With my current xsl file it would give a result like this:

Andersen LO, Husted H, Otte KS, et al. High volume infiltration analgesia in total knee arthroplasty: a randomized double-blind placebo-controlled trial Acta Anaesthesiol Scand 2008;:1331–5.

Which obviously looks weird and needs manually editing before submission.  I have tried putting the colon all over the place in my xsl file, including inside  a pair  of braces which surround the vol and issue field in the hope it would then be hidden if these parameters had no value, but it keeps appearing. 

How should my format field look?  It currently is as follows:

<format>{%Author:1%.}{ %Title|ShortTitle% }{&lt;i&gt;%JournalName%&lt;/i&gt;} { {  %Month:s% {%Day%, }}{ %Year%;}}{{%Volume%}{(%Issue%)}}{:%Pages::%}.{ %Comments%.}</format>

Many thanks!

Jon



Coordinator
Sep 4, 2011 at 8:28 AM

Use conditional formatting with groupings as shown here for volume, issue, and pages.

So basically you only want the colon if pages are available and volume/issue? You could use something like:

  • When pages, volume, and issue are available: {%Volume%(%Issue%):%Pages::%}
  • When pages and volume are available but issue is not: {%Volume%:%Pages::%}
  • When volume and issue are available but not pages: {%Volume%(%Issue%)}
  • When just pages is available: {%Pages::%}

If you would put those for strings after eachother, you would get the formatting you want:

{%Volume%(%Issue%):%Pages::%}{%Volume%:%Pages::%}{%Volume%(%Issue%)}{%Pages::%}

 

 

 

Sep 5, 2011 at 3:27 PM

 

Thanks Yves, that works perfectly.