I was recently asked to contribute in a latex project which is already relatively large. The main project is in one folder lets call it "project". There ist also another folder called "style", which includes some .cls files and some images.
I already found out, how to download submodules recursively via git and now I have a project structure like this:
parent_folder
|
+- project
|
+- project.tex
+- style
|
+- stylesheet.cls
In project, there is a file project.tex which uses stylesheet.cls like this:
\documentclass[a4paper,11pt]{stylesheet}
When I try to compile project.tex I get an error:
Missing input file: 'stylesheet.cls'
I tried using \documentclass[a4paper,11pt]{style/stylesheet}, but the same error occures.
Has anybody an idea how to fix this, whithout changing the whole project structure?
Is there something like a latex-makefile? I'm quite new to latex, sorry if I'm asking stupid questions...
Related
I am currently reworking a set of slides to teach students at an university, of course the files are written in LaTeX. Too increase modularity, I want to include files relative to a base file, which will be imported by other files. So suppose I have the following structure:
|-- document.tex
`-- module
`-- a
|-- base.tex
`-- listings
`-- test.java
Now I want to import test.java inside base.java by referring to the relative path listings/test.java. Is there a way to then import base.tex into document.tex? Or can I at least extend the relative path listings/test.java to the new parent document document.tex, e.g. module/a/listings/test.java?
I am displaying listings by using minted which is unfortunately not affected by the import package.
I have figured it out.
To effectively recreate the secret principle of OOP you have to use the package currfile which has the \currfiledir command, which is like pwd in bash.
It only works in via \input or \include loaded files, not by using import or anything else. It also does not work with the fragile option activated.
In this manner, you may create a module, which is relative to it's base file, not the one your document starts in.
I want to generate one jar per sub-package using an ant build script on a project looking like this :
basepackage
|__ subpackage1
| |_ Class11
| |_ Class12
|
|__ subackage2
|_ Class21
|_ Class22
...
So I have a target makejar that should build the jar from a given fileset and a target makeAll responsible for making all the filesets and calling the makejar target in these. The problem is that I don't understand how to build one fileset for each subpackage and how to transfer these filesets to the makejar target.
Is it the good way to do this or should I use an other tool ?
I'd prefer don't using user inputs and parse the directory structure automately.
I've seen a lot of answers talking about antcontrib but I don't know if it will solve my problems.
I am working on a project that contains multiples files with same file name. I am using git to maintain local versions of my changes. After staging the modified files, I notice that files with same name are appearing with status "R" implying replacing one file with another of same name but in different directory tree. How to make sure both are committed without being replaced by one another. I could not find relevant help material regarding this in any of git documentation.
Since this is a proprietary code, I am pasting only sample directory structure:
M <Proj_Root_Folder>/<dirA>/<dirAA>/file1.h
M <Proj_Root_Folder>/<dirA>/<dirAA>/file2.h
M <Proj_Root_Folder>/<dirA>/<dirAA>/file3.h
R <Proj_Root_Folder>/<dirB>/<dirBA>/file4.h -> <Proj_Root_Folder>/<dirA>/<dirAA>/file4.h
In git "R" means "rename". Git thinks that ///file4.h is a file that has been moved from where it was originally. Most likely because the file looks simmer.
My Setting
I'm creating a base mvc project for a number of other mvc projects where all the error handling and basic user validation is located so that I don't have to duplicate the boilerplate code in all of the other projects. With the help of my favorite dependency injection container (go, go SimpleInjector) I was able to put my ErrorController within the base project and have it being used by the other projects. The same goes for the custom user validation attribute I created.
I'm using ASP.NET MVC4 targetting .NET4.0 with the following layout:
MvcBase
+- Controllers
+- ErrorController.cs // Common error controller
+- Filters
+- AuthenticateUserAttribute.cs
+- Application.cs // Base class for all MVC applications
+- Web.config // Base configuration (*)
MvcProject1
+- Views
+- Error
+- Index.cshtml
+- Web.config
MvcProject2
+- Views
+- Error
+- Index.cshtml
+- Web.config
The Question
I know that the Web.configs inherit from parent directories but is there a way to explicitly state the base config file such a configuration should inherit from? In my case it would be great to be able to reference the (*) Web.config, which is located at the same hierarchical level as the projects containing the other Web.configs. My use case is that I want to store some information in the basic Web.config that is the same in all other projects (e.g. configuration for error emails) that I don't want to duplicate in the other projects to keep the overall architecture as DRY as possible.
Any help would be appreciated ...
You can sort of achieve what you're looking for via the configSource attribute. You add that attribute to a section of your web.config with a path to another config file that holds those settings, e.g.:
Web.config
<connectionStrings configSource="bin/ConnectionStrings.config"></connectionStrings>
ConnectionStrings.config
<connectionStrings>
<add ... />
</connectionsStrings>
Then, you can use the `Add... > Existing File" option to add these configs to other projects. After you select the config file you want to add, click the arrow next to the "Add" button and choose "Add Link" instead. This will cause Visual Studio to simply create a link to the existing file instead of copying it into the project. Then, any changes will propogate automatically to any project that has linked to the file.
I have some compression components (like KAZip, JVCL, zLib) and exactly know how to use them to compress files, but i want to compress multiple folders into one single archive and keep folders structure after extract, how can i do it?
in all those components i just can give a list of files to compress, i can not give struct of folders to extract, there is no way (or i couldn't find) to tell every file must be extracted where:
i have a file named myText.txt in folder FOLDER_A and have a file with same name myText.txt in folder FOLDER_B:
|
|__________ FOLDER_A
| |________ myText.txt
|
|__________ FOLDER_B
| |________ myText.txt
|
i can give a list of files to compress: myList(myText.txt, myText.txt) but i cant give the structure for uncompress files, what is best way to found which file belongs to which folder?
The zip format just does not have folders. Well, it kinda does, but they are kind of empty placeholders, only inserted if you need metadata storage like user access rights. But other than those rather rare advanced things - there is no need for folders at all. What is really done - and what you can observe opening zip file in the notepad and scrolling to the end - is that each file has its path in it, starting with "archive root". In your exanple the zip file should have two entries (two files):
FOLDER_A/myText.txt
FOLDER_B/myText.txt
Note, that the separators used are true slashes, common to UNIX world, not back-slashes used in DOS/Windows world. Some libraries would fix back-slashes it for you, some would not - just do your tests.
Now, let's assume that that tree is contained in D:\TEMP\Project - just for example.
D:\TEMP\Project\FOLDER_A\myText.txt
D:\TEMP\Project\FOLDER_B\myText.txt
There are two more questions (other than path separators): are there more folders within D:\TEMP\Project\ that should be ignored, rather than zipped (like maybe D:\TEMP\Project\FOLDER_C\*.* ? and does your zip-library have direct API to pack the folders wit hall its internal subfolder and files or should you do it file by file ?
Those three questions you should ask yourself and check while choosing the library. The code drafts would be somewhat different.
Now let's start drafting for the libraries themselves:
The default variant is just using Delphi itself.
Enumerate the files in the folder: http://docwiki.embarcadero.com/CodeExamples/XE3/en/DirectoriesAndFilesEnumeraion_(Delphi)
If that enumeration results in absolute paths then strip the common D:\TEMP\Project from the beginning: something like If AnsiStartsText('D:\TEMP\Project\', filename) then Delete(filename, 1, Length('D:\TEMP\Project\'));. You should get paths relative to chosen containing place. Especially if you do not compress the whole path and live some FOLDER_C out of archive.
Maybe you should also call StringReplace to change '\' into '/' on filenames
then you can zip them using http://docwiki.embarcadero.com/Libraries/XE2/en/System.Zip.TZipFile.Add - take care to specify correct relative ArchiveFileName like aforementioned FOLDER_A/myText.txt
You can use ZipMaster library. It is very VCL-bound and may cause troubles using threads or DLLs. But for simple applications it just works. http://www.delphizip.org/
Last version page have links to "setup" package which had both sources, help and demos. Among demos there is an full-featured archive browser, capable of storing folders. So, you just can read the code directly from it. http://www.delphizip.org/191/v191.html
You talked about JVCL, that means you already have Jedi CodeLib installed. And JCL comes with a proper class and function, that judging by name can directly do what you want it too: function TJclSevenzipCompressArchive.AddDirectory(const PackedName: WideString; const DirName: string = ''; RecurseIntoDir: Boolean = False; AddFilesInDir: Boolean = False): Integer;
Actually all those libraries are rather similar on basic level, when i made XLSX export i just made a uniform zipping API, that is used with no difference what an actual zipping engine is installed. But it works with in-memory TStream rather than on-disk files, so would not help you directly. But i just learned than apart of few quirks (like instant vs postponed zipping) on ground level all those libs works the same.