# \[solved\] Store my new csl file local and use in texstudio

**URL:** <https://discourse.citationstyles.org/t/solved-store-my-new-csl-file-local-and-use-in-texstudio/1798>\
**Category:** Uncategorized\
**Created:** [February 14, 2023, 3:33pm UTC](https://discourse.citationstyles.org/t/solved-store-my-new-csl-file-local-and-use-in-texstudio/1798 "2023-02-14T15:33:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwakkie](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/bwakkie/32/337_2.png) [@bwakkie](https://discourse.citationstyles.org/u/bwakkie)\
**Post date:** [February 14, 2023, 3:33pm UTC](https://discourse.citationstyles.org/t/solved-store-my-new-csl-file-local-and-use-in-texstudio/1798/1 "2023-02-14T15:33:42Z")

</div>

Hi,

I have difficulties using my own csl file created on [Visual CSL Editor](https://editor.citationstyles.org/visualEditor/)

I am using TeXstudio. Where do I place my .csl file so that I can do:

\usepackage{citation-style-language}  
\cslsetup{style = myfancystyle}

texlive-full is installed om Manjaro linux.

Thanks

---

<div class="post-metadata">

**Author:** ![zepinglee](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/zepinglee/32/278_2.png) [@zepinglee](https://discourse.citationstyles.org/u/zepinglee)\
**Post date:** [February 14, 2023, 5:07pm UTC](https://discourse.citationstyles.org/t/solved-store-my-new-csl-file-local-and-use-in-texstudio/1798/2 "2023-02-14T17:07:43Z")

</div>

The `.csl` file is expected to be in the same directory as the main `.tex` document.

The `citation-style-language` package in Linux distribution may be outdated. I suggest installing the latest version either with `tlmgr` or from [https://github.com/zepinglee/citeproc-lua](https://github.com/zepinglee/citeproc-lua).

---

<div class="post-metadata">

**Author:** ![bwakkie](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/bwakkie/32/337_2.png) [@bwakkie](https://discourse.citationstyles.org/u/bwakkie)\
**Post date:** [February 15, 2023, 7:51am UTC](https://discourse.citationstyles.org/t/solved-store-my-new-csl-file-local-and-use-in-texstudio/1798/3 "2023-02-15T07:51:12Z")

</div>

That is weird it is in the same directory.

I tried updating it via tlmgr but it has the latest available:

> package: citation-style-language  
> category: Package  
> shortdesc: Bibliography formatting with Citation Style Language  
> longdesc: The Citation Style Language (CSL) is an XML-based language that defines the formats of citations and bibliography. There are currently thousands of styles in CSL including the most widely used APA, Chicago, Vancouver, etc. The citation-style-language package is aimed to provide another reference formatting method for LaTeX that utilizes the CSL styles. It contains a citation processor implemented in pure Lua (citeproc-lua) which reads bibliographic metadata and performs sorting and formatting on both citations and bibliography according to the selected CSL style. A LaTeX package (citation-style-language.sty) is provided to communicate with the processor.  
> installed: Yes  
> revision: 65357  
> sizes: doc: 273k, run: 2093k, bin: 5k  
> relocatable: No  
> cat-version: 0.3.0  
> cat-license: mit cc-by-sa-3  
> cat-topics: biblio use-lua  
> cat-contact-repository: [GitHub - zepinglee/citeproc-lua: A Lua implementation of the Citation Style Language (CSL)](https://github.com/zepinglee/citeproc-lua)  
> collection: collection-bibtexextra

---

<div class="post-metadata">

**Author:** ![bwakkie](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/bwakkie/32/337_2.png) [@bwakkie](https://discourse.citationstyles.org/u/bwakkie)\
**Post date:** [February 15, 2023, 8:25am UTC](https://discourse.citationstyles.org/t/solved-store-my-new-csl-file-local-and-use-in-texstudio/1798/4 "2023-02-15T08:25:08Z")

</div>

Ok got a bit further but got a citeproc error:

Module citeproc Error: CSL parsing error: XMLDecl not at start of document [char=1]. \begin{document}

This is my tex file:

> \documentclass[english]{article}  
> \usepackage{url}
> 
> \usepackage{citation-style-language}  
> \cslsetup{style = myfancystyle}  
> \addbibresource{myfancystyle-bbt-csl.json}  
> \setcounter{secnumdepth}{0}  
> \begin{document}
> 
> … some content
> 
> %\nocite{\*}  
> \printbibliography  
> \end{document}

---

<div class="post-metadata">

**Author:** ![bwakkie](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/bwakkie/32/337_2.png) [@bwakkie](https://discourse.citationstyles.org/u/bwakkie)\
**Post date:** [February 15, 2023, 8:35am UTC](https://discourse.citationstyles.org/t/solved-store-my-new-csl-file-local-and-use-in-texstudio/1798/5 "2023-02-15T08:35:24Z")

</div>

Ok solved the last error myself too.

The csl I downloaded via the [Visual CSL Editor](https://editor.citationstyles.org/visualEditor/) creates a  
“XML 1.0 document, Unicode text, UTF-8 (with BOM) text” file.

The following command solved it for me:

sed 1s/\xef\xbb\xbf//’ \< orig.csl \> new.csl

---

<div class="post-metadata">

**Author:** ![zepinglee](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/zepinglee/32/278_2.png) [@zepinglee](https://discourse.citationstyles.org/u/zepinglee)\
**Post date:** [February 15, 2023, 1:19pm UTC](https://discourse.citationstyles.org/t/solved-store-my-new-csl-file-local-and-use-in-texstudio/1798/6 "2023-02-15T13:19:09Z")

</div>

> [@bwakkie](#):
>
> Ok solved the last error myself too.

That’s Great!

> [@bwakkie](#):
>
> The csl I downloaded via the [Visual CSL Editor](https://editor.citationstyles.org/visualEditor/) creates a  
> “XML 1.0 document, Unicode text, UTF-8 (with BOM) text” file.
> 
> The following command solved it for me:
> 
> sed 1s/\xef\xbb\xbf//’ \< orig.csl \> new.csl

Thanks for your feedback and I’ll fix this. The native file reader in Lua doesn’t handle UTF-8 BOM.
