0

i'm preparing a beamer-presentation-template for our institution. We want to use --citeproc and a specific csl style. So far, everything went fine. The file is processed without problems and inline-citations, as well as the bibliography is rendered as wanted.

Only one problem occured: Entries with an URL or an DOI are also rendered correctly, except for the line feed character. It should insert a linebreak before URLs/DOIs but instead is rendered verbatim.

The csl style I use is of the German Archaeological Institute (full source code).

The corresponding code part is the following:

  <macro name="url">
    <choose>
      <if match="any" variable="URL">
        <group display="block" prefix=",&amp;#10;"> <!-- Here the line feed character -->
          <text variable="URL" text-case="lowercase" prefix="&lt;" suffix="&gt;"/>
          <choose>
            <if match="none" is-uncertain-date="accessed">
              <date form="text" variable="accessed" prefix=" (" suffix=")"/>
            </if>
          </choose>
        </group>
      </if>
    </choose>
  </macro>
  <macro name="doi">
    <choose>
      <if match="any" variable="DOI">
        <group display="block" prefix=",&amp;#10;"> <!-- Here the line feed character -->
          <text value="doi: " font-variant="small-caps"/>
          <text variable="DOI"/>
        </group>
      </if>
    </choose>
  </macro>

But if i run my pandoc comman pandoc -t beamer -H header.tex --citeproc conference.md -o conference.pdf it renders as on the image, without inserting a linebreak and showing the character verbatim. There also appears an unnecessary space in front of the comma befor the DOI:

wrong rendered bib entry

My knowledge of xml is very rudimentary. Does somebody knows what the problem could be?

Edit:

The wanted output is simple a linebreak after the comma and before the DOI. That is how the bibliographic style of the institution describes it. That is how it should look like:

M. D. Wilkinson – M. Dumontier et al., The FAIR guiding principles for scientific data management and stewardship, Sci Data 3, 1, 2016,
doi: 10.1038/sdata.2016.18.

The xml code is the original downloaded from the Zotero Style Repository without changes from my site.

Best

lukeflo
  • 125
  • 5
  • Should be : prefix=",& " You are missing the 2nd ampersand. – jdweng May 26 '23 at 09:52
  • Already tried it before. Then it shows an unnecessary ampersand and doesn't break the line at all: **... Sci Data 3, 1, 2016 ,& doi: 10.1038/sdata.2016.18.** – lukeflo May 26 '23 at 10:32
  • Do you want the ampersand? That is what the first escape sequence does. Do you want to remove the ampersand? Maybe you need a CR (13) as well as the LF. The return character has to match the OS and tool you are using. – jdweng May 26 '23 at 11:00
  • No i don't. Just updated the question how it should look like. I use GNU/Linux OS and `pandoc`, so the code should be correct. – lukeflo May 26 '23 at 11:09
  • You do not want the ampersand so remove the first part. I'm see in your edits both a CR and LF in your expected output. The issue is not linux, but the tool you are using to view the text file. You have to add the type of return that the tool want to see. – jdweng May 26 '23 at 11:28
  • See following to customize your environment : https://www.zotero.org/support/preferences?force_isolation=true – jdweng May 26 '23 at 11:36
  • What do you mean by the "tool"? I'm working on a LaTeX Beamer slide using pandoc Markdown syntax. And when i'm processing it with pandoc the result witj the umnecessary ampersand shows off in the produced PDF. That's where the Screenshot is Form. – lukeflo May 29 '23 at 12:11
  • Letgex, Pandoc, PDF viewer are all tools. – jdweng May 29 '23 at 13:10
  • Then were on the same page ;) I guess the Problem is pandoc not processing the LF code properly from csl over LaTeX to PDF... – lukeflo May 29 '23 at 14:33
  • See following : https://cran.r-project.org/web/packages/kableExtra/vignettes/best_practice_for_newline_in_latex_table.pdf – jdweng May 29 '23 at 15:13
  • The problem is indeed the .tex file generated during the process converting the .md file into pdf. The ` ` is not inserted as `\newline` into the .tex file, but simply as *new line* which in LaTeX only adds a space – or does nothing, if a space already exists. The unnecessary space in front of the comma appears, because `pandoc` doesn't insert a `%` before the simple linebreak ahead of the DOI-variable. Thus, the simple linebreak is interpreteted as *space* by LaTeX... So it's a error of the pandoc-filter working at the backend interpreting the XML input to LaTeX. – lukeflo May 30 '23 at 20:22

0 Answers0