Skip to content

Commit

Permalink
update manual on local packages
Browse files Browse the repository at this point in the history
  • Loading branch information
sunderme committed Nov 23, 2024
1 parent c7eb058 commit 92d604d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions utilities/manual/build/html/CHANGELOG.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ <h2>TeXstudio 4.8.5<a class="headerlink" href="#texstudio-4-8-5" title="Link to
<li><p>fix crash when %Tex root document was not found</p></li>
<li><p>class are used for completion in documentclass</p></li>
<li><p>class names are not used anymore for package name completion</p></li>
<li><p>local packages can provide local cwl files ,<a class="reference external" href="https://texstudio-org.github.io/advanced.html#local-packages">see manual</a></p></li>
</ul>
</section>
<section id="texstudio-4-8-4">
Expand Down
15 changes: 15 additions & 0 deletions utilities/manual/build/html/advanced.html
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,20 @@ <h2>Advanced header usage<a class="headerlink" href="#advanced-header-usage" tit
</dd>
</dl>
</section>
<section id="local-packages">
<h2>Local packages<a class="headerlink" href="#local-packages" title="Link to this heading">#</a></h2>
<p>Many users define personal commands, settings, colors, etc in a personal file which is included into the latex document via <code class="docutils literal notranslate"><span class="pre">\include</span></code> or <code class="docutils literal notranslate"><span class="pre">\input</span></code>.
TeXstudio can read the files and take up the defined commands for completion but is does not have any understanding of the arguments like if they are labels, texts or math elements.
The syntactital definition is given to TeXstudio via <a class="reference internal" href="background.html#description-of-the-cwl-format"><span class="std std-ref">cwl files</span></a>.
TeXstudio searches for local cwl files for local packages. To notify TeXstudio that a package is local, the package name has to be given as a relative path, e.g. <code class="docutils literal notranslate"><span class="pre">\usepackage{./myPackage}</span></code>.
TeXstudio looks for <code class="docutils literal notranslate"><span class="pre">./myPackage.cwl</span></code> and loads it if present.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The local package filename needs to be <code class="docutils literal notranslate"><span class="pre">myPackage.sty</span></code>.
Otherwise all normal commands are valid.</p>
<p>If a cwl file is changed, the updated version is only loaded into TeXstudio after a restart of TeXstudio.</p>
</div>
</section>
<section id="personal-macros">
<h2>Personal macros<a class="headerlink" href="#personal-macros" title="Link to this heading">#</a></h2>
<p>TeXstudio allows you to insert your own macros. These macros are defined
Expand Down Expand Up @@ -1220,6 +1234,7 @@ <h2>The “Convert to Html” command<a class="headerlink" href="#the-convert-to
<li><a class="reference internal" href="#bibliography">Bibliography</a></li>
<li><a class="reference internal" href="#git-svn-support">GIT/SVN Support</a></li>
<li><a class="reference internal" href="#advanced-header-usage">Advanced header usage</a></li>
<li><a class="reference internal" href="#local-packages">Local packages</a></li>
<li><a class="reference internal" href="#personal-macros">Personal macros</a><ul>
<li><a class="reference internal" href="#text-macros">Text macros</a></li>
<li><a class="reference internal" href="#environment-macros">Environment macros</a></li>
Expand Down
1 change: 1 addition & 0 deletions utilities/manual/build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ <h1>Welcome to TeXstudio Manual’s documentation!<a class="headerlink" href="#w
<li class="toctree-l2"><a class="reference internal" href="advanced.html#bibliography">Bibliography</a></li>
<li class="toctree-l2"><a class="reference internal" href="advanced.html#git-svn-support">GIT/SVN Support</a></li>
<li class="toctree-l2"><a class="reference internal" href="advanced.html#advanced-header-usage">Advanced header usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="advanced.html#local-packages">Local packages</a></li>
<li class="toctree-l2"><a class="reference internal" href="advanced.html#personal-macros">Personal macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="advanced.html#save-load-profile">Save/Load Profile</a></li>
<li class="toctree-l2"><a class="reference internal" href="advanced.html#the-convert-to-html-command">The “Convert to Html” command</a></li>
Expand Down
2 changes: 1 addition & 1 deletion utilities/manual/build/html/searchindex.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions utilities/manual/source/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- fix crash when %Tex root document was not found
- class are used for completion in documentclass
- class names are not used anymore for package name completion
- local packages can provide local cwl files ,[see manual](https://texstudio-org.github.io/advanced.html#local-packages)

## TeXstudio 4.8.4

Expand Down
16 changes: 16 additions & 0 deletions utilities/manual/source/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,22 @@ the following magic comments:
This is equivalent to
`% !TeX TXS-program:bibliography = txs:///biber`

## Local packages

Many users define personal commands, settings, colors, etc in a personal file which is included into the latex document via `\include` or `\input`.
TeXstudio can read the files and take up the defined commands for completion but is does not have any understanding of the arguments like if they are labels, texts or math elements.
The syntactital definition is given to TeXstudio via [cwl files](background.md#description-of-the-cwl-format).
TeXstudio searches for local cwl files for local packages. To notify TeXstudio that a package is local, the package name has to be given as a relative path, e.g. `\usepackage{./myPackage}`.
TeXstudio looks for `./myPackage.cwl` and loads it if present.

```{note}
The local package filename needs to be `myPackage.sty`.
Otherwise all normal commands are valid.
If a cwl file is changed, the updated version is only loaded into TeXstudio after a restart of TeXstudio.
```


## Personal macros

TeXstudio allows you to insert your own macros. These macros are defined
Expand Down

0 comments on commit 92d604d

Please sign in to comment.