This is a follow-up question to
- Place preamble packages in a different tex file,
- Methods for autocompletion in TexStudio don't work.
The Problem
Over the years, I have collected quite the number of useful packages and commands. Until now, I had them saved with TeXstudio as a template so that I could start a new file from it. This is similar to copy-pasting everything whenever you make a new file which raises some maintainability and duplication issues.
What I tried
I tried to separate the preamble into a test.sty file, placed it in a new root (../tex/latex/test.sty), added the root in MiKTeX Settings (Admin) and pressed "Refresh FNDB" to include it.
When I compile with TeXstudio, it locates test.sty and everything is fine and dandy. However, the autocompleter neither recognizes the packages nor their commands.
From what I gathered here, if MiKTeX is set up, TeXstudio compares test.sty, a custom, local package, with the list of packages on the cloud from MiKTeX using mpm.exe --list
. This may be the issue as running that command and saving its output in a temporary .txt file, my test.sty does not appear!
Am I attempting to do something currently impossible, or am I just being stupid?
Here is a MWE of my attempt, and a picture of the autocompleter.
myTex.tex
\documentclass{article}
\usepackage{test}
%\usepackage{mathtools}
\begin{document}
% the flalign* env. from mathtools in test.sty is not recognized before compiling.
\begin{flalign*}
2x+3 &= 5 \\[1mm]
x &= \dfrac{5-3}{2}
\end{flalign*}
\end{document}
test.sty
\ProvidesPackage{test}[2017/10/14 The Amazing Squirrel's collection of packages]
\RequirePackage[utf8]{inputenc}
\RequirePackage{mathtools}
\RequirePackage{amssymb}
\RequirePackage{logicproof} %Fitch-Style Predicate Logic Proof in the style of Huth & Ryan
\endinput
Technical info.
I have TeXstudio 2.12.6 and MiKTeX 2.9 running on a Win. 7 Pro. Lenovo laptop.
#include:mathtools
,#include:amssymb
etc.? – Troy Oct 14 '17 at 15:07