# Edit entry preview : How to eliminate the Publisher field in Articles but not in Book

**URL:** <https://discourse.jabref.org/t/edit-entry-preview-how-to-eliminate-the-publisher-field-in-articles-but-not-in-book/1836>\
**Category:** Help\
**Created:** [December 5, 2019, 8:25pm UTC](https://discourse.jabref.org/t/edit-entry-preview-how-to-eliminate-the-publisher-field-in-articles-but-not-in-book/1836 "2019-12-05T20:25:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkleine](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/bkleine/32/428_2.png) [@bkleine](https://discourse.jabref.org/u/bkleine)\
**Post date:** [December 5, 2019, 8:25pm UTC](https://discourse.jabref.org/t/edit-entry-preview-how-to-eliminate-the-publisher-field-in-articles-but-not-in-book/1836/1 "2019-12-05T20:25:06Z")

</div>

I wanted in the following example the publisher (in bold) removed:  
Heinrich, B.  
Beating the Heat in Obligate Insect Endotherms: The Environmental Problem and the Organismal Solutions  
_American Zoologist,_**Oxford University Press (OUP),****1989** _, 29_ , 1157-1168.

When I removed the field from the entry it worked. But that is not what I intend: I want a condition where the puiblisher is shown in books (and parts thereof) but not in articles.

BTW You have to restart jabref to let editing of the preview becoming effective. This restarting is not enforced why other changes which require restarting are shown to become effictive only after restarting.

Kind regards

---

<div class="post-metadata">

**Author:** ![Siedlerchr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/siedlerchr/32/216_2.png) [@Siedlerchr](https://discourse.jabref.org/u/Siedlerchr)\
**Post date:** [December 7, 2019, 2:01pm UTC](https://discourse.jabref.org/t/edit-entry-preview-how-to-eliminate-the-publisher-field-in-articles-but-not-in-book/1836/2 "2019-12-07T14:01:44Z")

</div>

Hi,

from what I see, it’s not possible to do model this kind of behavior in the entry preview directly.  
A workaround would be to define a custom field e.g. showPublisher with a value like true and then use a conditional output to check if both fields are present: [https://docs.jabref.org/import-export/export/customexports#conditional-output](https://docs.jabref.org/import-export/export/customexports#conditional-output)  
This should only print the publisher if both fields are filled

```
\begin{publisher&&showPublisher} <em>\format[HTMLChars]{\publisher}, </em>\end{publisher&&showPublisher}

```

Example entry:

```
@Book{Trapnell_2009,
  author = {Cole Trapnell and Lior Pachter and Steven L. Salzberg},
  title = {{TopHat}: discovering splice junctions with {RNA}-Seq},
  publihser = {Sample publisher},
 showPublisher = {true}
```

---

<div class="post-metadata">

**Author:** ![bkleine](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/bkleine/32/428_2.png) [@bkleine](https://discourse.jabref.org/u/bkleine)\
**Post date:** [December 8, 2019, 10:05am UTC](https://discourse.jabref.org/t/edit-entry-preview-how-to-eliminate-the-publisher-field-in-articles-but-not-in-book/1836/3 "2019-12-08T10:05:55Z")

</div>

I do not see how to create a custom field.

---

<div class="post-metadata">

**Author:** ![Siedlerchr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/siedlerchr/32/216_2.png) [@Siedlerchr](https://discourse.jabref.org/u/Siedlerchr)\
**Post date:** [December 8, 2019, 9:00pm UTC](https://discourse.jabref.org/t/edit-entry-preview-how-to-eliminate-the-publisher-field-in-articles-but-not-in-book/1836/4 "2019-12-08T21:00:57Z")

</div>

Unfortunately the dialog is not yet reimplemented, but you can simply add it in the bibtex source. JabRef will recognize this then

---

<div class="post-metadata">

**Author:** ![bkleine](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/bkleine/32/428_2.png) [@bkleine](https://discourse.jabref.org/u/bkleine)\
**Post date:** [December 10, 2019, 7:13pm UTC](https://discourse.jabref.org/t/edit-entry-preview-how-to-eliminate-the-publisher-field-in-articles-but-not-in-book/1836/5 "2019-12-10T19:13:29Z")

</div>

> Blockquote  
> **_\bibtextype_\begin{bibtexkey} (\bibtexkey)\end{bibtexkey}**  
>   
> \begin{author} \format[Authors(LastFirst,Initials,Semicolon,Amp),HTMLChars]{\author}  
> \end{author}  
> \begin{editor} \format[Authors(LastFirst,Initials,Semicolon,Amp),HTMLChars]{\editor} _(\format[IfPlural(Eds.,Ed.)]{\editor})_  
> \end{editor}  
> \begin{title} \format[HTMLChars]{\title} \end{title}  
>   
> \begin{chapter} Chap. \format[HTMLChars]{\chapter}  
> \end{chapter}  
> \begin{journal} _\format[HTMLChars]{\journal},_ \end{journal}  
> \begin{booktitle} _\format[HTMLChars]{\booktitle},_   
> \begin{publisher&&showpublisher} _\format[HTMLChars]{\publisher},_ \end{publisher&&showpublisher}  
> \begin{year} **\year** \end{year}\begin{volume}_, \volume_\end{volume}\begin{pages}, \format[FormatPagesForHTML]{\pages} \end{pages}  
>   
> \begin{doi} DOI: \format[HTMLChars]{\doi}  
> \end{doi}  
> \begin{abstract}  
>   
> **Abstract:** \format[HTMLChars]{\abstract} \end{abstract}  
> \begin{comment}  
>   
> **Comment:** \format[HTMLChars]{\comment} \end{comment}

I edited the Preview as shown above.  
The bibtex source

> Blockquote  
> @Article{DMC18,  
> author = {Dancau, Tina and Mason, Peter G. and Cappuccino, Naomi},  
> year = {2018},  
> title = {Elusively overwintering: a review of diamondback moth (Lepidoptera: Plutellidae) cold tolerance and overwintering strategy},  
> abstract = {There is no consensus …},  
> doi = {10.4039/tce.2018.2},  
> number = {2},  
> pages = {156–173},  
> volume = {150},  
> groups = {Lepidoptera, winterhardiness},  
> journal = {The Canadian Entomologist},  
> owner = {bk},  
> publisher = {Cambridge University Press},  
> showpublisher = {false},  
> timestamp = {2019.12.03},  
> }

still shows as

**_Article_ (DMC18)**  
Dancau, T.; Mason, P. G. & Cappuccino, N.  
Elusively overwintering: a review of diamondback moth (Lepidoptera: Plutellidae) cold tolerance and overwintering strategy  
_The Canadian Entomologist,__Cambridge University Press,_ **2018** _, 150_ , 156–173  
DOI: 10.4039/tce.2018.2

What is still wrong? Is it “false” or another keyword?  
BTW After saving the edited preferences I restarted Jabref since that seems to be necessary.

---

<div class="post-metadata">

**Author:** ![Siedlerchr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/siedlerchr/32/216_2.png) [@Siedlerchr](https://discourse.jabref.org/u/Siedlerchr)\
**Post date:** [December 11, 2019, 8:15am UTC](https://discourse.jabref.org/t/edit-entry-preview-how-to-eliminate-the-publisher-field-in-articles-but-not-in-book/1836/6 "2019-12-11T08:15:56Z")

</div>

> What is still wrong? Is it “false” or another keyword?

The condition only checks if the field is there and not empty. It doesn’t matter what’s written inside, there is no special keyword. The “true” was just a sample from me. You could also enter “asdf”  
So if you don’t want a publisher you can simply omit the field. You only need to add it for those entries where you want to show the publisher.

---

<div class="post-metadata">

**Author:** ![bkleine](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/bkleine/32/428_2.png) [@bkleine](https://discourse.jabref.org/u/bkleine)\
**Post date:** [December 29, 2019, 7:37pm UTC](https://discourse.jabref.org/t/edit-entry-preview-how-to-eliminate-the-publisher-field-in-articles-but-not-in-book/1836/7 "2019-12-29T19:37:12Z")

</div>

@Siedlerchr:  
I have edited the Preview as follows:

> **_\bibtextype_\begin{bibtexkey} (\bibtexkey)\end{bibtexkey}**  
>   
> \begin{author} \format[Authors(LastFirst,Initials,Semicolon,Amp),HTMLChars]{\author}  
> \end{author}  
> \begin{editor} \format[Authors(LastFirst,Initials,Semicolon,Amp),HTMLChars]{\editor} _(\format[IfPlural(Eds.,Ed.)]{\editor})_  
> \end{editor}  
> \begin{title} \format[HTMLChars]{\title} \end{title}  
>   
> \begin{chapter} Chap. \format[HTMLChars]{\chapter}  
> \end{chapter}  
> \begin{journal} _\format[HTMLChars]{\journal},_ \end{journal}  
> \begin{booktitle} _\format[HTMLChars]{\booktitle},_   
> \begin{publisher&&showpublisher} _\format[HTMLChars]{\publisher},_ \end{publisher&&showpublisher}  
> \begin{year} **\year** \end{year}\begin{volume}_, \volume_\end{volume}\begin{pages}, \format[FormatPagesForHTML]{\pages} \end{pages}  
>   
> \begin{doi} DOI: \format[HTMLChars]{\doi}  
> \end{doi}  
> \begin{abstract}  
>   
> **Abstract:** \format[HTMLChars]{\abstract} \end{abstract}  
> \begin{comment}  
>   
> **Comment:** \format[HTMLChars]{\comment} \end{comment}

The source is

> @InCollection{Hei93a,  
> author = {Bernd Heinrich},  
> booktitle = {The Hot-Blooded Insects},  
> year = {1993},  
> title = {Night-Flying Moths},  
> doi = {10.1007/978-3-662-10340-1\_2},  
> pages = {17–75},  
> publisher = {Springer Berlin Heidelberg},  
> abstract = {AS anyone who has ever passed a summer … an insect.},  
> groups = {winterhardiness},  
> owner = {bk},  
> showpublisher = {true},  
> timestamp = {2019.12.03},  
> }

The resulting preview is now:  
**_InCollection_ (Hei93a)**  
Heinrich, B.  
Night-Flying Moths  
_Springer Berlin Heidelberg,_ **1993** , 17-75  
DOI: 10.1007/978-3-662-10340-1\_2

The publisher is shown, but not the booktitle. May I ask why?

Happy New Year!

---

<div class="post-metadata">

**Author:** ![mlep](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/mlep/32/387_2.png) [@mlep](https://discourse.jabref.org/u/mlep)\
**Post date:** [December 29, 2019, 9:15pm UTC](https://discourse.jabref.org/t/edit-entry-preview-how-to-eliminate-the-publisher-field-in-articles-but-not-in-book/1836/8 "2019-12-29T21:15:38Z")

</div>

Maybe because _\end{booktitle}_ is missing?

---

<div class="post-metadata">

**Author:** ![bkleine](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/bkleine/32/428_2.png) [@bkleine](https://discourse.jabref.org/u/bkleine)\
**Post date:** [December 30, 2019, 1:33pm UTC](https://discourse.jabref.org/t/edit-entry-preview-how-to-eliminate-the-publisher-field-in-articles-but-not-in-book/1836/9 "2019-12-30T13:33:04Z")

</div>

Thank you very much, @mlep, that was the reason it did not work.  
Now the preview is  
**_InCollection_ (Hei93a)**  
Heinrich, B.  
Night-Flying Moths  
_The Hot-Blooded Insects,_  
_Springer Berlin Heidelberg,_ **1993** , 17-75  
DOI: 10.1007/978-3-662-10340-1\_2 plus the abstract, as it should be.
