XQ Dai's Technical Blog

website·Indexed 30 days ago

https://blog.xqdai.dpdns.org/

A collection of technical tutorials and guides covering LaTeX paper formatting, TeX Live installation on WSL2, Zotero configuration with QWEN-MT, and Matlab LMI toolbox usage, specifically the lmivar and lmiterm functions.

Tokens
5.4K
Snippets
37
Records
43
Agent score
50%

What's inside XQ Dai Blog

  1. Manage bibliography using .bib files in LaTeX

    To use a dynamic bibliography instead of a manual list, create a .bib file containing BibTeX entries. Ensure the .bib file and the bibliography style file (.bst, e.g., IEEEtran.bst) are in the same directory as your .tex file to avoid compilation errors.

    1. Create a file (e.g., reference.bib) and add entries in BibTeX format.
    2. Use the \cite{citation_key} command in the text to reference a specific entry.
    3. Replace the manual thebibliography environment with the bibliography style and file declarations.
    % 1. Replace the \begin{thebibliography}...\end{thebibliography} block with:
    \bibliographystyle{IEEEtran}
    \bibliography{reference} % 'reference' refers to reference.bib
    
    % 2. In-text citation example:
    As shown in \cite{lu2023event}...
  2. Install a translation plugin in Zotero

    To add translation capabilities (such as word-highlight translation or batch PDF translation) to Zotero, you must install a translation plugin using an .xpi file.

    Steps to install:

    1. Download the latest .xpi installer from the Translate for Zotero GitHub Releases or the Zotero Chinese Community plugin store.
    2. Open Zotero and navigate to Tools $\rightarrow$ Add-ons.
    3. Click the gear icon (⚙️) in the top right corner and select Install Add-on From File….
    4. Select the downloaded .xpi file and confirm.
    5. Restart Zotero to complete the installation.

    Verify installation by checking if 'Translate' options appear in the toolbar or right-click menu, or by ensuring the plugin is marked as 'Enabled' in the Add-ons list.

  3. Initialize and finalize an LMI system in MATLAB

    To define a system of Linear Matrix Inequalities (LMIs) in MATLAB, you must initialize the system before adding terms and finalize it after all terms are described.
    setlmis([])        % Initialize an LMI system
    % ... define variables and terms here ...
    lmisys = getlmis;  % Finalize the LMI system definition
  4. Configure VSCode LaTeX Workshop for TeX Live on WSL2

    To enable LaTeX compilation and PDF viewing in VSCode using the LaTeX Workshop extension, configure the settings.json file. This setup includes recipes for xelatex, pdflatex, and latexmk, as well as a comprehensive list of auxiliary files to clean during the build process. Key configurations include setting the PDF viewer to a VSCode tab and enabling auto-build on save.
    {
        "latex-workshop.latex.recipes": [
            {
                "name": "xelatex",
                "tools": ["xelatex"]
            },
            {
                "name": "pdflatex",
                "tools": ["pdflatex"]
            },
            {
                "name": "latexmk",
                "tools": ["latexmk"]
            },
            {
                "name": "xelatex -> bibtex -> xelatex*2",
                "tools": ["xelatex", "bibtex", "xelatex", "xelatex"]
            }
        ],
        "latex-workshop.latex.tools": [
            {
                "name": "latexmk",
                "command": "latexmk",
                "args": ["--shell-escape", "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-pdf", "%DOC%"]
            },
            {
                "name": "xelatex",
                "command": "xelatex",
                "args": ["--shell-escape", "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "%DOC%"]
            },
            {
                "name": "pdflatex",
                "command": "pdflatex",
                "args": ["--shell-escape", "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "%DOC%"]
            },
            {
                "name": "bibtex",
                "command": "bibtex",
                "args": ["%DOCFILE%"]
            }
        ],
        "latex-workshop.latex.clean.fileTypes": [
            "*.acn", "*.acr", "*.alg", "*.aux", "*.bbl", "*.blg", "*.fdb_latexmk", "*.fls", "*.glg", "*.glo", "*.gls", "*.idx", "*.ind", "*.ist", "*.lof", "*.log", "*.lot", "*.nav", "*.out", "*.pdfsync", "*.pre", "*.rubbercache", "*.snm", "*.synctex", "*.synctex(busy)", "*.synctex.gz", "*.synctex.gz(busy)", "*.toc", "*.vrb"
        ],
        "latex-workshop.latex.clean.method": "glob",
        "latex.linter.enabled": false,
        "latex-workshop.view.pdf.viewer": "tab",
        "latex-workshop.latex.autoBuild.run": "onSave",
        "latex-workshop.showContextMenu": true,
        "latex-workshop.message.error.show": true,
        "latex-workshop.message.warning.show": true,
        "latex-workshop.intellisense.package.enabled": true,
        "latex-workshop.latex.autoClean.run": "never",
        "latex-workshop.latex.recipe.default": "lastUsed",
        "latex-workshop.view.pdf.internal.synctex.keybinding": "double-click"
    }
  5. Use the Elsevier CAS (Complex) LaTeX template

    The CAS templates provide more advanced formatting options. There are two primary versions: cas-sc for single-column and cas-dc for double-column. These should not be used simultaneously. The template includes specific commands for headers and footers.
    \documentclass[a4paper,fleqn]{cas-dc} % Default: A4 paper, left-aligned equations
    
    \shorttitle{Short Title} % Displayed in header from page 2 onwards
    \shortauthors{Author et al.} % Displayed at the bottom of the page
    \title[mode = title]{Full Paper Title}
  6. Recommended Compression Software for Windows

    Recommended options for file compression include 7zip, 360 Zip International Edition (specifically the international version, not the domestic Chinese version), and Bandizip. 7zip is the primary recommendation. Avoid installing these on the C drive.
  7. Use the Elsevier (elsarticle) basic LaTeX template

    The basic Elsevier template is used for standard submissions. You can configure the layout (single vs double column) and font size within the document class declaration. Keywords should be separated using the \sep command. If using a .bib file for references, ensure the appropriate bibliography commands are included.
    \documentclass[preprint,12pt]{elsarticle}
    % Use 'twocolumn' in the options above to switch to a double-column layout