2

For another issue I have, I want to make a MWEB, but it (LaTeX/TexStudio) fails to recognise the content of the \jobname.bib. I need help to figure out, what is the problem. Here is my code for it:

%CLASS and GEOMETRY and PDFs
\documentclass{report}
\usepackage[
    a4paper,
    bindingoffset=0.5cm, left=2.6cm,right=2.6cm,top=2.6cm,bottom=3cm, 
    footskip=.67cm]
    {geometry}
\usepackage{pdfpages}

%FONT and language
\usepackage{gensymb}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\usepackage{xeCJK}
\usepackage{ruby}
\renewcommand{\rubysize}{0.5} % default: 0.4
\renewcommand{\rubysep}{-0.3ex}
\setCJKmainfont{TakaoMincho}

%FLOATS - table and graphics
\usepackage{float}
\usepackage{array} 
\usepackage{longtable}
\setlength\tabcolsep{2mm}
\usepackage{enumitem}
\setlist{noitemsep}

% TOC og LOFT mellemrum
\usepackage{tocloft}
\setlength{\cftbeforesecskip}{2mm} 
\setlength{\cftbeforefigskip}{2mm} 
\setlength{\cftbeforetabskip}{2mm}
\setcounter{secnumdepth}{-3}

%GRAPHICS
\usepackage{graphicx}
\usepackage{tcolorbox}

