Install LaTeX di vscode(firebase) - playmakermz/warkop-website GitHub Wiki

Install Latex

image

  1. Install "Latex workspace" di vsCode
  2. Install Latex compiler dengan cara ini:
sudo apt update
sudo apt install texlive-full
latex --version

untuk firebase

Cara untuk fire base disini cukup berbeda.

  1. atur file pada .idx/dev.nix seperti ini:
# To learn more about how to use Nix to configure your environment
# see: https://firebase.google.com/docs/studio/customize-workspace
{ pkgs, ... }: {
  # Which nixpkgs channel to use.
  channel = "stable-24.05"; # or "unstable"

  # Use https://search.nixos.org/packages to find packages
  packages = [
    # pkgs.go
    # pkgs.python311
    # pkgs.python311Packages.pip
    # pkgs.nodejs_20
    # pkgs.nodePackages.nodemon
    pkgs.nano
    pkgs.sile 
    pkgs.tetex
    pkgs.texliveFull
    #pkgs.texlive-latex-base
    #pkgs.texlive-fonts-recommended
    #pkgs.texlive-fonts-extra
    #pkgs.texlive-latex-extra
  ];

  # Sets environment variables in the workspace
  env = {};
  idx = {
    # Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
    extensions = [
      # "vscodevim.vim"
    ];

    # Enable previews
    previews = {
      enable = true;
      previews = {
        # web = {
        #   # Example: run "npm run dev" with PORT set to IDX's defined port for previews,
        #   # and show it in IDX's web preview panel
        #   command = ["npm" "run" "dev"];
        #   manager = "web";
        #   env = {
        #     # Environment variables to set for your server
        #     PORT = "$PORT";
        #   };
        # };
      };
    };

    # Workspace lifecycle hooks
    workspace = {
      # Runs when a workspace is first created
      onCreate = {
        # Example: install JS dependencies from NPM
        # npm-install = "npm install";
      };
      # Runs when the workspace is (re)started
      onStart = {
        # Example: start a background task to watch and re-build backend code
        # watch-backend = "npm run watch-backend";
      };
    };
  };
}
  1. ketik ini untuk file yang kamu tuju pdflatex namaFile.tex
  2. pada bagian tengah, ada tombol play warna hijau. click tombol tersebut dan juga logo diseblah kanannnya juga.
  3. setelah pdflatex namaFile.tex kita enter saja jika diberi pertanyaan nama. lalu ketik r jika error dan enter lagi!
  4. Jika ada error check pada file dengan format .log

Ref: