### Build Example Binaries Source: https://github.com/texstudio-org/texstudio/blob/master/src/zlib-1.3.1/CMakeLists.txt Configures and builds example executables like 'example', 'minigzip', 'example64', and 'minigzip64' if ZLIB_BUILD_EXAMPLES is enabled. These examples are linked against the zlib library. ```cmake if(ZLIB_BUILD_EXAMPLES) add_executable(example test/example.c) target_link_libraries(example zlib) add_test(example example) add_executable(minigzip test/minigzip.c) target_link_libraries(minigzip zlib) if(HAVE_OFF64_T) add_executable(example64 test/example.c) target_link_libraries(example64 zlib) set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") add_test(example64 example64) add_executable(minigzip64 test/minigzip.c) target_link_libraries(minigzip64 zlib) set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") endif() endif() ``` -------------------------------- ### Scripting Examples Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/usermanual_en.html Illustrative examples of how to use the provided script macros for common tasks. ```APIDOC ## Scripting Examples ### Example 1: Copy current file name to clipboard ```javascript %SCRIPT app.clipboard = editor.fileName(); ``` ### Example 2: Execution of editor text ```javascript %SCRIPT eval(editor.text()); ``` ### Example 3: Show all properties of an object ```javascript %SCRIPT function write_properties(obj) { app.fileNew(); newEditor = documentManager.currentDocument.editorView.editor; //access the newly created document newEditor.setText(Object.getOwnPropertyNames(obj).join("\n")); //print the properties } obj = editor; //object to show (e.g. the current editor) write_properties(obj) ``` ### Example 4: Additional action in the edit menu ```javascript %SCRIPT var menu = app.getManagedMenu("main/edit"); //get edit menu var act = app.newManagedAction(menu, "script", "scripttest"); //add action act.triggered.connect(function(){alert("called");}); //register simple handler registerAsBackgroundScript("test"); //keep handler valid ``` ### Example 5: Asynchronous dialog ```javascript %SCRIPT var ui = createUI(" ... path to your ui file ..."); //load dialog ui.accepted.connect(function(){alert("x")}) //react to dialog closing ``` ``` -------------------------------- ### Install Sphinx and Dependencies (Ubuntu) Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/source/background.md Package installation commands for Ubuntu to set up the necessary environment for translating the manual using Sphinx. ```bash sphinx furo python3-myst-parser python3-sphinx-inline-tabs python3-sphinx-designer python3-sphinxex-opengraph ``` -------------------------------- ### Install Documentation Dependencies Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/Readme.md Installs necessary Python packages for building documentation with Sphinx. Ensure pip is up-to-date before installation. ```bash pip3 install --upgrade pip pip3 install sphinx pip3 install myst_parser pip3 install sphinx_comments pip3 install sphinx_design pip3 install sphinxext.opengraph pip3 install sphinx-inline-tabs pip3 install furo ``` -------------------------------- ### Save/Load Profile Configuration Example Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/build/html/advanced.html Example of a .txsprofile file structure, showing how to configure settings like syntax highlighting and commands. The file is a text file that should be stripped down to necessary settings. ```ini [formats] data\align-ampersand\bold=true data\align-ampersand\fontFamily= data\align-ampersand\foreground=#0055ff data\align-ampersand\italic=false data\align-ampersand\overline=false ... [texmaker] Tools\Commands\latex="latex -src -interaction=nonstopmode %.tex" ``` -------------------------------- ### zpipe Example: Command-line Compression/Decompression Source: https://github.com/texstudio-org/texstudio/blob/master/src/zlib-1.3.1/examples/zlib_how.html This example demonstrates a command-line utility for compressing and decompressing data using zlib. It handles input/output streams and provides basic usage instructions. ```c #include #include #include #include "zlib.h" #define CHUNK 16384 /* compress or decompress using zlib */ int main(int argc, char **argv) { int ret, flush; unsigned have; z_stream strm; unsigned char in[CHUNK]; unsigned char out[CHUNK]; strm.zalloc = Z_NULL; strm.zfree = Z_NULL; strm.opaque = Z_NULL; if (argc == 2 && strcmp(argv[1], "-d") == 0) { if (inflateInit(&strm) != Z_OK) return 1; } else { if (deflateInit(&strm, Z_DEFAULT_COMPRESSION) != Z_OK) return 1; } do { strm.avail_in = fread(in, 1, CHUNK, stdin); if (ferror(stdin)) { (void)deflateEnd(&strm); return 1; } if (strm.avail_in == 0) break; strm.next_in = in; flush = feof(stdin) ? Z_FINISH : Z_OK; do { strm.avail_out = CHUNK; strm.next_out = out; if (argc == 2 && strcmp(argv[1], "-d") == 0) ret = inflate(&strm, flush); else ret = deflate(&strm, flush); assert(ret != Z_STREAM_ERROR); have = CHUNK - strm.avail_out; if (fwrite(out, 1, have, stdout) != have || ferror(stdout)) { (void)deflateEnd(&strm); return 1; } } while (strm.avail_out == 0); } while (flush != Z_FINISH); if (argc == 2 && strcmp(argv[1], "-d") == 0) inflateEnd(&strm); else deflateEnd(&strm); return ret == Z_STREAM_END ? Z_OK : 1; } ``` -------------------------------- ### Install Unix Translation Files Source: https://github.com/texstudio-org/texstudio/blob/master/CMakeLists.txt Installs translation files (.qm) for Texstudio on Unix-like systems. ```cmake if(UNIX) install(DIRECTORY translation/ DESTINATION ${CMAKE_INSTALL_DATADIR}/texstudio FILES_MATCHING PATTERN *.qm ) endif() ``` -------------------------------- ### Collaborative Editing Host Setup Source: https://context7.com/texstudio-org/texstudio/llms.txt Instructions for hosting a collaborative editing session. Start sharing a folder, and communicate the generated access code to collaborators. ```text # --- Host side --- # 1. Open a file from the folder you want to share. # 2. Tools → Start Sharing Folders # TeXstudio starts a host server for that folder. # 3. Hover over the status-bar sync icon to read the 4-word access code, # or right-click → Copy Access Code. # 4. Communicate the code (e.g. "4-alpha-button") to the collaborator. ``` -------------------------------- ### Install Unix Dictionary Files Source: https://github.com/texstudio-org/texstudio/blob/master/CMakeLists.txt Installs dictionary files for Texstudio on Unix-like systems. ```cmake if(UNIX) install(DIRECTORY utilities/dictionaries/ DESTINATION ${CMAKE_INSTALL_DATADIR}/texstudio FILES_MATCHING PATTERN * ) endif() ``` -------------------------------- ### Install QuaZip using CMake Source: https://github.com/texstudio-org/texstudio/blob/master/src/quazip/quazip/doc/index.dox Install QuaZip to a specified location using CMake build commands. Ensure you replace the placeholder paths with your desired build and installation directories. ```bash cmake --build wherever/you/want/your/build/to/be --target install -D CMAKE_INSTALL_PREFIX=/wherever/you/want/to/install ``` -------------------------------- ### Install Additional Unix Documentation Files Source: https://github.com/texstudio-org/texstudio/blob/master/CMakeLists.txt Installs various supplementary documentation files for Texstudio on Unix-like systems, including HTML and CSS for latex2e examples, images, and license information. ```cmake if(UNIX) install(FILES utilities/latex2e.html DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/texstudio) install(FILES utilities/latex2e.css DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/texstudio) install(FILES utilities/list.png DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/texstudio) install(FILES utilities/AUTHORS DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/texstudio) install(FILES utilities/COPYING DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/texstudio) install(FILES utilities/manual/source/CHANGELOG.md DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/texstudio) endif() ``` -------------------------------- ### Install Packages with vcpkg (Windows) Source: https://github.com/texstudio-org/texstudio/wiki/Compiling Install necessary development packages using vcpkg for Windows. Ensure the correct architecture (e.g., x64-windows) is specified. ```bash vcpkg.exe install poppler[qt]:x64-windows qtbase:x64-windows qtdeclarative:x64-windows qtsvg:x64-windows qt5compat:x64-windows qttools:x64-windows hunspell:x64-windows ``` -------------------------------- ### Generate LaTeX Document Preamble with Quick Start Wizard Source: https://context7.com/texstudio-org/texstudio/llms.txt Use the Quick Start Wizard to generate a basic LaTeX document preamble. This wizard sets up the document class, paper size, encoding, and common packages. ```latex \documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amssymb} \usepackage{graphicx} \begin{document} \end{document} ``` -------------------------------- ### Install Texstudio Executable Source: https://github.com/texstudio-org/texstudio/blob/master/CMakeLists.txt Installs the main Texstudio executable to the system's binary directory. ```cmake install(TARGETS texstudio DESTINATION ${CMAKE_INSTALL_BINDIR}) ``` -------------------------------- ### Install zlib Libraries and Headers Source: https://github.com/texstudio-org/texstudio/blob/master/src/zlib-1.3.1/CMakeLists.txt Installs the zlib and zlibstatic targets, along with public headers and man pages, to the specified installation directories. This is conditional on SKIP_INSTALL_LIBRARIES, SKIP_INSTALL_HEADERS, and SKIP_INSTALL_FILES not being set. ```cmake if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) install(TARGETS zlib zlibstatic RUNTIME DESTINATION "${INSTALL_BIN_DIR}" ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) endif() if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION "${INSTALL_INC_DIR}") endif() if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) install(FILES zlib.3 DESTINATION "${INSTALL_MAN_DIR}/man3") endif() if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) install(FILES ${ZLIB_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}") endif() ``` -------------------------------- ### Profile Configuration - Formats Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/source/advanced.md Example of a formats section in a .txsprofile file, showing syntax highlighting settings. ```ini [formats] data\align-ampersand\bold=true data\align-ampersand\fontFamily= data\align-ampersand\foreground=#0055ff data\align-ampersand\italic=false data\align-ampersand\overline=false ... ``` -------------------------------- ### Install Unix Manual HTML Files Source: https://github.com/texstudio-org/texstudio/blob/master/CMakeLists.txt Installs the HTML version of the Texstudio manual, including images and static assets, on Unix-like systems. ```cmake if(UNIX) install(DIRECTORY utilities/manual/build/html/ DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/texstudio FILES_MATCHING PATTERN *.html ) install(DIRECTORY utilities/manual/build/html/_images DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/texstudio FILES_MATCHING PATTERN *.webp ) install(DIRECTORY utilities/manual/build/html/_sphinx_design_static DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/texstudio ) install(DIRECTORY utilities/manual/build/html/_static DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/texstudio ) install(FILES utilities/manual/build/html/searchindex.js DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/texstudio) endif() ``` -------------------------------- ### Profile Configuration - Commands Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/source/advanced.md Example of a texmaker section in a .txsprofile file, showing a command configuration. ```ini [texmaker] Tools\Commands\latex="latex -src -interaction=nonstopmode %.tex" ``` -------------------------------- ### Install Sphinx and Dependencies (pip) Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/source/background.md Python package installation commands using pip to set up the necessary environment for translating the manual with Sphinx. Ensure packages are accessible via the command line. ```bash pip install sphinx furo myst-parser sphinx-inline-tabs sphinx_design sphinxext_opengraph ``` -------------------------------- ### Build TeXstudio with CMake (Unix/MacOSX) Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/build/html/background.html Alternative command for Unix and MacOSX systems to compile and install TeXstudio. Use sudo for system-wide installation. ```bash sudo sh BUILD.sh ``` -------------------------------- ### Install Unix Templates Source: https://github.com/texstudio-org/texstudio/blob/master/CMakeLists.txt Installs template files for Texstudio on Unix-like systems. ```cmake if(UNIX) install(DIRECTORY templates/ DESTINATION ${CMAKE_INSTALL_DATADIR}/texstudio FILES_MATCHING PATTERN * ) endif() ``` -------------------------------- ### Define Expl3 Environment Start Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/source/background.md Use this format to define the start of an environment, specifically for internal use with expl3 to validate expl3 commands. ```latex \ExplSyntaxOn#beginEnv#expl3 ``` -------------------------------- ### Install TeXstudio on Linux (CMake) Source: https://github.com/texstudio-org/texstudio/wiki/Compiling Install TeXstudio on Linux after compiling using CMake. This command should be run from the build directory. ```bash cmake --build . -t install ``` -------------------------------- ### Install Dependencies for TeXstudio on Ubuntu (<23.10) Source: https://github.com/texstudio-org/texstudio/wiki/Compiling Installs necessary development packages for compiling TeXstudio on older Ubuntu versions using apt-get. ```bash apt-get install qtbase5-dev qt5-default qt5-qmake libqt5svg5-dev qtdeclarative5-dev qttools5-dev libqt5svg5-dev libpoppler-qt5-dev libpoppler-cpp-dev pkg-config zlib1g-dev libquazip5-dev git cmake ``` -------------------------------- ### Start Teamtype Host Server Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/source/background.md Command to initiate a teamtype host server in a specified directory. This shares the folder with other users. ```bash teamtype share ``` -------------------------------- ### Example Bug Report Structure Source: https://github.com/texstudio-org/texstudio/wiki/Reporting-Bugs This example demonstrates the format and content expected in a comprehensive bug report, including OS and TeXstudio versions, a clear description of the issue, reproduction steps, and expected behavior. ```text OS X Yosemite 10.10.1 TeXstudio 2.8.8 The width of tabs for the "Messages / Log Files" does not adapt to the font size. How to reproduce: Go to Preferences -> Font size and set the font size 10 or more Result: The font in the tabs is increased, but the tab width is not. Thus the text is clipped. Expected: Tabs should scale with the font size. [screenshot] ``` -------------------------------- ### Install Dependencies for TeXstudio on Ubuntu (>=23.10) Source: https://github.com/texstudio-org/texstudio/wiki/Compiling Installs necessary development packages for compiling TeXstudio on newer Ubuntu versions using apt-get. ```bash apt-get install qt6-base-dev qt6-svg-dev qt6-declarative-dev qt6-tools-dev libpoppler-qt6-dev libpoppler-cpp-dev pkg-config zlib1g-dev libquazip1-qt6-dev git cmake ``` -------------------------------- ### Example: Reference Command Declaration Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/usermanual_en.html Declares a command as a reference, ensuring correct completion. ```latex \pageref{key}#r ``` -------------------------------- ### Example: Comment Line Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/usermanual_en.html A simple comment line in TeXstudio. ```latex # test ``` -------------------------------- ### Basic LaTeX Command Example Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/usermanual_en.html A simple LaTeX command definition, where options are treated as placeholders by default. ```latex \section{title} ``` -------------------------------- ### Build TeXstudio with CMake Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/build/html/background.html Standard commands to compile and install TeXstudio using cmake. Ensure you are in the build directory. ```bash mkdir build cd build cmake .. cmake --build . --target install ``` -------------------------------- ### Compile adwaita-qt with CMake Source: https://github.com/texstudio-org/texstudio/blob/master/src/adwaita-qt/README.md Standard compilation process using CMake. Ensure you have the necessary build tools installed. ```bash mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. make make install ``` -------------------------------- ### Install Homebrew on macOS Source: https://github.com/texstudio-org/texstudio/wiki/Compiling Installs the Homebrew package manager on macOS. This is a prerequisite for installing other development tools. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Start Token Definition Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/qxs/doc/QNFA.html The 'start' tag defines a context's starting token using a regular match. It supports 'format', 'id', 'exclusive', and 'parenthesis' attributes. ```xml \? ``` -------------------------------- ### LaTeX Tabbing Environment Example Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/latexhelp.html Demonstrates basic usage of the tabbing environment for aligning text in columns. Use when column widths are constant and known. ```latex \begin{tabbing} text \= more text \= still more text \= last text \\ second row \> \> more \\ . . . \end{tabbing} ``` -------------------------------- ### Command-Line Option to Open a File on Startup Source: https://context7.com/texstudio-org/texstudio/llms.txt Specify a file to be opened automatically when TeXstudio starts via the command line. ```bash # Pass a file to be opened on startup: texstudio /home/user/thesis/main.tex ``` -------------------------------- ### Install Unix-Specific Application Data Source: https://github.com/texstudio-org/texstudio/blob/master/CMakeLists.txt Installs application data files for Unix-like systems, including desktop entries, SVG icons, and metainfo files. The metainfo file installation is conditional on the APPDATA option. ```cmake if(UNIX AND NOT APPLE AND NOT HAIKU) option(APPDATA "Install appdata" ON) install(FILES utilities/texstudio.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) install(FILES utilities/texstudio.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) if(${APPDATA}) install(FILES utilities/texstudio.metainfo.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo) endif() endif() ``` -------------------------------- ### Start Teamtype Guest Server Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/source/background.md Command to initiate a teamtype guest server. This connects to a host server using a provided code and downloads shared files. ```bash teamtype join code ``` -------------------------------- ### Okular: Launch with Source Link Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/build/html/configuration.html Launches Okular to display a DVI file and enables forward search by embedding source file and line information in the file URI. ```shell okular --unique %.dvi#src:@ ?c:m.tex ``` -------------------------------- ### Install Essential Packages with Homebrew on macOS Source: https://github.com/texstudio-org/texstudio/wiki/Compiling Installs core development libraries and tools required for compiling TeXstudio on macOS using Homebrew. ```bash brew install qt brew install cairo fontconfig freetype gettext jpeg libpng libtiff little-cms2 nspr nss openjpeg brew install cmake pkg-config ``` -------------------------------- ### Configure Project with CMake (MSYS2/vcpkg) Source: https://github.com/texstudio-org/texstudio/wiki/Compiling Run CMake to configure the build environment after cloning the repository. For vcpkg, specify the toolchain file. ```bash cd texstudio mkdir build cd build cmake .. -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake ``` ```bash cd texstudio mkdir build cd build cmake .. ``` -------------------------------- ### Install MSYS2 Packages (Windows) Source: https://github.com/texstudio-org/texstudio/wiki/Compiling Install necessary packages for compiling TeXstudio using MSYS2 on Windows. Ensure you are in the MSYS2 command line. ```bash pacman -Syu git make mingw-w64-ucrt-x86_64-toolchain mingw-w64-ucrt-x86_64-qt6-base mingw-w64-ucrt-x86_64-poppler mingw-w64-ucrt-x86_64-poppler-qt6 mingw-w64-ucrt-x86_64-qt6-declarative mingw-w64-ucrt-x86_64-qt6-svg mingw-w64-ucrt-x86_64-qt6-5compat mingw-w64-ucrt-x86_64-qt6-tools mingw-w64-ucrt-x86_64-quazip-qt6 mingw-w64-ucrt-x86_64-hunspell mingw-w64-ucrt-x86_64-cmake ``` -------------------------------- ### Example: Environment Alias for Math Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/usermanual_en.html Declares the 'align' environment to be handled like a math environment for command validity and syntax highlighting. ```latex \begin{align}#\math ``` -------------------------------- ### Launch qpdfview from TeXstudio Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/build/html/configuration.html Use this command to launch qpdfview and open a specific PDF file, linking it to the source LaTeX file and line number. Redirects standard error to null. ```bash qpdfview --unique ?am.pdf#src:?c:am.tex:@:0 2> /dev/null ``` -------------------------------- ### LaTeX Auto-Completion Examples Source: https://context7.com/texstudio-org/texstudio/llms.txt Demonstrates various auto-completion triggers and results for commands, environments, references, citations, filenames, and key-value pairs in LaTeX. ```latex % --- Command completion --- % Type: \frac → press Tab or Enter to accept the suggestion % Result: \frac{%}{%} % Use Ctrl+Right to jump between placeholders. % --- Environment completion --- % Type: tab → press Ctrl+Alt+Space % Result: \begin{tabular}{%} % %| \end{tabular} ``` ```latex % --- Reference/label completion --- % Type: \ref{ → completer lists all \label{...} defined in the project % Type: \cite{ → completer lists all BibTeX keys in loaded .bib files % Multiple keys: \cite{key1, → press Ctrl+Space to add another entry ``` ```latex % --- Filename completion --- % Type: \includegraphics{ → completer shows files in the document's directory % Image files show a thumbnail tooltip on hover. ``` ```latex % --- Key-value completion --- \includegraphics[width=%, keepaspectratio=true]{figure.pdf} % After typing "width=", completer offers length values (\textwidth, etc.) ``` ```latex % --- Text word completion --- % Type first 3 letters of any word already in the document, press Ctrl+Space % Result: completer suggests matching words from the current document buffer. ``` ```latex % --- Completion modes (switch with Shift+Space while completer is open) --- % Typical → curated common commands % Most Used → commands you have personally used most % Fuzzy → type \bf to find \begin{figure}, \textbf, etc. % All → every known command from all loaded CWL files ``` -------------------------------- ### Combined Scope Limiting Example Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/build/html/advanced.html An example combining language and highlighted environment scope limitations for a trigger. This trigger will only respond to 'FIXME' in comments or todo notes within LaTeX documents. ```regex (?language:latex)(?highlighted-as:comment,commentTodo)FIXME ``` -------------------------------- ### Launch TeXstudio from qpdfview Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/build/html/configuration.html This command allows launching TeXstudio from qpdfview, passing the PDF file path and line number as arguments. Ensure the path is quoted to handle spaces. ```bash texstudio "%1" -line %2 ``` -------------------------------- ### Start New Line in LaTeX Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/latexhelp.html Forces a new line to start. An optional `extra-space` argument can add vertical space before the next line. The `\*` variant prevents a page break after the new line. ```latex \\[*][extra-space] ``` -------------------------------- ### Foxit Reader: Launch from TeXstudio Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/build/html/configuration.html Launches Foxit Reader to open a specified PDF file. Requires the path to the Foxit Reader executable. ```shell """(your Reader path)""" "?am.pdf" ``` -------------------------------- ### Example: Math-Only Command Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/usermanual_en.html A command valid only within a math environment. ```latex \sqrt{arg}#m ``` -------------------------------- ### UI File Loading Macros Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/usermanual_en.html Load and create UI elements from files or strings. `app.createUI` loads a UI file into a QWidget. `app.createUIFromString` creates a QWidget from a string description. ```javascript app.createUI(file, [parent]) ``` ```javascript app.createUIFromString(string, [parent]) ``` -------------------------------- ### Get Document Text Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/build/html/advanced.html Retrieves the complete text content of the current document. ```javascript editor.text() ``` -------------------------------- ### kdvi: Launch with Source Position Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/build/html/configuration.html Launches kdvi to display a DVI file and enables forward search by embedding source file and line information in the file URI. ```shell kdvi "file:%.dvi#src:@ ?c:m.tex" ``` -------------------------------- ### Example: Command Valid in Specific Environment Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/usermanual_en.html An unusual command that is valid only within the 'picture' environment. ```latex \vector(xslope,yslope){length}#*/picture ``` -------------------------------- ### Example: Unusual Command Completion Source: https://github.com/texstudio-org/texstudio/blob/master/utilities/manual/usermanual_en.html Demonstrates an unusual command that appears only in the 'all' completion tab. ```latex \typein{msg}#* ``` -------------------------------- ### Collaborative Editing Guest Setup Source: https://context7.com/texstudio-org/texstudio/llms.txt Instructions for joining a collaborative editing session as a guest. Enter the access code provided by the host to connect and synchronize files. ```text # --- Guest side --- # 1. Tools → Connect to Other User for Collaboration # 2. Enter the access code. # 3. TeXstudio downloads all files to the local collaboration folder # (configured at Options → Configure → Collaboration). # 4. Open any shared file; you will see the host's cursor (blue) # and changes appear in real time. ```