%SHORT CUTS
\newcommand{\sub}[1]{\textsubscript{#1}}
\newcommand{\ul}[1]{\underline{#1}}
\newcommand{\arrl}{\textleftarrow}
\newcommand{\arrr}{\textrightarrow}
\newcommand{\arrlr}{\textleftrightarrow}

\newcommand{\prs}[1]{PrS\sub{#1}}
\newcommand{\pos}[1]{PoS\sub{#1}}
\newcommand{\obs}[1]{ObS\sub{#1}}
\newcommand{\ds}[1]{DS\sub{#1}}

%BIBLIOGRAPHY
\usepackage[
    backend=biber,
    sortlocale=danish,
    firstinits=true,
    style=authoryear-icomp,
    dashed=false,
    doi=false,
    isbn=false,
    url=true,]
    {biblatex}
\DeclareNameAlias{sortname}{family-given}
\renewbibmacro{in:}{%
    \ifboolexpr{%
        test {\ifentrytype{article}}%
        or
        test {\ifentrytype{inproceedings}}%
    }{}{\printtext{\bibstring{in}\intitlepunct}}%
    }
\makeatletter
\newcommand{\tempmaxup}[1]{\def\blx@maxcitenames{99}#1}
\makeatother
\DeclareCiteCommand{\fullcite}[\tempmaxup] %sets name order to last-first 
    {\usebibmacro{prenote}}
    {\usedriver
        {\DeclareNameAlias{sortname}{default}}
        {\thefield{entrytype}}}
    {\multicitedelim}
    {\usebibmacro{postnote}}

\addbibresource{\jobname.bib}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
    @incollection{winslow2018,
        title = {Theorizing {{Lesson Study}}: {{Two}} Related Frameworks and Two {{Danish}} Case-Studies},
        booktitle = {({{To}} Appear) {{Mathematics Lesson Study Around}} the {{World}}: {{Theoretical}} and Methodological Issues},
        series = {Springer book series of ICME},
        publisher = {{Springer}},
        date = {2018},
        author = {Winsløw, Carl and Bahn, Jacob and Rasmussen, Klaus},
        editor = {Quaresma, Marisa and Winsløw, Carl and Clivaz, Stéphane and da Ponte, João and Ní Shúilleabháin, Aoibhinn and Takahashi, Akihiko},

    }
    @article{bahn2017c,
        title = {Evolution of Teachers' Anticipation of Didactical Situations in the Course of Three Lesson Studies},
        journaltitle = {(article submitted for) Annales de didactique et de Sciences Cognitives},
        date = {2017},
        author = {Bahn, Jacob},

    }

    @inproceedings{bahn2017d,
        location = {{Nagoya, Japan}},
        title = {How Infrastructures of Lesson Studies Impact on Teachers' Learning},
        eventtitle = {(Paper Submitted to) {{WALS Conference}} 2017},
        year = {2017/11/24-26},
        author = {Bahn, Jacob},

    }
\end{filecontents}

%TITLE and AUTHOR and FRONTPAGE
\usepackage{authblk}
\usepackage{eso-pic}

%FONT 
\setmainfont{Liberation Serif}

\begin{document}
\chapter{List of all papers and abstracts produced }
\noindent \fullcite{bahn2017c}.
\bigskip \noindent \fullcite{bahn2017d}.
\bigskip \noindent \fullcite{winslow2018}.
\section{References} % REFERENCES  ---------------------------------
\sloppy
\printbibliography[heading=none]
\end{document}
Mensch
  • 65,388
jbahn
  • 443
  • 4
    I can report that your MWEB (except for fonts I don't have) works here. AFAICS, the only thing that might be giving you problems is that you are issuing \addbibresource before creating your file with filecontents, so on the first run, you would not find the file, but on the second one already would. – gusbrs Dec 29 '17 at 20:10
  • Thanks. After reading your comment I gave another shot. I had tried to refresh a number of times, but it seems that closing the file (and/or TexStudio) did the trick. Thanks for taking your time. – jbahn Dec 29 '17 at 20:28
  • 4
    As you are asking for assistance regarding a MWEB, I think it is worth adding that you have "W" and "B" already, but you might put some more effort in "M", in making it minimal. Try to refrain from packages and customizations which are not essential to the problem you are trying to ask about. This helps you understand the problem and also others here concentrate on the main issue, and increases the chances of you getting a good answer. – gusbrs Dec 29 '17 at 20:34
  • I fully acknowledge your comment, but how can a novice like me tell which packages can influence each other? – jbahn Dec 29 '17 at 20:43
  • 3
    I understand the situation. You can try to remove as many of them, one by one eventually, and see if things still illustrate your issue. For example, I suppose the question your are trying to build a MWEB is https://tex.stackexchange.com/q/408024/105447, how are the font selection packages relevant for that problem? So you may leave these things out, and so on. Do this as much as you can within your limits, but what is left must still illustrate your problem, that is, must still be "E". If you feel you cannot reduce it further, give it a go, and see how things turn out. – gusbrs Dec 29 '17 at 20:52
  • 1
    The filecontents* environment is best put at the beginning of the file (and the filecontents package is rarely needed). But you don't need it for a “real world” document: you'll have a .bib file somewhere to get the data from. – egreg Dec 29 '17 at 20:57

1 Answers1

2

Well, first of all make sure the files are encoded with utf8.

I reduced your code to be more minimal for an MWE and moved the usage of package filecontents at the beginning of the MWE.

I commented line

% giveninits=true, % <==================================================

to get rid of a warning for biblatex. Please see that you used firstinits, which is depreciated ...

With the following MWE

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@incollection{winslow2018,
  title = {Theorizing {{Lesson Study}}: {{Two}} Related Frameworks and Two {{Danish}} Case-Studies},
  booktitle = {({{To}} Appear) {{Mathematics Lesson Study Around}} the {{World}}: {{Theoretical}} and Methodological Issues},
  series = {Springer book series of ICME},
  publisher = {{Springer}},
  date = {2018},
  author = {Winsløw, Carl and Bahn, Jacob and Rasmussen, Klaus},
  editor = {Quaresma, Marisa and Winsløw, Carl and Clivaz, Stéphane and da Ponte, João and Ní Shúilleabháin, Aoibhinn and Takahashi, Akihiko},
}
@article{bahn2017c,
  title = {Evolution of Teachers' Anticipation of Didactical Situations in the Course of Three Lesson Studies},
  journaltitle = {(article submitted for) Annales de didactique et de Sciences Cognitives},
  date = {2017},
  author = {Bahn, Jacob},
}
@inproceedings{bahn2017d,
  location = {{Nagoya, Japan}},
  title = {How Infrastructures of Lesson Studies Impact on Teachers' Learning},
  eventtitle = {(Paper Submitted to) {{WALS Conference}} 2017},
  year = {2017/11/24-26},
  author = {Bahn, Jacob},
}
\end{filecontents}


\documentclass{report}
\usepackage[%
  a4paper,
  bindingoffset=0.5cm, left=2.6cm,right=2.6cm,top=2.6cm,bottom=3cm, 
  footskip=.67cm
]{geometry}

\usepackage[%
  backend=biber,
  sortlocale=danish,
% giveninits=true, % <==================================================
  style=authoryear-icomp,
  dashed=false,
  doi=false,
  isbn=false,
  url=true,
]{biblatex}
\DeclareNameAlias{sortname}{family-given}
\renewbibmacro{in:}{%
    \ifboolexpr{%
        test {\ifentrytype{article}}%
        or
        test {\ifentrytype{inproceedings}}%
    }{}{\printtext{\bibstring{in}\intitlepunct}}%
    }
\makeatletter
\newcommand{\tempmaxup}[1]{\def\blx@maxcitenames{99}#1}
\makeatother
\DeclareCiteCommand{\fullcite}[\tempmaxup] %sets name order to last-first 
    {\usebibmacro{prenote}}
    {\usedriver
        {\DeclareNameAlias{sortname}{default}}
        {\thefield{entrytype}}}
    {\multicitedelim}
    {\usebibmacro{postnote}}

\addbibresource{\jobname.bib}


\begin{document}
\chapter{List of all papers and abstracts produced }
\noindent \fullcite{bahn2017c}. 
\bigskip \noindent \fullcite{bahn2017d}.
\bigskip \noindent \fullcite{winslow2018}.
\section{References} % REFERENCES  ---------------------------------
\sloppy
\printbibliography[heading=none]
\end{document}

and the usual compiling chain xelatex, biber, xelatex, xelatex you get the following resulting pdf:

resulting pdf

Please see that package filecontents is usually only used to get an MWE containing bib file and TeX code. For your work simple use \addbibresource{mybibliography.bib} and use file mybibliography.bib to contain your bib entrys ...

Mensch
  • 65,388