0

I have read through and tried question 1 and question 2, however I still can't get to work. The autocomplete does not complete, TexStudio can't find the citation. I am using subfile if that matters.

When I include only \addbibresource in the main file, instead of my custom style, doesn't work, if however I include the biblatex package too it works fine.

Compiling results (pdflatex, biber, pdflatex) are fine.

Citation missing

\documentclass[11pt,a4paper]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage[stretch=10]{microtype}
%***********************Document*******************

\usepackage{mystyle}

\begin{document} \cite{Johnson2014}

\chapter{something} \end{document}

And the style:

% Declare that this style file requires at least LaTeX version 2e.
\NeedsTeXFormat{LaTeX2e}[1994/06/01]

% Provide the name of your page, the date it was last updated, and a comment about what it's used for. typography, graphics, maths, sectioning \ProvidesPackage{mystyle}[2022/07/19 custom LaTeX style]

% Now paste your code from the preamble here %

\setfloatadjustment{figure}{\centering} \setfloatadjustment{table}{\centering} \g@addto@macro@floatboxreset\centering %esse tbm centraliza

\usepackage[backend=biber,style=abnt-numeric,language=english,alldates=long,sorting=none,hyperref,bibencoding=utf8,citecounter=true,]{biblatex} % \makeatletter @ifpackageloaded{biblatex}{\addbibresource{new_refs.bib}}{\bibliography{literatur}} \makeatother

%\DeclareFieldFormat*{citetitle}{#1} \appto{\bibsetup}{\sloppy} %

% % Finally, we'll use \endinput to indicate that LaTeX can stop reading this file. LaTeX will ignore anything after this line. \endinput

G. Bay
  • 2,047

1 Answers1

2

Autogenerated cwls only check for instances of \RequirePackage in .sty files, not \usepackage. So change \usepackage to \RequirePackage, delete the autogenerated mystyle.cwl (see file path in section 4.14.5 in the manual), and relaunch TeXstudio. The new autogenerated cwl will contain the line #include:biblatex.

For citation autocompletion, you must also have \addbibresource in either the main document or in another .tex file that is \input. It won't be recognized in a .sty file loaded with \usepackage or \RequirePackage.

mbert
  • 4,171