macOS - How can I install a new MacTex (LaTeX) package (a folder containing .sty or .bib files) and use it? - latex

I have been struggling to install a new package and use it for TexShop.
What I have tried is searching for the folder path: /texmf/tex/latex
However, even when enabling to see hidden folders, such a folder does not exist on my system. I therefore went ahead and created the three folder manually. I then placed my folders containing the .sty or .bib files inside. This does not seem to be working because I still receive the error that LaTeX could not find the .sty file.
Another folder that I can find within my Library is not the texmf folder but a TeX folder (see screenshot below)
Do I maybe have to place the packages inside one of these folders instead?

Related

there is no bin folder, when I create a Dart project in Intellij IDEA

When I create a Dart project in Intellij IDEA, I can't find a bin folder? that's why huh?
Previously I chose "Simple console Application - a simple command-line application" from Generate sample content: ..Please help, friends.
I also couldn't find the bin folder when i created dart project in vscode.But then, i realized that when you go to the actual folder location, the bin folder exist.Hence i opened the dart file inside it simply by right clicking and opening with VsCode.

Automate the process of including generated proto files into an Xcode project

Our iOS app currently is using Google protobuffer gRPC as our API layer to communicate between App and backend. And so we have these .proto files in our backend directory which will be converting to .grpc.swift and .pb.swift files by gRPC-Swift-Plugins and then consumed by the App.
This works okay, but the process of converting is very tedious, and we would like to automate the whole process.
Below is how we're doing it:
Delete previously copied directory, and copy all .proto files from backend (.proto files are maintained by backend devs) to App directory named "Protos" via a shell script
We already set up Build rules and include .proto files in Compile Sources. Following the steps from an answer here on SO
Screenshot of the current setup in Xcode Build Rules:
Whenever we build the project, .pb.swift and .grpc.swift are generated and putting into a directory named "generated" under the "Protos" folder.
Here are the problems:
If the backend added a new .proto files into the source directory, my script will only copy the files into the Protos directory but not included news files in the Compile Sources list.
Similar to the first problem, we need to manually set up Compile Sources in Xcode and that means if a new dev joins our team, he/she also needs to do the same setup again.
We sometimes need to refer to the .grpc.swift and .ph.swift files while coding. But If we add these files into Xcode and build the project again, Xcode will complain that these generated files are there like (Sorry, we're working on a private repo, so the project name and file names are replaced):
Multiple commands produce '${user_path}/${proto_name}.pb.o':
Target '${my_project_name}' (project '${my_project_name}') has compile command for Swift source files
Target '${my_project_name}' (project '${my_project_name}') has compile command for Swift source files
Any answers or comments and suggestions are greatly appreciated!
It's interesting I didn't have those problems with Swift if I use the $DERIVED_FILE_DIR
protoc "$INPUT_FILE_NAME" --swift_out="$DERIVED_FILE_DIR" --proto_path="Your/proto/path"
I don't use the plugin because I've got the plugin installed in my /usr/local/bin
But I have exactly those problems when we use the output for cpp files.

How to put eng.cube.lm in xcode 5.0.2

when i add tessdata folder in bundle then generates this error :
/Users/cepl/Desktop/NumberOCR/NumberOCR/tessdata/eng.cube.lm:8: premature EOF
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lex failed with exit code 1
Make sure you select the "Create folder references" option, when adding the tessdata folder to your project.
From the documentation:
NOTE: This library currently requires the tessdata folder to be linked
as a referenced folder instead of a symbolic group. If Tesseract can't
find a language file in your own project, it's probably because you
created the tessdata folder as a symbolic group instead of a
referenced folder. It should look like this if you did it correctly:
Note how the tessdata folder has a blue icon, indicating it was
imported as a referenced folder instead of a symbolic group.
Trashing the current folder and adding it again as a folder reference should solve the problem.

Where are the opencv2 include files?

I'm struggling to find the include files that should be in a directory names "opencv2"! I've downloaded OpenCV-2.4.0.tar.bz2 from here and extracted the files and ran cmake, which seemed to build the library successfully.
The problem is that under the "include" directory for "opencv2" there seem to be tons of header files missing. The only header file there at the moment is "opencv.hpp", which includes a whole set of other files which aren't there. Does anyone have any idea where I can get these files from?
Thanks!
The header files of the modules are in their own directories. E.g., you can find calib3d.hpp in /modules/calib3d/include/opencv2/calib3d. The Makefile created by CMake knows these addresses, hence when you make install the header files are all copied into /usr/local/include/opencv2.
In case you were using cmake-gui and visual studio on Windows to make opencv (I had 3.4.0), don't forget to build this project:
This will generate all required files in a single folder, so you can easily connect header files:

How can I get my project's folder structure to be mirrored in Finder?

I have an Xcode (4.2) project with a bunch of class files, and I have them neatly organized into folders. These folder aren't "real", however; in Finder, my classes are all just dumped into the one "Classes" folder. Is there any way to get the virtual folder structure I see in Xcode to be reflected in the real Finder folder structure? Or do I have to do this manually?
https://github.com/venmo/synx
A command-line tool that reorganizes your Xcode project folder to match your Xcode groups
Installation
$ gem install synx
Usage
Basic
:warning: WARNING: Make sure that your project is backed up through source control before doing anything :warning:
Execute the command on your project to have it reorganize the files on the file system:
$ synx path/to/my/project.xcodeproj
It may have confused CocoaPods. If you use them, execute this command:
$ pod install
You're good to go!
Advanced
Synx supports the following options:
--prune, -p remove source files and image resources that are not referenced by the the Xcode project
--no-color removes all color from the output
--no-default-exclusions doesn't use the default exclusions of /Libraries, /Frameworks, and /Products
--quiet, -q silence all output
--exclusion, -e EXCLUSION ignore an Xcode group while syncing
For example, OCMock could have been organized using this command:
$ synx -p -e "/OCMock/Core Mocks" -e /OCMockTests Source/OCMock.xcodeproj/
if they had wanted not to sync the /OCMock/Core Mocks and /OCMockTests groups, and also remove (-p) any image/source files found by synx that weren't referenced by any groups in Xcode.
I often want to do the same thing, but as far as I know there is no automatic way to do it, you have to do it manually unfortunately...
There is no 'automatic' way to make the XCode file pane structure automagically conform to the finder folder structure, although I agree there should be a setting for this.
I follow these steps when making a project:
Create the project.
Delete by reference any files I want to move.
Open finder and move the files, then drag them back into XCode.
When adding new files:
Create a folder in finder if needed.
Drag the folder into XCode.
Right-click and make a new file on the group that represents the folder just dragged in.
If you're using git, it's a little more work:
Commit your project before making a folder or file deletions/moves.
Delete them by reference from XCode.
Move them in finder.
Using terminal, type git mv sourcePath destPath to move files or git rm sourcePath to delete them.
Then drag back into XCode.
You can see more about my frustration with learning git here:
How can I move files & folders using git in Xcode 4?

Resources