parent_url
stringlengths
41
46
parent_score
stringlengths
1
4
parent_body
stringlengths
25
35.5k
parent_user
stringlengths
37
42
parent_title
stringlengths
12
150
accepted
bool
2 classes
body
stringlengths
4
36.7k
score
stringlengths
1
4
user
stringlengths
37
42
answer_id
stringlengths
1
6
__index_level_0__
int64
0
322k
https://tex.stackexchange.com/questions/8503
160
I know that hardly any information is passed to the PDF when a .tex file is compiled. But is there a tool that can convert a PDF document back to (La)TeX?
https://tex.stackexchange.com/users/749
How to convert PDF to (La)TeX?
false
A two step process has worked well for me. Step 1) Convert PDF to DOCX (MS Word) You can use pdf2docx or use the acrobat online service (if your doc is public) Step 2) Convert the DOCX to LaTeX with pandoc. pandoc -f docx -t latex --standalone -o converted.tex input.docx Pandoc does not accept pdf as input and docx is a very rich format. So, this combination produces reasonably good results.
1
https://tex.stackexchange.com/users/282431
689851
320,021
https://tex.stackexchange.com/questions/689837
2
I'm trying to use Georgian language with vimtex. I found out that I have to compile with XelaTex or LuaTex but i don't know how to make vimtex to compile with them. I would like to keep default compiler and add Xelatex as optional, is it possible? I have tried to read official documentation but I can't understand much.
https://tex.stackexchange.com/users/299839
LuaTex, Xelatex with VimTex
true
Without touching the default, you can use, in `vimtex`, the "magic comment" `TeX program`: ``` %! TeX program = xelatex \documentclass{article} \usepackage{iftex} \begin{document} I have been compiled with\dots{\ttfamily \ifluatex luatex \else\ifxetex xetex \else\ifpdftex pdftex \else NO IDEA! \fi\fi\fi} \end{document}[![enter image description here][1]][1] ``` Notice a couple of things: 1. if you change the "magic comment", you have to *reload the plugin* to acknowledge it (the standard keystrokes are `\lx`, if you didn't change the leader char). 2. the `xelatex` there is *not* a program name; it's a label for a set of configurations defined elsewhere. The most common ones are `xelatex` and `lualatex`. Using a generic command here can hinder all the security things that makes `--shell-escape` needed. 3. there is much more info directly in `vim` if you execute `:h vimtex-tex-directives`: ``` SUPPORT FOR TEX DIRECTIVES *vimtex-tex-directives* VimTeX supports two of the commonly used TeX directives [0]: the TeX root and the TeX program directive. The TeX root directive was already described above, see |vimtex-tex-root|. *vimtex-tex-program* The TeX program directive works by specifying the TeX compiler program in a comment in one of the first lines of the main project file. It is parsed only when it is required by a compiler backend. The syntax is best explained with an example: >latex %! TeX program = lualatex %! TEX TS-program = xelatex The left-hand side must contain the text "tex program" or "tex ts-program" and as with |vimtex-tex-root|, the words are recognized regardless of casing and the spaces are ignored. The right-hand side must correspond to a key in the |g:vimtex_compiler_latexmk_engines| or |g:vimtex_compiler_latexrun_engines| dictionaries. See also [0,1]. ``` 0: [When and why should I use % !TEX TS-program and % !TEX encoding?](https://tex.stackexchange.com/q/78101/34697) 1: <https://github.com/lervag/vimtex/issues/713> Not directly related, but you probably can also be interested in this: [How can I enable shell-escape?](https://tex.stackexchange.com/questions/598818/how-can-i-enable-shell-escape)
1
https://tex.stackexchange.com/users/38080
689862
320,025
https://tex.stackexchange.com/questions/689580
1
I have a problem with esvect and unicode-math. Here is a MWE (of course, I don't need esvect in this example): ``` \documentclass[10pt,a4paper]{article} \usepackage{unicode-math} \setmainfont{STIX two Text} \setmathfont{STIX two Math} \usepackage{esvect} \begin{document} $x+y$ \end{document} ``` I edited my first message with a shorter MWE. I get this warning message: LaTeX Font Warning: Font shape `U/esvect/m/n' in size <5.5> not available (Font) size <5> substituted on input line 10. [1 {C:/Users/didie/AppData/Local/MiKTeX/fonts/map/pdftex/pdftex.map}] (./probleme\_esvect.aux) LaTeX Font Warning: Size substitutions with differences (Font) up to 0.5pt have occurred. I don't get it because I don't use esvec in this example. And I don't know if I provide with enough information but I don't know which part of the log file would be relevant. I chekced in C:\Users\didie\AppData\Local\MiKTeX\fonts\tfm\public\esvect and I have: vect5.tfm, vect6.tfm, vect7.tfm, vect8.tfm and vect10.tfm
https://tex.stackexchange.com/users/249670
Conflict between esvect and unicode-math?
true
With your code ``` \documentclass[10pt,a4paper]{article} \usepackage{unicode-math} \setmainfont{STIX Two Text} \setmathfont{STIX Two Math} \usepackage{esvect} \begin{document} $x+y+\vv{x+y}+\overrightarrow{x+y}$ \end{document} ``` where I added examples of overarrows, respectively `esvect` and STIX Two Math, I get You decide what kind of arrows you prefer. But there's also the warning ``` LaTeX Font Warning: Font shape `U/esvect/m/n' in size <5.5> not available (Font) size <5> substituted on input line 11. ``` which is a bit annoying. It stems from the fact that in the olden times when Type1 fonts were not available, fonts were offered at fixed sizes in order not to fill disk space with useless copies of bitmap fonts. If you look in `uesvect.fd` (the font description file) you see ``` \DeclareFontFamily{U}{esvect}{} \DeclareFontShape{U}{esvect}{m}{n}{% <5><6><7><8><9><10>gen*vect% <10.95><12><14.4><17.28><20.74><24.88>vect10% }{} ``` You can easily fix this description to allow for fonts at any size. ``` \documentclass[10pt,a4paper]{article} \usepackage{unicode-math} \setmainfont{STIX Two Text} \setmathfont{STIX Two Math} \usepackage{esvect} \DeclareFontFamily{U}{esvect}{} \DeclareFontShape{U}{esvect}{m}{n}{ <-5.5> vect5 <5.5-6.5> vect6 <6.5-7.5> vect7 <7.5-8.5> vect8 <8.5-9.5> vect9 <9.5-> vect10 }{} \begin{document} $x+y+\vv{x+y}+\overrightarrow{x+y}$ \end{document} ```
2
https://tex.stackexchange.com/users/4427
689863
320,026
https://tex.stackexchange.com/questions/689865
0
ich have the following code: ``` \begin{center} \rule{0.2\linewidth}{0.1mm}\hspace{0.5em} \textbf{\large Analytische Aufgaben}\hspace{0.5em} \rule{0.2\linewidth}{0.1mm} \end{center} ``` What i want is that the text ist in between the lines like this: |-------------- Analytische Aufgaben ------------| The "----" should be on line and fill across the full horizontal page. "|" indicates the ends of the page. I've tried multiple things but didn't get it workling. Thanks
https://tex.stackexchange.com/users/299856
rule at middle of text hight
true
You might try the package `xhfill`, but its documentation is very poor. Alternatively ``` \documentclass{article} \newcommand{\myfillrule}{% \leavevmode \leaders \hrule height\dimeval{0.5ex+0.2pt} depth \dimeval{-0.5ex+0.2pt}% \hfill\hspace*{0pt}% } \begin{document} \begin{center} \large \myfillrule\enspace Analytische Aufgaben\enspace \myfillrule \end{center} \end{document} ``` If you want to change the thickness, replace the two occurrences of `0.2pt` with half the desired dimension. If you prefer that the rules are vertically centered with respect to uppercase letters, use ``` \documentclass{article} \newcommand{\myfillrule}{% \leavevmode \leaders \hrule height\dimeval{0.5\fontcharht\font`A+0.2pt} depth \dimeval{-0.5\fontcharht\font`A+0.2pt}% \hfill\hspace*{0pt}% } \begin{document} \begin{center} \large \myfillrule\enspace Analytische Aufgaben\enspace \myfillrule \end{center} \end{document} ``` with the same suggestion as above about the thickness.
2
https://tex.stackexchange.com/users/4427
689866
320,028
https://tex.stackexchange.com/questions/689865
0
ich have the following code: ``` \begin{center} \rule{0.2\linewidth}{0.1mm}\hspace{0.5em} \textbf{\large Analytische Aufgaben}\hspace{0.5em} \rule{0.2\linewidth}{0.1mm} \end{center} ``` What i want is that the text ist in between the lines like this: |-------------- Analytische Aufgaben ------------| The "----" should be on line and fill across the full horizontal page. "|" indicates the ends of the page. I've tried multiple things but didn't get it workling. Thanks
https://tex.stackexchange.com/users/299856
rule at middle of text hight
false
you could easy define a new centered rule like in the following: ``` \documentclass[% ]{article} \usepackage[T1]{fontenc} \usepackage[% %showframe % Uncomment this to see the frames of the textbody ]{geometry} \def\centerrulefill{\leavevmode\leaders\hrule height 0.7ex depth \dimexpr0.4pt-0.7ex\hfill\kern0pt} \begin{document} \begin{center} \centerrulefill\space \textbf{\large Analytische Aufgaben}% \space\centerrulefill \end{center} \end{document} ``` Further options are described [here](https://tex.stackexchange.com/questions/32597/vertically-centered-horizontal-rule-filling-the-rest-of-a-line). But if you want to use this, for example, as a section heading, there are other packages and options.
1
https://tex.stackexchange.com/users/297560
689867
320,029
https://tex.stackexchange.com/questions/689828
1
I haver a MWE where I want to calculate a sum and the associated error, implemented in the funcion serieF. How can I implement in the function to return two outputs, i.e., the variables \s and \e and call these variables next? Observation: I need to use tikzmath. ``` \documentclass[varwidth,border=5]{article} \usepackage{tikz} \usepackage{amsmath} \usepackage{xfp} \usetikzlibrary{math} \usepackage{etoolbox} \usepackage{fp} \usetikzlibrary{fixedpointarithmetic} \usetikzlibrary{calc,fpu} \usepackage{pgf} \tikzset{fixed point arithmetic} \tikzmath{ function serieF(\n) { real \s; real \a; real \e; \s = 0; \e = 0; for \i in {1,...,\n}{ if isodd(\i+1) == 1 then { \s = \s - 1/(2*\i-1); % }; if isodd(\i+1) == 0 then { \s = \s + 1/(2*\i-1); % }; \e = abs(1/(2*\i-1)); }; return \s; }; real \s \e; \s = serieF(100); }% \begin{document} The approximation for the serie is \s~ with an error of \end{document} ```
https://tex.stackexchange.com/users/299222
Problema in tikzmath with two outputs
false
Probably there is a better way of making global the internal variables of a function, but this hack works: ``` \documentclass{article} \usepackage{tikz} \usepackage{amsmath} \usepackage{xfp} \usetikzlibrary{math} \usepackage{etoolbox} \usepackage{fp} \usetikzlibrary{fixedpointarithmetic} \usetikzlibrary{calc,fpu} \usepackage{pgf} \tikzset{fixed point arithmetic} \tikzmath{ function serieF(\n) { real \s; real \a; real \e; \s = 0; \e = 0; for \i in {1,...,\n}{ if isodd(\i+1) == 1 then { \s = \s - 1/(2*\i-1); % }; if isodd(\i+1) == 0 then { \s = \s + 1/(2*\i-1); % }; \e = abs(1/(2*\i-1)); }; print {\xdef\mysum{\s}\xdef\myerr{\e}};% }; }% \begin{document} \tikzmath{serieF(100);} The approximation for the serie is~\mysum{} with an error of~\myerr. \end{document} ```
1
https://tex.stackexchange.com/users/38080
689869
320,030
https://tex.stackexchange.com/questions/594959
1
I am trying to create a Docker image with texlive which is not >4G heavy like `docker.io/texlive/texlive`. Installing e.g. from Debian sources won't build, because once you want to add certain packages (e.g. `tlmgr install cleveref`) right now it only says: > > tlmgr: Local TeX Live (2020) is older than remote repository (2021). > > > because CTAN mirrors have updated to 2021, but Debian has not. So I am trying to install [the recommended way](https://tug.org/texlive/acquire-netinstall.html) using `install-tl-unx.tar.gz`, but this also keeps failing because no CTAN mirror can be reached. Here is a minimum example of the Dockerfile: ``` FROM alpine:latest RUN apk add perl RUN wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz; \ tar -xzf install-tl-unx.tar.gz; RUN cd install-tl-* ; \ perl ./install-tl ``` It fails stating that it cannot contact mirror.ctan.org, even though a second before it downloaded the installer from the very same site: ``` query_ctan_mirror: Programs not set up, trying wget Loading http://www.ctan.org/tex-archive/systems/texlive/tlnet/tlpkg/texlive.tlpdb cannot contact mirror.ctan.org, returning a backbone server! ./install-tl: TLPDB::from_file could not initialize from: http://www.ctan.org/tex-archive/systems/texlive/tlnet/tlpkg/texlive.tlpdb ./install-tl: Maybe the repository setting should be changed. ./install-tl: More info: https://tug.org/texlive/acquire.html ``` We can even force using that server and also force HTTPS with the `--location` argument: ``` RUN cd install-tl-*; \ perl ./install-tl --location https://mirror.ctan.org/systems/texlive/tlnet ``` Still the same, the server cannot be reached. I also tried other mirrors, which I tested to be available in my browser, none worked. So I wonder what I need to do to have that installation run reliably, so that this can run inside a CI job.
https://tex.stackexchange.com/users/17013
Reliable installation from CTAN mirrors inside Docker image
false
For those who search for a way to install texlive from CTAN in a Docker container based on Alpine, check out this repository [kjarosh/latex-docker](https://github.com/kjarosh/latex-docker). The repo contains a Dockerfile that installs texlive in one of the desired schemes - `minimal` (~40MB), `basic` (~90MB), `small` (~180MB), `medium` (~500MB), `full` (~2GB). Already with `basic` scheme I was able to use `pdflatex` command to compile `.tex` source into a `.pdf` file. To install additional packages use `tlmgr install <packagename>` or even install a list of packages from a text file by running `tlmgr install `cat texpackages.txt``. Note the backquotes are important otherwise the command won't work.
0
https://tex.stackexchange.com/users/192743
689872
320,031
https://tex.stackexchange.com/questions/673389
2
I had installed TeX Live 2022 on Debian 11 with ``` cd /tmp # working directory of your choice wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz # or curl instead of wget zcat install-tl-unx.tar.gz | tar xf - cd install-tl-* perl ./install-tl --no-interaction # as root or with writable destination Finally, prepend /usr/local/texlive/YYYY/bin/PLATFORM to your PATH, e.g., /usr/local/texlive/2022/bin/x86_64-linux ``` Now I need to update packages and install new packages that I hadn't installed, so I input: ``` tlmgr update --all ``` and see > > tlmgr: Local TeX Live (2020) is older than remote repository (2022). > Cross release updates are only supported with > > update-tlmgr-latest(.sh/.exe) --update See > <https://tug.org/texlive/upgrade.html> for details. > > > It is weird as there is no TeX Live (2020) on my Debian 11. Then I tried: ``` update-tlmgr-latest(.sh/.exe) --update ``` There is an error: > > bash: syntax error near unexpected token `.sh/.exe' > > > How shoud I fix this problem?
https://tex.stackexchange.com/users/245010
Older than remote repository but 2022 had been installed and now need to update packages
false
This is an answer specifically for MacOS. But solution 2 probably applies to other OSes as well. Note that on MacOS, TeX Live is usually installed through the [MacTeX distribution](https://tug.org/mactex/), but it is essentially the same thing. When trying to update packages (or the package manager itself), I received the error message mentioned in the OP question: ``` sudo tlmgr update --self # ... # tlmgr: Local TeX Live (2022) is older than remote repository (2023). # Cross release updates are only supported with # update-tlmgr-latest(.sh/.exe) --update # See https://tug.org/texlive/upgrade.html for details. ``` **Solution 1**: To recover from this problem **without** upgrading the entire TeX Live distribution (e.g., from 2022 to 2023), the following worked for me: * Open the TeX Live Utility. It is distributed alongside TeX Live and usually resides under /Applications/TeX/ * Under Actions, choose Reinstall TeX Live Manager. **Solution 2**: As described in the section "Distaster recovery" of the [tlmgr documentation](https://www.tug.org/texlive/tlmgr.html), it is recommended to use `update-tlmgr-latest.sh`. The script is available on this website. I have not tested this solution myself, but I suspect that this is what Tex Live Manager ends up using to fix the problem in Solution 1.
0
https://tex.stackexchange.com/users/64217
689873
320,032
https://tex.stackexchange.com/questions/689878
1
I'm working on a beamer theme in which the title page should have the graphic on top. By reading `beamerinnerthemedefault.sty` I thought I could accomplish this by setting the `title page` template. Here is an MWE: ``` \documentclass{beamer} \title{Lorem Ipsum} \subtitle{Ut molestie eros sed enim} \author{Aspasius Protus} \date{June 26, 2023} \usepackage{lipsum} \titlegraphic{graphic} \setbeamertemplate{title page}{ \vbox{} \usebeamertemplate{titlegraphic} \vfill \begingroup \centering \usebeamertemplate{title} \vskip1em\par \usebeamertemplate{author} \usebeamertemplate{institute} \usebeamertemplate{date} \endgroup } \begin{document} \maketitle \end{document} ``` The document compiles successfully with no errors or warnings, but the title page comes out blank. [Here is the log file](https://pastebin.com/yBjMAQtg). I must be misunderstanding something about how `\setbeamertemplate` works without a predefined option. But what?
https://tex.stackexchange.com/users/1402
Setting beamer title page template produces empty title page
true
The `titlegraphic`, `title`, `author`, `institute` and `date` templates were recently added in <https://github.com/josephwright/beamer/commit/5a06df06cf88917234dfe86f7e06b064808fc618> . You will need at least beamer v3.70 to use these templates in your title page. Alternatively you could define them yourself: ``` \documentclass{beamer} \title{Lorem Ipsum} \subtitle{Ut molestie eros sed enim} \author{Aspasius Protus} \date{June 26, 2023} \usepackage{lipsum} \titlegraphic{graphic} \setbeamertemplate{title}{% \begin{beamercolorbox}[sep=8pt,center]{title} \usebeamerfont{title}\inserttitle\par% \ifx\insertsubtitle\@empty% \else% \vskip0.25em% {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}% \fi% \end{beamercolorbox}% } \setbeamertemplate{author}{% \begin{beamercolorbox}[sep=8pt,center]{author} \usebeamerfont{author}\insertauthor \end{beamercolorbox} } \setbeamertemplate{institute}{% \begin{beamercolorbox}[sep=8pt,center]{institute} \usebeamerfont{institute}\insertinstitute \end{beamercolorbox} } \setbeamertemplate{date}{% \begin{beamercolorbox}[sep=8pt,center]{date} \usebeamerfont{date}\insertdate \end{beamercolorbox} } \setbeamertemplate{titlegraphic}{% {\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par} } \setbeamertemplate{title page}{ \vbox{} \usebeamertemplate{titlegraphic} \vfill \begingroup \centering \usebeamertemplate{title} \vskip1em\par \usebeamertemplate{author} \usebeamertemplate{institute} \usebeamertemplate{date} \endgroup } \begin{document} \maketitle \end{document} ```
1
https://tex.stackexchange.com/users/36296
689880
320,034
https://tex.stackexchange.com/questions/689881
1
I am writing myself a package and I want to use imakeidx as a dependency. However, I don't want to make it a hard dependency, and so I was going to add a package option to disable to automatic loading of imakeidx. However, I am unable to get this to work, as imakeidx is always getting loaded. Looking at the debugging `\iow_term:n` statements, it looks like the `true` code is executed during `\keys_define:nn` due to the `.initial:n` statement. Later the `false` code is then executed when `\ProcessKeysOptions` gets called. However, without the `.initial:n` statement, imakeidx does not get loaded if the option is not specified. Is there a way to set a default key value that doesn't execute the code until `\ProcessKeysOptions` is called? ``` \RequirePackage{ expl3 } \ProvidesExplPackage {mypkg} {2023-06-29} {1.0.0} { My package } \RequirePackage { l3keys2e } \keys_define:nn { mypkg } { imakeidx .choice: , imakeidx / true .code:n = { \iow_term:n { imakeidx~True } \RequirePackage { imakeidx } } , imakeidx / false .code:n = { \iow_term:n { imakeidx~False } } , imakeidx / unknown .code:n = { \__msg_kernel_error:nnx { kernel } { boolean-values-only } { #1 } } , imakeidx .usage:n = { preamble } , imakeidx .default:n = { true } , imakeidx .initial:n = { true } } \ProcessKeysOptions { mypkg } \endinput ``` And in the main document: ``` \documentclass{article} \usepackage[imakeidx=false]{mypkg} \begin{document} \index{imakeidx should not be loaded} \end{document} ```
https://tex.stackexchange.com/users/278687
How to prevent .initial:n from setting keys before \ProcessKeysOptions is called?
true
Short answer: You can't. At the spot you use `.initial:n` you're setting those keys. If you want to set specific options only after the package options were evaluated you can do so using `\keys_set:nn`. NB: You don't need to use `l3keys2e` anymore, key=value option parsing got integrated into the LaTeX kernel. If you drop the package and use `\ProcessKeyOptions[mypgk]` you'll get the same and even more niceties from LaTeX. In your specific case, in which you want to load a package, use ``` \keys_define:nn { mypkg } { imakeidx .bool_set:N = \l__mypkg_imakeidx_bool, imakeidx .usage:n = load } \ProcessKeyOptions[mypkg] \bool_if:NT \l__mypkg_imakeidx_bool { \RequirePackage {imakeidx} } ```
3
https://tex.stackexchange.com/users/117050
689887
320,037
https://tex.stackexchange.com/questions/689890
2
I have a library that contains code snippets formatted with the listings package. This library is used in two different documents, with slight variations depending on the document. I've been using conditionals to achieve these document-specific changes. However, when I try to combine the listings-formatted snippets with a conditional, the LaTeX compiler (xelatex) outputs the following warning and the text is swallowed up: "Package Listings Warning: Text dropped after begin of listing on input line XYZ." Why am I getting this error/what do I need to do to be able to use listings inside a condition? I've included an MWE below that shows what I'm trying to do (the filename is MWE.tex): ``` \documentclass[a4paper]{article} \usepackage{listings} \usepackage{xstring} \lstset{basicstyle=\ttfamily,breaklines=true} \begin{document} Here is lstlisting without condition: \begin{lstlisting} This is sample code. \end{lstlisting} Here is lstlisting within a conditional: \IfSubStr{\jobname}{\detokenize{MWE}}% {\begin{lstlisting} This is sample code. \end{lstlisting}}%true {FALSE}%false \end{document} ```
https://tex.stackexchange.com/users/211328
How can I use listings in conditionals?
true
Using fragile content in the argument of a macro is not a good idea. You can avoid this problem e.g. by using an `\if` case: ``` \documentclass[a4paper]{article} \newif\ifmwe \usepackage{listings} \usepackage{xstring} \lstset{basicstyle=\ttfamily,breaklines=true} \begin{document} Here is lstlisting without condition: \begin{lstlisting} This is sample code. \end{lstlisting} Here is lstlisting within a conditional: \IfSubStr{\jobname}{\detokenize{MWE}}% {\mwetrue}%true {\mwefalse}%false \ifmwe \begin{lstlisting} This is sample code. \end{lstlisting} \else fasle \fi \end{document} ```
2
https://tex.stackexchange.com/users/36296
689892
320,039
https://tex.stackexchange.com/questions/689885
0
I have made a table (please see the attached code, obtained largely from [this answer](https://tex.stackexchange.com/a/688391/5001)) in latex but I am not being able to create a thinspace after the "<" symbol. If I put the dollar ($$) symbol or use \hspace{} then the code is not compiling. Could you please suggest to me how to resolve this issue? ``` \begin{table}[htbp] \centering \caption{\textcolor{red}{Reconstruction efficiency ($\epsilon$), signal yield ($N_{S}$), signal significance ($\mathcal{S}$), upper limit on the signal yield ($N_{p\ell}^{UL}$) and branching fraction ($\mathcal{B}$) at 90\% confidence level for each mode}.} \label{tab:ul_data} \begin{tabular}{c S[table-format=2.2] S[table-format=-2.2+-2.2] S[table-format=1.2] S[table-format=2.1] S[table-format=<1.2]} \hline \hline {{Decay mode}} & {{$\epsilon$ (\%)}}& {{$N_S$}} & {{$\mathcal{S}$($\sigma$)}} &{{$N_{p\ell}^{UL}$}} & {{$\mathcal{B} \times 10^{-7}$}} \\ [0.5ex] \hline \hline $D^{0} \rightarrow pe^{-}$ & 10.16 & -6.4 \pm 8.5& {-} & 16.2 & < 5.1 \\ [1ex] %\hline $\bar{D}^{0} \rightarrow pe^{-}$ & 10.19 & -18.4 \pm 23 & {-} & 22.0 & < 6.9 \\ [1ex] %\hline $D^{0} \rightarrow \bar{p}e^{+}$ & 9.72 & -4.7 \pm 23 & {-} & 21.6 & < 7.1 \\ [1ex] %\hline $\bar{D}^{0} \rightarrow \bar{p}e^{+}$ & 9.62 & 7.1 \pm 9.0 & 0.60 & 23.0 & < 7.6 \\ [1ex] %\hline $D^{0} \rightarrow p\mu^{-}$ & 10.75 & 11.0 \pm 23 & 0.95 & 17.1 & <5.1 \\ [1ex] %\hline $\bar{D}^{0} \rightarrow p\mu^{-}$ & 10.71 &-10.8 \pm 27 & {-} & 20.5 & <6.1 \\ [1ex] %\hline $D^{0} \rightarrow \bar{p}\mu^{+}$ & 10.52 &-4.5 \pm 14 & {-} & 21.0 & <6.3 \\ [1ex] %\hline $\bar{D}^{0} \rightarrow \bar{p}\mu^{+}$ & 10.45 & 16.7 \pm 8.8 & 1.56 & 21.4 & <6.5 \\ [1ex] \hline \hline \end{tabular} \end{table} ```
https://tex.stackexchange.com/users/298826
How to create a thinspace?
false
I suggest you change the column type of the final column to `c` and insert `{}` (an "empty math atom") before each instance of `<` in that column. I would also change the table type from `tabular` to `array` since most of the material is math-y. And I'd employ the line-drawing macros of the `booktabs` package instead of `\hline\hline`. ``` \documentclass{article} \usepackage{amsmath,siunitx,booktabs} \newcolumntype{T}[1]{S[table-format=#1]} \begin{document} \begin{table}[htbp] \caption{Reconstruction efficiency ($\epsilon$), signal yield ($N_{S}$), signal significance ($\mathcal{S}$), upper limit on the signal yield ($N_{p\ell}^{UL}$), and branching fraction ($\mathcal{B}$) at 90\% confidence level for each decay mode.} \label{tab:ul_data} \[ \begin{array}{@{} l T{2.2} T{-2.1+-3.0} T{1.2} T{2.1} c @{}} \toprule \mbox{Decay mode} & {\epsilon\ (\%)} & {N_S} & {\mathcal{S}(\sigma)} & {N_{p\ell}^{\mathrm{UL}}} & {\mathcal{B} {\times} 10^{-7}} \\ \midrule D^{0} \to pe^{-} & 10.16 & -6.4 \pm 8.5& {\text{--}} & 16.2 & {}< 5.1 \\ \bar{D}^{0} \to pe^{-} & 10.19 &-18.4 \pm 23 & {\text{--}} & 22.0 & {}< 6.9 \\ \addlinespace D^{0} \to \bar{p}e^{+} & 9.72 & -4.7 \pm 23 & {\text{--}} & 21.6 & {}< 7.1 \\ \bar{D}^{0}\to\bar{p}e^{+} & 9.62 & 7.1 \pm 9.0& 0.60 & 23.0 & {}< 7.6 \\ \addlinespace D^{0} \to p\mu^{-} & 10.75 & 11.0 \pm 23 & 0.95 & 17.1 & {}< 5.1 \\ \bar{D}^{0} \to p\mu^{-} & 10.71 &-10.8 \pm 27 & {\text{--}} & 20.5 & {}< 6.1 \\ \addlinespace D^{0} \to \bar{p}\mu^{+} & 10.52 & -4.5 \pm 14 & {\text{--}} & 21.0 & {}< 6.3 \\ \bar{D}^0\to\bar{p}\mu^{+} & 10.45 & 16.7 \pm 8.8 & 1.56 & 21.4 & {}< 6.5 \\ \bottomrule \end{array} \] \end{table} \end{document} ```
1
https://tex.stackexchange.com/users/5001
689894
320,041
https://tex.stackexchange.com/questions/688991
2
About one and a half decades ago I tried printing a panorama with LaTeX and found a version with several calls to \afterpage, that worked for me. Meanwhile, I found a much more elegant, shorter, and better understandable algorithm by Martin Scharrer working after the same principle here: [How to include a picture over two pages, left part on left side, right on right (for books)?](https://tex.stackexchange.com/questions/23860/how-to-include-a-picture-over-two-pages-left-part-on-left-side-right-on-right), but I still use my own version ("never change a running system!"). A few days ago Ulrike Fischer had a look at my code and complained about my usage of \afterpage, which would destroy my footnotes: " It doesn't need to be inside the float, you can also move it behind the figure, it only matters here that it is executed while footnotes and floats are handled" and I should never use \afterpage ([Footnotetext jumps to next page and back again](https://tex.stackexchange.com/questions/688815/footnotetext-jumps-to-next-page-and-back-again)). So I replaced the one appearance of \afterpage Ulrike had specially hinted at and my original problem vanished. But afterward, I had a deeper look at my output, and hmm..., Ulrike is right: There are even more problems, I only got used to them over the years. Since I wrote my algorithm, others have done so as well and I searched, whether they were able to solve the problem without \afterpage. But alas, I found \afterpage in Martin Scharrers algorithm as well as in the package hvfloat by Herbert Voß -- and both authors seem to know much more about LaTeX than me. Is it impossible to reach my aim without \afterpage? So I tried another time, starting with Martin Scharrers code: ``` \documentclass[twoside]{book} \usepackage{graphicx} \usepackage{adjustbox} \usepackage{placeins} \usepackage{xcolor} % For the `memoir` class remove the following two packages. % This class already provide the functionality of both \usepackage{caption} \usepackage[strict]{changepage} %%% \setcounter{totalnumber}{1} \setcounter{topnumber}{1} \setcounter{bottomnumber}{1} \renewcommand{\topfraction}{.99} \renewcommand{\bottomfraction}{.99} \renewcommand{\textfraction}{.01} \makeatletter \newcommand*{\twopagepicture}[4]{% \checkoddpage \ifoddpage \expandafter\suppressfloats% <-- replaced \afterpage by suppressfloats \else \expandafter\@firstofone% <-- and reversed order of \suppressfloats and \@firstofone \fi {{% <-- deleted \afterpage here, replaced by reversed order two lines above \begin{figure}[#1] \if #2p% \if #1t% \thispagestyle{empty}% <-- moved here for moving with figure \vspace*{-\dimexpr1in+\voffset+\topmargin+\headheight+\headsep\relax}% \fi \fi \if #1b% \caption{#4}% \fi \makebox[\textwidth][l]{% \if #2p\relax \let\mywidth\paperwidth \hskip-\dimexpr1in+\hoffset+\evensidemargin\relax \else \let\mywidth\linewidth \fi \adjustbox{trim=0 0 {.5\width} 0,clip}{\includegraphics[width=2\mywidth]{#3}}}% \if #1b\else \caption{#4}% \fi \if #2p% \if #1b% \vspace*{-\dimexpr\paperheight-\textheight-1in-\voffset-\topmargin-\headheight-\headsep\relax}% \fi \fi \end{figure}% \begin{figure}[#1] \if #2p% \if #1t% \thispagestyle{empty}% <-- moved here for moving with figure (replaces another \afterpage call) \vspace*{-\dimexpr1in+\voffset+\topmargin+\headheight+\headsep\relax}% \fi \fi \makebox[\textwidth][l]{% \if #2p% \let\mywidth\paperwidth \hskip-\dimexpr1in+\hoffset+\oddsidemargin\relax \else \let\mywidth\linewidth \fi \adjustbox{trim={.5\width} 0 0 0,clip}{\includegraphics[width=2\mywidth]{#3}}}% \if #2p% \if #1b% \vspace*{-\dimexpr\paperheight-\textheight-1in-\voffset-\topmargin-\headheight-\headsep\relax}% \fi \fi \end{figure}% }}% } \makeatother \usepackage{lipsum} \begin{document} \lipsum \lipsum \twopagepicture{b}{l}{image}{Test} \lipsum \lipsum \twopagepicture{t}{l}{image}{Test} \lipsum \lipsum \twopagepicture{b}{p}{image}{Other test} \lipsum \lipsum \twopagepicture{t}{p}{image}{Other test with very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long caption } \lipsum \lipsum \end{document} ``` The biggest problem for me was the \afterpage call, which was used if \twopagepicture was called on an odd page, as then the panorama breaks. But I had the idea, in that case to push both figures one page forward not with \afterpage, but with \suppressfloats. Now I have two questions: 1. The code of the MWE now works, if I replace "image" with the path to a quite wide image. Nevertheless, I am a bit anxious, about whether I have done a bad mistake again, as I do things, I have never done before. Are there any flaws visible again? 2. One problem remaining is: My mechanism with \suppressfloats only works, if not another float of the queue gets between it and my two figures. I thought about a \FloatBarrier just above \checkoddpage, but that would only reduce the possibility, not be foolproof. Has anybody a better idea?
https://tex.stackexchange.com/users/202047
Two page panorama without \afterpage -- tables as well as figures
false
``` \documentclass[twoside]{book} \usepackage{graphicx} \usepackage{caption} \usepackage{hvfloat} \usepackage{lipsum} \begin{document} \lipsum \lipsum \hvFloat[doublePage]{figure}{\includegraphics[doublefullPage]{felsen-wasser}} {This is the first double page image}{} \lipsum \lipsum \hvFloat[doublePage,sameHeight]{figure}{\includegraphics[doublefullPage]{felsen-wasser}} {This is the second double page image}{} \lipsum \lipsum \hvFloat[doublePAGE]{figure}{\includegraphics[doublefullPage]{felsen-wasser}} {This is the third double page image}{} \lipsum \lipsum \hvFloat[doublePAGE]{figure}{\includegraphics[doublefullPage]{felsen-wasser}} {This is the last double page image with a very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long caption }{} \lipsum \lipsum \end{document} ``` Page 4--5: Page 8--9 Page 12--13 Page 16--17
0
https://tex.stackexchange.com/users/187802
689903
320,044
https://tex.stackexchange.com/questions/689904
0
Please, don't ask why I need this. I need to print `>` character, but I can't use the `>` symbol inside the `.tex` file. `\rangle` doesn't work for me, since it prints a math-mode char, which looks very much different from `\texttt{>}` (I need true-type font).
https://tex.stackexchange.com/users/1449
How can I print a right/left angle character without using ">" and "<" symbols?
false
When compiling with XeLaTeX or LuaLaTeX you can use the following: ``` \documentclass{article} \chardef\myrangle=62 \chardef\mylangle=60 \begin{document} \mylangle\myrangle \end{document} ``` (in pdfLaTeX you'll need to also `\usepackage[T1]{fontenc}`). This'll give the following output:
1
https://tex.stackexchange.com/users/117050
689905
320,045
https://tex.stackexchange.com/questions/689899
0
I organize my references with bibdesk, most entries have files attached to them. I am using `bib2bib` (which is part of [bib2html](https://www.lri.fr/%7Efilliatr/bibtex2html/)) to export smaller bibliographies based on keyword with a `sh` script, here is an example: ``` bib2bib -ob subset.bib -c 'Keywords : "subset"' allBibEntries/allBibEntries.bib ``` I would like to also save a folder with the files linked to an entry in the same directory (or a subfolder) in which `subset.bib` is saved. Is there a command-line way to save the attached files from a `.bib` file organized with Bibdesk (so using the information in the `bdsk-file-x` fields? I'm not wedded to using `bib2html` if there's an alternative way...
https://tex.stackexchange.com/users/241834
export .bib and files with bib2html
false
This works on my computer: `bibtool -r bibtoolrsc -X /path/to/your/library.bib -i %f -e '.*' -d /path/to/save/files/`
0
https://tex.stackexchange.com/users/216807
689908
320,046
https://tex.stackexchange.com/questions/689907
1
I'm writing a document with multiple files, and I hope to add titles to them like so: ``` %%% main.tex \documentclass{article} \usepackage{subfiles} \title{Main} \begin{document} \maketitle Some text \subfile{a} \end{document} ``` and ``` %%% a.tex \documentclass[main]{subfiles} \title{A} \begin{document} \maketitle Subordinate text \end{document} ``` such that when I compile `main.tex`, `main.pdf` reads: **Main** Some text Subordinate text and when I complile `a.tex`, `a.pdf` reads: **A** Subordinate text Is this possible? Thank you in advance!
https://tex.stackexchange.com/users/101980
Add separate \maketitle to subfile which only executes when the subfile is compiled independently
false
One simple method you could use is to define an auxiliary in the preamble, since the preamble of the subfile will be ignored you can then use that auxiliary instead of `\maketitle`. The following does this for your two files: ``` %%% main.tex \documentclass{article} \usepackage{subfiles} \title{Main} \newcommand\submaketitle{} \begin{document} \maketitle Some text \subfile{a} \end{document} ``` ``` %%% a.tex \documentclass[main]{subfiles} \title{A} \newcommand\submaketitle{\maketitle} \begin{document} \submaketitle Subordinate text \end{document} ``` Then, if you compile `main.tex` you'll get: And if you compile `a.tex` you'll get:
2
https://tex.stackexchange.com/users/117050
689909
320,047
https://tex.stackexchange.com/questions/689904
0
Please, don't ask why I need this. I need to print `>` character, but I can't use the `>` symbol inside the `.tex` file. `\rangle` doesn't work for me, since it prints a math-mode char, which looks very much different from `\texttt{>}` (I need true-type font).
https://tex.stackexchange.com/users/1449
How can I print a right/left angle character without using ">" and "<" symbols?
true
`\textgreater` works with any encoding (in text mode); remember that TeX will ignore spaces following the command, so you may need `\textgreater{}` if a space must follow. If you also need to use `>` in math mode (but cannot input the character), also do ``` \DeclareMathSymbol{\mathgreater}{\mathrel}{letters}{"3E} ``` or, more simply but more cryptic, ``` \mathchardef\mathgreater=\mathcode62 ```
1
https://tex.stackexchange.com/users/4427
689911
320,048
https://tex.stackexchange.com/questions/689868
0
I am using the tgheros and sansmath package for my document. That changes the text font to sans-serif and all the parts of the math that are supported, meaning greek letters are still typeset with serifs. Here is a working minimal example: ``` \documentclass{article} \usepackage[T1]{fontenc} \usepackage{tgheros,sansmath} \renewcommand{\familydefault}{\sfdefault} \sansmath \begin{document} a %a is sans-serif. $$\alpha a$$ %a is sans-serif, \alpha is not - I'd like it to be. \end{document} ``` I would like to use cmbright for greek letters only as it is close enough of a match that it looks alright with the other sans-serif math (meaning just importing the cmbright package doesn't work as it changes the font for all the maths). How would I go about this? I am even happy for this not to happen automatically and having to manually set greek letters to cmbright with some command akin to \MakeThisCMBright{\alpha}. Note: I am using pdftex.
https://tex.stackexchange.com/users/299857
How to use cmbright for just greek letters
false
Run with `xelatex` or better with `lualatex` ``` \documentclass{article} \usepackage{firamath-otf} \usepackage[default]{FiraSans} \begin{document} a\textit{a} %a is sans-serif. $\alpha\beta a$ %a is sans-serif. \end{document} ```
0
https://tex.stackexchange.com/users/187802
689914
320,049
https://tex.stackexchange.com/questions/689868
0
I am using the tgheros and sansmath package for my document. That changes the text font to sans-serif and all the parts of the math that are supported, meaning greek letters are still typeset with serifs. Here is a working minimal example: ``` \documentclass{article} \usepackage[T1]{fontenc} \usepackage{tgheros,sansmath} \renewcommand{\familydefault}{\sfdefault} \sansmath \begin{document} a %a is sans-serif. $$\alpha a$$ %a is sans-serif, \alpha is not - I'd like it to be. \end{document} ``` I would like to use cmbright for greek letters only as it is close enough of a match that it looks alright with the other sans-serif math (meaning just importing the cmbright package doesn't work as it changes the font for all the maths). How would I go about this? I am even happy for this not to happen automatically and having to manually set greek letters to cmbright with some command akin to \MakeThisCMBright{\alpha}. Note: I am using pdftex.
https://tex.stackexchange.com/users/299857
How to use cmbright for just greek letters
true
In the Modern Toolchain ----------------------- If you can use LuaLaTeX or XeLaTeX, this will get you the specific fonts you requested, with other sans-serif math symbols from Fira Math. ``` \documentclass{article} \usepackage{unicode-math} \defaultfontfeatures{Scale=MatchLowercase} \setmainfont{TeX Gyre Heros}[Scale=1.0] \setsansfont{TeX Gyre Heros} \setmathfont{Fira Math} \setmathfont{TeX Gyre Heros}[range=up/{Latin,latin,Num}] \setmathfont{TeX Gyre Heros Italic}[range=it/{Latin,latin}] \setmathfont{TeX Gyre Heros Bold}[range=bfup/{Latin,latin,Num}] \setmathfont{TeX Gyre Heros Bold Italic}[range=bfit/{Latin,latin}] \setmathfont{CMU Bright}[range=up/{Greek,greek}] \setmathfont{CMU Bright Oblique}[range=it/{Greek,greek}] \setmathfont{CMU Bright Bold}[range=bfup/{Greek,greek}] \setmathfont{CMU Bright Bold Oblique}[range=bfit/{Greek,greek}] \begin{document} a $\alpha a$ \end{document} ``` If what you really want is a consistent set of sans-serif fonts for text and math, a much simpler way is ``` \usepackage[fira]{fontsetup} ``` Note that this also only works in LuaLaTeX or XeLaTeX. (And that I got beaten to it while writing this answer.) With Legacy Fonts ----------------- Another frame challenge: if what you want is to use sans-serif math throughout your document, not to switch between serif and sans-serif math versions, you may get better results with a sans-serif math package, such as `sansmathfonts` or `newtxsf`—or even `cmbright`—and no longer feel the need to use CM Bright for Greek only. If you still do, you have to load the `cmbr` family as a math font in OML encoding, and redefine all the Greek letters. The `sansmath` package breaks this, but it works with `sansmathfonts`. ``` \documentclass{article} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{sansmathfonts} \usepackage{tgheros} \renewcommand{\familydefault}{\sfdefault} \usepackage[italic]{mathastext} \DeclareSymbolFont{cmbright}{OML}{cmbr}{m}{it} \SetSymbolFont{cmbright}{bold}{OML}{cmbr}{bx}{it} \DeclareMathSymbol{\alpha}{\mathalpha}{cmbright}{"0B} \DeclareMathSymbol{\beta}{\mathalpha}{cmbright}{"0C} % etc. \begin{document} a $\alpha a \boldsymbol{\alpha a}$ \end{document} ``` Note that TeX Gyre Heros and Computer Modern Bright do not have the same x-height. You can look up and manually-enter [the slot of every Greek letter in the seven-bit OML encoding](https://www.latex-project.org/help/documentation/encguide.pdf#subsection.A.4), keeping in mind that it reuses several Latin letters such as A, B, H, etc. as Greek capitals. Both of these problems would be possible to fix by copying and editing a lot of boilerplate (see `OMLcmbr.fd`), if you really, truly want to go that route.
0
https://tex.stackexchange.com/users/61644
689916
320,051
https://tex.stackexchange.com/questions/689912
0
I would like to have a progressive numbering of Theorems, Lemmas, Corollaries, Examples, Remarks, etc. within sections. While for equations I would like a numbering within chapters. Also, I would like the counter to be set to 0 when starting a new chapter. I would say that the main problem is that I use the package tcolorbox for theorems, corollaries, lemmas, etc., and amsthm for examples and remarks. Below you find the MWE I'd need. ``` \documentclass[x11names,two sides,12pt]{book} \usepackage{changepage} \usepackage[titles]{tocloft} \renewcommand{\cftdot}{} \renewcommand{\cftchapfont}{\normalsize \bf\scshape} \renewcommand{\cftsecfont}{\normalsize} \renewcommand{\cftsubsecfont}{\itshape} \usepackage{geometry} \geometry{ left=25mm, right=25mm, top=20mm, bottom=20mm, headheight=14pt } \usepackage{soul} \usepackage{pgfkeys} \usepackage{tikz,tikz-cd} \usepackage{amsthm,amssymb,amsfonts,mathrsfs} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage[colorlinks = true, linkcolor = blue, filecolor=black, urlcolor = black!40!cyan, citecolor = blue, anchorcolor = red!60!black, pdfencoding=auto, psdextra ]{hyperref} \usepackage{tcolorbox} \tcbuselibrary{theorems,breakable} \usepackage[pagestyles, clearempty,explicit]{titlesec} \usepackage[titles]{tocloft} \usepackage[nottoc,numbib]{tocbibind} \theoremstyle{definition} \newtheorem{ex}{Example}[section] \theoremstyle{definition} \newtheorem{rmk}{Remark}[section] \newtcbtheorem[number within=section]{thm}{Theorem}{before skip=10pt, breakable, detach title, leftrule=2mm, before upper={\tcbtitle\quad},coltitle=black, colback=black!3!white, colframe=black!10!white, fonttitle=\bfseries, arc=0mm, separator sign none, description delimiters parenthesis, terminator sign colon}{theo} \newtcbtheorem[number within=section]{thm1}{Théorème}{before skip=10pt, breakable, detach title, leftrule=2mm, before upper={\tcbtitle\quad},coltitle=black, colback=black!3!white, colframe=black!10!white, fonttitle=\bfseries, arc=0mm, separator sign none, description delimiters parenthesis, terminator sign colon}{theo1} \newtcbtheorem[number within=section]{propn}{Proposition}{before skip=10pt, breakable , coltitle=black, leftrule=2mm, detach title, before upper={\tcbtitle\quad}, colback=black!3!white,colframe=black!10!white,fonttitle=\bfseries, arc=0mm, separator sign none, description delimiters parenthesis, terminator sign colon}{propn} %questo serve per il ref \newtcbtheorem[number within=section]{lem}{Lemma}{before skip=10pt, breakable, coltitle=black, detach title, leftrule=2mm, before upper={\tcbtitle\quad}, colback=black!3!white,colframe=black!10!white,fonttitle=\bfseries, arc=0mm, separator sign none, description delimiters parenthesis, terminator sign colon}{lem} \newtcbtheorem[number within=section]{defn}{Definition}{before skip=10pt, coltitle=black, breakable, leftrule=2mm, coltitle=black, detach title, before upper={\tcbtitle\quad}, colback=black!3!white, colframe=black!10!white, fonttitle=\bfseries, arc=0mm, separator sign none, description delimiters parenthesis, terminator sign colon}{defn} \newtcbtheorem[number within=section]{cor}{Corollary}{before skip=10pt, coltitle=black, breakable, detach title, leftrule=2mm, before upper={\tcbtitle\quad}, colback=black!3!white,colframe=black!10!white,fonttitle=\bfseries, arc=0mm, separator sign none, description delimiters parenthesis, terminator sign colon}{corol} \newtcbtheorem[number within=section]{cor1}{Corollaire}{before skip=10pt, coltitle=black, breakable, detach title, leftrule=2mm, before upper={\tcbtitle\quad}, colback=black!3!white,colframe=black!10!white,fonttitle=\bfseries, arc=0mm, separator sign none, description delimiters parenthesis, terminator sign colon}{corol1} \titleformat{\section}[display]{\fontsize{12}{0} \bfseries}{}{0pt}{\colorbox{black!15!white}{\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\thesection \textcolor{black}{\quad#1}}}}[] \titleformat{\subsection}[display] {\itshape \normalsize \bfseries}{\thesubsection \textcolor{black}{\quad#1}}{-0.4cm}{} \titleformat{name=\section,numberless}[display]{\fontsize{11.4}{0} \bfseries}{}{0pt}{\colorbox{black!15!white}{\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\textcolor{black}{\quad#1}}}}[] \titlespacing*{\section}{-0.8cm}{0.7cm}{0.2cm}[0pt] {\setcounter{secnumdepth}{0}% \addtocontents{toc}{\protect\setcounter{tocdepth}{0}\ignorespaces}} {\setcounter{secnumdepth}{2}% \addtocontents{toc}{\protect\setcounter{tocdepth}{2}\ignorespaces}} \titleformat{\chapter}[display] {\scshape\bfseries} {}{10pt} {\centering \LARGE \color{black!80!white} #1} \titlespacing*{\chapter}{0pt}{0pt}{20pt}{} \titleformat{\paragraph}[display]{\fontsize{11}{0}\selectfont \bfseries }{}{0pt}{#1} \titlespacing*{\paragraph}{0.3cm}{0.4cm}{0.1cm}[0pt] \setcounter{secnumdepth}{3} \begin{document} \section{Section} \begin{thm}{}{} Theorem. \end{thm} \begin{cor}{}{} Corollary. \end{cor} \begin{rmk} \end{rmk} \begin{equation} 1+1=2 \end{equation} \begin{rmk} Remark. \end{rmk} \begin{equation} 2+1=3 \end{equation} \begin{ex} Another example. \end{ex} \begin{lem}{}{} Lemma. \end{lem} \begin{defn}{}{} Definition. \end{defn} \end{document} ``` So, referring to the above, I would like it to appear like "Theorem 0.1.1", "Corollary 0.1.2", "Remark 0.1.3", "Equation 0.1", "Remark 0.1.4", "Equation 0.2", "Example 0.1.5", "Lemma 0.1.6", "Definition 0.1.7". When changing the chapter, for example, I would like the numbering to start from "1.1.1" in the first section of the first chapter (for theorems etc.), while from 1.1 for equations. I hope I well explained what I'd need!
https://tex.stackexchange.com/users/183151
Numbering Theorems, Remarks, Examples etc. with a unique counter
true
In `tcolorbox` you can use the option `use counter` (unfortunately I can't make the `use counter*` option work if used for all the `\newtcbtheorem` instructions, so I use `use counter` together with `number within` on all of them). For `amsmath` you can specify the counter it should use by using `\newtheorem{<env>}[<counter>]{<title>}`. To alter the `equation` counter you can use `\counterwithin{equation}{chapter}`. Put together: ``` \documentclass[x11names,twoside,12pt]{book} \usepackage{amsthm} \usepackage{tcolorbox} \tcbuselibrary{theorems,breakable} \theoremstyle{definition} \counterwithin{equation}{chapter} \newcounter{fradnscounter}[section] \newtheorem{ex}[fradnscounter]{Example} \theoremstyle{definition} \newtheorem{rmk}[fradnscounter]{Remark} \newtcbtheorem[number within=section, use counter=fradnscounter]{thm}{Theorem}{before skip=10pt, breakable, detach title, leftrule=2mm, before upper={\tcbtitle\quad},coltitle=black, colback=black!3!white, colframe=black!10!white, fonttitle=\bfseries, arc=0mm, separator sign none, description delimiters parenthesis, terminator sign colon}{theo} \newtcbtheorem[number within=section, use counter=fradnscounter]{thm1}{Théorème}{before skip=10pt, breakable, detach title, leftrule=2mm, before upper={\tcbtitle\quad},coltitle=black, colback=black!3!white, colframe=black!10!white, fonttitle=\bfseries, arc=0mm, separator sign none, description delimiters parenthesis, terminator sign colon}{theo1} \newtcbtheorem[number within=section, use counter=fradnscounter]{propn}{Proposition}{before skip=10pt, breakable , coltitle=black, leftrule=2mm, detach title, before upper={\tcbtitle\quad}, colback=black!3!white,colframe=black!10!white,fonttitle=\bfseries, arc=0mm, separator sign none, description delimiters parenthesis, terminator sign colon}{propn} %questo serve per il ref \newtcbtheorem[number within=section, use counter=fradnscounter]{lem}{Lemma}{before skip=10pt, breakable, coltitle=black, detach title, leftrule=2mm, before upper={\tcbtitle\quad}, colback=black!3!white,colframe=black!10!white,fonttitle=\bfseries, arc=0mm, separator sign none, description delimiters parenthesis, terminator sign colon}{lem} \newtcbtheorem[number within=section, use counter=fradnscounter]{defn}{Definition}{before skip=10pt, coltitle=black, breakable, leftrule=2mm, coltitle=black, detach title, before upper={\tcbtitle\quad}, colback=black!3!white, colframe=black!10!white, fonttitle=\bfseries, arc=0mm, separator sign none, description delimiters parenthesis, terminator sign colon}{defn} \newtcbtheorem[number within=section, use counter=fradnscounter]{cor}{Corollary}{before skip=10pt, coltitle=black, breakable, detach title, leftrule=2mm, before upper={\tcbtitle\quad}, colback=black!3!white,colframe=black!10!white,fonttitle=\bfseries, arc=0mm, separator sign none, description delimiters parenthesis, terminator sign colon}{corol} \newtcbtheorem[number within=section, use counter=fradnscounter]{cor1}{Corollaire}{before skip=10pt, coltitle=black, breakable, detach title, leftrule=2mm, before upper={\tcbtitle\quad}, colback=black!3!white,colframe=black!10!white,fonttitle=\bfseries, arc=0mm, separator sign none, description delimiters parenthesis, terminator sign colon}{corol1} \setcounter{secnumdepth}{3} \begin{document} \section{Section} \begin{thm}{}{} Theorem. \end{thm} \begin{cor}{}{} Corollary. \end{cor} \begin{rmk} \end{rmk} \begin{equation} 1+1=2 \end{equation} \begin{rmk} Remark. \end{rmk} \begin{equation} 2+1=3 \end{equation} \begin{ex} Another example. \end{ex} \begin{lem}{}{} Lemma. \end{lem} \begin{defn}{}{} Definition. \end{defn} \section{Section} \begin{thm}{}{} Theorem. \end{thm} \begin{cor}{}{} Corollary. \end{cor} \begin{rmk} \end{rmk} \begin{equation} 1+1=2 \end{equation} \begin{rmk} Remark. \end{rmk} \begin{equation} 2+1=3 \end{equation} \begin{ex} Another example. \end{ex} \begin{lem}{}{} Lemma. \end{lem} \begin{defn}{}{} Definition. \end{defn} \end{document} ```
1
https://tex.stackexchange.com/users/117050
689918
320,052
https://tex.stackexchange.com/questions/689917
4
I'm trying to print the vertical bar symbol in text mode, but I can't use the `|` symbol itself. What is the right command for this? Please, don't suggest to use `\rule`, since I need the standard symbol in the current font.
https://tex.stackexchange.com/users/1449
How to print a vertical bar in text mode without the use of the "|" symbol?
true
The command to produce a `|` is `\textbar`. See `lttextcomp.dtx` in [`source2e`](http://mirrors.ctan.org/macros/latex/base/source2e.pdf). Note this works even in `OT1` encoding, where `|` produces a horizontal bar
8
https://tex.stackexchange.com/users/208544
689919
320,053
https://tex.stackexchange.com/questions/87789
1
By default TeX prints the page number at the bottom of the page. I added a custom header so that the page number appears in the top right hand corner. So I have the page number in two places, at the bottom of the page and in my header. How do I get rid of the page number that is at the bottom of the page?
https://tex.stackexchange.com/users/19229
Page numbers and headers
false
How do I get rid of the page number that is at the bottom of the page? R: Just write after `\pagestyle{fancy}`: ``` \cfoot{} ``` Here you have an MWE: ``` \documentclass[twoside]{article} \usepackage[utf8]{inputenc} \usepackage{amssymb} \usepackage{amsmath} \usepackage{txfonts} \usepackage{mathdots} \usepackage{lipsum} \usepackage{bmpsize} \usepackage[classicReIm]{kpfonts} \usepackage{scrextend} \usepackage{graphicx} \usepackage[affil-it]{authblk} \usepackage{fancyhdr} \usepackage{hyperref} \usepackage{titling} \setlength\headheight{20pt} \pagestyle{fancy} \cfoot{} \newcommand\authors{\textit{Rui S. Camps}} \fancyhead[LE,RO]{\textit{\thepage}} \fancyhead[LO]{\textit{\nouppercase{\leftmark}}} \fancyhead[RE]{\authors} % Move this line after \author command \renewcommand{\headrulewidth}{0.4pt} % Custom command to set running head for odd and even pages \newcommand{\oddhead}{\markright{Running Head}} \pagestyle{fancy} \begin{document} \title{Relative Advantage of Latex} \date{} \author{Rui de S. Camphos\thanks{Univ of Porto: \texttt{xx@fe.up.pt}}} \maketitle \thispagestyle{empty} \begin{small} \textbf{Abstract} \\ \noindent bla bla. \end{small} \newpage \section{Introduction} \textbf{1st paragraph}\\ \lipsum[1] \textbf{2nd paragraph}\\ \lipsum[2] \lipsum[2] \lipsum[3] \lipsum[3] \newpage \lipsum[5] \lipsum[6] \lipsum[7] \end{document} ```
0
https://tex.stackexchange.com/users/98630
689923
320,055
https://tex.stackexchange.com/questions/689926
3
This is the code, it compiles (please, don't ask me what it's for): ``` \documentclass{minimal} \begin{document} \ExplSyntaxOn \newcommand\foo[1]{ \tl_set:Nn \l_ebnf_tl { } \tl_set_rescan:Nno \l_ebnf_tl {}{#1} \l_ebnf_tl } \ExplSyntaxOff \foo{ \textdollar} \end{document} ``` However, if I modify the line with `textdollar` to this one (I just remove the leading space): ``` \foo{\textdollar} ``` It prints this: ``` ! Undefined control sequence. \l_ebnf_tl ->\? -cmd \textdollar \?\textdollar l.10 \foo{\textdollar} ``` What is this about and how to fix? I don't need this space character over there.
https://tex.stackexchange.com/users/1449
Why \tl_set_rescan fails without a leading space char?
true
The expansion of `\textdollar` is (courtesy of `\tl_analysis_show:N`) ``` The token list \textdollar contains the tokens: > \?-cmd (control sequence=macro:#1#2->\ifx \protect \@typeset@protect \ETC.) > \textdollar (control sequence=macro:->\?-cmd \textdollar \?\textdollar ) > \?\textdollar (control sequence=\long macro:->\UseTextSymbol {TS1}\te\ETC.). ``` The first control sequence cannot ordinarily be obtained, but it obviously can with `\csname ?-cmd\endcsname`. Also the third control sequence has been obtained with `\csname ?\string\textdollar\endcsname`. You're applying `\tl_set_rescan:no {} {\textdollar}` and TeX duly expands once `\textdollar` before performing `\tl_set_rescan:nn` and you get ``` \tl_set_rescan:nn {} {\?-cmd \textdollar \?\textdollar} ``` But at this point, category codes are the standard ones, so the rescanning interprets the input as ``` \?•-•c•m•d• •\textdollar•\?•\textdollar ``` (where `•` is used to separate one token from another) Now `\?` is usually undefined and you get the error. If you add a space like in ``` \foo{ \textdollar} ``` the `o` specifier means that the *first* token in the argument is tried for expansion. It's not expandable, so nothing happens and the rescanning produces a space followed by `\textdollar`.
5
https://tex.stackexchange.com/users/4427
689933
320,056
https://tex.stackexchange.com/questions/523675
6
I would like to add a new font specifier, so that I can for example use `C-c C-f C-a` to insert `\textcolour{blue}{*}` Is this possible?
https://tex.stackexchange.com/users/202672
Custom font specifiers in AUCTeX
false
After `M-x customize-variable RET LaTeX-font-list RET`: You should see that most of the `Key` field defined by AUCTeX is hardly invisible(depends on your color theme), this is because the key here are shown **as it is**, so things like `C-a` are invisible. So, you have to **insert the non-graphical char (such as control-c)** yourself in the `customize` buffer. Say you wanna bind `C-c C-f C-x` to inserting `aaa[your text]bbb` then try: 1. Press the `INS` button to insert a new entry 2. In the `Prefix` field, type: `aaa` 3. In the `Suffix` field, type: `bbb` 4. In the `Key` field, type : `C-q C-x` (this will insert a literal `C-x` into the buffer, `C-q` stands for `(quoted-insert)`) 5. Click `Apply And Save` at the top. 6. Back in your `.tex` file, `M-x TeX-normal-mode` to take that into effect (this should load the style hooks and everything.). Note: You cannot fill emacs-lisp expression in the these fields. In fact it's easier (and safer) to set `Key` field to something like `x`, this will bind your `PREFIX[your text]SUFFIX` pair to key `C-c C-f x`. Or, if you prefer lisp: ``` (add-to-list 'LaTeX-font-list '(?a "\\myFontA{" "}")) ;;bind to C-c C-f a (add-to-list 'LaTeX-font-list '(?b "\\myFontB{" "}")) ;;bind to C-c C-f b ;;Sometimes you need the following. This reload the 'LaTeX-font-list ;; (TeX-normal-mode) ```
1
https://tex.stackexchange.com/users/297499
689941
320,059
https://tex.stackexchange.com/questions/689942
2
I have a 0th chapter in my book to recollect the prerequisites. The figure environment is supposed to follow the default numbering scheme: `\thechapter.\thefigure`. However, this scheme is violated in the 0th chapter, whereas the behaviour is as expected in the 'non-zero' chapters. The following MWE illustrates the problem. I want the `figure`s to follow the same numbering scheme in the 0th chapter as in other chapters. ``` \documentclass{book} \usepackage{graphicx} \begin{document} \setcounter{chapter}{-1} \chapter{0th} \begin{figure} \includegraphics{example-image-a} \caption{Image A} \end{figure} \begin{figure} \includegraphics{example-image-b} \caption{Image B} \end{figure} \chapter{1st} \begin{figure} \includegraphics{example-image-a} \caption{Image A} \end{figure} \begin{figure} \includegraphics{example-image-b} \caption{Image B} \end{figure} \end{document} ```
https://tex.stackexchange.com/users/162028
Problem with Figure counter in the 0th chapter in book class
true
Please try with the tag `\numberwithin{figure}{chapter}` from the package `amsmath` and the `MWE` is: ``` \documentclass{book} \usepackage{graphicx} \usepackage{amsmath} \begin{document} \numberwithin{figure}{chapter} \setcounter{chapter}{-1} \chapter{0th} \begin{figure} \includegraphics{example-image-a} \caption{Image A} \end{figure} \begin{figure} \includegraphics{example-image-b} \caption{Image B} \end{figure} \clearpage \chapter{1st} \begin{figure} \includegraphics{example-image-a} \caption{Image A} \end{figure} \begin{figure} \includegraphics{example-image-b} \caption{Image B} \end{figure} \end{document} ```
1
https://tex.stackexchange.com/users/121024
689943
320,060
https://tex.stackexchange.com/questions/689942
2
I have a 0th chapter in my book to recollect the prerequisites. The figure environment is supposed to follow the default numbering scheme: `\thechapter.\thefigure`. However, this scheme is violated in the 0th chapter, whereas the behaviour is as expected in the 'non-zero' chapters. The following MWE illustrates the problem. I want the `figure`s to follow the same numbering scheme in the 0th chapter as in other chapters. ``` \documentclass{book} \usepackage{graphicx} \begin{document} \setcounter{chapter}{-1} \chapter{0th} \begin{figure} \includegraphics{example-image-a} \caption{Image A} \end{figure} \begin{figure} \includegraphics{example-image-b} \caption{Image B} \end{figure} \chapter{1st} \begin{figure} \includegraphics{example-image-a} \caption{Image A} \end{figure} \begin{figure} \includegraphics{example-image-b} \caption{Image B} \end{figure} \end{document} ```
https://tex.stackexchange.com/users/162028
Problem with Figure counter in the 0th chapter in book class
false
Originally `book.cls` defines `\thefigure` as: ``` \renewcommand \thefigure {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@figure} ``` which means, that the chapter counter is only shown, if the chapter number (`\c@chapter`) is greater than 0 (`\z@`). This is, to avoid e.g. the usage of the chapter counter prefix for chapters in the frontmatter. To avoid this, you could remove the condition and use: ``` \renewcommand\thefigure{\thechapter.\arabic{figure}} ``` in the document preamble. The same could be done using: ``` \counterwithout{figure}{chapter}% only to have the counter only once in the reset list of chapter, which usually wouldn't be problematic \counterwithin{figure}{chapter} ``` But (as already explained), this would also show, e.g., "0.<FigureNo>" in the front matter, where the chapter won't be numbered. To avoid this, you can use a definition similar to the KOMA-Script class `scrbook`: ``` \makeatletter \renewcommand*{\thefigure}{\if@mainmatter\thechapter.\fi\@arabic\c@figure} \makeatother ``` If you also have other elements also using the chapter counter in your chapter 0, you can adapt all the above also for those. For example for tables replace `\thefigure` by `\thetable`, `figure` by `table` or `\c@figure` by `\c@table`. Here an example with all relevant counters, defined by `book.cls`: ``` \documentclass{book} \usepackage{graphicx} \renewcommand*{\thefigure}{\thechapter.\arabic{figure}} \renewcommand*{\thetable}{\thechapter.\arabic{table}} \renewcommand*{\theequation}{\thechapter.\arabic{equation}} %\renewcommand*{\thelstlisting}{\thechapter.\arabic{lstlisting}}% if you use listings in your chapter 0 \begin{document} \setcounter{chapter}{-1} \chapter{0th} \begin{figure} \includegraphics{example-image-a} \caption{Image A} \end{figure} \begin{figure} \includegraphics{example-image-b} \caption{Image B} \end{figure} \clearpage \chapter{1st} \begin{figure} \includegraphics{example-image-a} \caption{Image A} \end{figure} \begin{figure} \includegraphics{example-image-b} \caption{Image B} \end{figure} \end{document} ```
5
https://tex.stackexchange.com/users/277964
689946
320,061
https://tex.stackexchange.com/questions/689950
4
I am trying to get the "Bourbaki" symbol (dangerous bend U+2621). I use latin modern font which doesn't have this symbol, so I tried this (changing the font in STIX): ``` \documentclass[10pt,a4paper,french]{article} \usepackage{babel} \usepackage[warnings-off={mathtools-colon,mathtools-overbracket},math-style=french]{unicode-math} \usepackage[scale={0.75,0.8},footskip=1.5cm,heightrounded]{geometry} \NewDocumentCommand{\bourbaki}{}{{\setmainfont{STIX two Text}\symbol{"2621}}} \begin{document} \bourbaki \end{document} ``` It doesn't work because in the log file, I get: Missing character: There is no ☡ (U+2621) in font STIXtwoText:mode=node;script =latn;language=dflt;+tlig;! How could I get the symbol?
https://tex.stackexchange.com/users/249670
Changing unicode font for just one symbol
false
``` \documentclass[10pt,a4paper,french]{article} \usepackage{babel} \usepackage[warnings-off={mathtools-colon,mathtools-overbracket},math-style=french]{unicode-math} \setmathfont{latinmodern-math.otf} \setmathfont[version=stx,range="2621]{STIX2Math.otf} \newcommand\bourbaki{{\mathversion{stx}\ensuremath{\symbol{"2621}}}} \begin{document} foo \bourbaki\ bar $\bourbaki$ \end{document} ```
2
https://tex.stackexchange.com/users/187802
689952
320,063
https://tex.stackexchange.com/questions/689954
0
Which font is used for cursive writing in LaTeX? `{\raggedleft\small\sffamily\bfseries\itshape\@JournalInfo\\ \scriptsize\@Archive\par}` Here, `sffamily` I think it is for font. Isn't it?
https://tex.stackexchange.com/users/299890
Which font is used for cursive writing in LaTeX?
false
What you provide is a command to tell the compiler how to typeset entries in *JournalInfo* and *Archive*, two locations defined somewhere in a class or preamble. *JournalInfo* is typeset right aligned (`\raggedleft`) using a sans serif font (`sffamily`) set as *bold* (`\bfseries`) and *italics* (`\itshape`) in a smaller font size (`\small`) than the normal text. The command `\sffamily` doesn't specify any particular font, just that that font needs to be part of a sans serif family. Look at the [LaTeX Font Catalogue](https://tug.org/FontCatalogue/) for available fonts in that family.
0
https://tex.stackexchange.com/users/189383
689959
320,065
https://tex.stackexchange.com/questions/689950
4
I am trying to get the "Bourbaki" symbol (dangerous bend U+2621). I use latin modern font which doesn't have this symbol, so I tried this (changing the font in STIX): ``` \documentclass[10pt,a4paper,french]{article} \usepackage{babel} \usepackage[warnings-off={mathtools-colon,mathtools-overbracket},math-style=french]{unicode-math} \usepackage[scale={0.75,0.8},footskip=1.5cm,heightrounded]{geometry} \NewDocumentCommand{\bourbaki}{}{{\setmainfont{STIX two Text}\symbol{"2621}}} \begin{document} \bourbaki \end{document} ``` It doesn't work because in the log file, I get: Missing character: There is no ☡ (U+2621) in font STIXtwoText:mode=node;script =latn;language=dflt;+tlig;! How could I get the symbol?
https://tex.stackexchange.com/users/249670
Changing unicode font for just one symbol
true
As far as I can tell, STIX Two Text doesn't have the glyph, but STIX Two Math has it. Since there is no law that requires math fonts to be exclusively used for math, you just define a suitable font face. ``` \documentclass[10pt,a4paper,french]{article} \usepackage{babel} \usepackage[scale={0.75,0.8},footskip=1.5cm,heightrounded]{geometry} \usepackage[ warnings-off={mathtools-colon,mathtools-overbracket}, math-style=french ]{unicode-math} \newfontface{\STIXTWO}{STIX Two Math} \NewDocumentCommand{\bourbaki}{}{\mbox{\STIXTWO\symbol{"2621}}} \begin{document} \bourbaki \end{document} ```
2
https://tex.stackexchange.com/users/4427
689963
320,069
https://tex.stackexchange.com/questions/689965
3
First of all, I guess that will be a very easy answer for people who are experienced in `expl3`. But for me its new and I'm very willing to learn that stuff to understand Latex3 better. So I hope for some pro help here. What i want to achieve is the following: First an userdefined command which has a simple sentence as content. Let's say `\NewDocumentCommand{\testcommand}{}{A Test Sentence for expl3}` Now I want to store *the content* of the command in a token list or string. So that it can be printed/used or counted. The latter is needed, because I want to use the number of characters in an if-condition which activates different commands depending on the total count. My MWE looks like this: ``` \documentclass[% ]{article} \usepackage[T1]{fontenc} \NewDocumentCommand{\testcommand}{}{A Test Sentence for expl3} \ExplSyntaxOn \tl_new:N \test_tl \tl_set:Nn \test_tl {\testcommand} \NewDocumentCommand{\showteststring}{}{ \tl_use:N \test_tl \par \tl_count:N \test_tl } \NewDocumentCommand{\countteststring}{}{ \tl_to_str:N \test_tl \par \str_count:N \test_tl } \ExplSyntaxOff \begin{document} \showteststring \countteststring \end{document} ``` `\showteststring` prints the content of `\testcommand` correctly using `\tl_use:N`, but `\tl_count:N` only counts one token; of course this token is `\testcommand`. The same for the for `\countteststring`. It converts only the command-sequence `\testcommand` into a string and counts the 13 characters of the command-sequence itself. So I need to expand `\testcommand` first. But my tries so far didn't offer any success. For instance, I tried: `\tl_set:Nx \test_tl {\testcommand}` (with **x**) instead of `\tl_set:Nn \test_tl {\testcommand}`. It compiles fine, but the output remains the same. I also tried some variants with `\exp_args:N`, but didn't get it to work, because I don't fully understand where to place it and which argument specifier to use in `expl3` syntax. I also thought about the **v**/**V** argument specifier, but couldn't get it to work. I looked into the **interface3** doc. But its overwhelming in case of informations and I couldn't figure out the right commands so far. Further, I searched Tex.SE and read the blog by [Ziyue Xiang](https://www.alanshawn.com/latex3-tutorial/#macro-expansion-control-v); also very informative, but not the specific solution I'm looking for (or, of course, I may have overlooked something). Thus, I am already thankful in advance for any help or hint! For an explanation I would also be very grateful, so I understand it better next time!
https://tex.stackexchange.com/users/297560
LaTeX3 how to use content/value of predefined command in token list/string?
true
You have declared `\testcommand` as a document command: these are protected from expansion. That means that `\tl_set:Nx \l_test_tl { \testcommand }` doesn't change the result. I would declare `\testcommand` as an expandable command and use `V`-type expansion: ``` \newcommand*\testcommand{A Test Sentence for expl3} \tl_set:NV \l_test_tl \testcommand ``` etc.
4
https://tex.stackexchange.com/users/73
689967
320,070
https://tex.stackexchange.com/questions/689950
4
I am trying to get the "Bourbaki" symbol (dangerous bend U+2621). I use latin modern font which doesn't have this symbol, so I tried this (changing the font in STIX): ``` \documentclass[10pt,a4paper,french]{article} \usepackage{babel} \usepackage[warnings-off={mathtools-colon,mathtools-overbracket},math-style=french]{unicode-math} \usepackage[scale={0.75,0.8},footskip=1.5cm,heightrounded]{geometry} \NewDocumentCommand{\bourbaki}{}{{\setmainfont{STIX two Text}\symbol{"2621}}} \begin{document} \bourbaki \end{document} ``` It doesn't work because in the log file, I get: Missing character: There is no ☡ (U+2621) in font STIXtwoText:mode=node;script =latn;language=dflt;+tlig;! How could I get the symbol?
https://tex.stackexchange.com/users/249670
Changing unicode font for just one symbol
false
The New Computer Modern Math fonts have the "Bourbaki" symbol (dangerous bend U+2621) matching the Computer Modern style. ``` \documentclass[10pt,a4paper,french]{article} \usepackage{babel} \usepackage[warnings-off={mathtools-colon,mathtools-overbracket},math-style=french]{unicode-math} \setmathfont{NewCMMath-Book} \usepackage[scale={0.75,0.8},footskip=1.5cm,heightrounded]{geometry} \NewDocumentCommand{\bourbaki}{}{\danger} \begin{document} \(\bourbaki\) \end{document} ```
0
https://tex.stackexchange.com/users/128462
689972
320,071
https://tex.stackexchange.com/questions/689965
3
First of all, I guess that will be a very easy answer for people who are experienced in `expl3`. But for me its new and I'm very willing to learn that stuff to understand Latex3 better. So I hope for some pro help here. What i want to achieve is the following: First an userdefined command which has a simple sentence as content. Let's say `\NewDocumentCommand{\testcommand}{}{A Test Sentence for expl3}` Now I want to store *the content* of the command in a token list or string. So that it can be printed/used or counted. The latter is needed, because I want to use the number of characters in an if-condition which activates different commands depending on the total count. My MWE looks like this: ``` \documentclass[% ]{article} \usepackage[T1]{fontenc} \NewDocumentCommand{\testcommand}{}{A Test Sentence for expl3} \ExplSyntaxOn \tl_new:N \test_tl \tl_set:Nn \test_tl {\testcommand} \NewDocumentCommand{\showteststring}{}{ \tl_use:N \test_tl \par \tl_count:N \test_tl } \NewDocumentCommand{\countteststring}{}{ \tl_to_str:N \test_tl \par \str_count:N \test_tl } \ExplSyntaxOff \begin{document} \showteststring \countteststring \end{document} ``` `\showteststring` prints the content of `\testcommand` correctly using `\tl_use:N`, but `\tl_count:N` only counts one token; of course this token is `\testcommand`. The same for the for `\countteststring`. It converts only the command-sequence `\testcommand` into a string and counts the 13 characters of the command-sequence itself. So I need to expand `\testcommand` first. But my tries so far didn't offer any success. For instance, I tried: `\tl_set:Nx \test_tl {\testcommand}` (with **x**) instead of `\tl_set:Nn \test_tl {\testcommand}`. It compiles fine, but the output remains the same. I also tried some variants with `\exp_args:N`, but didn't get it to work, because I don't fully understand where to place it and which argument specifier to use in `expl3` syntax. I also thought about the **v**/**V** argument specifier, but couldn't get it to work. I looked into the **interface3** doc. But its overwhelming in case of informations and I couldn't figure out the right commands so far. Further, I searched Tex.SE and read the blog by [Ziyue Xiang](https://www.alanshawn.com/latex3-tutorial/#macro-expansion-control-v); also very informative, but not the specific solution I'm looking for (or, of course, I may have overlooked something). Thus, I am already thankful in advance for any help or hint! For an explanation I would also be very grateful, so I understand it better next time!
https://tex.stackexchange.com/users/297560
LaTeX3 how to use content/value of predefined command in token list/string?
false
The `\NewDocumentCommand` facility is aimed at offering more powerful argument parsing than the legacy `\newcommand`. It is not at all suitable for defining “text containers”. If you want text containers, define an infrastructure for them. ``` \documentclass{article} \ExplSyntaxOn \NewDocumentCommand{\definecontainer}{mm} { \tl_clear_new:c { g_lukeflo_cont_#1_tl } \tl_gset:cn { g_lukeflo_cont_#1_tl } { #2 } } \NewExpandableDocumentCommand{\usecontainer}{m} { \tl_use:c { g_lukeflo_cont_#1_tl } } \NewExpandableDocumentCommand{\countcontainer}{sm} { \IfBooleanTF { #1 } {% count as string \str_count:e { \tl_to_str:v { g_lukeflo_cont_#2_tl } } } {% count as tl \tl_count:c { g_lukeflo_cont_#2_tl } } } \ExplSyntaxOff \definecontainer{test}{A Test Sentence for expl3} \definecontainer{test2}{abc} \begin{document} `\usecontainer{test}' has \countcontainer{test} items `\usecontainer{test}' has \countcontainer*{test} tokens `\usecontainer{test2}' has \countcontainer{test2} items `\usecontainer{test2}' has \countcontainer*{test2} tokens \end{document} ``` Note that `\tl_count:N` will not count spaces, whereas they're counted when the token list is first converted into a string.
5
https://tex.stackexchange.com/users/4427
689975
320,073
https://tex.stackexchange.com/questions/689902
-1
I work on generating a large PDF file from a markdown source with Pandoc. The document contains lots of non-floating images without caption. In these cases, the generated LaTeX code is simply `\includegraphics{path/to/file}`. The generated PDF shows hardly any whitespace between the image and the paragraphs above and below. I don't see where I can set a vertical margin for images with either Pandoc variables or within the template (e.g. the default template or Eisvogel) because they simply output the Pandoc generated `body` variable. Is there a way to fix this layout issue (other than inserting line breaks in the markdown)?
https://tex.stackexchange.com/users/168246
Vertical image spacing in Pandoc generated PDF
false
If you want, you can automatically add, e.g., a `center` environment to each `\includegraphics` not used inside given environments like `figure`, `table`, `center`, `flushleft` or `flushright`: ``` \documentclass{article} \usepackage{mwe} \NewCommandCopy{\savedincludegraphics}{\includegraphics} \makeatletter \renewcommand*{\includegraphics}[2][]{% \expandafter\in@\expandafter{\expandafter,\@currenvir,}% {,figure,table,center,flushleft,flushright,}% \ifin@ \savedincludegraphics[{#1}]{#2}% \else \begin{center}\savedincludegraphics[{#1}]{#2}\end{center}% \fi } \makeatother \begin{document} \blindtext \includegraphics[scale=.5]{example-image-a} \blindtext[2] \begin{figure}[htbp] \includegraphics[scale=.5]{example-image-b} \caption{Test (intended to not be centered)} \end{figure} \blindtext Next image also should be left aligned. \begin{flushleft} \includegraphics[scale=.5]{example-image-c} \end{flushleft} \blindtext \end{document} ``` I don't know how to tell `pandoc` to add the code ``` \NewCommandCopy{\savedincludegraphics}{\includegraphics} \makeatletter \renewcommand*{\includegraphics}[2][]{% \expandafter\in@\expandafter{\expandafter,\@currenvir,}% {,figure,table,center,flushleft,flushright,}% \ifin@ \savedincludegraphics[{#1}]{#2}% \else \begin{center}\savedincludegraphics[{#1}]{#2}\end{center}% \fi } \makeatother ``` to the document preamble, but I'm sure, it would be possible. But note: The redefinition would also be valid for, e.g., using `\includegraphics` in page headers or title pages. Note: If you want to extend the comma separated list ``` {,figure,table,center,flushleft,flushright,} ``` don't forget the comma at the start and the end! Note: If you'd use `\includegraphics` inside, e.g., a `tabular` inside a `table`, the `table` environment is not recognized by my re-definition of `\includegraphics`. Only the current inner environment is recognized. But you could, e.g., define a dummy environment: ``` \newenvironment{dontcenter}{}{} ``` and add this to the list. So you could use ``` \begin{dontcenter}\includegraphics{…}\end{dontcenter} ``` for all images inside other environments, which should not be centered.
3
https://tex.stackexchange.com/users/277964
689979
320,075
https://tex.stackexchange.com/questions/689971
0
The following Latex code allows me to create an appendix automatically where proofs are stored by setting the value of the command `\moveToAppendix` to `1`. ``` \documentclass[a4paper,USenglish]{article} \usepackage{amssymb,amsthm,amsmath} \usepackage{thmtools, thm-restate} \newtheorem{theorem}{Theorem} \newcommand{\moveToAppendix}{1} \newenvironment{varProof}[1] { \restatable{proof}{#1} } { \endrestatable } \begin{document} \begin{theorem} Toto. \end{theorem} \begin{varProof}{ProofOne} Tata. \end{varProof} \if\moveToAppendix1 \newpage \appendix \section{Auxiliary proofs} \ProofOne \fi \end{document} ``` The problem is, when `\moveToAppendix` is set to `1`, the proofs still remain in the main part of the paper (outside of the appendix), how would I go about making them invisible when the value of `\moveToAppendix` is set to `1`? EDIT: After a comment, I decided to include an example of what I want, but it's somewhat of a bother to define each proof like below and I was wondering whether I could define it in an environment somehow in a simpler manner to use each time I place a proof. ``` \documentclass[a4paper,USenglish]{article} \usepackage{amssymb,amsthm,amsmath} \usepackage{thmtools, thm-restate} \newtheorem{theorem}{Theorem} \newcommand{\moveToAppendix}{0} \newenvironment{varProof}[1] { \begin{proof}{#1} } { \end{proof} } \begin{document} \begin{theorem} Toto. \end{theorem} \newcommand{\ProofOne}{ \begin{proof} Tata. \end{proof} }\if\moveToAppendix0\ProofOne\fi \if\moveToAppendix1 \newpage \appendix \section{Auxiliary proofs} \label{appendix:aux} \ProofOne \fi \end{document} ```
https://tex.stackexchange.com/users/147720
How to hide this proof depending on my command's value?
false
The problem is that `\restatable` prints the contents of the theorem where it is called. A different approach might be to use a `\savebox` and then recall it in the appendix. ``` \documentclass[a4paper,USenglish]{article} \usepackage{xparse} \usepackage{amssymb,amsthm,amsmath} \usepackage{thmtools, thm-restate} \newtheorem{theorem}{Theorem} \newcommand{\moveToAppendix}{1} \NewDocumentEnvironment{varProof}{mb}{ \expandafter \newsavebox \csname#1box\endcsname \expandafter \global \expandafter \sbox \csname#1box\endcsname {% \parbox { \columnwidth } { \begin{theorem} #2 \end{theorem} }} \expandafter \gdef \csname#1\endcsname {% \expandafter\usebox\csname#1box\endcsname } \if\moveToAppendix0 \noindent\csname#1\endcsname \fi }{} \begin{document} \begin{theorem} Toto. \end{theorem} \begin{varProof}{ProofOne} Tata. \end{varProof} \if\moveToAppendix1 \newpage \appendix \section{Auxiliary proofs} \ProofOne \fi \end{document} ``` Note however, with this approach the theorem number will be based on where `\begin{varProof}` is *called*, and not where it is eventually printed in the appendix. **Edit:** For older (pre 2019) TeX installations, we need to use the `Environ` package. ``` \usepackage{environ} \NewEnviron{varProof}[1]{ \expandafter \newsavebox \csname#1box\endcsname \expandafter \global \expandafter \sbox \csname#1box\endcsname {% \parbox { \columnwidth } { \begin{theorem} \BODY \end{theorem} }} \expandafter \gdef \csname#1\endcsname {% \expandafter\usebox\csname#1box\endcsname } \if\moveToAppendix0 \noindent\csname#1\endcsname \fi } ```
0
https://tex.stackexchange.com/users/278687
689983
320,076
https://tex.stackexchange.com/questions/689981
1
I want the columns of the last row to be merged to one. How to do it? When i am having long sentence it wont come to next line even if i use \newline. Could anyone help me by adding one more such row... ``` \documentclass{article} \usepackage{tabularx} \usepackage{paralist} \makeatother \begin{document} \begin{table}[!b] \centering \caption{ Comparison between ST-Kriging, Bayesian inference, and ANNs.} \label{tab:2} \renewcommand{\arraystretch}{1.5} \scriptsize \begin{tabularx}{\textwidth}{|X|X|X|X|} \hline \textbf{} & \textbf{Bayesian Inferences} & \textbf{ST-Kriging} & \textbf{ANNs} \\ \hline \textbf{Computational Complexity} & NP-hard \cite{ref-satria2020spatial} & $O(N^2)$ & $O(i\times o\times n + n\times o)$ or $O(n \times o \times (i+1))$ for training a single epoch. \cite{ref-taylor1995freeway} \\ \hline \textbf{Performance Evaluation } & Provides a posterior probability distribution with confidence interval. & Ensure linear unbiased predictors. & Epoch with the lowest sum of squared error.\\ \hline \textbf{Weaknesses} & Very computationally intensive due to choosing the proper prior distribution. & \begin{compactitem} \item Missing value causes error in unmatched dimensions. \item Can not handle large datasets. \item Require normal distribution. \end{compactitem} & Require intensive data training, and this might lead to an overfitting problem. \\ \hline \textbf{Strengths } & \begin{compactitem} \item Handle large and small data. \item Handle missing values. \item Prior knowledge about uncertain input is not required. \end{compactitem} & \begin{itemize} \item Handle small data. \item Computational efficiency. \end{itemize} & \begin{compactitem} \item Handle big data and small data. \item Accommodate missing values without a separate estimation step [108] \item Computational efficiency due to the parallelity feature. \item Prior knowledge about uncertain input is not required. \end{compactitem} \\ \hline \textbf{Overcoming the Limitation} & Use uninformative prior to reduce the computational time, however, it can affect the prediction accuracy negatively. & Remove observations that include missing values. & \begin{compactitem} \item Decrease the number of layers of the network. \item Use iterative methods to stop the training process such as gradient descent. \end{compactitem} \\ \hline \end{tabularx} \end{table} \end{document} ```
https://tex.stackexchange.com/users/296796
how to merge column with tabularx?
false
I'm not sure, what you expect. To merge four columns of a row of your `tabularx`, you can use `\multicolumn{4}{|p{\dimexpr\hsize-2\tabcolsep-2\arrayrulewidth\relax}|}{…}`, e.g. ``` \documentclass{article} \usepackage{tabularx} \usepackage{caption}% Because of using \caption above the tabular. \usepackage{paralist} \makeatother \begin{document} \begin{table}[!b] \centering \caption{ Comparison between ST-Kriging, Bayesian inference, and ANNs.} \label{tab:2} \renewcommand{\arraystretch}{1.5} \scriptsize \begin{tabularx}{\textwidth}{|X|X|X|X|} \hline \textbf{} & \textbf{Bayesian Inferences} & \textbf{ST-Kriging} & \textbf{ANNs} \\ \hline \textbf{Computational Complexity} & NP-hard \cite{ref-satria2020spatial} & $O(N^2)$ & $O(i\times o\times n + n\times o)$ or $O(n \times o \times (i+1))$ for training a single epoch. \cite{ref-taylor1995freeway} \\ \hline \textbf{Performance Evaluation } & Provides a posterior probability distribution with confidence interval. & Ensure linear unbiased predictors. & Epoch with the lowest sum of squared error.\\ \hline \textbf{Weaknesses} & Very computationally intensive due to choosing the proper prior distribution. & \begin{compactitem} \item Missing value causes error in unmatched dimensions. \item Can not handle large datasets. \item Require normal distribution. \end{compactitem} & Require intensive data training, and this might lead to an overfitting problem. \\ \hline \textbf{Strengths } & \begin{compactitem} \item Handle large and small data. \item Handle missing values. \item Prior knowledge about uncertain input is not required. \end{compactitem} & \begin{itemize} \item Handle small data. \item Computational efficiency. \end{itemize} & \begin{compactitem} \item Handle big data and small data. \item Accommodate missing values without a separate estimation step [108] \item Computational efficiency due to the parallelity feature. \item Prior knowledge about uncertain input is not required. \end{compactitem} \\ \hline \multicolumn{4}{|p{\dimexpr\hsize-2\tabcolsep-2\arrayrulewidth\relax}|}{% \textbf{Overcoming the Limitation} Use uninformative prior to reduce the computational time, however, it can affect the prediction accuracy negatively. Remove observations that include missing values. \begin{compactitem} \item Decrease the number of layers of the network. \item Use iterative methods to stop the training process such as gradient descent. \end{compactitem}} \\ \hline \end{tabularx} \end{table} \end{document} ```
1
https://tex.stackexchange.com/users/277964
689985
320,078
https://tex.stackexchange.com/questions/689955
0
Is it possible to define command name containing greek (and latin) letter with any type of \*tex? (latex, latex...) Eg: \μμμμ or \μinv
https://tex.stackexchange.com/users/299910
Command naming convention different abc letters
false
Should work out of the box with LuaLaTeX and XeLaTeX ``` \documentclass[a4paper]{article} \NewDocumentCommand{\μinv}{}{text} \begin{document} \μinv \end{document} ``` pdfLaTeX on the other hand is not really set up for this, and I wouldn't recommend it.
0
https://tex.stackexchange.com/users/278687
689987
320,079
https://tex.stackexchange.com/questions/689925
1
In the `scrartcl` class, how can one include the author's affiliation, address, and email address? --- Code: ``` \documentclass[11pt]{scrartcl} \usepackage[utf8]{inputenc} \begin{document} \title{Title} \author{My name} \maketitle How do you add author affiliation, address and email address? \end{document} ```
https://tex.stackexchange.com/users/209717
Author affiliation and email address in scrartcl class
false
Depends on where you expect it to be printed, you can use, e.g., ``` \documentclass[11pt]{scrartcl}% Note: 11pt is the default and therefore not needed. \usepackage[utf8]{inputenc}% Note: utf8 us the default of LaTeX >= 2018/04/01. \begin{document} \title{Title} \author{My name\\affiliation\\address\\email} \maketitle How do you add author affiliation, address and email address? \end{document} ``` or ``` \documentclass{scrartcl} \begin{document} \title{Title} \author{My name\thanks{affiliation\\address\\email}} \maketitle How do you add author affiliation, address and email address? \end{document} ``` or you can design your title free without using `\maketitle`, or you can use an [additional package](https://ctan.org/topic/titlepage).
2
https://tex.stackexchange.com/users/277964
689990
320,081
https://tex.stackexchange.com/questions/689971
0
The following Latex code allows me to create an appendix automatically where proofs are stored by setting the value of the command `\moveToAppendix` to `1`. ``` \documentclass[a4paper,USenglish]{article} \usepackage{amssymb,amsthm,amsmath} \usepackage{thmtools, thm-restate} \newtheorem{theorem}{Theorem} \newcommand{\moveToAppendix}{1} \newenvironment{varProof}[1] { \restatable{proof}{#1} } { \endrestatable } \begin{document} \begin{theorem} Toto. \end{theorem} \begin{varProof}{ProofOne} Tata. \end{varProof} \if\moveToAppendix1 \newpage \appendix \section{Auxiliary proofs} \ProofOne \fi \end{document} ``` The problem is, when `\moveToAppendix` is set to `1`, the proofs still remain in the main part of the paper (outside of the appendix), how would I go about making them invisible when the value of `\moveToAppendix` is set to `1`? EDIT: After a comment, I decided to include an example of what I want, but it's somewhat of a bother to define each proof like below and I was wondering whether I could define it in an environment somehow in a simpler manner to use each time I place a proof. ``` \documentclass[a4paper,USenglish]{article} \usepackage{amssymb,amsthm,amsmath} \usepackage{thmtools, thm-restate} \newtheorem{theorem}{Theorem} \newcommand{\moveToAppendix}{0} \newenvironment{varProof}[1] { \begin{proof}{#1} } { \end{proof} } \begin{document} \begin{theorem} Toto. \end{theorem} \newcommand{\ProofOne}{ \begin{proof} Tata. \end{proof} }\if\moveToAppendix0\ProofOne\fi \if\moveToAppendix1 \newpage \appendix \section{Auxiliary proofs} \label{appendix:aux} \ProofOne \fi \end{document} ```
https://tex.stackexchange.com/users/147720
How to hide this proof depending on my command's value?
false
Something like this perhaps? ### Code ``` \documentclass{article} \usepackage{amsthm} \usepackage{environ} \newif\ifmoveprooftoend \newcommand\showDeferredProofs{} \makeatletter \NewEnviron{movableProof}[1][Proof]{% \ifmoveprooftoend \edef\next{\noexpand\g@addto@macro\noexpand\showDeferredProofs{% \noexpand\begin{proof}[#1]\unexpanded\expandafter{\BODY}\noexpand\end{proof}}} \next \else \begin{proof}[#1]\BODY\end{proof} \fi}{} \makeatother \newtheorem{thm}{Theorem} \begin{document} \begin{thm} First theorem \end{thm} \begin{movableProof} Proof of first theorem \end{movableProof} \moveprooftoendtrue \begin{movableProof}[Alternative proof of first theorem] Alternate proof \end{movableProof} \moveprooftoendfalse \begin{thm} Second theorem \end{thm} We give the heuristics of the proof here, and defer the full proof later. \begin{movableProof}[Heuristic argument] Heuristics of second theorem \end{movableProof} \moveprooftoendtrue \begin{movableProof}[Actual proof of second theorem] Proof of second theorem \end{movableProof} \begin{thm} Really a lemma \end{thm} \begin{movableProof} Lemma's proof is still deferred \end{movableProof} \section{Deferred proofs} \showDeferredProofs \end{document} ``` ### Explanation ``` \newif\ifmoveprooftoend \newcommand\showDeferredProofs{} ``` Since you really want a boolean toggle, might as well define it using a `\newif` instead of a `\newcommand`. This way the `\if` testing can be written a bit easier. You can turn the toggle on with `\moveprooftoendtrue` and turn it off with `\moveprooftoendfalse`. The creation of the `\showDeferredProofs` command is so that you can gather up all the deferred proofs and print them all at once with a single command (as opposed to your piecemeal `\ProofOne` approach.) ``` \makeatletter \NewEnviron{movableProof}[1][Proof]{% \ifmoveprooftoend \edef\next{\noexpand\g@addto@macro\noexpand\showDeferredProofs{% \noexpand\begin{proof}[#1]\unexpanded\expandafter{\BODY}\noexpand\end{proof}}} \next \else \begin{proof}[#1]\BODY\end{proof} \fi}{} \makeatother ``` We define a new environment called `movableProof`. What it does is it tests the present value of the boolean toggle `\ifmoveprooftoend`. If it is *false* then it acts as the standard `proof` environment. If it is *true*, it appends to `\showDeferredProofs` the necessary ingredients to print the proof later. (The trick with `\edef\next` is because we want to expand `\BODY` one level before appending it to `\showDeferredProofs`.)
0
https://tex.stackexchange.com/users/119
689994
320,083
https://tex.stackexchange.com/questions/689981
1
I want the columns of the last row to be merged to one. How to do it? When i am having long sentence it wont come to next line even if i use \newline. Could anyone help me by adding one more such row... ``` \documentclass{article} \usepackage{tabularx} \usepackage{paralist} \makeatother \begin{document} \begin{table}[!b] \centering \caption{ Comparison between ST-Kriging, Bayesian inference, and ANNs.} \label{tab:2} \renewcommand{\arraystretch}{1.5} \scriptsize \begin{tabularx}{\textwidth}{|X|X|X|X|} \hline \textbf{} & \textbf{Bayesian Inferences} & \textbf{ST-Kriging} & \textbf{ANNs} \\ \hline \textbf{Computational Complexity} & NP-hard \cite{ref-satria2020spatial} & $O(N^2)$ & $O(i\times o\times n + n\times o)$ or $O(n \times o \times (i+1))$ for training a single epoch. \cite{ref-taylor1995freeway} \\ \hline \textbf{Performance Evaluation } & Provides a posterior probability distribution with confidence interval. & Ensure linear unbiased predictors. & Epoch with the lowest sum of squared error.\\ \hline \textbf{Weaknesses} & Very computationally intensive due to choosing the proper prior distribution. & \begin{compactitem} \item Missing value causes error in unmatched dimensions. \item Can not handle large datasets. \item Require normal distribution. \end{compactitem} & Require intensive data training, and this might lead to an overfitting problem. \\ \hline \textbf{Strengths } & \begin{compactitem} \item Handle large and small data. \item Handle missing values. \item Prior knowledge about uncertain input is not required. \end{compactitem} & \begin{itemize} \item Handle small data. \item Computational efficiency. \end{itemize} & \begin{compactitem} \item Handle big data and small data. \item Accommodate missing values without a separate estimation step [108] \item Computational efficiency due to the parallelity feature. \item Prior knowledge about uncertain input is not required. \end{compactitem} \\ \hline \textbf{Overcoming the Limitation} & Use uninformative prior to reduce the computational time, however, it can affect the prediction accuracy negatively. & Remove observations that include missing values. & \begin{compactitem} \item Decrease the number of layers of the network. \item Use iterative methods to stop the training process such as gradient descent. \end{compactitem} \\ \hline \end{tabularx} \end{table} \end{document} ```
https://tex.stackexchange.com/users/296796
how to merge column with tabularx?
true
* For last two rows you need to form multi column cells. At "classic" table by use suggestion in @cabohah answer, or as is suggested below by use of the `tabullaray` package syntax (see both MWEs below) * It is unclear what should be content of last two rows. * Please edit your question and clarify this. So, the following MWE is mostly off-topic with suggestion how to simplify your table code and make table nicer. In this context for your table I would use: * `tabularray` package instead of the `tabularx` for table (it enable simple syntax for inserting and make nice looking lists) * `enumitem` package instead of `paralist` for better formatting list in table ``` \documentclass{article} %---------------- show page layout. don't use in a real document! \usepackage{showframe} \renewcommand\ShowFrameLinethickness{0.15pt} \renewcommand*\ShowFrameColor{\color{red}} %---------------------------------------------------------------% %\usepackage{newtxtext, newtxmath} % ? %\usepackage{microtype} % ? \usepackage{enumitem} \usepackage{ragged2e} \usepackage{tabularray} \UseTblrLibrary{varwidth} \begin{document} \begin{table}[htp] \centering \caption{ Comparison between ST-Kriging, Bayesian inference, and ANNs.} \label{tab:2} \setlist[itemize]{nosep, leftmargin=*} \footnotesize \begin{tblr}{hlines, vlines, colsep = 4pt, colspec = {Q[l, font=\bfseries] *{3}{X[cmd=\RaggedRight]}}, measure = vbox, row{1} = {font=\bfseries, m, cmd=\Centering}, rowsep = 5pt, stretch = -1, hspan=minimal, cell{Y,Z}{1} = {c=4}{font=\normalfont} % define multi column cells in the last two rows } & {Bayesian\\ Inferences} & ST-Kriging & ANNs \\ % {Computational\\ Complexity} & NP-hard \cite{ref-satria2020spatial} & $O(N^2)$ & $O(i\times o\times n + n\times o)$ or $O(n \times o \times (i+1))$ for training a single epoch. \cite{ref-taylor1995freeway} \\ {Performance\\ Evaluation} & Provides a posterior probability distribution with confidence interval. & Ensure linear unbiased predictors. & Epoch with the lowest sum of squared error. \\ Weaknesses & Very computationally intensive due to choosing the proper prior distribution. & \begin{itemize} \item Missing value causes error in unmatched dimensions. \item Can not handle large datasets. \item Require normal distribution. \end{itemize} & Require intensive data training, and this might lead to an overfitting problem. \\ Strengths & \begin{itemize} \item Handle large and small data. \item Handle missing values. \item Prior knowledge about uncertain input is not required. \end{itemize} & \begin{itemize} \item Handle small data. \item Computational efficiency. \end{itemize} & \begin{itemize} \item Handle big data and small data. \item Accommodate missing values without a separate estimation step [108] \item Computational efficiency due to the parallelity feature. \item Prior knowledge about uncertain input is not required. \end{itemize} \\ {Overcoming\\ the Limitation} & Use uninformative prior to reduce the computational time, however, it can affect the prediction accuracy negatively. & Remove observations that include missing values. & \begin{itemize} \item Decrease the number of layers of the network. \item Use iterative methods to stop the training process such as gradient descent. \end{itemize} \\ Penultimate table row has merged cells of all columns. It is unclear what is contents of this row. & & & \\ Last row has merged cells. It is unclear what is contents of this row. & & & \\ \end{tblr} \end{table} \end{document} ``` (red lines shows page layout. You may consider to change it by use of the `geometry` package) **Addendum:** For more professional looks if table I would remove the most of table rule. For used on I would use rules as are defined in the `booktabs` package (loaded by `booktabs` library): ``` \documentclass{article} %---------------- show page layout. don't use in a real document! \usepackage{showframe} \renewcommand\ShowFrameLinethickness{0.15pt} \renewcommand*\ShowFrameColor{\color{red}} %---------------------------------------------------------------% \usepackage{lipsum}% For dummy text. Don't use in a real document \renewcommand{\textfraction}{0.07} % allow minimal text w. figs %\usepackage{newtxtext, newtxmath} % ? \usepackage{microtype} % used for better inter words spacing \usepackage{enumitem} \usepackage{ragged2e} \usepackage{tabularray} \UseTblrLibrary{booktabs, % load the package of the same name varwidth} \begin{document} \begin{table}[ht] \centering \caption{Comparison between ST-Kriging, Bayesian inference, and ANNs.} \label{tab:2} \setlist[itemize]{nosep, leftmargin=*} \footnotesize \begin{tblr}{colsep = 4pt, colspec = {@{} Q[l, font=\bfseries] *{3}{X[cmd=\RaggedRight]} @{}}, measure = vbox, row{1} = {font=\bfseries, m, cmd=\Centering}, row{2-Z}= {rowsep = 5pt}, stretch = -1, hspan=minimal, cell{Y,Z}{1} = {c=4}{font=\normalfont} } \toprule & {Bayesian\\ Inferences} & ST-Kriging & ANNs \\ \midrule {Computational\\ Complexity} & NP-hard \cite{ref-satria2020spatial} & $O(N^2)$ & $O(i\times o\times n + n\times o)$ or $O(n \times o \times (i+1))$ for training a single epoch. \cite{ref-taylor1995freeway} \\ {Performance\\ Evaluation} & Provides a posterior probability distribution with confidence interval. & Ensure linear unbiased predictors. & Epoch with the lowest sum of squared error. \\ Weaknesses & Very computationally intensive due to choosing the proper prior distribution. & \begin{itemize} \item Missing value causes error in unmatched dimensions. \item Can not handle large datasets. \item Require normal distribution. \end{itemize} & Require intensive data training, and this might lead to an overfitting problem. \\ Strengths & \begin{itemize} \item Handle large and small data. \item Handle missing values. \item Prior knowledge about uncertain input is not required. \end{itemize} & \begin{itemize} \item Handle small data. \item Computational efficiency. \end{itemize} & \begin{itemize} \item Handle big and small data. \item Accommodate missing values without a separate estimation step [108] \item Computational efficiency due to the parallelity feature. \item Prior knowledge about uncertain input is not required. \end{itemize} \\ {Overcoming\\ the Limitation} & Use uninformative prior to reduce the computational time, however, it can affect the prediction accuracy negatively. & Remove observations that include missing values. & \begin{itemize} \item Decrease the number of layers of the network. \item Use iterative methods to stop the training process such as gradient descent. \end{itemize} \\ Penultimate table row contain the cell composed from merged cells from all columns. It is unclear what is contents of this row. Therefore in it is temporary used just dummy text filler: \lipsum[66] & & & \\ Last row has merged cells too. The contents of this row is unknown. & & & \\ \bottomrule \end{tblr} \end{table} \lipsum[66] \end{document} ```
0
https://tex.stackexchange.com/users/18189
689996
320,084
https://tex.stackexchange.com/questions/689995
1
I'm having a really hard time doing what I thought would be simple. I have this permutation: ``` \pi=\left(\begin{array}{cccccccccccc} 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ 2 & 1 & 3 & 4 & 5 & 9 & 6 & 7 & 8 \\ \end{array}\right) ``` and I want the sequence 345 to have a brace labelled `$\sigma$` and I need the sequence 678 to have the same thing.
https://tex.stackexchange.com/users/240842
Brackets in a Permutation
true
You can use `nicematrix`, but 1. the space occupied by the overbraces is not taken into account; 2. we need a trick to move the parenthesis a bit farther from the matrix. In order to fix point 1, a phantom tall enough is added. For 2, some explicit spacing. I guess you wanted 12 and 6789, in order to single out the disjoint cycles, otherwise it would make little sense. ``` \documentclass{article} \usepackage{amsmath} \usepackage{nicematrix} \begin{document} Some text to see whether the vertical spacing is good. Some more text in order to get more than one line. This should be enough. \[ \pi=\left(\;\begin{NiceArray}{*{9}{c}} 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ 2 & 1 & 3 & 4 & 5 & 9 & 6 & 7 & 8 \CodeAfter \OverBrace[shorten,yshift=1pt]{1-1}{2-2}{\sigma} \OverBrace[shorten,yshift=1pt]{1-6}{2-9}{\tau} \end{NiceArray}\;\right) \smash[b]{\vphantom{% \begin{matrix}0\\0\\0\\0\end{matrix} }} \] Some text to see whether the vertical spacing is good. Some more text in order to get more than one line. \end{document} ```
2
https://tex.stackexchange.com/users/4427
690001
320,085
https://tex.stackexchange.com/questions/690003
1
I'm trying to use `xparse` and generic TeX/LaTeX commands to write a macro (that takes no arguments) to define another macro that does take arguments: ``` \documentclass{minimal} \RequirePackage{xparse,fmtcount} \newcounter{mycounter} \NewDocumentCommand{\mycounterHex}{O{1}}{} \providecommand{\enableCounterCommands}{ \RenewDocumentCommand{\mycounterHex}{O{1}}{\padzeroes[#1]{\hexadecimal{mycounter}}} } \begin{document} \end{document} ``` When I compile this document with `pdflatex --interaction=nonstopmode`, I get the following error message: ``` ! Illegal parameter number in definition of \enableCounterCommands. <to be read again> 1 l.11 } ``` I believe that the problem is that TeX thinks I'm trying to refer to the (nonexistent) first argument of `\enableCounterCommands`, but I'm actually trying to reference the optional-with-default-value first argument of `\mycounterHex`. **How can I indicate to TeX that I am referencing the argument of `\mycounterHex`?**
https://tex.stackexchange.com/users/272916
Macro without arguments to define macro with arguments
false
You want `##1` in the replacement text. On the other hand I don't see why defining `\mycounterHex` that way, when it's not difficult to have an expandable version using *any* counter. ``` \documentclass{article} \ExplSyntaxOn \NewExpandableDocumentCommand{\paddedhex}{O{0}m} {% #1 = size to pad with zeros to, #2 = counter name \zelnick_paddedhex:nn { #1 } { #2 } } \cs_new:Nn \zelnick_paddedhex:nn { \int_compare:nT { #1-\str_count:e { \int_to_Hex:n { \value{#2} } } > 0 } {% we want to pad \prg_replicate:nn { #1-\str_count:e { \int_to_Hex:n { \value{#2} } } } { 0 } } \int_to_Hex:n { \value{#2} } } \ExplSyntaxOff \newcounter{mycounter} \begin{document} \setcounter{mycounter}{42} \paddedhex{mycounter} \paddedhex[4]{mycounter} \setcounter{mycounter}{1234567} \paddedhex{mycounter} \paddedhex[4]{mycounter} \paddedhex[8]{mycounter} \edef\temp{\paddedhex[8]{mycounter}} \texttt{\meaning\temp}% show full expandability \end{document} ``` We first convert the counter's value to hexadecimal, count the number of characters and, if it's less than the stated size to pad to, we add the required number of zeros. Full expandability means that you can for instance say ``` \renewcommand{\themycounter}{\paddedhex[4]{mycounter}} ``` You could have your section numbers in hexadecimal padded to four digits with ``` \renewcommand{\thesection}{\paddedhex[4]{section}} ``` and this would work with `\label` and `\ref`. You wouldn't be able to with `fmtcount` facilities.
1
https://tex.stackexchange.com/users/4427
690009
320,089
https://tex.stackexchange.com/questions/689966
14
When I started using `LaTeX` a few decades ago, one of the main arguments for using it was the separation of content and editing. The idea was that the author would concentrate on the content and `LaTeX` would take care of the editing. After several decades of use, I think this promise has been at least partially kept: `LaTeX` does a pretty good job of managing formulas, fonts, distributing text over multiple lines, positioning floats, etc. even without additional packages. Only the `microtype` package and the `sloppy`-like commands are used occasionally. However, I am less sure if this also applies to **page layout**, i.e. things like line spacing, paragraph spacing, line length, etc. As a rule, there is usually only one serious limitation imposed by the publisher, namely the page size. So, when I finish my books (scientific notebooks), I usually consult graphic designers, none of whom have any experience with `LaTeX`, and they usually butcher all the default settings completely. So are design/typographic principles/rules for **page layout** implemented by standard `LaTeX` or perhaps by more complex packages like `KOMA`? I have to say that I was a bit disappointed with `KOMA` when I read in its manual that "*line lengths beyond 80 characters are unacceptable*", and the length of this particular line is - 95 characters! So at first glance, I am not sure how many, if any, typographic rules for page layout have been implemented in `LaTeX` and `KOMA`. Incidentally, when I look at my favourite textbooks, they all seem to stick to the line length of `13 cm`, which interestingly was also the advice of the last graphic designer I consulted. So my question is: How much can a user rely on the standard `LaTeX` page layout? To what extent, if at all, is `KOMA` an improvement on the `LaTeX` specifications in this respect? Where can one get reliable information or even paid advice on how to design a page layout appropriately, preferably from a person who is both professional in page design and has some `LaTeX` experience? **PLEASE, do not close this question.** It has received a large number of upvotes (with some downvotes) very fast, so I think this is a relevant question that deserves a chance to receive the conclusion. **EDIT**: Answers and discussions usually help to understand the question better, and also in this case I would formulate the question a little differently if I were to ask it now: To increase the efficiency of production, it is always good to distribute the work among different specialists. In the case of publishing, this would mean that the author creates the content, the typographer/designer creates the layout, the printer puts this on paper and finally the publisher distributes the result. My question can be boiled down to the following: `LaTeX` most likely does the typographer's job, but can it replace a designer? **Can ambitious academic notebook projects be published without the involvement of a designer, by tweaking only one or two options?** Because as soon as designers are involved, and they almost universally don't know `LaTeX`, the result deviates far from the default `LaTeX` settings. I have also opened a chat room if anyone would like to discuss these issues: <https://chat.stackexchange.com/rooms/146970/default-latex-page-layout>
https://tex.stackexchange.com/users/3450
How good is a default LaTeX page layout?
false
This is a difficult question, because what is considered good type design depends on many different things and also on personal taste. You ask specifically about page layout, but note that the page layout is always related to the text and cannot truly be separated from other metrics such as font size, line spacing etc. Therefore, this is not really an answer, but rather an attempt to push you towards finding a good solution for your project. If you want to prepare a PDF which is meant to be printed as a book, I think that simply using the default settings of the standard LaTeX classes won't really help you, because they only provide a very basic set up and the default paper sizes of these classes are probably not optimal for a book. So, you would at least need to use a package, such as the `geometry` package, to adjust the paper size and probably together with it the margins. You also mention the KOMA classes which, in combination with the `typearea` package, can help you to set up a traditional paper layout where the outer and lower margins are typically larger than the upper and inner margins. In this aspect, the KOMA classes indeed provide an improvement regarding the settings for the page layout. While adhering to these settings for the page layout is indeed considered a good choice in many cases, it still might not be the right thing if you want to typeset an academic book with lots of diagrams or tables. You also ask where to find reliable information about page layout and type design and I would again argue that this depends on what you are trying to do. There are surely some rules-of-thumb or even golden standards one should probably stick to in most cases (you could look out for literature written by famous typographers such as Robert Bringhurst or Jan Tschichold), but a lot of design choices still depend on the contents, the medium and the intended readership. I don't think that there exists a single best solution for everything. But I also don't think that you need to create everything from scratch. What is probably a good idea in order to decide about the "right" page layout is to start with a standard class and, in a first step, just change the paper size as required (if there are other requirements by the publishing house, you should of course also keep them in mind). The result, of course, won't be an optimal page layout, but it can serve as a starting point for further improvements. In step by step improving the page laout, you should always think about the *why*: *why* should the margins of your book should have a certain width? *Why* should the lines of the text should not exceed a certain length? You will probably find that it more or less always boils down to enhanced readability and usability: Larger lines require larger line spacing, so that the reader can easily find the start of the next line (and this is also the reason why lines should be not too long in general). The page number should probably be on the lower outside, so that the reader who searches for a page can quickly find it using their thumb. The white space around blocks of text or between headers and paragraphs should help the reader to quickly identify what belongs together. The reader should have some place on the page to put there finger in order to hold the book ... If you do your design choices always with the "user" (that is, the reader) in mind, I think you will eventually come up with a good layout. --- To answer your questions added in one of the lastest edits: The more ambitous the project gets, the less probable it is to get what you need with only tweaking one or two settings. So I'd tend to answer this with no. But I would also say that there are surely good designers that know LaTeX. So, if you haven't found a good designer who is proficient in LaTeX yet, maybe this means that you just haven't yet found the *right* designer for you ...
5
https://tex.stackexchange.com/users/47927
690012
320,090
https://tex.stackexchange.com/questions/689988
0
In regular LaTeX I can simply use: ``` \^{\omega} ``` to get Omega hat. However, Anki returns `\^ω` where `\^` is marked red. I am unsure where to look this up.
https://tex.stackexchange.com/users/241607
How can I make the hat symbol in Anki?
true
You did not provide a full example but ``` \documentclass{article} \begin{document} $\^{\omega}$ \end{document} ``` produces an error in latex, your error is unrelated to anki: ``` LaTeX Warning: Command \^ invalid in math mode on input line 4. ! Missing $ inserted. <inserted text> $ l.4 $\^{\omega} $ ? ! Improper \spacefactor. <recently read> \spacefactor l.4 $\^{\omega} $ ? ``` Use `\hat`: ``` \documentclass{article} \begin{document} $\hat{\omega}$ \end{document} ```
5
https://tex.stackexchange.com/users/1090
690019
320,093
https://tex.stackexchange.com/questions/689966
14
When I started using `LaTeX` a few decades ago, one of the main arguments for using it was the separation of content and editing. The idea was that the author would concentrate on the content and `LaTeX` would take care of the editing. After several decades of use, I think this promise has been at least partially kept: `LaTeX` does a pretty good job of managing formulas, fonts, distributing text over multiple lines, positioning floats, etc. even without additional packages. Only the `microtype` package and the `sloppy`-like commands are used occasionally. However, I am less sure if this also applies to **page layout**, i.e. things like line spacing, paragraph spacing, line length, etc. As a rule, there is usually only one serious limitation imposed by the publisher, namely the page size. So, when I finish my books (scientific notebooks), I usually consult graphic designers, none of whom have any experience with `LaTeX`, and they usually butcher all the default settings completely. So are design/typographic principles/rules for **page layout** implemented by standard `LaTeX` or perhaps by more complex packages like `KOMA`? I have to say that I was a bit disappointed with `KOMA` when I read in its manual that "*line lengths beyond 80 characters are unacceptable*", and the length of this particular line is - 95 characters! So at first glance, I am not sure how many, if any, typographic rules for page layout have been implemented in `LaTeX` and `KOMA`. Incidentally, when I look at my favourite textbooks, they all seem to stick to the line length of `13 cm`, which interestingly was also the advice of the last graphic designer I consulted. So my question is: How much can a user rely on the standard `LaTeX` page layout? To what extent, if at all, is `KOMA` an improvement on the `LaTeX` specifications in this respect? Where can one get reliable information or even paid advice on how to design a page layout appropriately, preferably from a person who is both professional in page design and has some `LaTeX` experience? **PLEASE, do not close this question.** It has received a large number of upvotes (with some downvotes) very fast, so I think this is a relevant question that deserves a chance to receive the conclusion. **EDIT**: Answers and discussions usually help to understand the question better, and also in this case I would formulate the question a little differently if I were to ask it now: To increase the efficiency of production, it is always good to distribute the work among different specialists. In the case of publishing, this would mean that the author creates the content, the typographer/designer creates the layout, the printer puts this on paper and finally the publisher distributes the result. My question can be boiled down to the following: `LaTeX` most likely does the typographer's job, but can it replace a designer? **Can ambitious academic notebook projects be published without the involvement of a designer, by tweaking only one or two options?** Because as soon as designers are involved, and they almost universally don't know `LaTeX`, the result deviates far from the default `LaTeX` settings. I have also opened a chat room if anyone would like to discuss these issues: <https://chat.stackexchange.com/rooms/146970/default-latex-page-layout>
https://tex.stackexchange.com/users/3450
How good is a default LaTeX page layout?
false
Let me share some views and experience. I've been working with all programs mentioned during the past decades. ### Put black and white ... ... `(La)TeX` focuses on the word, while graphic designers focus on visuals and visual concepts. For (La)TeX it's clear from its history and inner working mechanisms, doing some typesetting to "create beautiful text", as TeX' inventor phrased. Now I admire what graphic designers can do, like drawing with pens, mouse, drawing pads, meeting proportions, putting contrasts, creating visual relationships between elements, conveying visual messages. However, you probably would drive them nuts by requesting them to "draw" using `Tikz` or `pgfplot` ... ### Freedom ... ... is probably what graphic designers favour. They don't have to follow any rules, though they often do by intention. So for handling of graphics and text I'd be not surprised, if they'd favour programs like `Scribus` (Open Source), `FrameMaker`, Microsofts `Publisher` and the like. Basically you put frames, arrange them (visually), link them for flow-text etc. So basically, you still do kind of graphic design, only with frames. And yes, you have full control (and burden) over any font, baselines, kernels, borders and what have you. ### Standardization ... ... is a restriction which gives content wings to fly. Let me explain. I once worked with electronic engineers, who where used to write their own data sheets first with `Ventura Publisher`, and later with `FrameMaker`. Freedom prevailed ... driving the central management of the companies data sheets (quite "some few") nuts. Error checking, corrections, compatibility issues, left alone checking content was a night mare, bound to specialists. So they decided to combine FrameMaker with a visual XML feature, again separating content from representation. Consequences: you had to build content structures first from a predefined set of elements, and fill in engineers content next. Layout fixed, everything fixed, plus extra rules. Freedom gone. It were big deals to convert medium sized data sheets (say 50-80 pages) into this new system. Once they were available, the next correction or derived data sheet were much easier to create or adapt. And from the centrals point of view changing the look&feel was much easier for a huge set of data sheets in one go (much like you'd change the .css for a webpage). And they were able to extract `meaning` from all those document, through the elements. Freedom returned in a different way: focus on content, focus on what's relevant to the reader, i.e. those engineers who buy such chips ... and they bought convincing products ... ### Latex and me I heard about Latex in the mid or late 90's, but had neither resources nor incentives to try or even use it. However, I always admired the typographical style I read in scientific or engineering articles. Universities seemed to have some magic tool at hand ... So only recently I started using `Latex`, `Tikz`, `pgfplot`, and am happy with the standards they provide. I like it. I tried mimicking the layout of brochures, and the best you can do then is using package [flowfram from Nicola Talbot](https://www.ctan.org/pkg/flowfram). To some degree it joins the `Frame-Making` approach and `Latex` ... it can be tricky and has a learning curve. But then you may be close to a graphics designers visual approach to documents using text as just one design element. // BTW, when mimicking just a few pages of any paper you find in your mailbox you rediscover the graphic designers focus on freedom again. Little to no systematic, from page to page, from rubric to rubric ... ### What do publishers do? In the scientific community that's simple: they provide some Latex template, e.g. for a paper in a journal, and process it into their production system, which probably is or is close to `FrameMaker` with add-ons. By tradition authors sent in manuscripts, i.e. handwritten pages, which were converted by a lengthy process into their production system (including printing machines, paper handling etc.). It never was the authors task to even bother about page layout etc. I'm not aware of publishers who do all with `Latex`. It probably will have limitations when it comes to the machine level of their production system. Though there are packages to insert all those markings a print-engineer needs, e.g. to adjust the colour drums. ### Page, layout, authors and graphic designers With all this in mind it may be a good idea to work out, or just write down, a useful workflow. Of course, you can do anything, using all kinds of combinations of the above ... it just depends on the effort you are willing to spend. * e.g. converting `Latex` into the `Frame`-World, e.g. `Scribus`, is possible, painful and time consuming * e.g. letting graphic designers work on your Latex files may not be the best idea, while specifying graphics may work fine With a step back I'd suggest to view your book projects like an industrial production process and ecosystem: * what do you need? * what do you supply? * how to make it run smoothly at a high rate? * etc. Also I suggest to take readers preferences into account (content communication) * 95 characters or more spanned over 13 cm or more * may not be a nice idea for a book * there is a reason why newspapers invented columns. Finally, thinking out loud: After this analysis your question about layout may spot more a symptom than the real problem?
4
https://tex.stackexchange.com/users/245790
690020
320,094
https://tex.stackexchange.com/questions/690028
1
I have some text that I want to be in between `\normalsize` and `\small`. Any way to do that?
https://tex.stackexchange.com/users/295684
How to get a font-size in between normalsize and small?
false
Taking the average of normal and small size: ``` \RequirePackage{fix-cm} \documentclass[12pt]{article} \makeatletter \AtBeginDocument{% \begingroup \normalsize \let\tmp@n@s\f@size \let\tmp@n@b\f@baselineskip \small \let\tmp@s@s\f@size \let\tmp@s@b\f@baselineskip \xdef\semismall@size{\fpeval{(\tmp@n@s+\tmp@s@s)/2}}% \xdef\semismall@baselineskip{\fpeval{(\tmp@n@b+\tmp@s@b)/2}}% \endgroup } \newcommand{\semismall}{\fontsize{\semismall@size}{\semismall@baselineskip}\selectfont} \usepackage{lipsum} \begin{document} Normal size {\semismall not so small} {\small and small} \lipsum[1][1-2] (\fontname\font) {\semismall\lipsum[1][1-2] (\fontname\font)\par} {\small\lipsum[1][1-2] (\fontname\font)\par} \end{document} ``` I can't see how your reader will acknowledge the difference between normal size and semismall or between semismall and small. Here is the same with a fully scalable font (Cochineal) At 10pt main size ### Addendum Let me comment the image you got I repeat the first image above for a comparison. In the comment, you say that all sizes are the same, but it's not true. First of all, apart from scale factor and background, the typeset result is the same. If you look at the space between the period and U in the second line, you will see that it's smaller than the corresponding space in the fourth line: in the fourth line the font size is smaller and interword spaces are therefore larger in order to justify the text. In the 10.475pt part, TeX found no way to split “vestibulum” so that a part can go in the first line of the paragraph. If you look at “felis”, you can see that it's rather visibly to the left in the fifth line than in the third one. This confirms my opinion: nobody can really spot that you're using a font size between `\normalsize` and `\small`. I'd add that `\small` is often used for quotations, but in this case the part is set with wider margins and separate from the main text by vertical space, like with ``` \begin{quotation}\small text to be quoted \end{quotation} ``` This tells that the text is not original, but doesn't hinder reading, because the size is not so different from the standard one. The `\semismall` trick might be used in a real emergency for cramming a bit more text in a paragraph, but in this case the second parameter to `\fontsize` must be `\f@baselineskip` so as to cover our tracks.
5
https://tex.stackexchange.com/users/4427
690029
320,100
https://tex.stackexchange.com/questions/689966
14
When I started using `LaTeX` a few decades ago, one of the main arguments for using it was the separation of content and editing. The idea was that the author would concentrate on the content and `LaTeX` would take care of the editing. After several decades of use, I think this promise has been at least partially kept: `LaTeX` does a pretty good job of managing formulas, fonts, distributing text over multiple lines, positioning floats, etc. even without additional packages. Only the `microtype` package and the `sloppy`-like commands are used occasionally. However, I am less sure if this also applies to **page layout**, i.e. things like line spacing, paragraph spacing, line length, etc. As a rule, there is usually only one serious limitation imposed by the publisher, namely the page size. So, when I finish my books (scientific notebooks), I usually consult graphic designers, none of whom have any experience with `LaTeX`, and they usually butcher all the default settings completely. So are design/typographic principles/rules for **page layout** implemented by standard `LaTeX` or perhaps by more complex packages like `KOMA`? I have to say that I was a bit disappointed with `KOMA` when I read in its manual that "*line lengths beyond 80 characters are unacceptable*", and the length of this particular line is - 95 characters! So at first glance, I am not sure how many, if any, typographic rules for page layout have been implemented in `LaTeX` and `KOMA`. Incidentally, when I look at my favourite textbooks, they all seem to stick to the line length of `13 cm`, which interestingly was also the advice of the last graphic designer I consulted. So my question is: How much can a user rely on the standard `LaTeX` page layout? To what extent, if at all, is `KOMA` an improvement on the `LaTeX` specifications in this respect? Where can one get reliable information or even paid advice on how to design a page layout appropriately, preferably from a person who is both professional in page design and has some `LaTeX` experience? **PLEASE, do not close this question.** It has received a large number of upvotes (with some downvotes) very fast, so I think this is a relevant question that deserves a chance to receive the conclusion. **EDIT**: Answers and discussions usually help to understand the question better, and also in this case I would formulate the question a little differently if I were to ask it now: To increase the efficiency of production, it is always good to distribute the work among different specialists. In the case of publishing, this would mean that the author creates the content, the typographer/designer creates the layout, the printer puts this on paper and finally the publisher distributes the result. My question can be boiled down to the following: `LaTeX` most likely does the typographer's job, but can it replace a designer? **Can ambitious academic notebook projects be published without the involvement of a designer, by tweaking only one or two options?** Because as soon as designers are involved, and they almost universally don't know `LaTeX`, the result deviates far from the default `LaTeX` settings. I have also opened a chat room if anyone would like to discuss these issues: <https://chat.stackexchange.com/rooms/146970/default-latex-page-layout>
https://tex.stackexchange.com/users/3450
How good is a default LaTeX page layout?
false
A might be surprising fact mentioned several times in The TeXbook and typesetting manuals at the time of moveable types, and modern typography book such as The Elements of Typographic Style (a very good book to read for anyone want to make their own books), is, when it is not likely to typeset a paragraph in a visual appearing way, the first thing to do is ask the author to rewrite the paragraph. Only start to seek suboptimal workarounds if the author was deceased. If write with deliberate control, even the default document class would work well. In fact, there are many published computer science texts made with the default book class (or variants) from LaTeX, without changing the default Computer Modern font, going fancy with `microtype` etc, and I would consider it to be a pretty solid option. Example of such books includes *Algorithms for Functional Programming* by John David Stone, published by Springer, *Domains and Lambda-Calculi* by Roberto M. Amadio and Pierre-Louis Curien, part of the Cambridge Tracts in Theoretical Computer Science series (some other books from the series also use slightly tweaked default LaTeX class. If pushing TeX to its limit, even with the fanciest extension and packages it would fail. Page breaking and layout decisions are based more on psychology factors more than can be judge by a simple algorithm, and there is no way leave everything to LaTeX before AI technology been implanted into it. For KOMA-Script, from a personal perspective I would say it could be a bad idea to rely on an "external package" that is rapidly changing its interface. You would learn it the hard way when trying to modify the LaTeX document years later. I would recommend you make design decisions based on what you know you can make LaTeX work, rather than trying to implement everything told by your designer while don't understand the potential side effect of the changes. For example, `microtype` works by having a predefined set of configurations for a limited number of font, so you might have to tweak the parameters to make things right if a different font other than default is chosen, and it would easily be messed up if you don't have the font tweaking knowledge yourself while your designer cannot communicate the change their desire to you.
3
https://tex.stackexchange.com/users/246082
690036
320,103
https://tex.stackexchange.com/questions/689790
6
Following the question [here](https://tex.stackexchange.com/questions/442855/arabic-right-to-left-using-luatex), I managed to write in Arabic using Luatex (plain/Optex), but all numbers are also written from the right to the left (and in Western numbers, not Arabic). It seems that the [Luabidi package](https://tex.stackexchange.com/questions/689675/incorrect-rtl-rendering-of-arabic-numbers-in-enumerate) also has the same issue. Is there a way to selectively activate left-to-right + correct "font" selection for numbers in this case? ``` \font\dubai={Dubai:script=arabic} at 12pt \def\setArabic{\pagedir TRT \bodydir TRT \pardir TRT \textdir TRT} \def\setLatin {\pagedir TLT \bodydir TLT \pardir TLT \textdir TLT} \def\arabe#1{ \bgroup \setArabic\dubai #1 \egroup } \arabe{ دبي هي المدينة الأكثر اكتظاظاً بالسكان في الإمارات 0123456 ٢٥٦ العربية المتحدة.} \bye ```
https://tex.stackexchange.com/users/258453
Number direction in Arabic using (plain) Luatex
true
A very basic OpTeX solution: ``` \ufont\plexarabic={file:ibmplexsansarabic-regular.otf:script=arabic} at 12pt \def\arabe#1{{ \pagedir TRT \bodydir TRT \pardir TRT \textdir TRT \plexarabic #1 }} \directlua{ % Add any characters here that you want to always be LTR local chars = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "٠", "١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩" } local _chars = {} for i, char in ipairs(chars) do _chars[utf8.codepoint(char)] = true end local insert_before = node.insert_before local copy = node.copy local fonts = font.fonts local push_dir = node.new("dir") push_dir.dir = "+TLT" local pop_dir = node.new("dir") pop_dir.dir = "-TLT" callback.add_to_callback("pre_linebreak_filter", function (head) local found = false for n, char, font in node.traverse_glyph(head) do char = fonts[font].characters[char].unicode if not found and _chars[char] then found = true head = insert_before(head, n, copy(push_dir)) elseif found then if not _chars[char] then found = false head = insert_before(head, n, copy(pop_dir)) end end end return head end, "test") } \arabe{ دبي هي المدينة الأكثر اكتظاظاً بالسكان في الإمارات 0123456 ٢٥٦ العربية المتحدة.} \bye ``` True bidi is a really hard problem; if you want a complete/robust solution, you'll likely need to switch to LaTeX or ConTeXt.
5
https://tex.stackexchange.com/users/270600
690037
320,104
https://tex.stackexchange.com/questions/690041
8
In the end of Chapter14 of TeXbook, there is a macro called `\signed`: ``` \def\signed #1 (#2){{\unskip\nobreak\hfil\penalty50 \hskip2em\hbox{}\nobreak\hfil\sl#1\/ \rm(#2) \parfillskip=0pt \finalhyphendemerits=0 \par}} ``` which is used to add the reviewer's name and address in the end of the review. And the `\finalhyphendemerits=0` is used to prevent TeX from preferring two final lines to one final line. I'm still quite confused about the functional of `\finalhyphendemerits` here. Does setting `\finalhyphendemerits` always help to make more white space to the last line? Can someone give more explanations (better with an example) please?
https://tex.stackexchange.com/users/241621
TeXbook Exercise 14.32
false
It is really just that simple: adds extra penalty if the second last line ends with a hyphen. The left is `\finalhyphendemerits=0`, right is with the default `5000`. ``` \hsize=2.9in \finalhyphendemerits=0 But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system. \bye ``` Cite TeX by Topic > > `\finalhyphendemerits` Penalty added when the penultimate line of a paragraph ends with a > hyphen. Plain TEX default: 5000. > > > Note that in The TeXbook it says: > > The one-line solution will usually be preferred if it is feasible. > > > Setting `\finalhyphendemerits=0` helps the second last line to be more compact, making more space to the last line, thus makes the one-line version much likely to occur.
9
https://tex.stackexchange.com/users/246082
690042
320,105
https://tex.stackexchange.com/questions/690028
1
I have some text that I want to be in between `\normalsize` and `\small`. Any way to do that?
https://tex.stackexchange.com/users/295684
How to get a font-size in between normalsize and small?
false
``` \documentclass{article} \usepackage{lmodern} \newcommand\bitsmall{\fontsize{9.5}{11}\selectfont} \begin{document} Normal (10/12) {\bitsmall Bit small (9.5/11)} {\small Small (9/11)}. \end{document} ``` The first number is the font size (default `pt` units) the second the baselineskip which is only used if complete paragraphs are set in that size, not as here just fragments in a normalsize paragraph. I use latin modern here, if using the original computer modern, add `\RequirePackage{fix-cm}` as first line to allow fonts at any size.
3
https://tex.stackexchange.com/users/1090
690045
320,107
https://tex.stackexchange.com/questions/690041
8
In the end of Chapter14 of TeXbook, there is a macro called `\signed`: ``` \def\signed #1 (#2){{\unskip\nobreak\hfil\penalty50 \hskip2em\hbox{}\nobreak\hfil\sl#1\/ \rm(#2) \parfillskip=0pt \finalhyphendemerits=0 \par}} ``` which is used to add the reviewer's name and address in the end of the review. And the `\finalhyphendemerits=0` is used to prevent TeX from preferring two final lines to one final line. I'm still quite confused about the functional of `\finalhyphendemerits` here. Does setting `\finalhyphendemerits` always help to make more white space to the last line? Can someone give more explanations (better with an example) please?
https://tex.stackexchange.com/users/241621
TeXbook Exercise 14.32
false
In a normal paragraph, with a short last line, a hyphen on the penultimate line appears as the last thing at the right margin and just has white space below it. This is normally discouraged by `\finalhyphendemerits`. Here, the white space in the last line does not apply as the last line is always flush to the margin as seen by the extra example added. Worse if you do force a linebreak to avoid hypenation being on the penultmate line, you can have the opposite of the desired effect and force white space below the hyphen as seen here if the example is repeated without setting `\finalhyphendemerits` to zero. ``` \def\signed #1 (#2){{\unskip\nobreak\hfil\penalty50\hskip2em \hbox{}\nobreak\hfil\sl#1\/ \rm(#2) \parfillskip=0pt \finalhyphendemerits=0 \endgraf}} \hbox{\vrule \vbox{\hsize 3.6in \parindent0pt This is a case where the name and address fit in nicely with the review. \signed A. Reviewer (Ann Arbor, Mich.) \medskip But sometimes an extra line must be added. \signed N. Bourbaki (Paris) \medskip This is a case where the name and address fit most excellently with the review. \signed A. Reviewer (Ann Arbor, Mich.) }\vrule} \bigskip \def\signed #1 (#2){{\unskip\nobreak\hfil\penalty50\hskip2em \hbox{}\nobreak\hfil\sl#1\/ \rm(#2) \parfillskip=0pt \endgraf}} \hbox{\vrule \vbox{\hsize 3.6in \parindent0pt This is a case where the name and address fit in nicely with the review. \signed A. Reviewer (Ann Arbor, Mich.) \medskip But sometimes an extra line must be added. \signed N. Bourbaki (Paris) \medskip This is a case where the name and address fit most excellently with the review. \signed A. Reviewer (Ann Arbor, Mich.) }\vrule} \bye ```
9
https://tex.stackexchange.com/users/1090
690046
320,108
https://tex.stackexchange.com/questions/690054
0
Hi there I am trying align the "2403 Y" to the top of the 4 connected rows and not in the middle of the 4 connected rows. ``` \begin{longtblr}[ caption = {Ergebnisse der Gitterschnittprüfung der bei $40^{\circ}C$ gehärteten Proben PUA 2403 X, -Y und -Z}, label = {tblr:GT 40 grad}, ] {width=\linewidth,colspec={X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]}} \hline \textbf{PUA Nr.} & \textbf{Substrat} & \textbf{Blech Nr.} & \textbf{GT Nr. 1} & \textbf{GT Nr. 2} & \textbf{GT Nr. 3} & \textbf{Mittelwert} & \textbf{Stabw. S}\\ \hline \SetCell[r=4]{c} \rotatebox[origin=c]{90}{2403 X}& Oxsilan & 4 & 0 & 0 & 0 & 0 & 0\\\hline &Fe Phosphatiert & 5 & 0 & 0 & 0 & 0 & 0 \\\hline &Zn Phosphatiert & 1 & 0 & 0 & 0 & 0 & 0 \\\hline &Gestrahltes Aluminium & 1 & 0 & 0 & 0 & 0 & 0 \\ \hline \SetCell[r=4]{c} \rotatebox[origin=c]{90}{2403 Y}& Oxsilan & 3 & 0 & 0 & 0 & 0 & 0\\\hline &Fe Phosphatiert & 4 & 0 & 0 & 0 & 0 & 0 \\\hline &Zn Phosphatiert & 2 & 0 & 0 & 0 & 0 & 0 \\\hline &Gestrahltes Aluminium & 1 & 0 & 0 & 0 & 0 & 0 \\ \hline \SetCell[r=4]{c} \rotatebox[origin=c]{90}{2403 Z}& Oxsilan & 1 & 0 & 0 & 0 & 0 & 0\\\hline &Fe Phosphatiert & 4 & 0 & 0 & 0 & 0 & 0 \\\hline &Zn Phosphatiert & 2 & 0 & 0 & 0 & 0 & 0 \\\hline &Gestrahltes Aluminium & 1 & 0 & 0 & 0 & 0 & 0 \\ \hline \end{longtblr} ``` Ty for any help
https://tex.stackexchange.com/users/293330
Top alignment of SetCell command
true
Please, next time, give a MWE (starts with `\documentclass` and ends with `\end{document}` The key is `cell{6}{1} = {r=4,c=1}{h,cmd=\rotatebox{90}},` I made a few changes: * `colspec={X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]` by `colspec={*{8}{X[c]}},` * `vline{1} = {1-Z}{0pt}` and `vline{9} = {1-Z}{0pt}` for special cases * `Setcells` with the new `\cell` interface * for non-centered alignment, replace with `f` or `h` * EDIT: caption in bold **The code** ``` \documentclass{article} %https://tex.stackexchange.com/questions/690054/top-alignment-of-setcell-command \usepackage[margin=1cm]{geometry} \usepackage{tabularray} \usepackage{adjustbox} \usepackage{caption} \begin{document} \SetTblrStyle{caption-tag}{font=\bfseries}%<<< edit \begin{longtblr}[ caption = {Ergebnisse der Gitterschnittprüfung der bei $40^{\circ}C$ gehärteten Proben PUA 2403 X, -Y und -Z}, label = {tblr:GT 40 grad}, ] { width=\linewidth, colspec={*{8}{X[c,m]}}, hlines,vlines, % vline{1} = {1-Z}{0pt}, % vline{9} = {1-Z}{0pt}, vline{1,9} = {1-Z}{0pt},%<-- in one line row{1}={font=\bfseries}, % cell{2}{1} = {r=4,c=1}{c,cmd=\rotatebox{90}}, cell{6}{1} = {r=4,c=1}{h,cmd=\rotatebox{90}}, % cell{10}{1} = {r=4,c=1}{c,cmd=\rotatebox{90}}, cell{2,10}{1} = {r=4,c=1}{c,cmd=\rotatebox{90}},%<-- in one line } % PUA Nr. & Substrat & Blech Nr. & GT Nr. 1 & GT Nr. 2 & GT Nr. 3 & Mittelwert & Stabw. S\\ % 2403 X& Oxsilan & 4 & 0 & 0 & 0 & 0 & 0\\% &Fe Phosphatiert & 5 & 0 & 0 & 0 & 0 & 0 \\% &Zn Phosphatiert & 1 & 0 & 0 & 0 & 0 & 0 \\% &Gestrahltes Aluminium & 1 & 0 & 0 & 0 & 0 & 0 \\ % 2403 Y& Oxsilan & 3 & 0 & 0 & 0 & 0 & 0\\% &Fe Phosphatiert & 4 & 0 & 0 & 0 & 0 & 0 \\% &Zn Phosphatiert & 2 & 0 & 0 & 0 & 0 & 0 \\% &Gestrahltes Aluminium & 1 & 0 & 0 & 0 & 0 & 0 \\ % 2403 Z& Oxsilan & 1 & 0 & 0 & 0 & 0 & 0\\% &Fe Phosphatiert & 4 & 0 & 0 & 0 & 0 & 0 \\% &Zn Phosphatiert & 2 & 0 & 0 & 0 & 0 & 0 \\% &Gestrahltes Aluminium & 1 & 0 & 0 & 0 & 0 & 0 \\ % \end{longtblr} \end{document} ```
1
https://tex.stackexchange.com/users/263375
690057
320,116
https://tex.stackexchange.com/questions/688471
-1
I have a problem. I used this <https://forums.zotero.org/discussion/comment/389917/#Comment_389917> to show up the Zotero picker window in front of TeXstudio. But when the Zotero picker window shows up, the cursor remains on TeXstudio. Consequently, I have to manually navigate to the Zotero picker using the mouse and click on it. Is there a solution to this issue?
https://tex.stackexchange.com/users/295935
The cursor remains on TeXstudio after the Zotero picker window shows up
true
I've found a solution by creating a Python file with the help of ChatGPT. The file brings the 'Quick Format Citation' window to the front based on its title. I incorporated this script into Texstudio and added a delay function to ensure proper execution. Additionally, I use an openApp.pyw script to open Zotero if it's closed. I hope this solution proves helpful to others.
0
https://tex.stackexchange.com/users/295935
690064
320,119
https://tex.stackexchange.com/questions/690061
1
First a little background. I am using MathTime Pro II (which is *not* an OpenType Font) as my math font and do not want to replace it. I *think* this precludes my loading `unicode-math` if I want to use the OTF versions of all other fonts. I am successfully using the OTF versions of TeX Gyre Termes for Roman, TeX Gyre Heros for sans serif, and Microsoft's Consolas for typewriter. Obviously, I am compiling with XeTeX and using `fontspec` but not `unicode-math`. Now to the specifics of my question(s) (which was difficult to condense into the question title). I have figured out how to access individual characters from the OTF version of Stix Two Math using, for instance, `{{fontspec{STIX Two Math}\char"27D3}}`, although I am not sure this will work in math mode (I am using that particular character as a type of QED symbol and it is in text mode). So my first question is: * Will this work in math mode? If not, what alteration do I need to make to get this to work in math mode? I have *not* figured out how to access characters with codes above FFFF. The errors I was getting led me to [Bad Character Code Error in Math Mode for Unicode Character](https://tex.stackexchange.com/questions/593400/bad-character-code-error-in-math-mode-for-unicode-character), where I thought I had found the answer; despite numerous attempts, I have been unable to wrestle that code into a form that solves my problem. So my second question is: * How can I access characters with codes above FFFF in the Stix Two Math OTF font (or any font, for that matter)? I realize this is a multifaceted question but was afraid breaking it up into two questions would obfuscate the answer. I hope I have successfully provided the setting and what I am trying to accomplish. Ultimately, I want the entire Stix Two Math OTF font available to me without having to replace MathTime Pro II. I will likely only need a few characters at a time.
https://tex.stackexchange.com/users/224317
Using ANY Stix Two Math OTF character in text and math modes without loading it as math font
true
You haven't shown what you did, or what error you got. This shows stix two math alongside latin modern tfm fonts, mathtime would be the same. ``` \documentclass{article} \usepackage{fontspec} \newfontface\StixTwoMath{STIXTwoMath-Regular.otf}[NFSSFamily=stixtwomath,Script=Math] \DeclareSymbolFont{stixtwomath}{TU}{stixtwomath}{m}{n} \Umathchardef\myA "0 \symstixtwomath "1D400 \begin{document} {\StixTwoMath \char"1D400 / } \[ \myA \neq A \] \end{document} ```
1
https://tex.stackexchange.com/users/1090
690067
320,120
https://tex.stackexchange.com/questions/690065
0
The following tex document is compiled with LuaLaTeX engine. ``` \documentclass{article} \usepackage{luakeytest} \begin{document} \myAddFunction[c=30,d=40]{10.1}{20} \myAddFunction{1}{2} \end{document} ``` This output to ``` 100.1 73 ``` The second result is unexpected. I expect the result to be `10` as `1 + 2 + 3 + 4 = 10` and because the default key values of `c` and `d` are `3` and `4`. So it appears that the command is not taking default key values and it is retaining values of `c` and `d` from the previous exectuion. Is there something wrong in the code? How could the code be corrected? Here is the code in `luakeytest.sty' file. ``` \ProvidesPackage{luakeytest} \RequirePackage{xkeyval} \RequirePackage{luacode} \begin{luacode*} function test(a,b,c,d) local c = c or 3 local d = d or 4 return a + b + c + d end \end{luacode*} % ========= KEY DEFINITIONS ========= \define@key{someop}{c}{\def\mop@third{#1}} \define@key{someop}{d}{\def\mop@fourth{#1}} % ========= KEY DEFAULTS ========= \setkeys{someop}{c=3,d=4}% % ========= Defining Command ========= \newcommand{\myAddFunction}[3][]{% \setkeys{someop}{#1}% \directlua{tex.sprint(test(#2,#3,\mop@third,\mop@fourth))}% }% \endinput ```
https://tex.stackexchange.com/users/75476
xkeyval keys not resetting after execution of the command with luatex
true
You need (for example) ``` \newcommand{\myAddFunction}[3][]{{% \setkeys{someop}{#1}% \directlua{tex.sprint(test(#2,#3,\mop@third,\mop@fourth))}% }}% ``` so the key assignments are within a group.
2
https://tex.stackexchange.com/users/1090
690069
320,122
https://tex.stackexchange.com/questions/690078
3
I downloaded the Overleaf file [latexmkrc](https://www.overleaf.com/learn/how-to/How_does_Overleaf_compile_my_project%3F) to automate the creation of glossaries and maintain the standardization of the functioning of my projects. This latexmkrc works perfectly on my local machine with subdirectory hierarchy when running command: ``` latexmk -pdf main.tex ``` However, this command pollutes the root directory and all subdirectories with intermediate files. And when I use the command ``` latexmk -pdf -output-directory=out main.tex ``` I get a compilation error ``` Rc files read: /etc/LatexMk latexmkrc Latexmk: This is Latexmk, John Collins, 4 Apr. 2023. Version 4.80. No existing .aux file, so I'll make a simple one, and require run of *latex. ------------ Running 'internal overleaf_pre_process "main.tex" "main.pdf"' ------------ Latexmk: calling overleaf_pre_process( "main.tex" "main.pdf" ) Latexmk: applying rule 'pdflatex'... Rule 'pdflatex': Reasons for rerun Category 'other': Rerun of 'pdflatex' forced or previously required ------------ Run number 1 of rule 'pdflatex' ------------ ------------ Running 'pdflatex -recorder "main.tex"' ------------ This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022/Debian) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (./main.tex LaTeX2e <2022-11-01> patch level 1 L3 programming layer <2023-01-16> (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2022/07/02 v1.4n Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo)) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/base/glossaries.sty (/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty) (/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (/usr/share/texlive/texmf-dist/tex/latex/mfirstuc/mfirstuc.sty (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty)) (/usr/share/texlive/texmf-dist/tex/latex/xfor/xfor.sty) (/usr/share/texlive/texmf-dist/tex/latex/datatool/datatool-base.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/substr/substr.sty) (/usr/share/texlive/texmf-dist/tex/latex/datatool/datatool-fp.sty (/usr/share/texlive/texmf-dist/tex/latex/fp/fp.sty `Fixed Point Package', Version 0.8, April 2, 1995 (C) Michael Mehlich (/usr/share/texlive/texmf-dist/tex/latex/fp/defpattern.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-basic.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-addons.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-snap.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-exp.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-trigo.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-pas.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-random.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-eqn.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-upn.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-eval.sty)))) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/styles/glossary-hypernav.st y) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/styles/glossary-list.sty ) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/styles/glossary-long.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty)) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/styles/glossary-super.sty (/usr/share/texlive/texmf-dist/tex/latex/supertabular/supertabular.sty)) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/styles/glossary-tree.sty)) (/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def) (./main.aux) (./Sections/section1.tex) [1{/var/lib/texmf/fonts/map/pdftex/updma p/pdftex.map}] No file main.acr. [2] (./main.aux) )</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm /cmbx12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10 .pfb> Output written on main.pdf (2 pages, 27285 bytes). Transcript written on main.log. Latexmk: Getting log file 'main.log' Latexmk: Examining 'main.fls' Latexmk: Examining 'main.log' Latexmk: Missing input file 'main.acr' (or dependence on it) from following: No file main.acr. Latexmk: Log file says output to 'main.pdf' Latexmk: applying rule 'cusdep acn acr main'... Rule 'cusdep acn acr main': Reasons for rerun Changed files or newly in use/created: main.acn Category 'no_dest': cusdep acn acr main ------------ Run number 1 of rule 'cusdep acn acr main' ------------ makeglossaries version 4.51 (2022-11-02) added glossary type 'main' (glg,gls,glo) added glossary type 'acronym' (alg,acr,acn) makeindex -s "main.ist" -t "main.alg" -o "main.acr" "main.acn" This is makeindex, version 2.16 [TeX Live 2022] (kpathsea + Thai support). Scanning style file ./main.ist...........................done (27 attributes redefined, 0 ignored). Scanning input file main.acn....done (3 entries accepted, 0 rejected). Sorting entries....done (4 comparisons). Generating output file main.acr....done (9 lines written, 0 warnings). Output written in main.acr. Transcript written in main.alg. Warning: File 'main.glo' is empty. Have you used any entries defined in glossary 'main'? Remember to use package option 'nomain' if you don't want to use the main glossary. Latexmk: applying rule 'pdflatex'... Rule 'pdflatex': Reasons for rerun Changed files or newly in use/created: main.acr main.aux ------------ Run number 2 of rule 'pdflatex' ------------ ------------ Running 'pdflatex -recorder "main.tex"' ------------ This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022/Debian) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (./main.tex LaTeX2e <2022-11-01> patch level 1 L3 programming layer <2023-01-16> (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2022/07/02 v1.4n Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo)) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/base/glossaries.sty (/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty) (/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (/usr/share/texlive/texmf-dist/tex/latex/mfirstuc/mfirstuc.sty (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty)) (/usr/share/texlive/texmf-dist/tex/latex/xfor/xfor.sty) (/usr/share/texlive/texmf-dist/tex/latex/datatool/datatool-base.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/substr/substr.sty) (/usr/share/texlive/texmf-dist/tex/latex/datatool/datatool-fp.sty (/usr/share/texlive/texmf-dist/tex/latex/fp/fp.sty `Fixed Point Package', Version 0.8, April 2, 1995 (C) Michael Mehlich (/usr/share/texlive/texmf-dist/tex/latex/fp/defpattern.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-basic.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-addons.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-snap.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-exp.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-trigo.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-pas.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-random.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-eqn.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-upn.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-eval.sty)))) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/styles/glossary-hypernav.st y) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/styles/glossary-list.sty ) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/styles/glossary-long.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty)) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/styles/glossary-super.sty (/usr/share/texlive/texmf-dist/tex/latex/supertabular/supertabular.sty)) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/styles/glossary-tree.sty)) (/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def) (./main.aux) (./Sections/section1.tex) [1{/var/lib/texmf/fonts/map/pdftex/updma p/pdftex.map}] (./main.acr) [2] (./main.aux) )</usr/share/texlive/texmf-dist/fo nts/type1/public/amsfonts/cm/cmbx10.pfb></usr/share/texlive/texmf-dist/fonts/ty pe1/public/amsfonts/cm/cmbx12.pfb></usr/share/texlive/texmf-dist/fonts/type1/pu blic/amsfonts/cm/cmr10.pfb> Output written on main.pdf (2 pages, 38653 bytes). Transcript written on main.log. Latexmk: Getting log file 'main.log' Latexmk: Examining 'main.fls' Latexmk: Examining 'main.log' Latexmk: Log file says output to 'main.pdf' Latexmk: All targets () are up-to-date ------------ Running 'internal overleaf_post_process "main.tex" "main.pdf"' ------------ Latexmk: calling overleaf_post_process( "main.tex" "main.pdf" ) (base) ➜ Another Glossary example latexmk -pdf -output-directory=out main.tex Rc files read: /etc/LatexMk latexmkrc Latexmk: This is Latexmk, John Collins, 4 Apr. 2023. Version 4.80. Latexmk: making output directory 'out' No existing .aux file, so I'll make a simple one, and require run of *latex. ------------ Running 'internal overleaf_pre_process "main.tex" "out/main.pdf"' ------------ Latexmk: calling overleaf_pre_process( "main.tex" "out/main.pdf" ) Latexmk: applying rule 'pdflatex'... Rule 'pdflatex': Reasons for rerun Category 'other': Rerun of 'pdflatex' forced or previously required ------------ Run number 1 of rule 'pdflatex' ------------ ------------ Running 'pdflatex -recorder -output-directory="out" "main.tex"' ------------ This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022/Debian) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (./main.tex LaTeX2e <2022-11-01> patch level 1 L3 programming layer <2023-01-16> (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2022/07/02 v1.4n Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo)) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/base/glossaries.sty (/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty) (/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (/usr/share/texlive/texmf-dist/tex/latex/mfirstuc/mfirstuc.sty (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty)) (/usr/share/texlive/texmf-dist/tex/latex/xfor/xfor.sty) (/usr/share/texlive/texmf-dist/tex/latex/datatool/datatool-base.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/substr/substr.sty) (/usr/share/texlive/texmf-dist/tex/latex/datatool/datatool-fp.sty (/usr/share/texlive/texmf-dist/tex/latex/fp/fp.sty `Fixed Point Package', Version 0.8, April 2, 1995 (C) Michael Mehlich (/usr/share/texlive/texmf-dist/tex/latex/fp/defpattern.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-basic.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-addons.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-snap.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-exp.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-trigo.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-pas.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-random.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-eqn.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-upn.sty) (/usr/share/texlive/texmf-dist/tex/latex/fp/fp-eval.sty)))) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/styles/glossary-hypernav.st y) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/styles/glossary-list.sty ) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/styles/glossary-long.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty)) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/styles/glossary-super.sty (/usr/share/texlive/texmf-dist/tex/latex/supertabular/supertabular.sty)) (/usr/share/texlive/texmf-dist/tex/latex/glossaries/styles/glossary-tree.sty)) (/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def) (out/main.aux) (./Sections/section1.tex) [1{/var/lib/texmf/fonts/map/pdftex/upd map/pdftex.map}] No file main.acr. [2] (out/main.aux) )</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/ cm/cmbx12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr 10.pfb> Output written on out/main.pdf (2 pages, 27285 bytes). Transcript written on out/main.log. Latexmk: Getting log file 'out/main.log' Latexmk: Examining 'out/main.fls' Latexmk: Examining 'out/main.log' Latexmk: Missing input file 'main.acr' (or dependence on it) from following: No file main.acr. Latexmk: Log file says output to 'out/main.pdf' Latexmk: applying rule 'cusdep acn acr out/main'... Rule 'cusdep acn acr out/main': Reasons for rerun Changed files or newly in use/created: out/main.acn Category 'no_dest': cusdep acn acr out/main ------------ Run number 1 of rule 'cusdep acn acr out/main' ------------ makeglossaries version 4.51 (2022-11-02) added glossary type 'main' (glg,gls,glo) added glossary type 'acronym' (alg,acr,acn) makeindex -s "main.ist" -t "out/main.alg" -o "out/main.acr" "out/main.acn" Index style file main.ist not found. Usage: makeindex [-ilqrcgLT] [-s sty] [-o ind] [-t log] [-p num] [idx0 idx1 ...] ***Call to makeindex failed*** Possible cause of problem: Style file not found. (Have you used \noist by mistake?) Exit status: 3. Check 'out/main.alg' for details Rule 'cusdep acn acr out/main', function 'glo2gls' failed with return code = 6400 Latexmk: Errors, so I did not complete making targets ------------ Running 'internal overleaf_post_process "main.tex" "out/main.pdf"' ------------ Latexmk: calling overleaf_post_process( "main.tex" "out/main.pdf" ) Collected error summary (may duplicate other messages): cusdep acn acr out/main: Command for 'cusdep acn acr out/main' gave return code 6400 Latexmk: If appropriate, the -f option can be used to get latexmk to try to force complete processing. ``` which flags in latexmk should I use to make this latexmkrc file work? the minimal example to reproduce this error is [here](https://www.overleaf.com/read/qdfgfznkftgn)
https://tex.stackexchange.com/users/223790
Overleaf latexmk with glossaries and output directory
true
The problem is that the code in Overleaf's `latexmkrc` for dealing with glossaries is an old version that doesn't work when an output directory is used. Code that does work is to be found in the `glossaries_latexmkrc` file in the `example_rcfiles` in the current latexmk distribution. The specific correction to be made is to change the following code in `latexmkrc`: ``` add_cus_dep( 'glo', 'gls', 0, 'glo2gls' ); add_cus_dep( 'acn', 'acr', 0, 'glo2gls'); # from Overleaf v1 sub glo2gls { system("makeglossaries $_[0]"); } ``` to ``` add_cus_dep( 'acn', 'acr', 0, 'makeglossaries' ); add_cus_dep( 'glo', 'gls', 0, 'makeglossaries' ); $clean_ext .= " acr acn alg glo gls glg"; sub makeglossaries { my ($base_name, $path) = fileparse( $_[0] ); my @args = ( "-q", "-d", $path, $base_name ); if ($silent) { unshift @args, "-q"; } return system "makeglossaries", "-d", $path, $base_name; } ``` This also includes a line to add to the configuration variable `$clean_ext` items that will add glossaries-generated files to the list of files to be deleted when latexmk does a clean up operation of generated files.
4
https://tex.stackexchange.com/users/8495
690086
320,127
https://tex.stackexchange.com/questions/690061
1
First a little background. I am using MathTime Pro II (which is *not* an OpenType Font) as my math font and do not want to replace it. I *think* this precludes my loading `unicode-math` if I want to use the OTF versions of all other fonts. I am successfully using the OTF versions of TeX Gyre Termes for Roman, TeX Gyre Heros for sans serif, and Microsoft's Consolas for typewriter. Obviously, I am compiling with XeTeX and using `fontspec` but not `unicode-math`. Now to the specifics of my question(s) (which was difficult to condense into the question title). I have figured out how to access individual characters from the OTF version of Stix Two Math using, for instance, `{{fontspec{STIX Two Math}\char"27D3}}`, although I am not sure this will work in math mode (I am using that particular character as a type of QED symbol and it is in text mode). So my first question is: * Will this work in math mode? If not, what alteration do I need to make to get this to work in math mode? I have *not* figured out how to access characters with codes above FFFF. The errors I was getting led me to [Bad Character Code Error in Math Mode for Unicode Character](https://tex.stackexchange.com/questions/593400/bad-character-code-error-in-math-mode-for-unicode-character), where I thought I had found the answer; despite numerous attempts, I have been unable to wrestle that code into a form that solves my problem. So my second question is: * How can I access characters with codes above FFFF in the Stix Two Math OTF font (or any font, for that matter)? I realize this is a multifaceted question but was afraid breaking it up into two questions would obfuscate the answer. I hope I have successfully provided the setting and what I am trying to accomplish. Ultimately, I want the entire Stix Two Math OTF font available to me without having to replace MathTime Pro II. I will likely only need a few characters at a time.
https://tex.stackexchange.com/users/224317
Using ANY Stix Two Math OTF character in text and math modes without loading it as math font
false
Here is a math-mode `\stixtwosymbol` command (based on `\boldsymbol` from `amsbsy`) that replaces any arbitrary symbol with the one from STIX Two Math. it also creates a `\mathversion{stixtwo}` and a `\stixtwomath`, which work just like `\mathversion{bold}` and `\boldmath`. ``` \documentclass{article} \usepackage{unicode-math} \setmathfont{New Computer Modern Math Book} \setmathfont{STIX Two Math}[version=stixtwo] \makeatletter \newcommand\stixtwomath{\mathversion{stixtwo}} %% Based on the definition of \boldsymbol from amsbsy.sty" \DeclareRobustCommand{\stixtwosymbol}[1]{% \begingroup% \let\@nomath\@gobble \mathversion{stixtwo}% \math@atom{#1}{% \mathchoice% {\hbox{$\m@th\displaystyle#1$}}% {\hbox{$\m@th\textstyle#1$}}% {\hbox{$\m@th\scriptstyle#1$}}% {\hbox{$\m@th\scriptscriptstyle#1$}}}% \endgroup} \makeatother \begin{document} \noindent\( x \triangleright y \)\\ \( x \stixtwosymbol{\triangleright} y\) \end{document} ``` You could instead use any arbitrary text-mode command, including setting the font family followed by `\symbol{"123A}`, by wrapping it in `\text` from `amsmath` (or `amstext`). If you need it to have any spacing other than `\mathord`, you need to wrap it again in the math class, such as, ``` \newfontface\symbolfont{STIX Two Math} \newcommand\triangleright{\mathbin{\text{\symbolfont\symbol{"2A65}}}} ``` However, a frame challenge: if what you really want is to use certain symbols from a different math font, consistently, use the `range=` option from `unicode-math`: ``` \defaultfontfeatures{Scale=MatchLowercase} \setmathfont{New Computer Modern Math Book} % Or your font of choice \setmathfont{STIX Two Math}[range={\triangleleft,\triangleright}] ``` You can also set ranges and alphabets, and use hex or decimal Unicode codepoints instead of symbolic names. So, for example ``` \setmathfont{STIX Two Math}[StylisticSet=8, range={"222B-"2233,"2A0B-"2A1C}] ``` changes all the integrals to upright, or ``` \setmathfont{STIX Two Math}[StylisticSet=1, range={scr, bfscr}] ``` changes the `\mathscr` and `\mathbfscr` alphabets from a copy of `\mathcal` to a script font.
0
https://tex.stackexchange.com/users/61644
690087
320,128
https://tex.stackexchange.com/questions/370948
6
In LaTeX, when I type symbols as `\tan` or `\inf` in math mode, they use the normal text font, while I would want them to use Times font, without changing the main font of the text nor the math fonts, neither of which are Times. How can I do that?
https://tex.stackexchange.com/users/134199
Changing fonts in \sin, \tan, \lim…
false
Some necromancy, because someone just told me they looked up the solution here, and it didn’t work for them with `fontspec`. (Because egreg used legacy font encodings, which are very portable so long as you stick to unaccented Latin letters and digits, it doesn’t support the `fontspec` scaling commands.) When using `fontspec` or `unicode-math`, the default font for log-like operators is `\mathrm`, which you can change with, e.g.: ``` \documentclass{article} \usepackage{fontspec} \defaultfontfeatures{Scale=MatchLowercase} \setmainfont{TeX Gyre Heros} \setmathrm{TeX Gyre Termes} \begin{document} The sine is \(\sin x\) and the infinimum is \(\inf S\). \end{document} ``` If what you want is to change *only* the operator font and leave `\mathrm` alone, `unicode-math` has a `\setoperatorfont` command: ``` \documentclass{article} \usepackage{unicode-math} \defaultfontfeatures{Scale=MatchLowercase} \setmainfont{TeX Gyre Heros} \newfontface\timesfont{TeX Gyre Termes}[Ligatures={Common,TeX}] \setoperatorfont\timesfont \begin{document} The sine is \(\sin x\) and the infinimum is \(\inf S\). \end{document} ```
1
https://tex.stackexchange.com/users/61644
690089
320,130
https://tex.stackexchange.com/questions/690084
0
I have a wide table that I'm trying to wrangle, and I think I have it just about done except for the table headings. In the example below, I've had to rotate the headings for columns 5, 6, and 8. I've tried any number of things to get those headings to line up (roughly centered) with the non-rotated headings to no avail (e.g., changing the `parbox` optional argument from `c` to `b` to `t` and changing the `multirow` parameters). It looks like the solution [here](https://tex.stackexchange.com/questions/210869/how-to-align-rotated-column-headings-in-a-table) could be useful, but I could not make it work; [this](https://tex.stackexchange.com/questions/102573/latex-rotated-multi-column) did not seem to work either. Your help is appreciated. ``` \documentclass[fontsize=9pt, twoside, final, openright, c6paper]{book} \usepackage{amsmath} \usepackage{amssymb} \usepackage{scrextend} \usepackage{moresize} \usepackage{booktabs} \usepackage{multirow} \usepackage{array} \usepackage{hanging} \usepackage{dashrule} \usepackage{longtable} \usepackage{setspace} \usepackage{makecell} \usepackage{colortbl} \usepackage[dvipsnames]{xcolor} \usepackage{fancyhdr} \usepackage{ragged2e} \usepackage{rotating} \usepackage{here} \usepackage[colorlinks=true, hyperindex=true]{hyperref} % COLOR DEFINITION \definecolor{darkred}{HTML}{AE0000} \newcommand{\cdr}{\color{darkred}} \newcommand{\phz}{\phantom{0}} \begin{document} \setcounter{page}{60} \thispagestyle{empty} \setlength{\tabcolsep}{3pt} % Default value: 6pt \renewcommand{\arraystretch}{0.6} \begin{Center} {\large{festorum mobilium}} \end{Center} \begin{table}[H] \centering \scriptsize{ \begin{tabular}{ccccccc>{\color{darkred}}c} \toprule \midrule Anno & \multirow{2}{*}{Ascensio} & \multirow{2}{*}{Pentecostes} & Corpus & \raisebox{3em}{\multirow{2}{*}{\begin{sideways}\parbox[c]{16ex}{\centering Indict.}\end{sideways}}} & \raisebox{3.4em}{\multirow{2}{*}{\begin{sideways}\parbox[c]{16ex}{\centering Dom.\ post \\ Pentec.}\end{sideways}}} & Dom.\ I & \raisebox{3.4em}{\multirow{2}{*}{\begin{sideways}\parbox[c]{16ex}{\centering Litt.\ Mart.}\end{sideways}}} \\ % Dom. & & & Christi & & & Adventus & \\ % \midrule 2024 & \phz9 maii & 19 maii & 30 maii & \phz2 & 27 & \phz1 dec. & u \\ 2025 & 29 maii & \phz8 iunii & 19 iunii & \phz3 & 24 & 30 nov. & P \\ 2026 & 14 maii & 24 maii & \phz4 iunii & \phz4 & 26 & 29 nov. & l \\ 2027 & \phz6 maii & 16 maii & 27 maii & \phz5 & 27 & 28 nov. & C \\ 2028 & 25 maii & \phz4 iunii & 15 iunii & \phz6 & 25 & \phz3 dec. & c \\ \midrule 2029 & 10 maii & 20 maii & 31 maii & \phz7 & 27 & \phz2 dec. & p \\ 2030 & 30 maii & \phz9 iunii & 20 iunii & \phz8 & 24 & \phz1 dec. & F \\ 2031 & 22 maii & \phz1 iunii & 12 iunii & \phz9 & 25 & 30 nov. & f \\ 2032 & \phz6 maii & 16 maii & 27 maii & 10 & 27 & 28 nov. & s \\ 2033 & 26 maii & \phz5 iunii & 16 iunii & 11 & 24 & 27 nov. & N \\ \midrule 2034 & 18 maii & 28 maii & \phz8 iunii & 12 & 26 & \phz3 dec. & k \\ 2035 & \phz3 maii & 13 maii & 24 maii & 13 & 28 & \phz2 dec. & B \\ 2036 & 22 maii & \phz1 iunii & 12 iunii & 14 & 25 & 30 nov. & b \\ 2037 & 14 maii & 24 maii & \phz4 iunii & 15 & 26 & 29 nov. & n \\ 2038 & \phz3 iunii & 13 iunii & 24 iunii & \phz1 & 23 & 28 nov. & E \\ \midrule 2039 & 19 maii & 29 maii & \phz9 iunii & \phz2 & 25 & 27 nov. & e \\ % \bottomrule \end{tabular} } \end{table} \end{document} ```
https://tex.stackexchange.com/users/213262
Aligning rotated headings in LaTeX tables
true
I would probably avoid rotating the headings apart from the red one, or rotate them all, but the requested form something like ``` \documentclass[fontsize=9pt, twoside, final, openright]{book} \usepackage{amsmath} \usepackage{amssymb} \usepackage{scrextend} \usepackage{moresize} \usepackage{booktabs} \usepackage{array} \usepackage{makecell} \usepackage[dvipsnames,table]{xcolor} \usepackage{ragged2e} \usepackage{graphicx} \usepackage[colorlinks=true, hyperindex=true]{hyperref} % COLOR DEFINITION \definecolor{darkred}{HTML}{AE0000} \newcommand{\cdr}{\color{darkred}} \newcommand{\phz}{\phantom{0}} \begin{document} \setcounter{page}{60} \thispagestyle{empty} \setlength{\tabcolsep}{3pt} % Default value: 6pt \begin{Center} \large festorum mobilium \end{Center} \begin{table}[htp] \centering \scriptsize \begin{tabular}{ccccccc>{\color{darkred}}c} \toprule \midrule \makecell{Anno\\Dom.} & \makecell{Ascen-\\sio} & \makecell{Pente-\\costes} & \makecell{Corpus\\Christi} & \rotatebox[origin=c]{90}{Indict.} & \rotatebox[origin=c]{90}{\makecell{Dom.\ post \\ Pentec.}} & \makecell{Dom.\ I\\Adventus} & \rotatebox[origin=c]{90}{Litt.\ Mart.}\\ % \midrule 2024 & \phz9 maii & 19 maii & 30 maii & \phz2 & 27 & \phz1 dec. & u \\ 2025 & 29 maii & \phz8 iunii & 19 iunii & \phz3 & 24 & 30 nov. & P \\ 2026 & 14 maii & 24 maii & \phz4 iunii & \phz4 & 26 & 29 nov. & l \\ 2027 & \phz6 maii & 16 maii & 27 maii & \phz5 & 27 & 28 nov. & C \\ 2028 & 25 maii & \phz4 iunii & 15 iunii & \phz6 & 25 & \phz3 dec. & c \\ \midrule 2029 & 10 maii & 20 maii & 31 maii & \phz7 & 27 & \phz2 dec. & p \\ 2030 & 30 maii & \phz9 iunii & 20 iunii & \phz8 & 24 & \phz1 dec. & F \\ 2031 & 22 maii & \phz1 iunii & 12 iunii & \phz9 & 25 & 30 nov. & f \\ 2032 & \phz6 maii & 16 maii & 27 maii & 10 & 27 & 28 nov. & s \\ 2033 & 26 maii & \phz5 iunii & 16 iunii & 11 & 24 & 27 nov. & N \\ \midrule 2034 & 18 maii & 28 maii & \phz8 iunii & 12 & 26 & \phz3 dec. & k \\ 2035 & \phz3 maii & 13 maii & 24 maii & 13 & 28 & \phz2 dec. & B \\ 2036 & 22 maii & \phz1 iunii & 12 iunii & 14 & 25 & 30 nov. & b \\ 2037 & 14 maii & 24 maii & \phz4 iunii & 15 & 26 & 29 nov. & n \\ 2038 & \phz3 iunii & 13 iunii & 24 iunii & \phz1 & 23 & 28 nov. & E \\ \midrule 2039 & 19 maii & 29 maii & \phz9 iunii & \phz2 & 25 & 27 nov. & e \\ % \bottomrule \end{tabular} \end{table} \end{document} ```
2
https://tex.stackexchange.com/users/1090
690091
320,132
https://tex.stackexchange.com/questions/646842
1
The question is already in the title. I am using "algorithmic" as package and can not find any reference for "FOREACH" definition. I already know that for "algpseudocode" I could use ``` % define macro foreach \algnewcommand\algorithmicforeach{\textbf{for each}} \algdef{S}[FOR]{ForEach}[1]{\algorithmicforeach\ #1\ \algorithmicdo} ``` But I can not find something similar for "algorithmic".
https://tex.stackexchange.com/users/270476
How to create a ForEach loop in LaTeX algorithms using "algorithmic"?
true
You can copy the content that is created for `\FORALL` and replace the necessary elements to create a `\FOREACH`: ``` \documentclass{article} \usepackage{algorithmic} \makeatletter % Taken from \FORALL within % http://mirrors.ctan.org/macros/latex/contrib/algorithms/algorithms.dtx \newcommand{\algorithmicforeach}{\textbf{for each}} \newcommand{\FOREACH}[2][default]{% \ALC@it\algorithmicforeach\ #2\ \algorithmicdo% \ALC@com{#1}\begin{ALC@for}} \makeatother \begin{document} \begin{algorithmic}[1] \FORALL{$i$ such that $0 \leq i \leq 10$} \STATE carry out some processing \ENDFOR \FOREACH{$i$ such that $0 \leq i \leq 10$} \STATE carry out some processing \ENDFOR \end{algorithmic} \end{document} ```
1
https://tex.stackexchange.com/users/5764
690102
320,135
https://tex.stackexchange.com/questions/690075
2
I want to center horizontally and vertically all text inside the table for example in the sample code, the text 'angular velocity' be in the center of his cell vertically and horizontally while the width of the columns did not change (the width of the 1st and 3rd columns is 2cm and the 2nd and 4th columns by 5cm). ``` \documentclass{article} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{mathrsfs} \usepackage{caption} \usepackage{mathtools,amssymb} \usepackage{amsthm,amssymb} \usepackage{bm} \begin{document} \begin{table}[h] \begin{center} \renewcommand{\arraystretch}{1.35} \captionsetup{justification=centering} \caption{ {List of variables} } \label{tbl: List of variables} \begin{tabular}{|p{20mm}|p{50mm}|p{20mm}|p{50mm}|} \noalign{\hrule height 2pt} Variables & Definition & Variables & Definition \\ \noalign{\hrule height 2pt} $\mathbf{J} $ & moment of inertia matrix &$\mathbf{C}_{L/B}$ & Direction Cosine Matrix \\ \hline $\bm{q}$&quaternion vector&$\bm{\omega}_{L/B}$& angular velocity relative to LVLH coordinate system expressed in BFCS \\ \hline $\mathbf{M}$& augmented skew-symmetric matrix &$\sum{T}_{ext}$ & total external torque \\ \hline $\mathbf{h}_B$ &angular momentum vector& $\bm{\omega}_{E/B}$& angular velocity relative to ECI coordinate system expressed in BFCS \\ \hline $\omega_{wx}$, $\omega_{wy}$, $\omega_{wz}$ & angular velocity of the RWs &$I_w$ & MOI of the RWs \\ \hline $\omega_{j}$& angular velocity& $\bm{\omega}_{E/L}$ & the satellite's angular velocity relative to LVLH coordinate system with respect to ECI \\ \hline $\bm{x}$&state vector & $\bm{u}$ & control torque vector\\ \hline $T_s$ & sampling time & $T_x$, $T_y$, $T_z$ & applied torques \\ \hline $\alpha$, $\beta$ & fractional-order parameters & $\mathbf{Q}$, $\mathbf{R}$&weighting matrices\\ \hline $\omega_{x}$, $\omega_{y}$, $\omega_{z}$& satellite angular velocity& $\bm{\omega}^\times_{L/B}$& the skew-symmetric matrix of the angular velocity \\ \hline $\bm{T}_{dis}$&disturbance torque&$v$&the velocity of the satellite\\ \hline $r$& the position of the satellite&& \\ \noalign{\hrule height 2pt} \end{tabular} \end{center} \end{table} \end{document} ''' ```
https://tex.stackexchange.com/users/248493
Vertically and horizontally center text inside tabular
false
For Vertically and horizontally centered text, we can use `{\centering\arraybackslash}m{width}` with package `array`. And code for cauterizing Vertically and horizontally the text: ``` \documentclass{article} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{mathrsfs} \usepackage{caption} \usepackage{mathtools,amssymb} \usepackage{amsthm,amssymb} \usepackage{bm} \usepackage{array} \begin{document} \begin{table}[h] \begin{center} \renewcommand{\arraystretch}{1.35} \captionsetup{justification=centering} \caption{ {List of variables} } \label{tbl: List of variables} \begin{tabular}{|>{\centering\arraybackslash}m{.2\linewidth}|>{\centering\arraybackslash}m{0.4\linewidth}|>{\centering\arraybackslash}m{.2\linewidth}|>{\centering\arraybackslash}m{.4\linewidth}|} \noalign{\hrule height 2pt} Variables & Definition & Variables & Definition \\ \noalign{\hrule height 2pt} $\mathbf{J} $ & moment of inertia matrix &$\mathbf{C}_{L/B}$ & Direction Cosine Matrix \\ \hline $\bm{q}$&quaternion vector&$\bm{\omega}_{L/B}$& angular velocity relative to LVLH coordinate system expressed in BFCS \\ \hline $\mathbf{M}$& augmented skew-symmetric matrix &$\sum{T}_{ext}$ & total external torque \\ \hline $\mathbf{h}_B$ &angular momentum vector& $\bm{\omega}_{E/B}$& angular velocity relative to ECI coordinate system expressed in BFCS \\ \hline $\omega_{wx}$, $\omega_{wy}$, $\omega_{wz}$ & angular velocity of the RWs &$I_w$ & MOI of the RWs \\ \hline $\omega_{j}$& angular velocity& $\bm{\omega}_{E/L}$ & the satellite's angular velocity relative to LVLH coordinate system with respect to ECI \\ \hline $\bm{x}$&state vector & $\bm{u}$ & control torque vector\\ \hline $T_s$ & sampling time & $T_x$, $T_y$, $T_z$ & applied torques \\ \hline $\alpha$, $\beta$ & fractional-order parameters & $\mathbf{Q}$, $\mathbf{R}$&weighting matrices\\ \hline $\omega_{x}$, $\omega_{y}$, $\omega_{z}$& satellite angular velocity& $\bm{\omega}^\times_{L/B}$& the skew-symmetric matrix of the angular velocity \\ \hline $\bm{T}_{dis}$&disturbance torque&$v$&the velocity of the satellite\\ \hline $r$& the position of the satellite&& \\ \noalign{\hrule height 2pt} \end{tabular} \end{center} \end{table} \end{document} ```
0
https://tex.stackexchange.com/users/248493
690114
320,140
https://tex.stackexchange.com/questions/690094
2
I am facing difficulties in including the contents of an external file into a LaTeX table using the tabularray package. I am using the following LaTeX code: ``` \documentclass{article} \usepackage{pythontex} \usepackage{tabularray} \usepackage{siunitx} \begin{document} \begin{pycode} from scipy.constants import physical_constants constants = physical_constants.keys() table = [] for constant in constants: value, unit, uncertainty = physical_constants[constant] table.append([constant, value, unit, uncertainty]) # Função para formatar um valor com unidade def format_value_with_unit(value, unit): formatted_value = r'\num{' + str(value) + r'}' formatted_unit = r'\unit{' + unit + r'}' return formatted_value, formatted_unit # Gravar o output em um arquivo LaTeX with open('output.tex', 'w') as f: # f.write(r'\begin{tabular}{cccc}' + '\n') f.write(r'\textbf{Constante} & \textbf{Valor} & \textbf{Unidade} & \textbf{Incerteza} \\ \hline' + '\n') # Escrever as constantes com seus valores e unidades for row in table: constant = row[0] value = row[1] unit = row[2] uncertainty = row[3] formatted_value, formatted_unit = format_value_with_unit(value, unit) line = constant + ' & ' + formatted_value + ' & ' + formatted_unit + ' & ' + r'\num{' + str(uncertainty) + r'}' + r' \\' f.write(line + '\n') # f.write(r'\end{tabular}') \end{pycode} \begin{longtblr}[ caption = {Constantes da Física.}, label = {constantes}, ]{ colspec = {XXXX}, width = \linewidth, } \input{output.tex} \end{longtblr} \end{document} ``` The file output.tex contains a list of constants and their respective values, units, and uncertainties. However, when I compile the code, I receive the following error: ``` (./pythontex-files-stack-overflow/stack-overflow.pytxpyg) (./output.tex ! Misplaced alignment tab character &. l.1 \textbf{Constante} & \textbf{Valor} & \textbf{Unidade} & \textbf{Incerte... ``` Could someone help me identify what I am doing wrong or provide an alternative solution to include the content of the output.tex file in the table? I appreciate any help you can offer! Thank you, Luís Ferreira
https://tex.stackexchange.com/users/43477
Issue with including data file in a LaTeX table using the tabularray package
false
As per the documentation of the `tabularray` package, add ``` \UseTblrLibrary{functional} ``` to preamble and use ``` \begin{longtblr}[ evaluate = \fileInput, caption = {Constantes da Física.}, label = {constantes}, ]{ colspec = {XXXX}, width = \linewidth, } \fileInput{output} \end{longtblr} ``` Or, make it so that `output.tex` contains the whole thing, i.e. not only the data but the `longtblr` environment. Side remark: this gives a 30 pages document whose build time is inordinately long. If I were in your place I would not use `tabularray` package but some `longtable` with suitable traditional `p` columns with suitably chosen width. It appears the `tabularray` approach has simply too much overhead on such example. Except if you have a really fast CPU. I admit my material is rather antiquated. Also, the first column "Constante" displays badly. You can include `\usepackage{ragged2e}` in the document preamble and insert `>{\RaggedRight}` in the table preamble specification to improve things (i.e. if sticking with `tabularray` use `colspec = {>{\RaggedRight}XXXX},`). #### Update: I obtained a reasonable result (and a very much faster build, but 2 compilations are needed) with ``` \renewcommand{\arraystretch}{1.2} \begin{longtable}{>{\RaggedRight}p{2.5cm}SSS} \input{output} \end{longtable} ``` Edit: here is more evolved, but the best would be to remove from `output.tex` the header line then ``` \renewcommand{\arraystretch}{1.2} \begin{longtable}{>{\RaggedRight}p{2.5cm}SSS} \endfirsthead \multicolumn{4}{c}{\textbf{Table of physical constants (cont.)}}\\\hline\noalign{\vskip2\jot} \endhead \input{output} \end{longtable} ``` But you may (should?) consider refinements of this using optional argument of `S` specifier, see `siunitx` documentation (things such as `S[table-column-width = 2cm]` syntax appears relevant). Then the whole `\num` and `\unit` mark-up in `output.tex` may be redundant, or not (I am not too familiar with `siunitx`). #### Side remark The mark-up in `output.tex` for negative exponents is wrong. And also it is lacking a dot between units. Things such as `\unit{C^4 m^4 J^-3}` should be `\unit{C^4.m^4.J^{-3}}` or `\unit{C^4.m^4/J^3}`. See `siunitx` documentation section `3.3 Units`.
2
https://tex.stackexchange.com/users/293669
690116
320,141
https://tex.stackexchange.com/questions/690105
5
I have a question about naming variables. In `expl3`, the variable naming convention is the following: `\<scope>_<module>_<description>_<type>`. The `<scope>` can be `l`, `g`, or `c`, which indicates whether the variable is a local, global, or constant variable (although this is technically not enforced; it is just a convention). I am currently writing a package where I set up variables using `l3keys`. These variables have an initial value set by the `.initial:` key. In this situation, I am unsure whether I should use `g` or `c` as the variable scope. One could argue `c` would be appropriate since I would like the variable's value never to change after it is loaded via the package option. Or perhaps `g` would be best since, if my understanding is correct, the variable can change from the initial value set by `.initial:n` to the value set by the user when loading the package options. EDIT: I've updated my MWE. Here is the main file. ``` \documentclass{article} \usepackage{mypackage} \begin{document} Some text. %I am aware that using \ExplSyntax is bad practice inside the document body. %This is solely for demonstration. \ExplSyntaxOn \dim_use:N \c_mymodule_testdimen_dim \par \skip_use:N \c_mymodule_testskip_skip \ExplSyntaxOff \end{document} ``` Here is the package file named `mypackage.sty`. ``` \ProvidesExplPackage {mypackage} {2023-07-01} {1.0.0} {Test package} \keys_define:nn { mymodule } { testdimen .dim_gset:N = \c_mymodule_testdimen_dim ,testdimen .initial:n = { 12pt } ,textskip .skip_gset:N = \c_mymodule_testskip_skip ,textskip .initial:n = { 12pt plus 6pt minus 3pt } } \ProcessKeyOptions ```
https://tex.stackexchange.com/users/278534
Variable naming inside l3keys
true
User-defined values are never constants, as you are *setting* an existing *variable* not creating them in one go. As you are setting globally, you should use `\g_...` not `\l_...`. (You can't really have a constant set from a key, as the variable has to be created when the key is, so has one value, then is being altered when you set the key.) Of course, TeX doesn't have formal constants, but the `expl3` convention for these are they are programmer-specified global values that do no change. Thus `\c_...` is for things like pre-defined sizes of data structures that never change, locations of csnames that are fixed. (*E.g.* `l3keys` itself for example uses a set of constant `tl` to set where keys are stored.) They are in that sense not just 'set once for this TeX run' but 'set for all uses of this code on the same setup (engine, platform, etc.)'.
7
https://tex.stackexchange.com/users/73
690118
320,142
https://tex.stackexchange.com/questions/690075
2
I want to center horizontally and vertically all text inside the table for example in the sample code, the text 'angular velocity' be in the center of his cell vertically and horizontally while the width of the columns did not change (the width of the 1st and 3rd columns is 2cm and the 2nd and 4th columns by 5cm). ``` \documentclass{article} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{mathrsfs} \usepackage{caption} \usepackage{mathtools,amssymb} \usepackage{amsthm,amssymb} \usepackage{bm} \begin{document} \begin{table}[h] \begin{center} \renewcommand{\arraystretch}{1.35} \captionsetup{justification=centering} \caption{ {List of variables} } \label{tbl: List of variables} \begin{tabular}{|p{20mm}|p{50mm}|p{20mm}|p{50mm}|} \noalign{\hrule height 2pt} Variables & Definition & Variables & Definition \\ \noalign{\hrule height 2pt} $\mathbf{J} $ & moment of inertia matrix &$\mathbf{C}_{L/B}$ & Direction Cosine Matrix \\ \hline $\bm{q}$&quaternion vector&$\bm{\omega}_{L/B}$& angular velocity relative to LVLH coordinate system expressed in BFCS \\ \hline $\mathbf{M}$& augmented skew-symmetric matrix &$\sum{T}_{ext}$ & total external torque \\ \hline $\mathbf{h}_B$ &angular momentum vector& $\bm{\omega}_{E/B}$& angular velocity relative to ECI coordinate system expressed in BFCS \\ \hline $\omega_{wx}$, $\omega_{wy}$, $\omega_{wz}$ & angular velocity of the RWs &$I_w$ & MOI of the RWs \\ \hline $\omega_{j}$& angular velocity& $\bm{\omega}_{E/L}$ & the satellite's angular velocity relative to LVLH coordinate system with respect to ECI \\ \hline $\bm{x}$&state vector & $\bm{u}$ & control torque vector\\ \hline $T_s$ & sampling time & $T_x$, $T_y$, $T_z$ & applied torques \\ \hline $\alpha$, $\beta$ & fractional-order parameters & $\mathbf{Q}$, $\mathbf{R}$&weighting matrices\\ \hline $\omega_{x}$, $\omega_{y}$, $\omega_{z}$& satellite angular velocity& $\bm{\omega}^\times_{L/B}$& the skew-symmetric matrix of the angular velocity \\ \hline $\bm{T}_{dis}$&disturbance torque&$v$&the velocity of the satellite\\ \hline $r$& the position of the satellite&& \\ \noalign{\hrule height 2pt} \end{tabular} \end{center} \end{table} \end{document} ''' ```
https://tex.stackexchange.com/users/248493
Vertically and horizontally center text inside tabular
true
* Your table is wider than `\textwidth` defined by default `article` page out. - - You may consider to increase it by adding `\usepackage{geometry} to document preamble. * Simple code, which enable desired table formatting you can write by use of the `tabularray` package: ``` \documentclass{article} %---------------- show page layout. don't use in a real document! \usepackage{showframe} \renewcommand\ShowFrameLinethickness{0.15pt} \renewcommand*\ShowFrameColor{\color{red}} %---------------------------------------------------------------% \usepackage{lipsum}% For dummy text. Don't use in a real document \usepackage{mathrsfs} \usepackage{caption} \usepackage{bm} \usepackage{tabularray} \begin{document} \begin{table}[h] \caption{List of variables} \label{tbl: List of variables} \begin{tblr}{hline{1,2,Z} = 1pt, hline{3-Y}, vlines, colspec = {*{2}{Q[c,m, mode=math] X[c,m]} }, colsep = 4pt, row{1} = {mode=text} } Variables & Definition & Variables & Definition \\ \mathbf{J} & moment of inertia matrix & \mathbf{C}_{L/B} & Direction Cosine Matrix \\ \bm{q} & cquaternion vector & \bm{\omega}_{L/B} & angular velocity relative to LVLH coordinate system expressed in BFCS \\ \mathbf{M} & augmented skew-symmetric matrix & \sum{T}_{\mathrm{ext}} & total external torque \\ \mathbf{h}_B & angular momentum vector & \bm{\omega}_{E/B} & angular velocity relative to ECI coordinate system expressed in BFCS \\ \omega_{wx}, \omega_{wy}, \omega_{wz} & angular velocity of the RWs & I_w & MOI of the RWs \\ \omega_{j} & angular velocity & \bm{\omega}_{E/L} & the satellite's angular velocity relative to LVLH coordinate system with respect to ECI \\ \bm{x} & state vector & \bm{u} & control torque vector \\ T_s & sampling time & T_x, T_y, T_z & applied torques \\ \alpha, \beta & fractional-order parameters & \mathbf{Q}, \mathbf{R} & weighting matrices \\ \omega_{x}, \omega_{y}, \omega_{z} & satellite angular velocity & \bm{\omega}^\times_{L/B} & the skew-symmetric matrix of the angular velocity \\ \bm{T}_{dis} & disturbance torque & v & the velocity of the satellite \\ r & the position of the satellite & & \\ \end{tblr} \end{table} \end{document} ``` **Edit:** BTW, to my opinion table will be nicer (more professional looking) if cells contents would be left aligned, not vertical centered, all vertical lines omitted and for horizontal rules used `booktabs` rules for the first, second and last rule: ``` \documentclass{article} %\usepackage{geometry} %---------------- show page layout. don't use in a real document! \usepackage{showframe} \renewcommand\ShowFrameLinethickness{0.15pt} \renewcommand*\ShowFrameColor{\color{red}} %---------------------------------------------------------------% \usepackage{lipsum}% For dummy text. Don't use in a real document \usepackage{mathrsfs} \usepackage{caption} \usepackage{bm} \usepackage{tabularray} \UseTblrLibrary{booktabs} \begin{document} \begin{table}[ht] \caption{List of variables} \label{tbl: List of variables} \begin{tblr}{colsep = 4pt, colspec = {@{} *{2}{Q[l, mode=math] X[l, font=\linespread{0.88}\selectfont} @{}}, row{1} = {mode=text} row{2-Z} = {rowsep=3pt} } \toprule Variables & Definition & Variables & Definition \\ \midrule \mathbf{J} & moment of inertia matrix & \mathbf{C}_{L/B} & Direction Cosine Matrix \\ \bm{q} & cquaternion vector & \bm{\omega}_{L/B} & angular velocity relative to LVLH coordinate system expressed in BFCS \\ \mathbf{M} & augmented skew-symmetric matrix & \sum{T}_{\mathrm{ext}} & total external torque \\ \mathbf{h}_B & angular momentum vector & \bm{\omega}_{E/B} & angular velocity relative to ECI coordinate system expressed in BFCS \\ \omega_{wx}, \omega_{wy}, \omega_{wz} & angular velocity of the RWs & I_w & MOI of the RWs \\ \omega_{j} & angular velocity & \bm{\omega}_{E/L} & the satellite's angular velocity relative to LVLH coordinate system with respect to ECI \\ \bm{x} & state vector & \bm{u} & control torque vector \\ T_s & sampling time & T_x, T_y, T_z & applied torques \\ \alpha, \beta & fractional-order parameters & \mathbf{Q}, \mathbf{R} & weighting matrices \\ \omega_{x}, \omega_{y}, \omega_{z} & satellite angular velocity & \bm{\omega}^\times_{L/B} & the skew-symmetric matrix of the angular velocity \\ \bm{T}_{dis} & disturbance torque & v & the velocity of the satellite \\ r & the position of the satellite & & \\ \bottomrule \end{tblr} \end{table} \end{document} ``` (red lines indicate page layout)
1
https://tex.stackexchange.com/users/18189
690119
320,143
https://tex.stackexchange.com/questions/690093
-1
``` \documentclass{article} \usepackage{fontspec} \setmainfont{/local/path/to/cienfuegos}[ Extension=.ttf ] \begin{document} \begin{itemize} \item HellO \end{itemize} \end{document} ``` --- ``` /tex/latex/fontspec/fontspec.cfg))) LaTeX Font Warning: Font shape TU//home/r' undefined (Font) using TU/lmr/m/n' instead on input line 11. ! Illegal unit of measure (pt inserted). t l.11 ^^I] ``` Advice of changes to make please?
https://tex.stackexchange.com/users/299995
fonspec font shape undefined
false
When you do ``` \setmainfont{<fontname>}[<options>] ``` TeX (either XeTeX or LuaTeX) wants in the mandatory argument something it can fully interpret. It can be a file name (but not with a path) or the PostScript name of a font present on your system. For instance, on my system I can do ``` \setmainfont{Times New Roman} ``` because it is known as an internal font name to the OS; interaction with the system libraries also makes it possible for TeX to guess also the fonts to associate with italics and boldface. The mandatory argument can als be a file name with extension and in this case TeX will look for it in the relevant directories of the TeX trees. If you want to load a font in a nonstandard directory, use the `Path` key: ``` \setmainfont{cienfuegos}[ Path=/path/to/, Extension=.ttf ] ``` Suppose your font files follow nonstandard naming conventions, so you have `bizarre.ttf` for upright medium shape, `bizarrei.ttf` for italic, `bizarreb.ttf` for boldface and `bizarrebi.ttf` for bold italic. You can do ``` \setmainfont{bizarre}[ Path=/path/to/, Extension=.ttf, UprightFont=*, ItalicFont=*i, BoldFont=*b, BoldItalicFont=*bi, ] ``` where the `*` will be replaced by the mandatory argument.
1
https://tex.stackexchange.com/users/4427
690120
320,144
https://tex.stackexchange.com/questions/595454
4
I am collaborating in an Overleaf project where I use git to work locally while my colleagues work directly on the browser. On top of editing, they also use Overleaf's comments (see [url](https://pt.overleaf.com/learn/how-to/Track_Changes_in_Overleaf#Resolve,_re-open_and_delete_comment_threads)) to talk to one another. If I commit my local changes to Overleaf, do I risk accidentally deleting their comments? Is there some file where Overleaf keeps these comments used in the browser?
https://tex.stackexchange.com/users/234870
Will I lose comments in Overleaf if I use git as well?
false
I have been using Overleaf's Git feature for a while now and it seems like you risk losing comments created online. It seems that you can lose the comments if your update changes the commented lines. Still, if you want to use Git only to update resources of your project like figures (I do this a lot), that is safe. Another option would be to convince your collaborators to use some LaTeX solution for commenting, like [`\usepackage{todonotes}`](https://www.overleaf.com/blog/619-tip-of-the-week-add-inline-or-margin-comments-to-your-pdf#:%7E:text=In%20LaTeX%2C%20you%20can%20use,can%20use%20the%20todonotes%20package.&text=Tags%3A,guides).
3
https://tex.stackexchange.com/users/234870
690127
320,145
https://tex.stackexchange.com/questions/690124
1
I'm using to `tblr` for tables but whenever I switch the table to fit one column, caption disappears and for the second table it's too wide so I used ``` \newcommand{\spheading}[2][7em]{% \spheading[<width>]{<stuff>} \raisebox{-.5\normalbaselineskip}[6pt][1pt]{\rotatebox{90}{\parbox{#1}{\raggedright #2}}}} ``` from another post on the Stack to vertically align the text, but for some reason the row's length is shrinking when I used the command. Any ideas would be appreciate it. ``` \documentclass[default,iicol]{sn-jnl} \usepackage{graphicx}% \usepackage{multirow}% \usepackage{amsmath,amssymb,amsfonts}% \usepackage{amsthm}% \usepackage{mathrsfs}% \usepackage{xcolor}% \usepackage{tabularray} \UseTblrLibrary{varwidth} \usepackage{caption} \usepackage{cleveref} \usepackage{float} \begin{document} \newcommand{\spheading}[2][7em]{% \spheading[<width>]{<stuff>} \raisebox{-.5\normalbaselineskip}[6pt][1pt]{\rotatebox{90}{\parbox{#1}{\raggedright #2}}}} \begin{table*}[h!] \centering \begin{tblr} { colspec = {|m{0.09\textwidth}| % <-- use 'm', not 'p', m{0.13\textwidth}| m{0.04\textwidth}| m{0.06\textwidth}| m{0.07\textwidth}| m{0.05\textwidth}| m{0.05\textwidth}| m{0.08\textwidth}| m{0.06\textwidth}| m{0.06\textwidth}| }, hline{1,2} = {1pt,solid}, hline{3,4-7,9-12} = {dashed}, hline{4,8,13} = {solid}, row{1} = {gray!30}, % cell{4-8,10-16,20-24,28-32,36-40}{2}={c=2}{h,0.6\paperwidth}, measure=vbox, row{1-Z} = {font=\small}, cell{1}{1-3} = {font=\small\bfseries}, % cell{1,9,17,25,33}{1-2} = {font=\small\bfseries}, } &\spheading{Profession} & \spheading{Student} & \spheading{Company \& employee} & \spheading{Faculty \& staff} & \spheading{Researcher} & \spheading{Self-employed \& freelancers} & \spheading{Innovative enterprise manager} & \spheading{Chi-square test} & \spheading{Sign. \\ (\%)} \\ \end{tblr} \caption{yyyyyyyyyyy} \label{tabVIII} \end{table*} \begin{table}[t!] \centering \begin{tblr} { colspec = {|m{0.09\textwidth}| % <-- use 'm', not 'p', m{0.15\textwidth}| m{0.03\textwidth}| m{0.07\textwidth}| }, hline{1,2} = {1pt,solid}, hline{3,5-7,9-13,15-18} = {dashed}, hline{4,8,14,19} = {solid}, row{1} = {gray!30}, measure=vbox, row{1-Z} = {font=\small}, cell{1}{1-3} = {font=\small\bfseries}, } Item & Classification & No. & Perc. (\%)\\ \end{tblr} \caption{xxxxxxx.} \label{tabI} \end{table} \Cref{tabI} outlines \Cref{tabVIII} outlines \end{document} ``` This is an update to the problem, so I used the code provided below and I tried to test it on Overleaf, and I noticed that when I remove the `row{1} = {cmd=\rothead,},`, the caption disappears, but when I keep it the caption appears again. Please check the Overleaf to see the problem. I would appreciate any help since I've been trying to solve the problem since a few days now.
https://tex.stackexchange.com/users/98778
Caption disappears with tabularray
false
* I can't reproduce your problem. In test I used up-to-date MiKTeX. * However, at least the first table, as you defined columns widths, is quite wide, so you will have hard time to fit it in one column. * Your code for column headers with rotate text is a bit clumsy, I suggest to employ `rotating` and `makecell` package as I did in MWWE below. * It is unknown, what is table content, consequently I cant judged if you really need to define width of each column separately. In MWE below I assume that they can have equal width. ``` \documentclass[default,iicol]{sn-jnl} \usepackage{lipsum} %\usepackage{graphicx} % not used in MWE %\usepackage{multirow} % %\usepackage{amssymb} % %\usepackage{amsthm} % %\usepackage{mathrsfs} % \usepackage{rotating} \usepackage{makecell} \usepackage{xcolor}% \usepackage{tabularray} \UseTblrLibrary{amsmath, varwidth} \usepackage{caption} \usepackage{cleveref} %\usepackage{float} % not recommended \begin{document} \lipsum[66] \begin{table}[ht]%{sidewaystable} \renewcommand\theadfont{} \settowidth\rotheadsize{Faculty \& staff} % from makecell \begin{tblr}{hline{1,2} = {1pt,solid}, hline{3,4-7,9-12} = {dashed}, hline{4,8,13} = {solid}, vlines, colspec = {Q[c,m] *{9}{X[c,m]}}, row{1} = {cmd=\rothead, bg=gray!30, rowsep=0pt}, measure=vbox, row{1-Z} = {font=\small}, cell{1}{1-3} = {font=\small\bfseries}, colsep = 1pt, % cell{4-8,10-16,20-24,28-32,36-40}{2}={c=2}{h,0.6\paperwidth}, % cell{1,9,17,25,33}{1-2} = {font=\small\bfseries}, } & Profession & Student & Company \& employee & Faculty \& staff & Researcher & Self-employed \& freelancers & Innovative enterprise manager & Chi-square test & Sign. (\%) \\ 1 & 2 & 3 & 4 & 5 & 6 & 7 & 7 & 8 & 9 \\ \end{tblr} \caption{yyyyyyyyyyy} \label{tabVIII} \end{table} \Cref{tabVIII} outlines \dots \lipsum[1-6] \end{document} ```
0
https://tex.stackexchange.com/users/18189
690131
320,146
https://tex.stackexchange.com/questions/690126
0
I have created a custom margin for the automation of chapter creation of certain sections of me digitizing a book. I want to be able to remove the top margin from the chapter heading as i feel i wouldn't be needing it. However, I can't do this. Minimum working example: ``` \documentclass[10pt,a4paper]{book} % Packages \usepackage[margin=1in]{geometry} \usepackage{fontspec} \usepackage{titlesec} \usepackage[vietnamese=nohyphenation]{hyphsubst} \usepackage[vietnamese]{babel} \usepackage{indentfirst} % The specific macro that I use \newcommand{\house}[3]{ \chapter[#1]{#1 \\ #2} \vspace{-20pt} \noindent \Large{\textbf{(#3)}}} \begin{document} \house{HỌ HỒNG BÀNG}{鴻龐氏}{2879 -- 258 trước Tây lịch} \end{document} ```
https://tex.stackexchange.com/users/257308
How to remove top margin from chapter heading in a custom macro?
true
Here is how I've done it. ``` % Title Format \titleformat{\chapter}[display] {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{10pt}{\Huge\MakeUppercase} \titlespacing{\chapter}{0pt}{20pt}{10pt} % Macros \newcommand{\house}[3]{ \chapter[#1]{#1 \\ #2} \noindent \Large{\textbf{(#3)}}} ```
0
https://tex.stackexchange.com/users/257308
690132
320,147
https://tex.stackexchange.com/questions/690130
0
This is a follow-up question to [Using ANY Stix Two Math OTF character in text and math modes without loading it as math font](https://tex.stackexchange.com/questions/690061/using-any-stix-two-math-otf-character-in-text-and-math-modes-without-loading-it/690087?noredirect=1#comment1712378_690087). Using David Carlisle's method, I made the following package file: ``` \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{Stix2OTFCalligraphic}[07/01/2023] \newfontface\StixTwoMathZero{STIXTwoMath-Regular.otf}[NFSSFamily=stixtwocal,Script=Math] \DeclareSymbolFont{stixtwocal}{TU}{stixtwocal}{m}{n} \Umathchardef\stixc@lA "0 \symstixtwocal "1D49C \Umathchardef\stixc@lB "0 \symstixtwocal "0212C \Umathchardef\stixc@lC "0 \symstixtwocal "1D49E \Umathchardef\stixc@lD "0 \symstixtwocal "1D49F \Umathchardef\stixc@lE "0 \symstixtwocal "02130 \Umathchardef\stixc@lF "0 \symstixtwocal "02131 \Umathchardef\stixc@lG "0 \symstixtwocal "1D4A2 \Umathchardef\stixc@lH "0 \symstixtwocal "0210B \Umathchardef\stixc@lI "0 \symstixtwocal "02110 \Umathchardef\stixc@lJ "0 \symstixtwocal "1D4A5 \Umathchardef\stixc@lK "0 \symstixtwocal "1D4A6 \Umathchardef\stixc@lL "0 \symstixtwocal "02112 \Umathchardef\stixc@lM "0 \symstixtwocal "02133 \Umathchardef\stixc@lN "0 \symstixtwocal "1D4A9 \Umathchardef\stixc@lO "0 \symstixtwocal "1D4AA \Umathchardef\stixc@lP "0 \symstixtwocal "1D4AB \Umathchardef\stixc@lQ "0 \symstixtwocal "1D4AC \Umathchardef\stixc@lR "0 \symstixtwocal "0211B \Umathchardef\stixc@lS "0 \symstixtwocal "1D4AE \Umathchardef\stixc@lT "0 \symstixtwocal "1D4AF \Umathchardef\stixc@lU "0 \symstixtwocal "1D4B0 \Umathchardef\stixc@lV "0 \symstixtwocal "1D4B1 \Umathchardef\stixc@lW "0 \symstixtwocal "1D4B2 \Umathchardef\stixc@lX "0 \symstixtwocal "1D4B3 \Umathchardef\stixc@lY "0 \symstixtwocal "1D4B4 \Umathchardef\stixc@lZ "0 \symstixtwocal "1D4B5 \Umathchardef\stixc@la "0 \symstixtwocal "1D4B6 \Umathchardef\stixc@lb "0 \symstixtwocal "1D4B7 \Umathchardef\stixc@lc "0 \symstixtwocal "1D4B8 \Umathchardef\stixc@ld "0 \symstixtwocal "1D4B9 \Umathchardef\stixc@le "0 \symstixtwocal "0212F \Umathchardef\stixc@lf "0 \symstixtwocal "1D4BB \Umathchardef\stixc@lg "0 \symstixtwocal "0210A \Umathchardef\stixc@lh "0 \symstixtwocal "1D4BD \Umathchardef\stixc@li "0 \symstixtwocal "1D4BE \Umathchardef\stixc@lj "0 \symstixtwocal "1D4BF \Umathchardef\stixc@lk "0 \symstixtwocal "1D4C0 \Umathchardef\stixc@ll "0 \symstixtwocal "1D4C1 \Umathchardef\stixc@lm "0 \symstixtwocal "1D4C2 \Umathchardef\stixc@ln "0 \symstixtwocal "1D4C3 \Umathchardef\stixc@lo "0 \symstixtwocal "02134 \Umathchardef\stixc@lp "0 \symstixtwocal "1D4C5 \Umathchardef\stixc@lq "0 \symstixtwocal "1D4C6 \Umathchardef\stixc@lr "0 \symstixtwocal "1D4C7 \Umathchardef\stixc@ls "0 \symstixtwocal "1D4C8 \Umathchardef\stixc@lt "0 \symstixtwocal "1D4C9 \Umathchardef\stixc@lu "0 \symstixtwocal "1D4CA \Umathchardef\stixc@lv "0 \symstixtwocal "1D4CB \Umathchardef\stixc@lw "0 \symstixtwocal "1D4CC \Umathchardef\stixc@lx "0 \symstixtwocal "1D4CD \Umathchardef\stixc@ly "0 \symstixtwocal "1D4CE \Umathchardef\stixc@lz "0 \symstixtwocal "1D4CF \Umathchardef\stixc@lbfA "0 \symstixtwocal "1D4D0 \Umathchardef\stixc@lbfB "0 \symstixtwocal "1D4D1 \Umathchardef\stixc@lbfC "0 \symstixtwocal "1D4D2 \Umathchardef\stixc@lbfD "0 \symstixtwocal "1D4D3 \Umathchardef\stixc@lbfE "0 \symstixtwocal "1D4D4 \Umathchardef\stixc@lbfF "0 \symstixtwocal "1D4D5 \Umathchardef\stixc@lbfG "0 \symstixtwocal "1D4D6 \Umathchardef\stixc@lbfH "0 \symstixtwocal "1D4D7 \Umathchardef\stixc@lbfI "0 \symstixtwocal "1D4D8 \Umathchardef\stixc@lbfJ "0 \symstixtwocal "1D4D9 \Umathchardef\stixc@lbfK "0 \symstixtwocal "1D4DA \Umathchardef\stixc@lbfL "0 \symstixtwocal "1D4DB \Umathchardef\stixc@lbfM "0 \symstixtwocal "1D4DC \Umathchardef\stixc@lbfN "0 \symstixtwocal "1D4DD \Umathchardef\stixc@lbfO "0 \symstixtwocal "1D4DE \Umathchardef\stixc@lbfP "0 \symstixtwocal "1D4DF \Umathchardef\stixc@lbfQ "0 \symstixtwocal "1D4E0 \Umathchardef\stixc@lbfR "0 \symstixtwocal "1D4E1 \Umathchardef\stixc@lbfS "0 \symstixtwocal "1D4E2 \Umathchardef\stixc@lbfT "0 \symstixtwocal "1D4E3 \Umathchardef\stixc@lbfU "0 \symstixtwocal "1D4E4 \Umathchardef\stixc@lbfV "0 \symstixtwocal "1D4E5 \Umathchardef\stixc@lbfW "0 \symstixtwocal "1D4E6 \Umathchardef\stixc@lbfX "0 \symstixtwocal "1D4E7 \Umathchardef\stixc@lbfY "0 \symstixtwocal "1D4E8 \Umathchardef\stixc@lbfZ "0 \symstixtwocal "1D4E9 \Umathchardef\stixc@lbfa "0 \symstixtwocal "1D4EA \Umathchardef\stixc@lbfb "0 \symstixtwocal "1D4EB \Umathchardef\stixc@lbfc "0 \symstixtwocal "1D4EC \Umathchardef\stixc@lbfd "0 \symstixtwocal "1D4ED \Umathchardef\stixc@lbfe "0 \symstixtwocal "1D4EE \Umathchardef\stixc@lbff "0 \symstixtwocal "1D4EF \Umathchardef\stixc@lbfg "0 \symstixtwocal "1D4F0 \Umathchardef\stixc@lbfh "0 \symstixtwocal "1D4F1 \Umathchardef\stixc@lbfi "0 \symstixtwocal "1D4F2 \Umathchardef\stixc@lbfj "0 \symstixtwocal "1D4F3 \Umathchardef\stixc@lbfk "0 \symstixtwocal "1D4F4 \Umathchardef\stixc@lbfl "0 \symstixtwocal "1D4F5 \Umathchardef\stixc@lbfm "0 \symstixtwocal "1D4F6 \Umathchardef\stixc@lbfn "0 \symstixtwocal "1D4F7 \Umathchardef\stixc@lbfo "0 \symstixtwocal "1D4F8 \Umathchardef\stixc@lbfp "0 \symstixtwocal "1D4F9 \Umathchardef\stixc@lbfq "0 \symstixtwocal "1D4FA \Umathchardef\stixc@lbfr "0 \symstixtwocal "1D4FB \Umathchardef\stixc@lbfs "0 \symstixtwocal "1D4FC \Umathchardef\stixc@lbft "0 \symstixtwocal "1D4FD \Umathchardef\stixc@lbfu "0 \symstixtwocal "1D4FE \Umathchardef\stixc@lbfv "0 \symstixtwocal "1D4FF \Umathchardef\stixc@lbfw "0 \symstixtwocal "1D500 \Umathchardef\stixc@lbfx "0 \symstixtwocal "1D501 \Umathchardef\stixc@lbfy "0 \symstixtwocal "1D502 \Umathchardef\stixc@lbfz "0 \symstixtwocal "1D503 \def\ifiscseq#1{\ifcat$\expandafter\@gobble\string#1$\expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi} \def\stix@@cal#1#2\@nil{% \ifiscseq{#1}{\ifcsdef{stixc@l\@xp\@gobble\string#1}{\csname stixc@l\@xp\@gobble\string#1\endcsname}{#1}}{%not a cs \csname stixc@l#1\endcsname} \ifblank{#2}{\relax}{\stix@@cal #2\@nil}} \def\stix@@calbf#1#2\@nil{% \ifiscseq{#1}{\ifcsdef{stixc@lbf\@xp\@gobble\string#1}{\csname stixc@lbf\@xp\@gobble\string#1\endcsname}{#1}}{%not a cs \csname stixc@lbf#1\endcsname} \ifblank{#2}{\relax}{\stix@@calbf #2\@nil}} \DeclareRobustCommand*{\stixcal}[1]{\stix@@cal#1\@nil} \DeclareRobustCommand*{\stixcalbf}[1]{\stix@@calbf#1\@nil} ``` This works beautifully. I know there is probably a way to make it cleaner, and I welcome input in that regard. Now, if I add ``` \newfontface\StixTwoMathOne{STIXTwoMath-Regular.otf}[NFSSFamily=stixtwochan,Script=Math,StylisticSet=1] \DeclareSymbolFont{stixtwochan}{TU}{stixtwochan}{m}{n} ``` and ``` \def\stix@@chan#1#2\@nil{% \ifiscseq{#1}{\ifcsdef{stixch@n\@xp\@gobble\string#1}{\csname stixch@n\@xp\@gobble\string#1\endcsname}{#1}}{%not a cs \csname stixch@n#1\endcsname} \ifblank{#2}{\relax}{\stix@@chan #2\@nil}} \def\stix@@chanbf#1#2\@nil{% \ifiscseq{#1}{\ifcsdef{stixch@nbf\@xp\@gobble\string#1}{\csname stixch@nbf\@xp\@gobble\string#1\endcsname}{#1}}{%not a cs \csname stixch@nbf#1\endcsname} \ifblank{#2}{\relax}{\stix@@chanbf #2\@nil}} \DeclareRobustCommand*{\stixchan}[1]{\stix@@chan#1\@nil} \DeclareRobustCommand*{\stixchanbf}[1]{\stix@@chanbf#1\@nil} ``` at the bottom and the entire gamut of lines of the form ``` \Umathchardef\stixch@nA "0 \symstixtwochan "1D49C ``` in between, I get a plethora of errors beginning with ``` \symstixtwocal=\mathgroup15 ! LaTeX Error: Too many symbol fonts declared. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.7 ...bolFont{stixtwochan}{TU}{stixtwochan}{m}{n} Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it. ! Undefined control sequence. l.117 \Umathchardef\stixch@nA "0 \symstixtwochan "1D49C The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! Bad math family (119964). l.117 ...ardef\stixch@nA "0 \symstixtwochan "1D49C Since I expected to read a number between 0 and 255, I changed this one to zero. ! Missing number, treated as zero. <to be read again> \Umathchardef l.118 \Umathchardef \stixch@nB "0 \symstixtwochan "0212C A number should have been here; I inserted `0'. (If you can't figure out why I needed to see a number, look up `weird error' in the index to The TeXbook.) ``` I've included what I think is relevant. The errors that follow are repetitive and I think they all (including the last three shown) stem from the very first error because the 17th mathgroup is never declared. This entire effort has been aimed at getting around this limitation. Again, I am using XeTeX to compile with `fontspec`, not `unicode-math`, because I do not wish to replace MathTime Pro II as my math font. All my text fonts are OpenType. I am trying to move as many non-`mtpro2` math fonts to OpenType as possible. What am I doing wrong?
https://tex.stackexchange.com/users/224317
How to get around ! LaTeX Error: Too many symbol fonts declared if using XeTeX
true
A simpler test file would be ``` \documentclass{article} \usepackage{etoolbox} \makeatletter %\patchcmd\DeclareSymbolFont@m@dropped{15}{255}{\typeout{patched}}{\ERROR} \makeatother \usepackage{fontspec} \newfontface\StixTwoMathOne [NFSSFamily=stixtwochan,Script=Math,StylisticSet=1] {STIXTwoMath-Regular.otf} \DeclareSymbolFont{stixtwochan}{TU}{stixtwochan}{m}{n} \DeclareSymbolFont{stixtwochana}{TU}{stixtwochan}{m}{n} \DeclareSymbolFont{stixtwochanb}{TU}{stixtwochan}{m}{n} \DeclareSymbolFont{stixtwochanc}{TU}{stixtwochan}{m}{n} \DeclareSymbolFont{stixtwochand}{TU}{stixtwochan}{m}{n} \DeclareSymbolFont{stixtwochane}{TU}{stixtwochan}{m}{n} \DeclareSymbolFont{stixtwochanf}{TU}{stixtwochan}{m}{n} \DeclareSymbolFont{stixtwochang}{TU}{stixtwochan}{m}{n} \DeclareSymbolFont{stixtwochanh}{TU}{stixtwochan}{m}{n} \DeclareSymbolFont{stixtwochani}{TU}{stixtwochan}{m}{n} \DeclareSymbolFont{stixtwochanj}{TU}{stixtwochan}{m}{n} \DeclareSymbolFont{stixtwochank}{TU}{stixtwochan}{m}{n} \DeclareSymbolFont{stixtwochanl}{TU}{stixtwochan}{m}{n} \DeclareSymbolFont{stixtwochanm}{TU}{stixtwochan}{m}{n} \DeclareSymbolFont{stixtwochann}{TU}{stixtwochan}{m}{n} \begin{document} $x$ \end{document} ``` Uncommenting line 5 gives latex a hint there are more than 16 families available
0
https://tex.stackexchange.com/users/1090
690133
320,148
https://tex.stackexchange.com/questions/690123
3
I often end up adjusting all trim lengths of `cmidrule` in a table to the same non-default value. The only option I found in the [booktabs documentation](http://tug.ctan.org/macros/latex/contrib/booktabs/booktabs.pdf) is to adjust every single `l` and `r` marker of every `cmidrule` manually, as in `\cmidrule(l{1pt}r{1pt}){1-1}`. Is there a way I can do this for a whole table at once without mindlessly copy-pasting everything 100 times? ``` \documentclass{article} \usepackage{booktabs} \begin{document} \begin{tabular}{ccc} \toprule A & B & C \\ \cmidrule(r{1pt}){1-1} \cmidrule(l{1pt}r{1pt}){2-2} \cmidrule(l{1pt}){3-3} Cat & Dog & Mouse \\ \bottomrule \end{tabular} \end{document} ```
https://tex.stackexchange.com/users/45734
How to change the trim width from booktabs for the full table at once?
true
The documentation (page 4) says that `l` is the same as `l{\cmidrulekern}` and that the default value of `\cmidrulekern` is `0.5em`. Actually, it would be better if instead of a dimen register it was a macro, so the value of em is computed at run time and not in the document preamble, which might refer to the em of a font not used in the document or, at least, it was set at begin document. Anyway, you can do in your preamble (or in the environment where you need the changed setting) ``` \setlength{\cmidrulekern}{1pt} ```
3
https://tex.stackexchange.com/users/4427
690140
320,151
https://tex.stackexchange.com/questions/690104
0
What is a simple way to write a numeral inside a square, or a rectangle if it is not a short numeral?
https://tex.stackexchange.com/users/24406
How can numbers be boxed in?
true
Assuming that you use tabular (same width) and lining (same height) digits, you can use `\fbox` with tweaked parameters. ``` \documentclass{article} \makeatletter \newcommand{\sqnum}[1]{% \begingroup \settowidth{\dimen@}{#1}% \setlength{\fboxsep}{1pt}% \fbox{% \ifdim\dimen@>\fontcharht\font`0 % just box the numbers #1% \else \makebox[\fontcharht\font`0]{#1}% \fi }% \endgroup } \makeatother \begin{document} \sqnum{1} \sqnum{2} \sqnum{123} \end{document} ```
5
https://tex.stackexchange.com/users/4427
690141
320,152
https://tex.stackexchange.com/questions/690129
0
The following demo (file name `demo.dtx`) is used to demonstrate how to merge `.ins` file into `.dtx` in literate programming: ``` % \iffalse meta-comment %<*internal> \iffalse %</internal> %<*readme> some readme contents %</readme> %<*internal> \fi \begingroup \def\temp{LaTeX2e} \expandafter\endgroup\ifx\temp\fmtname\else \csname fi\endcsname %</internal> %<*install> \input docstrip % \generate{ \nopreamble\nopostamble \file{README.md}{\from{demo.dtx}{readme}}} \endbatchfile %</install> %<*internal> \fi %</internal> %<*driver> \documentclass{ltxdoc} \begin{document} \DocInput{\jobname.dtx} \PrintChanges \PrintIndex \end{document} %</driver> % \fi % % \title{\LaTeX~Literate Programming} % \author{Jack} % \maketitle ``` Running `tex demo.dtx` will extract the `README.md` file while running `pdflatex demo.dtx` will produce the documentation (currently there is only the title and author, just for demonstration). I think the code fragment: ``` \begingroup \def\temp{LaTeX2e} \expandafter\endgroup\ifx\temp\fmtname\else \csname fi\endcsname ``` is the key point since it can conduct different tasks by judging the format. But I'm a little confused about the detailed and precise process when `demo.dtx` is compiled by different formats especially the pairing of `\iffalse` and `\fi`. Can someone give some explanations? Thanks!
https://tex.stackexchange.com/users/241621
Merge the ins file into dtx file
true
The basic problem is how to skip conditionals. If you want to skip some code containing `\fi` you can not do ``` \iffalse \foo \bar \fi \hmm \fi ``` as, despite the indent, the `\iffalse` matches the first `\fi`. `\csname fi\endcsname` expands to `\fi` so can be used (sometimes) to hide a `\fi` from an outer conditional. However you can only sometimes use `\csname fi\endcsname`: ``` \iftrue hello \csname fi\endcsname ``` has matching `if` and `fi` and prints `hello` but ``` \iftrue hello \else goodbye \csname fi\endcsname ``` will skip the rest of the document looking for `\fi` as after the `\else` tex will be scanning for `\fi` without expansion. In docstrip things are made more interesting as `%` is or is not a comment, depending on the mode. so.... **if you do `pdflatex demo.dtx`** `%` is a comment so `% \iffalse` on line 1 is not seen, `\iffalse` on line 3 matches `\fi` on line 9. `\ifx` on line 12 is `\iftrue` so `\else` branch skipped `\csname fi\endcsname` on line 13 is skipped `\fi` on line 23 closes the `\ifx` `\documentclass{ltxdoc}` is processed `\DocInput{\jobname.dtx}` inputs the file again but `%` is not a comment. --- `\iffalse` on line 1 is seen, starts skipping `\iffalse` adds to the fi nesting that must be skipped `\csname fi\endcsname` on line 13 not seen as `\fi` `\fi` on line 23 removes one level of if-fi nesting `\fi` on line 33 closes the `\iffalse` on line 1 and skipping stops. `\title`, `\author` and `\maketitle` executed. --- --- **If you do `pdftex demo.dtx`** works as above until `\ifx` on line 12. `\ifx` is `\iffalse` so after `\else` expansion enabled `\csname fi\endcsname` seen as `\fi` and ends the `\ifx` `\input docstrip` is executed on line 16 `\generate` will input `demo.dtx` in verbatim mode where none of the `\if` are executed control returns to line 19 `\endbatchfile` on line 20 does `\@@end` and ends the job the `\fi` on line 23 is therefore not seen.
2
https://tex.stackexchange.com/users/1090
690145
320,154
https://tex.stackexchange.com/questions/690096
1
I have a long list in an enumerate environment. I would like to put as header to the page (or in any case to save in a variable to use elsewhere) the number of the last item appearing on it. A minimal example of what I would like to do is in the following code in luatex (where the only use I make of lua is to have 120 consecutive items to get what I want). ``` \documentclass{article} \usepackage[absolute]{textpos} \let\mycounter=0 \AddToHook{shipout/before}{ \begin{textblock}{40}(0,0) Last entry: \mycounter \end{textblock}} \AddToHook{cmd/item/before}{\let\beginitmpage=\thepage} \AddToHook{cmd/item/after}{\let\enditmpage=\thepage \ifnum \thepage=\beginitmpage \let\mycounter=\theenumi\fi} \begin{document} \begin{enumerate} \directlua{ for i=1,120,1 do tex.print("\\item Dummy text from page \\beginitmpage\\ to page \\enditmpage") end} \end{enumerate} \end{document} ``` As it can be seen, at the end of the first page the counter is already at 32 (but the last line printed is 28). Entries 29-32 "believe" to be on page 1 even if they are formatted on page 2. I know that tex has already processed part of the text which is to appear on the second page and that this is normal, but this is exactly what I would like to avoid. Similar problems occur with the remaining pages. Is there any simple way to implement what I would like to get in a "simple" way? (i.e. not to get the value of the counter at shipout, but the value of the counter used to construct the page).
https://tex.stackexchange.com/users/37282
How can I get the number of the last item of a list appearing on a page?
false
Following the suggestions of @John and after a bit of debugging I have finally got a satisfactory result. Here is the code (printing both the number of both the first and the last entry of the list on each page). ``` \documentclass{article} \usepackage{luacode} \usepackage[absolute]{textpos} \usepackage{lipsum} \def\lastcounter{\relax} \def\firstcounter{\relax} % ref_page from https://tex.stackexchange.com/questions/659916/get-page-number-of-label-in-lualatex \begin{luacode*} function ref_page(l) local r = token.get_macro('r@'..l) if r == nil then return 0 end local sec, page = r:match("{([^}]*)}{([^}]*)}") return page end toSwap=0 function process() currPage=tonumber(tex.count['c@page']) if toSwap==1 and Bpage==currPage then tex.sprint('\\global\\def\\firstcounter{'..nextval..'}') toSwap=0 end enumi=tonumber(tex.count['c@enumi']) Apage=tonumber(ref_page('Q'..tostring(enumi-1))) Bpage=tonumber(ref_page('Q'..tostring(enumi))) if (Apage<Bpage and toSwap==0) then nextval=enumi toSwap=1 print("S") end if (Apage<=Bpage and Bpage==currPage) then tex.sprint('\\global\\def\\lastcounter{'..(enumi)..'}') end print("ref #="..enumi.." on page "..Apage.."/"..Bpage.." cpage="..currPage) end \end{luacode*} \AddToHook{shipout/before}{ \begin{textblock}{40}(0,0) {\rm First entry: \firstcounter} \\ {\rm Last entry: \lastcounter} \end{textblock} } \AddToHook{cmd/item/after}{\expandafter\label{Q\theenumi}\directlua{process()}} %%% SAMPLE TEXT \begin{document} \begin{enumerate} \directlua{ for i=1,120,1 do tex.print("\\item {\\bf Dummy text on page \\pageref{Q"..(i).."} } \\lipsum[2]" ) end} \end{enumerate} \end{document} ```
0
https://tex.stackexchange.com/users/37282
690149
320,155
https://tex.stackexchange.com/questions/690146
0
So far I have not needed to insert jpg images in my LaTex files, but now I want to write a text that will include some pictures. I would like a format where the picture doesn't take the full width of the page but be rather set to the right or the left and the remaining space on its side filled with text. I have tried to use the figure environment from the graphicx package together with a minipage environment, but failed. What would be the best way to proceed? Is it safe (or even possible) to change from a one column format to a two columns format in the middle of a page?
https://tex.stackexchange.com/users/8175
Image with text aside
false
Consider this code: ``` \documentclass[12pt]{article} \usepackage{graphicx} \usepackage{wrapfig} \usepackage{lipsum} \begin{document} \section{First section} \lipsum[1] \begin{wrapfigure}{R}{0.5\textwidth} %\vspace{-2cm} \centering \includegraphics[width=0.48\textwidth]{example-image} \end{wrapfigure} \lipsum[2] \begin{wrapfigure}{L}{0.3\textwidth} %\vspace{-2cm} \centering \includegraphics[width=0.28\textwidth]{example-image} \end{wrapfigure} \lipsum[3][1-9] \end{document} ``` Output:
2
https://tex.stackexchange.com/users/24644
690153
320,156
https://tex.stackexchange.com/questions/690152
4
In the code below I want to proceed with a calculated result (from Lualatex). But the calculated value (rounded) is not recognized as a number. Who knows a solution for this? ``` \documentclass{article} \usepackage{luacode} \begin{luacode} function round(num, numDecimalPlaces) local mult = 10^(numDecimalPlaces or 0) if num >= 0 then return math.floor(num * mult + 0.5) / mult else return math.ceil(num * mult - 0.5) / mult end end sqrt = math.sqrt function treq (t, s, p, k, w, a) return k *s * sqrt(p / w) + a end function PROCEED (a, b) return a / f end \end{luacode} \newcommand\round[2][0]{% default value of opt. param.: 0 \directlua{tex.sprint(round(#2,#1))}} \begin{document} \obeylines Let's try macro 'round': $ \sqrt{2} \approx \round[1]{2^(1/2)} $ OK. $ \sqrt[5]{32} = \round{32^(1/5)} $ OK. $ 1.699999 \approx \round[5]{1.699999} $ OK. $ -1.699999 \approx \round[1]{-1.699999} $ Also OK. $ -1.9 \approx \round{-1.9} $ OK. $ 8 \approx \round[-1]{8} $ OK.\\ Let's try macro 'round' in calculations: \def\t{3} \def\s{454} \def\p{4.51} \def\k{0.0039413} \def\w{7.04} \def\a{1.5} \def\treq{\round[3]{\luadirect{tex.print(treq(\t,\s,\p,\k,\w,\a))}}} $ k = \round[4]{\k} $. OK. $ t_{req} =\treq $ OK there is an answer (and rounded) \\ Let's try macro 'round' in proceeding calculations: \def\A{\round[3]{\luadirect{tex.print(PROCEED(\t,2))}}} \def\B{\round[3]{\luadirect{tex.print(PROCEED(\treq,2))}}} $ A =\A $ macro 'PROCEED' works with $t=\t$ $ B =\B $ macro 'PROCEED' is NOT working with $t_{req}=\treq!\\$ Why is rounded value 'treq' NOT applicable in further calculations? \end{document} ```
https://tex.stackexchange.com/users/223471
Why is calculated value not recognized as a number?
true
Your command `\treq` uses `\round` which is not expandable as it has an optional argument, so it does not expand to a numeric value when passed to Lua Using a mandatory argument: ``` \documentclass{article} \usepackage{luacode} \begin{luacode} function round(num, numDecimalPlaces) local mult = 10^(numDecimalPlaces or 0) if num >= 0 then return math.floor(num * mult + 0.5) / mult else return math.ceil(num * mult - 0.5) / mult end end sqrt = math.sqrt function treq (t, s, p, k, w, a) return k *s * sqrt(p / w) + a end function PROCEED (a, b) return a / b end \end{luacode} \newcommand\round[2]{% default value of opt. param.: 0 \directlua{tex.sprint(round(#2,#1))}} \begin{document} \obeylines Let's try macro 'round': $ \sqrt{2} \approx \round{1}{2^(1/2)} $ OK. $ \sqrt[5]{32} = \round0{32^(1/5)} $ OK. $ 1.699999 \approx \round{5}{1.699999} $ OK. $ -1.699999 \approx \round{1}{-1.699999} $ Also OK. $ -1.9 \approx \round0{-1.9} $ OK. $ 8 \approx \round{-1}{8} $ OK.\\ Let's try macro 'round' in calculations: \def\t{3} \def\s{454} \def\p{4.51} \def\k{0.0039413} \def\w{7.04} \def\a{1.5} \def\treq{\round{3}{\luadirect{tex.print(treq(\t,\s,\p,\k,\w,\a))}}} $ k = \round{4}{\k} $. OK. $ t_{req} =\treq $ OK there is an answer (and rounded) Let's try macro 'round' in proceeding calculations: \def\A{\round{3}{\luadirect{tex.print(PROCEED(\t,2))}}} \def\B{\round{3}{\luadirect{tex.print(PROCEED(\treq,2))}}} $ A =\A $ macro 'PROCEED' works with $t=\t$ $ B =\B $ macro 'PROCEED' is NOT working with $t_{req}=\treq!\\$ Why is rounded value 'treq' NOT applicable in further calculations? \end{document} ``` You could use `\NewExpandableDocumentCommand` to define an expandable version of `\round` with an optional argument, but I don't think I would here.
5
https://tex.stackexchange.com/users/1090
690155
320,157
https://tex.stackexchange.com/questions/39181
78
Is there a possibility to draw large integral signs? I have found the package [`bigints`](http://ctan.org/tex-archive/macros/latex/contrib/bigints) but I have the feeling it is not very professional... Any better idea?
https://tex.stackexchange.com/users/4594
Big integral sign
false
Or use \scalebox from the graphicx package. ``` \[ t=\scalebox{1.2}[2.1]{$\displaystyle\int$}_{\hspace{-0.5em}0}^{\,a} \sqrt{\frac{1+\lr[{\phb y'(x)}]^2}{2gy(x)}}\,dx. \] ```
0
https://tex.stackexchange.com/users/300038
690157
320,158
https://tex.stackexchange.com/questions/690150
0
I am writing a novel and I would like to create a data structure to hold character attributes and be able to reference the values. I looked into creating custom glossaries, bibtex and datatool structure but I wasn't able to find a suitable method. I would much prefer not creating custom commands and using native latex available functionality. Example ``` character{emma, title = {Emma}, dateofbirth = {1995-05-10}, eyecolor = {brown} } Emma her eye colour is \ref{emma:eyecolor}. ```
https://tex.stackexchange.com/users/201703
Create custom entry and reference fields
false
I agree with others that a bibtex database probably is not the best way. One alternative that you may explore is put the data in a R data frame, that can be easily integrated with LaTeX text in several ways. Here a MWE showing only some of these ways: (note: if you do not have idea of what is R/knitr, save the file as `mwe.Rnw` to compile it with RStudio, or alternatively save it as `mwe.Rtex` to compile it on line in Overleaf.) ``` \documentclass{article} \usepackage{booktabs} \begin{document} <<data,echo=FALSE,results="asis">>= df <- data.frame( name=c("Negan","Rick Grimes","Maggie Greene"), date = c("1995-05-10","1995-05-13","2005-05-13"), eyecolor = c("brown","blue","green"), rol = c("evil","hero","survivor"), zombies=c(502,834,254) ) row.names(df) <- c("negan","rick","maggie") # nick names library(xtable) library(knitr) print(xtable(df, caption="Example characters to start walking, but alive."), booktabs=TRUE) df$date <- as.Date(df$date) @ I am \Sexpr{df["negan","name"]}. Main characters are \Sexpr{combine_words(df$name)}. \Sexpr{df$name[1]} have \Sexpr{df$eyecolor[1]} eyes and born in \Sexpr{format(df$date[1], format="%Y")} and he is the \Sexpr{df["negan","rol"]}, whereas \Sexpr{df["rick","name"]} is the \Sexpr{df["rick","rol"]} of \Sexpr{df["rick","eyecolor"]} eyes and born only \Sexpr{df$date[2]-df$date[1]} days later. \Sexpr{df["maggie","name"]} was roughly \Sexpr{round((df$date[3]-df$date[2])/365.25,0)} years younger and have \Sexpr{df[3,3]} eyes. She is a \Sexpr{df["maggie","rol"]} survivor of the zombie apocalypse. Each character kill an average of \Sexpr{round(mean(df$zombies),0)} zombies. \end{document} ```
0
https://tex.stackexchange.com/users/11604
690166
320,161
https://tex.stackexchange.com/questions/58903
12
I draw shapes on background via `pgfonlayer` ``` \documentclass{article} \usepackage{tikz} \usetikzlibrary{backgrounds} \begin{document} \begin{tikzpicture} \begin{pgfonlayer}{background} \draw[rounded corners,fill=red] (1,1) rectangle (2,2); \draw[fill=blue] (0,0) circle (.8cm); \end{pgfonlayer} \end{tikzpicture} \end{document} ``` I know the values (coordinates) needed to draw `rectangle` or `circle`, but I have no idea what are the parameters needed to draw a `star`. We define the starting coordinate; for `rectangle` we give the second coordinate two draw `rectangle` between two points, for `circle`, we give the radius to draw circle around the starting point. What we need to give to draw star around the starting point? ``` \draw[fill=green] (0,0) star ????; ``` **PS.** Sorry, I know this is a basic typical question, but I had a long struggle with it.
https://tex.stackexchange.com/users/7881
How to draw star in TikZ background
false
``` \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[ star, star points=8, star point height=1.2mm, ball color=violet, draw=blue!50, font=\bf ] at (current page.center) {I'M FROM VIETNAMESE}; \end{tikzpicture} \end{document} ```
1
https://tex.stackexchange.com/users/300006
690170
320,163
https://tex.stackexchange.com/questions/690173
0
Similar to [this](https://tex.stackexchange.com/questions/125893/labeling-columns-of-figures-in-a-subfig-environment) question, I am using `subfigure` to layout a grid of images. I would like (a) to be upper left, (b) to be lower left, (c) to be upper right, and (d) to be lower right. How to do this? ``` \documentclass{article} \usepackage[demo]{graphicx} \usepackage{subcaption} \begin{document} \begin{figure} \centering \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{dummy} % \caption*{Column 1a} \label{fig:1} \end{subfigure}% ~ \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{dummy} % \caption*{Column 2a} \label{fig:2} \end{subfigure}% \\ % Change row. \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{dummy} \caption{Column 1b} \label{fig:3} \end{subfigure}% ~ \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{dummy} \caption{Column 2b} \label{fig:4} \end{subfigure}% \caption{The overall caption.} \label{fig:all} \end{figure}% \end{document} ```
https://tex.stackexchange.com/users/144086
subcaption: label subfigures in columns
true
You could use a tabular containing two tabulars. ``` \documentclass{article} \usepackage[demo]{graphicx} \usepackage{subcaption} \usepackage{array} \begin{document} \begin{figure} \centering \begin{tabular}{@{}c@{}p{1ex}@{}c@{}} \begin{tabular}{@{}c@{}} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{dummy} \caption{Column 1a} \label{fig:1} \end{subfigure}\\[1em] \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{dummy} \caption{Column 1b} \label{fig:2} \end{subfigure}% \end{tabular} && \begin{tabular}{@{}c@{}} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{dummy} \caption{Column 2a} \label{fig:3} \end{subfigure}\\[1em] \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{dummy} \caption{Column 2b} \label{fig:4} \end{subfigure}% \end{tabular} \end{tabular} \caption{The overall caption.} \label{fig:all} \end{figure}% \end{document} ```
2
https://tex.stackexchange.com/users/nan
690174
320,164
https://tex.stackexchange.com/questions/690173
0
Similar to [this](https://tex.stackexchange.com/questions/125893/labeling-columns-of-figures-in-a-subfig-environment) question, I am using `subfigure` to layout a grid of images. I would like (a) to be upper left, (b) to be lower left, (c) to be upper right, and (d) to be lower right. How to do this? ``` \documentclass{article} \usepackage[demo]{graphicx} \usepackage{subcaption} \begin{document} \begin{figure} \centering \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{dummy} % \caption*{Column 1a} \label{fig:1} \end{subfigure}% ~ \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{dummy} % \caption*{Column 2a} \label{fig:2} \end{subfigure}% \\ % Change row. \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{dummy} \caption{Column 1b} \label{fig:3} \end{subfigure}% ~ \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=\textwidth]{dummy} \caption{Column 2b} \label{fig:4} \end{subfigure}% \caption{The overall caption.} \label{fig:all} \end{figure}% \end{document} ```
https://tex.stackexchange.com/users/144086
subcaption: label subfigures in columns
false
With use of the `minipage`s is quite simple: ``` \documentclass{article} \usepackage{graphicx} \usepackage{subcaption} \usepackage{array} \begin{document} \begin{figure} \centering \setkeys{Gin}{width=\linewidth} \begin{minipage}[t]{0.45\textwidth} \begin{subfigure}[b]{\linewidth} \includegraphics{example-image-duck} \caption{Column 1a} \label{fig:1} \end{subfigure} \medskip \begin{subfigure}[b]{\linewidth} \includegraphics{example-image-duck} \caption{Column 1b} \label{fig:2} \end{subfigure}% \end{minipage}\hfil \begin{minipage}[t]{0.45\textwidth} \begin{subfigure}[b]{\linewidth} \includegraphics{example-image-duck} \caption{Column 2a} \label{fig:3} \end{subfigure} \medskip \begin{subfigure}[b]{\linewidth} \centering \includegraphics{example-image-duck} \caption{Column 2b} \label{fig:4} \end{subfigure}% \end{minipage} \caption{The overall caption.} \label{fig:all} \end{figure}% \end{document} ```
1
https://tex.stackexchange.com/users/18189
690177
320,165
https://tex.stackexchange.com/questions/689907
1
I'm writing a document with multiple files, and I hope to add titles to them like so: ``` %%% main.tex \documentclass{article} \usepackage{subfiles} \title{Main} \begin{document} \maketitle Some text \subfile{a} \end{document} ``` and ``` %%% a.tex \documentclass[main]{subfiles} \title{A} \begin{document} \maketitle Subordinate text \end{document} ``` such that when I compile `main.tex`, `main.pdf` reads: **Main** Some text Subordinate text and when I complile `a.tex`, `a.pdf` reads: **A** Subordinate text Is this possible? Thank you in advance!
https://tex.stackexchange.com/users/101980
Add separate \maketitle to subfile which only executes when the subfile is compiled independently
true
The subfiles package provides the `\ifSubfilesClassLoaded` macro which allows you to test if you compile the subfile or the main file: ``` %%% a.tex \documentclass[main]{subfiles} \title{A} \begin{document} \ifSubfilesClassLoaded{% \maketitle }{} Subordinate text \end{document} ```
2
https://tex.stackexchange.com/users/36296
690181
320,167
https://tex.stackexchange.com/questions/26870
32
I want to implement an if-then-else depending on whether the argument contains a special character or not. Should I be looking here: <http://www.tug.org/TUGboat/Articles/tb28-1/tb88glister.pdf>, or does anyone know a simpler way?
https://tex.stackexchange.com/users/7514
Check if a string contains a given character
false
In OpTeX, we have `\isinlist` macro for these purposes. The syntax is ``` \isinlist <list>{<substring>}\iftrue true branch\else false branch\fi ``` The `<list>` can be implicit (like `\macro`) or explicit (like `{text}`. Example: ``` \def\mystring{abcdef} \isinlist {abcdef}{a}\iftrue \message{YES}\else\message{NO}\fi \isinlist \mystring{a}\iftrue \message{YES}\else\message{NO}\fi \bye ``` The result is YES in both cases.
3
https://tex.stackexchange.com/users/51799
690186
320,169
https://tex.stackexchange.com/questions/690182
2
After the update my Miktex distro (2023-07-03), I am no longer be able to compile my code. See MNWE below: ``` \documentclass{article} % \usepackage{siunitx} \usepackage{unicode-math} % sisetup uses \mitpi (require unicode-math) \begin{document} Hello world. \end{document} ``` Warning: ``` LaTeX hooks Warning: Generic hook 'package/before/amsmath' is deprecated. (hooks) Use hook 'package/amsmath/before' instead. ! LaTeX Error: Control sequence \g__hook_package/amsmath/before_reversed_tl (LaTeX) already defined. ``` My other observation is that, code can be compiled by `xelatex` but **not** by `lualatex` (my case). There is probably a bug in the `unicode-math` library but unfortunately I don't have the knowledge to fix it. Full logfile after compilation by command `lualatex myfile.tex`: ``` This is LuaHBTeX, Version 1.17.0 (MiKTeX 23.5) (format=lualatex 2023.7.3) 3 JUL 2023 12:13 restricted system commands enabled. **grain0093.tex (./grain0093.tex LaTeX2e <2023-06-01> patch level 1 L3 programming layer <2023-06-16> Lua module: luaotfload 2022-10-03 3.23 Lua based OpenType font support Lua module: lualibs 2022-10-04 2.75 ConTeXt Lua standard libraries. Lua module: lualibs-extended 2022-10-04 2.75 ConTeXt Lua libraries -- extended c ollection. luaotfload | conf : Root cache directory is "C:/Users/z0037rdx/AppData/Local/MiK TeX/luatex-cache/generic/names". luaotfload | init : Loading fontloader "fontloader-2022-10-03.lua" from kpse-res olved path "C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/luatex/luaotfloa d/fontloader-2022-10-03.lua". Lua-only attribute luaotfload@noligature = 1 luaotfload | init : Context OpenType loader version 3.120 Inserting `luaotfload.node_processor' in `pre_linebreak_filter'. Inserting `luaotfload.node_processor' in `hpack_filter'. Inserting `luaotfload.glyph_stream' in `glyph_stream_provider'. Inserting `luaotfload.define_font' in `define_font'. Lua-only attribute luaotfload_color_attribute = 2 luaotfload | conf : Root cache directory is "C:/Users/z0037rdx/AppData/Local/MiK TeX/luatex-cache/generic/names". Inserting `luaotfload.harf.strip_prefix' in `find_opentype_file'. Inserting `luaotfload.harf.strip_prefix' in `find_truetype_file'. Removing `luaotfload.glyph_stream' from `glyph_stream_provider'. Inserting `luaotfload.harf.glyphstream' in `glyph_stream_provider'. Inserting `luaotfload.harf.finalize_vlist' in `post_linebreak_filter'. Inserting `luaotfload.harf.finalize_hlist' in `hpack_filter'. Inserting `luaotfload.cleanup_files' in `wrapup_run'. Inserting `luaotfload.harf.finalize_unicode' in `finish_pdffile'. Inserting `luaotfload.glyphinfo' in `glyph_info'. Lua-only attribute luaotfload.letterspace_done = 3 Inserting `luaotfload.aux.set_sscale_dimens' in `luaotfload.patch_font'. Inserting `luaotfload.aux.set_font_index' in `luaotfload.patch_font'. Inserting `luaotfload.aux.patch_cambria_domh' in `luaotfload.patch_font'. Inserting `luaotfload.aux.fixup_fontdata' in `luaotfload.patch_font_unsafe'. Inserting `luaotfload.aux.set_capheight' in `luaotfload.patch_font'. Inserting `luaotfload.aux.set_xheight' in `luaotfload.patch_font'. Inserting `luaotfload.rewrite_fontname' in `luaotfload.patch_font'. Inserting `tracingstacklevels' in `input_level_string'. (C:/Users/z0037rdx/AppD ata/Local/Programs/MiKTeX/tex/latex/base/article.cls Document Class: article 2023/05/17 v1.4n Standard LaTeX document class (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/base/size10.clo File: size10.clo 2023/05/17 v1.4n Standard LaTeX file (size option) luaotfload | db : Font names database loaded from C:/Users/z0037rdx/AppData/Loca l/MiKTeX/luatex-cache/generic/names/luaotfload-names.luc.gz) \c@part=\count183 \c@section=\count184 \c@subsection=\count185 \c@subsubsection=\count186 \c@paragraph=\count187 \c@subparagraph=\count188 \c@figure=\count189 \c@table=\count190 \abovecaptionskip=\skip48 \belowcaptionskip=\skip49 \bibindent=\dimen139 ) (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/unicode-math/unicode -math.sty (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/l3kernel/expl3.sty Package: expl3 2023-06-16 L3 programming layer (loader) (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/l3backend/l3backend- luatex.def File: l3backend-luatex.def 2023-04-19 L3 backend support: PDF output (LuaTeX) \l__color_backend_stack_int=\count191 Inserting `l3color' in `luaotfload.parse_color'. \l__pdf_internal_box=\box51 )) Package: unicode-math 2020/01/31 v0.8q Unicode maths in XeLaTeX and LuaLaTeX (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/unicode-math/unicode -math-luatex.sty Package: unicode-math-luatex 2020/01/31 v0.8q Unicode maths in XeLaTeX and LuaL aTeX (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/l3packages/xparse/xp arse.sty Package: xparse 2023-02-02 L3 Experimental document command parser ) (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/l3packages/l3keys2e/ l3keys2e.sty Package: l3keys2e 2023-02-02 LaTeX2e option processing using LaTeX3 keys ) (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/fontspec/fontspec.st y Package: fontspec 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaTeX Lua module: fontspec 2022/01/15 2.8a Font selection for XeLaTeX and LuaLaTeX (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/fontspec/fontspec-lu atex.sty Package: fontspec-luatex 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaT eX \l__fontspec_script_int=\count192 \l__fontspec_language_int=\count193 \l__fontspec_strnum_int=\count194 \l__fontspec_tmp_int=\count195 \l__fontspec_tmpa_int=\count196 \l__fontspec_tmpb_int=\count197 \l__fontspec_tmpc_int=\count198 \l__fontspec_em_int=\count199 \l__fontspec_emdef_int=\count266 \l__fontspec_strong_int=\count267 \l__fontspec_strongdef_int=\count268 \l__fontspec_tmpa_dim=\dimen140 \l__fontspec_tmpb_dim=\dimen141 \l__fontspec_tmpc_dim=\dimen142 (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/base/fontenc.sty Package: fontenc 2021/04/29 v2.0v Standard LaTeX package ) (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/fontspec/fontspec.cf g))) (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/base/fix-cm.sty Package: fix-cm 2020/11/24 v1.1t fixes to LaTeX (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/base/ts1enc.def File: ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file LaTeX Font Info: Redeclaring font encoding TS1 on input line 47. )) (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/amsmath/amsmath.sty Package: amsmath 2023/05/13 v2.17o AMS math features \@mathmargin=\skip50 For additional information on amsmath, use the `?' option. (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/amsmath/amstext.sty Package: amstext 2021/08/26 v2.01 AMS text (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/amsmath/amsgen.sty File: amsgen.sty 1999/11/30 v2.0 generic functions \@emptytoks=\toks17 \ex@=\dimen143 )) (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/amsmath/amsbsy.st y Package: amsbsy 1999/11/29 v1.2d Bold Symbols \pmbraise@=\dimen144 ) (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/amsmath/amsopn.sty Package: amsopn 2022/04/08 v2.04 operator names ) \inf@bad=\count269 LaTeX Info: Redefining \frac on input line 236. \uproot@=\count270 \leftroot@=\count271 LaTeX Info: Redefining \overline on input line 399. LaTeX Info: Redefining \colon on input line 410. \classnum@=\count272 \DOTSCASE@=\count273 LaTeX Info: Redefining \ldots on input line 496. LaTeX Info: Redefining \dots on input line 499. LaTeX Info: Redefining \cdots on input line 620. \Mathstrutbox@=\box52 \strutbox@=\box53 LaTeX Info: Redefining \big on input line 722. LaTeX Info: Redefining \Big on input line 723. LaTeX Info: Redefining \bigg on input line 724. LaTeX Info: Redefining \Bigg on input line 725. \big@size=\dimen145 LaTeX Font Info: Redeclaring font encoding OML on input line 743. LaTeX Font Info: Redeclaring font encoding OMS on input line 744. \macc@depth=\count274 LaTeX Info: Redefining \bmod on input line 905. LaTeX Info: Redefining \pmod on input line 910. LaTeX Info: Redefining \smash on input line 940. LaTeX Info: Redefining \relbar on input line 970. LaTeX Info: Redefining \Relbar on input line 971. \c@MaxMatrixCols=\count275 \dotsspace@=\muskip16 \c@parentequation=\count276 \dspbrk@lvl=\count277 \tag@help=\toks18 \row@=\count278 \column@=\count279 \maxfields@=\count280 \andhelp@=\toks19 \eqnshift@=\dimen146 \alignsep@=\dimen147 \tagshift@=\dimen148 \tagwidth@=\dimen149 \totwidth@=\dimen150 \lineht@=\dimen151 \@envbody=\toks20 \multlinegap=\skip51 \multlinetaggap=\skip52 \mathdisplay@stack=\toks21 LaTeX Info: Redefining \[ on input line 2953. LaTeX Info: Redefining \] on input line 2954. ) (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/lualatex/lualatex-math/lua latex-math.sty Package: lualatex-math 2021/07/05 v1.11 Patches for mathematics typesetting wit h LuaLaTeX (C:/Users/z0037rdx/AppData/Local/Programs/MiKTeX/tex/latex/etoolbox/etoolbox.st y Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW) \etb@tempcnta=\count281 ) Lua module: lualatex-math 2013/08/03 1.3 Patches for mathematics typesetting wit h LuaLaTeX LaTeX hooks Warning: Generic hook 'package/before/amsmath' is deprecated. (hooks) Use hook 'package/amsmath/before' instead. ! LaTeX Error: Control sequence \g__hook_package/amsmath/before_reversed_tl (LaTeX) already defined. For immediate help type H <return>. ... l.139 } ? x Here is how much of LuaTeX's memory you used: 3955 strings out of 478031 100000,1977958 words of node,token memory allocated 409 words of node memory still in use: 3 hlist, 1 rule, 1 dir, 3 kern, 1 glyph, 4 attribute, 51 glue_spec, 4 attribu te_list, 3 if_stack, 1 write nodes avail lists: 2:8,3:2,4:1,7:2,9:2 24479 multiletter control sequences out of 65536+600000 16 fonts using 855119 bytes 90i,0n,97p,223b,148s stack positions out of 10000i,1000n,20000p,200000b,200000s warning (pdf backend): no pages of output. PDF statistics: 0 PDF objects out of 1000 (max. 8388607) 0 named destinations out of 1000 (max. 131072) 1 words of extra memory for PDF output out of 10000 (max. 100000000) ```
https://tex.stackexchange.com/users/17229
Generic hook 'package/before/amsmath
false
According to samcarter\_is\_at\_topanswers.xyz's observation, it seems that the problem laid in old package in my Miktex distro (For some reason it has not been automatically updated.): ``` Package: lualatex-math 2021/07/05 v1.11 Patches for mathematics typesetting with LuaLaTeX ``` After the update to ``` lualatex-math.sty 2022/01/01 v1.12 Patches for mathematics typesetting with LuaLaTeX ``` it works properly.
4
https://tex.stackexchange.com/users/17229
690189
320,172
https://tex.stackexchange.com/questions/690190
1
Firstly, I apologise in advance if this is a really silly and obvious one. I am trying to add a logo to the right side of every single page. I am not sure why this image is constantly showing in the middle? The original document is super messy so here is the important bit of the latex code. Thank you so much for the help. ``` \documentclass{exam} \usepackage[a4paper, total={6in, 11in}]{geometry} \usepackage{background} \backgroundsetup{ scale=1, color=black, opacity=1, angle=0, position=current page.south, vshift=60pt, hshift=30pt, contents={% \tiny%\sffamily% \includegraphics[width=\linewidth,height=50pt,keepaspectratio, right]{Images/1.png} } } \begin{document} What \end{document} ```
https://tex.stackexchange.com/users/292225
Trying to move this logo to the right of the page
true
1. remove `right` from `\includegraphics` 2. put `south east` instead of `south` 3. adjust `vshift` and `hshift` as you please (`hshift` with negative value). ``` \documentclass{exam} \usepackage[a4paper, total={6in, 11in}]{geometry} \usepackage{background} \backgroundsetup{ scale=1, color=black, opacity=1, angle=0, position=current page.south east, vshift=60pt, hshift=-30pt, contents={% \includegraphics[width=\linewidth,height=50pt,keepaspectratio]{Images/1.png} } } ```
3
https://tex.stackexchange.com/users/233251
690197
320,175
https://tex.stackexchange.com/questions/690202
3
I keep getting this error and I am not sure what I am doing wrong. ``` \documentclass{report} \usepackage{forest} %Required for trees \usepackage{tikz} \begin{document} \begin{figure} \forestset{ L2/.style={draw=blue,}, L1/.style={,edge={,line width=0.9pt}}, } \tikzset{% L1/.style={draw=blue}, L2/.style={line width=0.9pt}, }% \begin{center} \begin{forest} for tree={ grow'=0, parent anchor=children, child anchor=parent, edge+=L2, outer sep=+1pt, rounded corners, minimum width=19mm, minimum height=7mm, l sep' =31mm, s sep' =21mm } [S1, L1 [aS1, L2, edge label={node[midway,fill=white,font=\scriptsize]{p1}}] [aS1, L2, edge label={node[midway,fill=white,font=\scriptsize]{p2}}] ] \end{forest} \bigskip t=0~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~t=1 \end{center} \caption{googly} \end{figure} \end{document} ``` the last time I had this issue, I adjusted my labels to not include subscripts. Not too sure what is wrong here.
https://tex.stackexchange.com/users/300082
! Extra }, or forgotten \endgroup. latex
true
Remove the empty line in l.37: ``` \documentclass{report} \usepackage{forest} %Required for trees \usepackage{tikz} \begin{document} \begin{figure} \forestset{ L2/.style={draw=blue,}, L1/.style={,edge={,line width=0.9pt}}, } \tikzset{% L1/.style={draw=blue}, L2/.style={line width=0.9pt}, }% \begin{center} \begin{forest} for tree={ grow'=0, parent anchor=children, child anchor=parent, edge+=L2, outer sep=+1pt, rounded corners, minimum width=19mm, minimum height=7mm, l sep' =31mm, s sep' =21mm } [S1, L1 [aS1, L2, edge label={node[midway,fill=white,font=\scriptsize]{p1}}] [aS1, L2, edge label={node[midway,fill=white,font=\scriptsize]{p2}}] ] \end{forest} \bigskip t=0~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~t=1 \end{center} \caption{googly} \end{figure} \end{document} ```
3
https://tex.stackexchange.com/users/36296
690203
320,177
https://tex.stackexchange.com/questions/690183
0
I wanted to write the bibliography I used for my master thesis. I grouped the references I used based on their type but my problem is that the references are not sorted. My .bib file is this ``` %The studies @misc{study1, title={The economic effects of the coronavirus around the world}, url={https://www.weforum.org/agenda/2020/02/coronavirus-economic-effects-global-economy-trade-travel/}, journal={World Economic Forum}, author={Hutt, Rosamond}, year={2020}, month={Feb}} @misc{study2, place={Brussels}, title={The impact of the COVID-19 crisis on poverty and social exclusion in Bulgaria}, institution={ESPN}, author={Bogdanov, George}, year={2020}, note = {\url{https://ec.europa.eu/social/BlobServlet?docId=22934&langId=en}}} @misc{study3, title={The Covid-19 recession in France: The trough is behind us, but let’s stay vigilant}, url={https://cepr.org/voxeu/columns/covid-19-recession-france-trough-behind-us-lets-stay-vigilant}, journal={CEPR}, author={Ferrara, Laurent and Mignon, Valerie}, year={2021}, month={Nov}} @misc{study4, title={Euro area unemployment at 7.3\% EU at 6.5\%}, url={https://ec.europa.eu/eurostat/documents/2995521/10662618/3-01042020-AP-EN.pdf/be3d73ee-6715-824b-2c23-f0512f12bdc6?t=1585657691000}, author={Eurostat}, year={2020}} @misc{study5, title={Online dashboard and data analysis approach for assessing COVID-19 case and death data}, author={Florez, Hector and Singh, Sweta}, journal={F1000Research}, volume={9},year={2020}, publisher={Faculty of 1000 Ltd}, note ={\url{https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7450472/}}} @misc{study6, title={Euro area unemployment at 7.3\% EU at 6.6\%}, url={https://ec.europa.eu/eurostat/documents/2995521/10294960/3-03062020-AP-EN.pdf/b823ec2b-91af-9b2a-a61c-0d19e30138ef?t=1591123422000}, author={Eurostat}, year={2020}, month={Jun}} @misc{study7, title={Euro area unemployment at 7.9\%}, url={https://ec.europa.eu/eurostat/documents/2995521/10568643/3-01092020-BP-EN.pdf/39668e66-2fd4-4ec0-9fd4-4d7c99306c98?t=1598882965000}, author={Eurostat}, year={2020}, month={Sep}} @misc{study8, title={Assessing the impact of COVID-19 on Africa’s economic development}, author={Gondwe, Grace}, booktitle={United Nations Conference on Trade and Development},volume={3}, year={2020}, note = {\url{https://unctad.org/system/files/official-document/aldcmisc2020d3_en.pdf}}} @misc{study9, title = {Analyzing COVID-19 pandemic for unequal distribution of tests,identified cases, deaths, and fatality rates in the top 18 countries}, journal = {Diabetes & Metabolic Syndrome: Clinical Research & Reviews}, volume = {14}, number = {5}, pages = {953-961}, year = {2020}, issn = {1871-4021}, doi = {https://doi.org/10.1016/j.dsx.2020.06.051}, url = {https://www.sciencedirect.com/science/article/pii/S1871402120302204}, author = {Shahbaz A. Shams and Abid Haleem and Mohd Javaid}, keywords = {Country-wise analysis, COVID-19, Life expectancy: Pandemic}} %The R packages @manual{package1, title={Ggplot2 : Elegant Graphics For Data Analysis}, ISBN={9783319242750}, publisher={Cham, Schweiz] Springer}, author={Wickham, Hadley and Sievert, Carson and Springer}, year={2016}, note = {\url{https://ggplot2.tidyverse.org}}} @manual{package2, title = {readr: Read Rectangular Text Data}, author = {Hadley Wickham and Jim Hester and Jennifer Bryan}, year = {2022}, note = {\url{https://CRAN.R-project.org/package=readr}}, url = {https://CRAN.R-project.org/package=readr}} @manual{package3, title = {dplyr: A Grammar of Data Manipulation}, author = {Hadley Wickham and Romain François and Lionel Henry and Kirill Müller}, year = {2022}, note = {R package version 1.0.10}, url = {https://CRAN.R-project.org/package=dplyr}} @Manual{package4, title = {randomcoloR: Generate Attractive Random Colors}, author = {Ron Ammar}, year = {2019}, note = {R package version 1.1.0.1}, url = {https://CRAN.R-project.org/package=randomcoloR}} %Sources for theory @book{book1, title={Πολυμεταβλητή Στατιστική Ανάλυση}, ISBN={9603515949}, publisher={Εκδόσεις Σταμούλη}, author={Καρλής, Δημήτρης}, year={2005}, note = {\url{https://www.stamoulis.gr/\%CE\%A0\%CE\%BF\%CE\%BB\%CF\%85\%CE\%BC\%CE\%B5\%CF\%84\%CE\%B1\%CE\%B2\%CE\%BB\%CE\%B7\%CF\%84\%CE\%AE-\%CE\%A3\%CF\%84\%CE\%B1\%CF\%84\%CE\%B9\%CF\%83\%CF\%84\%CE\%B9\%CE\%BA\%CE\%AE-\%CE\%91\%CE\%BD\%CE\%AC\%CE\%BB\%CF\%85\%CF\%83\%CE\%B7_p-406955.aspx}}} @book{book2, title={Ανάλυση Συστάδων}, url={https://repository.kallipos.gr/handle/11419/1238}, publisher={Kallipos, Open Academic Editions}, author={Κύρκος, Ευστάθιος}, year={2015}} %I used some master theses as sources for some theory @mastersthesis{msc3, title = {Διαχωριστική Ανάλυση και εφαρμογές}, url = {https://dspace.lib.ntua.gr/xmlui/bitstream/handle/123456789/5414/\%CE\%B9\%CF\%89\%CE\%B1\%CE\%BD\%CE\%BD\%CE\%B9\%CE\%B4\%CE\%BF\%CF\%85\%CE\%BA_\%CE\%B4\%CE\%B9\%CE\%B1\%CF\%87\%CF\%89\%CF\%81\%CE\%B9\%CF\%83\%CF\%84\%CE\%B9\%CE\%BA\%CE\%AE.pdf?sequence=3}, author = {Κυριακή Ι. Ιωαννίδου}, year = {2011}, school = {Εθνικό Μετσόβιο Πολυτεχνείο Σχολή Εφαρμοσμένων Μαθηματικών και Φυσικών Επιστημών}} @book{book4, author = {Κ. Φωκιανός και Χ. Χαραλάμπους}, title = {Ανάλυση Κατά Συστάδες στην R 1 21.1 Εισαγωγή}, url = {http://www.mas.ucy.ac.cy/~fokianos/GreekRbook/clustering.pdf}, urldate = {2022-12-18}, note = {\url{http://www.mas.ucy.ac.cy/~fokianos/GreekRbook/clustering.pdf}} } @mastersthesis{msc5, author = {Στρατινάκης, Νικόλαος}, title = {Εφαρμοσμένη Ανάλυση Συστάδων }, url = {https://dias.library.tuc.gr/view/manf/79057}, school = {Πολυτεχνείο Κρήτης Π.Μ.Σ Εφαρμοσμένα Μαθηματικά για μηχανικούς}, year = {2018}} @mastersthesis{msc6, author = {Καλλιόπη, Παπούλια}, title = {Μέθοδοι Πολυμεταβλητής Ανάλυσης Επιχειρηματικών Δεδομένων}, school = {Πανεπιστήμιο Πειραιώς Τμήμα Στατιστικής και Ασφαλιστικής Επιστήμης Π.Μ.Σ Εφαρμοσμένη Στατιστική}, url = {https://dione.lib.unipi.gr/xmlui/bitstream/handle/unipi/12905/\%CE\%94\%CE\%B9\%CF\%80\%CE\%BB\%CF\%89\%CE\%BC\%CE\%B1\%CF\%84\%CE\%B9\%CE\%BA\%CE\%AE\%20\%CE\%95\%CF\%81\%CE\%B3\%CE\%B1\%CF\%83\%CE\%AF\%CE\%B1\%20\%CE\%A0\%CE\%B1\%CF\%80\%CE\%BF\%CF\%8D\%CE\%BB\%CE\%B9\%CE\%B1\%20\%CE\%9A\%CE\%B1\%CE\%BB\%CE\%BB\%CE\%B9\%CF\%8C\%CF\%80\%CE\%B7-MES18020.pdf?sequence=2&isAllowed=y}, year = {2020}} %Data source @online{dataset, title = {Our World in Data}, url = {https://github.com/owid}, organization = {GitHub}} ``` I wanted to group my references based on their type (books, packages, master theses etc.) so I wroted this .tex file ``` \documentclass[inscr,ack,preface]{dithesis} \usepackage[backend=bibtex]{biblatex} \addbibresource{references.bib} %my .bib file is called references.bib \begin{document} %My document % manually include the bibliography \bibliographystyle{plain} %\bibliography{references} % include it also in ToC (do sth on your own) \addcontentsline{toc}{chapter}{Βιβλιογραφία} %Βιβλιογραφία is the name of the chapter in Greek \chapter*{\bibname} \addcontentsline{toc}{chapter}{\bibname} \begingroup \let\clearpage\relax % Disable page breaks within this group \printbibliography[type=misc, title={Μελέτες}] %for the studies \printbibliography[type=online, title={Σύνολο δεδομένων}] %for the data source \printbibliography[type=book, title={Βιβλία}] %for the books \printbibliography[type=manual, title={Πακέτα στην R}] %for the packages in R programming languages \printbibliography[type=thesis, title={Διπλωματικές Εργασίες}] %for master theses \endgroup %\nocite{*} \end{document} ``` The output is presented in the following pictures [first image](https://i.stack.imgur.com/bZLMO.png) [second image](https://i.stack.imgur.com/ZpiqL.png). As you can see in these pictures the references are grouped but not sorted. What do you think I should do in order to keep them grouped and also sorted. I have searched a lot and I haven't found something useful yet. Can you provide me the LaTeX code?
https://tex.stackexchange.com/users/294342
How to sort references which are grouped in LaTeX?
true
replace your `\usepackage[backend=bibtex]{biblatex}` line with `\usepackage[backend=bibtex,defernumbers=true]{biblatex}`
0
https://tex.stackexchange.com/users/284587
690207
320,178
https://tex.stackexchange.com/questions/690200
1
It is needed to insert a Minted inside Xsim environment. The basic code is as follow: ``` \documentclass{book} \usepackage{xcolor} \usepackage{minted} \usepackage[verbose]{xsim}%paquete de ejercicios mejorado \usepackage{musixtex} \begin{document} \chapter{Chapter One} Chapter one. \begin{exercise} Exercise description. \end{exercise} \begin{solution} Solution: \begin{minted}{python} def serie_armonica(fundamental, limite): p1 = pitch.Pitch(fundamental) serie_armonica("C2", 16) \end{minted} \end{solution} \printsolutionstype[chapter=1]{exercise} \chapter{Chapter Two} Chapter two. \end{document} ``` By some reason, the line: \printsolutionstype[chapter=1]{exercise} prompts an error: LaTeX Error: \begin{document} ended by \end{minted}.
https://tex.stackexchange.com/users/285170
Minted inside Xsim environment
false
The solved code is as follow: ``` \documentclass{book} \usepackage{xcolor} \definecolor{mintedbackground}{rgb}{0.95,0.95,0.95} \usepackage{minted} \usepackage[verbose]{xsim}%paquete de ejercicios mejorado \usepackage{musixtex} \newmintedfile[mipycode]{python}{ bgcolor=mintedbackground, breaklines=true, fontfamily=tt, linenos=true, numberblanklines=true, numbersep=5pt, gobble=0, frame=leftline, framerule=0.4pt, framesep=2mm, funcnamehighlighting=true, tabsize=4, obeytabs=false, mathescape=false samepage=false, %with this setting you can force the list to appear on the same page showspaces=false, showtabs =false, texcl=false, } \begin{document} \chapter{Chapter One} Chapter one. \begin{exercise} Exercise description. \end{exercise} \begin{solution} Solution: \mipycode{Ejercicio_1.1.py} \end{solution} \printsolutionstype[chapter=1]{exercise} \chapter{Chapter Two} Chapter two. \end{document} ``` Where Ejercicio\_1.1.py is as follow: ``` def serie_armonica(fundamental, limite): p1 = pitch.Pitch(fundamental) armonicos=[] i=1 while i <= limite: armonicos.append(p1.getHarmonic(i)) i+= 1 j=1 for k in armonicos: print("Armónico ",j,":",k.unicodeNameWithOctave,':', k.frequency, "->", k) j+= 1 serie_armonica("C2", 16) ```
1
https://tex.stackexchange.com/users/285170
690208
320,179
https://tex.stackexchange.com/questions/690205
1
I recently updated MikTeX packages, what I had not done in a while. Then, when I compiled a paper I am working on, that I plan to submit to a SIAM journal, and therefore I am using its LaTeX template, it failed. The template is available here: <https://epubs.siam.org/journal-authors#macros> I noticed the file would not compile. It seems to be a problem with the cleverref package, specifically with the cref command. An example of a error is ``` ! Argument of \@fourthoffive has an extra }. <inserted text> \par l.71 \cref{sec:main} , our new algorithm is in \cref{sec:alg}, experimental I've run across a `}' that doesn't seem to match anything. For example, `\def\a#1{...}' and `\a}' would produce this error. If you simply proceed now, the `\par' that I've just inserted will cause me to report a runaway argument that might be the root of the problem. But if your `}' was spurious, just type `2' and it will go away. ``` Then, I tried compiling the template article available in the link above, and it also failed, with the same error. I have tried looking for answers, and have been unlucky so far. I have no idea if the problem is a package conflict, the MikTex version, or the SIAM template file. The log-file I get when I attempt to compile ex-article.tex (provided in the link above) is available here: <https://drive.google.com/file/d/1eb2qxlkB6aCiMkNwrB8Jsr7NGyTr1uoi/view>
https://tex.stackexchange.com/users/300083
The SIAM Latex Template stopped working after Miktex update
false
As I understood it, the problem seems to be a problem with the hyperref package, that was patched very recently. And because the update is so recent, it is not showing up yet on MikTeX-Console. But, alas, the suggestion of Ulrike Fischer to use the trick in <https://github.com/latex3/hyperref/issues/284#issuecomment-1588022830> worked!
0
https://tex.stackexchange.com/users/300083
690209
320,180
https://tex.stackexchange.com/questions/690005
1
I am using this academic CV template from Overleaf: <https://www.overleaf.com/latex/examples/academic-cv-template/hvjpfjnyggbf>. Please, consider that template as the MWE. I want to modify the `\cvsection` and `\cvsubsection` commands so that they act like the standard `\section` and `\subsection` commands in LaTeX. This means that they should have numbers, be included in the table of contents, but keeping the same formatting as in the template. How can I do this? The `\cvsection` and `\cvsubsection` are defined as follows: ``` \newcommand{\cvsection}[1]{% \vspace{\acvSectionTopSkip} \sectionstyle{#1} \phantomsection \color{gray}\vhrulefill{0.9pt} } \newcommand{\cvsubsection}[1]{% \vspace{\acvSectionContentTopSkip} \vspace{-3mm} \subsectionstyle{#1} \phantomsection } ```
https://tex.stackexchange.com/users/183803
Section and subsection formatting
true
The `academic-cv` class defines its own sectioning commands, so you are right that these are what need to be changed. So the following additions need to be made to the class: First, we make some counters for the sections: ``` \newcounter{cvsection} \newcounter{cvsubsection}[cvsection] \renewcommand\thecvsubsection{\thecvsection.\arabic{cvsubsection}} ``` Next we redefine the sectioning commands to write to the TOC. Notice that although the commands are called `\cvsection` and `\cvsubsection` when we write to the TOC, we use `section` and `subsection` since these correspond to *levels* of the TOC format, not actual command names. ``` \newcommand{\cvsection}[1]{% \vspace{\acvSectionTopSkip} \refstepcounter{cvsection} \addcontentsline{toc}{section}{\thecvsection.\quad#1} \sectionstyle{\thecvsection.\quad#1} \phantomsection \color{gray}\vhrulefill{0.9pt} } \newcommand{\cvsubsection}[1]{% \vspace{\acvSectionContentTopSkip} \vspace{-3mm} \refstepcounter{cvsubsection} \addcontentsline{toc}{subsection}{\normalfont\thecvsubsection.~#1} \subsectionstyle{\thecvsubsection.\quad #1} \phantomsection } ``` Finally we use the `tocloft` package to adjust the TOC format as needed. ``` \RequirePackage{tocloft} \setlength{\cftbeforesecskip}{0pt} \setlength{\cftsubsecindent}{2em} ``` Now in the main document, we can simply add `\tableofcontents` and we get the following output. Obviously you may want to issue a `\clearpage` command after the TOC. Any further formatting of the TOC can be done using `tocloft` as needed.
3
https://tex.stackexchange.com/users/2693
690212
320,182
https://tex.stackexchange.com/questions/690216
3
I'm trying to use tex4ebook to generate an epub file from a project in LaTeX. The original project, targetting pdf, uses XeLaTeX and the package xeCJK, and works fine. With tex4ebook, I get the following error if the package xeCJK is included: ``` tex4ht warning: package xeCJK was prevented from loading ! Undefined control sequence. l.98 \DeclareDocumentCommand \setCJKmainfont{o m o}{} ``` If I remove xeCJK, it seems to work, the ebook is genterated and everything is fine, except that all the text in Japanese simply disappears. I've reduced the file to a minimum working example, which generates the expected pdf file perfectly. The .tex file is the following: ``` \documentclass[a5paper,10pt,openright]{book} %\usepackage{xeCJK} \usepackage[portuguese]{babel} \begin{document} !!START JAPANESE TEXT!! 三里塚闘争は、千葉県成田市の農村地区名称である三里塚とその近辺で継続している成田市・芝山町の地元住民及び新左翼活動家らによる新東京国際空港(成田国際空港)の建設・存続に反対する闘争のことを指す。成田闘争とも呼ばれる。 !!END JAPANESE TEXT!! \end{document} ``` The command I'm using is the following: tex4ebook -x -f epub ebooktest.tex I've been looking around but so far I haven't found a way to make it work.
https://tex.stackexchange.com/users/286680
tex4ebook does not render Japanese text
true
It seems that you may have an older installation. With up-to-date TeX Live 2023, it works. Even with the older installation, you can compile it and get the Japanese text if you don't use the `xeCJK` package and compile your file with LuaTeX instead of XeTeX. With LuaTeX, TeX4ht can keep all Unicode characters used in your document in a much more robust way than with XeTeX. Your modified example can look like this: ``` \documentclass[a5paper,10pt,openright]{book} \ifdefined\HCode\else \usepackage{xeCJK} \fi \usepackage[portuguese]{babel} \begin{document} !!START JAPANESE TEXT!! 三里塚闘争は、千葉県成田市の農村地区名称である三里塚とその近辺で継続している成田市・芝山町の地元住民及び新左翼活動家らによる新東京国際空港(成田国際空港)の建設・存続に反対する闘争のことを指す。成田闘争とも呼ばれる。 !!END JAPANESE TEXT!! \end{document} ``` With this code, the `xeCJK` package is ignored with TeX4ht: ``` \ifdefined\HCode\else \usepackage{xeCJK} \fi ``` You can now compile it using: ``` $ tex4ebook -l ebooktest.tex ``` And this is the result:
3
https://tex.stackexchange.com/users/2891
690220
320,185
https://tex.stackexchange.com/questions/688991
2
About one and a half decades ago I tried printing a panorama with LaTeX and found a version with several calls to \afterpage, that worked for me. Meanwhile, I found a much more elegant, shorter, and better understandable algorithm by Martin Scharrer working after the same principle here: [How to include a picture over two pages, left part on left side, right on right (for books)?](https://tex.stackexchange.com/questions/23860/how-to-include-a-picture-over-two-pages-left-part-on-left-side-right-on-right), but I still use my own version ("never change a running system!"). A few days ago Ulrike Fischer had a look at my code and complained about my usage of \afterpage, which would destroy my footnotes: " It doesn't need to be inside the float, you can also move it behind the figure, it only matters here that it is executed while footnotes and floats are handled" and I should never use \afterpage ([Footnotetext jumps to next page and back again](https://tex.stackexchange.com/questions/688815/footnotetext-jumps-to-next-page-and-back-again)). So I replaced the one appearance of \afterpage Ulrike had specially hinted at and my original problem vanished. But afterward, I had a deeper look at my output, and hmm..., Ulrike is right: There are even more problems, I only got used to them over the years. Since I wrote my algorithm, others have done so as well and I searched, whether they were able to solve the problem without \afterpage. But alas, I found \afterpage in Martin Scharrers algorithm as well as in the package hvfloat by Herbert Voß -- and both authors seem to know much more about LaTeX than me. Is it impossible to reach my aim without \afterpage? So I tried another time, starting with Martin Scharrers code: ``` \documentclass[twoside]{book} \usepackage{graphicx} \usepackage{adjustbox} \usepackage{placeins} \usepackage{xcolor} % For the `memoir` class remove the following two packages. % This class already provide the functionality of both \usepackage{caption} \usepackage[strict]{changepage} %%% \setcounter{totalnumber}{1} \setcounter{topnumber}{1} \setcounter{bottomnumber}{1} \renewcommand{\topfraction}{.99} \renewcommand{\bottomfraction}{.99} \renewcommand{\textfraction}{.01} \makeatletter \newcommand*{\twopagepicture}[4]{% \checkoddpage \ifoddpage \expandafter\suppressfloats% <-- replaced \afterpage by suppressfloats \else \expandafter\@firstofone% <-- and reversed order of \suppressfloats and \@firstofone \fi {{% <-- deleted \afterpage here, replaced by reversed order two lines above \begin{figure}[#1] \if #2p% \if #1t% \thispagestyle{empty}% <-- moved here for moving with figure \vspace*{-\dimexpr1in+\voffset+\topmargin+\headheight+\headsep\relax}% \fi \fi \if #1b% \caption{#4}% \fi \makebox[\textwidth][l]{% \if #2p\relax \let\mywidth\paperwidth \hskip-\dimexpr1in+\hoffset+\evensidemargin\relax \else \let\mywidth\linewidth \fi \adjustbox{trim=0 0 {.5\width} 0,clip}{\includegraphics[width=2\mywidth]{#3}}}% \if #1b\else \caption{#4}% \fi \if #2p% \if #1b% \vspace*{-\dimexpr\paperheight-\textheight-1in-\voffset-\topmargin-\headheight-\headsep\relax}% \fi \fi \end{figure}% \begin{figure}[#1] \if #2p% \if #1t% \thispagestyle{empty}% <-- moved here for moving with figure (replaces another \afterpage call) \vspace*{-\dimexpr1in+\voffset+\topmargin+\headheight+\headsep\relax}% \fi \fi \makebox[\textwidth][l]{% \if #2p% \let\mywidth\paperwidth \hskip-\dimexpr1in+\hoffset+\oddsidemargin\relax \else \let\mywidth\linewidth \fi \adjustbox{trim={.5\width} 0 0 0,clip}{\includegraphics[width=2\mywidth]{#3}}}% \if #2p% \if #1b% \vspace*{-\dimexpr\paperheight-\textheight-1in-\voffset-\topmargin-\headheight-\headsep\relax}% \fi \fi \end{figure}% }}% } \makeatother \usepackage{lipsum} \begin{document} \lipsum \lipsum \twopagepicture{b}{l}{image}{Test} \lipsum \lipsum \twopagepicture{t}{l}{image}{Test} \lipsum \lipsum \twopagepicture{b}{p}{image}{Other test} \lipsum \lipsum \twopagepicture{t}{p}{image}{Other test with very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long caption } \lipsum \lipsum \end{document} ``` The biggest problem for me was the \afterpage call, which was used if \twopagepicture was called on an odd page, as then the panorama breaks. But I had the idea, in that case to push both figures one page forward not with \afterpage, but with \suppressfloats. Now I have two questions: 1. The code of the MWE now works, if I replace "image" with the path to a quite wide image. Nevertheless, I am a bit anxious, about whether I have done a bad mistake again, as I do things, I have never done before. Are there any flaws visible again? 2. One problem remaining is: My mechanism with \suppressfloats only works, if not another float of the queue gets between it and my two figures. I thought about a \FloatBarrier just above \checkoddpage, but that would only reduce the possibility, not be foolproof. Has anybody a better idea?
https://tex.stackexchange.com/users/202047
Two page panorama without \afterpage -- tables as well as figures
false
The homebrew package doublepagefloats needed for my first answer -- unfortunately, it is too long to fit in my answer as well: ``` \NeedsTeXFormat{LaTeX2e}[1994/06/01]% \ProvidesPackage{doublepagefloats}[% 2023/06/22 v0.1 double page floats]% \extrafloats{20}% Techniques used in this package include generating quite some "invisible floats", which may prolong the queue \newif\ifsymmbound\symmboundfalse% Text boundaries on left and right page of double page float different because of caption \newif\ifleftcaption\leftcaptionfalse% Caption on right or left page? \DeclareOption{symmbound}{\symmboundtrue}% With option [symmboundtrue] text boundaries equal on both pages \DeclareOption{leftcaption}{\leftcaptiontrue}% With option [symmboundtrue] text boundaries equal on both pages \DeclareOption*{\OptionNotUsed}% Warning, that option is not used \ProcessOptions\relax% \RequirePackage{adjustbox}% Delivers package{graphicx} \RequirePackage{zref-abspage,zref-user, zref-pageattr}% Needed for zlabel{} and the mechanism, to erase foot or head of page \RequirePackage[maxfloats=256]{morefloats}% For not getting the error "too many unprocessed floats" \maxdeadcycles=200% An error "too many dead cycles" sometimes can occur because of the cycles in \pushfloattopage{} % Exchange of \belowcaptionskip and \abovecaptionskip for caption above figure: \newcommand\exch@ngec@ptionskip{% \let\dpf@templen\abovecaptionskip% \let\abovecaptionskip\belowcaptionskip% \let\belowcaptionskip\dpf@templen}% % Width of the gap between the text on the left and the text on the right page: \newcommand\gapwidth{\dimexpr\paperwidth-\evensidemargin+\oddsidemargin-\textwidth\relax}% % Savebox for caption: \newsavebox{\dpf@captionbox}% % Left half of the image (originally overtaken from Martin Scharrer, all mistakes by me): \newcommand\leftp@geflo@t[5][\@empty]{% #1 auxiliary caption, #2: b/t, #3: p/l, #4: content, #5: caption \if #2t\else% \if #2h\else% \exch@ngec@ptionskip% For bottom floats with above caption a skip below the caption is needed instead of above \fi% \fi% \if #2t% \vskip-\dimexpr1in+\voffset+\topmargin+\headheight+\headsep\relax% Move float directly to top of page \fi% \ifx\@empty#1% \global\savebox{\dpf@captionbox}{\parbox[b]{\textwidth}{\caption[#5]{#5}}}% This works, if #1 is empty \else% \global\savebox{\dpf@captionbox}{\parbox[b]{\textwidth}{\caption[#1]{#5}}}% This doesn't work, if #1 is empty, why? \fi% \if #2t\else% \if #2h\else% \ifleftcaption% \usebox{\dpf@captionbox}\\% \else% \ifsymmbound% Text on both pages symmetrical? \rule{0pt}{\ht\dpf@captionbox}\\% this delivers the same white space as the height of the caption \fi% \fi% \fi% \fi% \makebox[\textwidth][r]{% \if #3p\relax% \global\let\panowidth\paperwidth% \else% \global\let\panowidth\linewidth% \fi% \makebox[\textwidth][r]{% \adjustbox{trim=0 0 {.5\width} 0,clip}{#4}}% End \adjustbox \if #3p% \hskip-\dimexpr\paperwidth-\textwidth-1in-\hoffset-\evensidemargin\relax% \fi% }% \if #2b\else% \if #2l\else% \ifleftcaption% \\\usebox{\dpf@captionbox}% \else% \ifsymmbound% Text on both pages symmetrical? \\\rule{0pt}{\ht\dpf@captionbox}% this delivers the same white space as the height of the caption \fi% \fi% \fi% \fi% \if #2b% \vskip-\dimexpr\paperheight-\textheight-1in-\voffset-\topmargin-\headheight-\headsep\relax% Move float completely to page bottom \fi% }% Ende \leftp@geflo@t % Right half of the image (originally overtaken from Martin Scharrer, all mistakes by me): \newcommand*\rightp@geflo@t[5][\@empty]{% #1: auxiliary caption, #2: b/t, #3: p/l, #4: content, #5: caption \if #2t\else% \if #2h\else% \exch@ngec@ptionskip% For bottom floats with above caption a skip below the caption is needed instead of above \fi% \fi% \if #2t% \vskip-\dimexpr1in+\voffset+\topmargin+\headheight+\headsep\relax% \fi% \ifx\@empty#1% \global\savebox{\dpf@captionbox}{\parbox[b]{\textwidth}{\caption[#5]{#5}}}% This works, if #1 is empty \else% \global\savebox{\dpf@captionbox}{\parbox[b]{\textwidth}{\caption[#1]{#5}}}% This doesn't work, if #1 is empty, why? \fi% \if #2t\else% \if #2h\else% \ifleftcaption% \ifsymmbound% Text on both pages symmetrical? \rule{0pt}{\ht\dpf@captionbox}\\% this delivers the same white space as the height of the caption \fi% \else% \usebox{\dpf@captionbox}\\% \fi% \fi% \fi% \makebox[\textwidth][l]{% \if #3p% \global\let\panowidth\paperwidth% \hskip-\dimexpr1in+\hoffset+\oddsidemargin\relax% \else% \global\let\panowidth\linewidth% \fi% \adjustbox{trim={.5\width} 0 0 0,clip}{#4}% End \adjustbox }% end of \makebox \if #2b\else% \if #2l\else% \ifleftcaption% \ifsymmbound% Text on both pages symmetrical? \\\rule{0pt}{\ht\dpf@captionbox}% this delivers the same white space as the height of the caption \fi% \else% \\\usebox{\dpf@captionbox}% \fi% \fi% \fi% \if #2b% \vskip-\dimexpr\paperheight-\textheight-1in-\voffset-\topmargin-\headheight-\headsep\relax% \fi% }% Ende \rightp@geflo@t %---------------------------------------- % With this we can push a float forward to a certain page %---------------------------------------- \newcount\invisiblefloat% \invisiblefloat=0% \newcount\safety% \safety=0 \newcommand\dpf@position{}% Dummy for being able to call for \renewcommand \def\pushfloattopage#1#2#3{% #1: page to reach, #2: float type (figure/table), #3: float placement \loop\ifnum\safety<20% \edef\pagelastinvisiblefloat{\zref@extractdefault{invisiblefloat\number\invisiblefloat}{abspage}{-1}}% \advance\invisiblefloat by 1\relax% increment label number for unique label \edef\actualpage{\zref@extractdefault{invisiblefloat\number\invisiblefloat}{abspage}{-1}}% % Invisible float without caption, needing no space, delivers information about actual page \if #3h \renewcommand\dpf@position{t} \begin{@float}{#2}[t]% Empty float without \caption, so \counter{figure/table} is not increased \else% \if #3l \renewcommand\dpf@position{b} \begin{@float}{#2}[b]% Empty float without \caption, so \counter{figure/table} is not increased \else% \renewcommand\dpf@position{#3}% \begin{@float}{#2}[#3]% Empty float without \caption, so \counter{figure/table} is not increased \fi% \fi% % If either following another invisible float or it is the landing page #1 (then the doublepage float follows), compensate \floatsep, either \textfloatsep \ifnum\actualpage = \pagelastinvisiblefloat\relax% \vskip-\floatsep% \else% \ifnum\actualpage=#1\relax% \vskip-\floatsep% \else% \vskip-\textfloatsep% \fi% \fi% \zlabel{invisiblefloat\number\invisiblefloat}% test label: On which page are we? \end{@float}% % Error queries: \ifnum\actualpage = -1\relax% Label not found \PackageWarning{doublepagefloats}{Label of invisible float not found}% \let\iterate\relax% leave the loop \fi% \edef\lastpage{\zref@extractdefault{LastPage}{abspage}{-1}} \ifnum#1>\lastpage\relax% #1 > last page \PackageWarning{doublepagefloats}{Page number #1 behind last page \lastpage}% \let\iterate\relax% leave the loop \fi% if #1 > last page \ifnum#1 < 1\relax% Too small argument #1 \PackageWarning{doublepagefloats}{Absolute page number less than 1 does not exist}% \let\iterate\relax% leave the loop \fi% % Normal end of loop after landing page is reached \ifnum\numexpr#1-1\relax < \actualpage% \let\iterate\relax% leave the loop \fi% \advance\safety by 1\relax% \repeat% \safety=0% for next call to pushfloattopage }% End \pushfloattopage %---------------------------------------- % Make a length non-elastic %---------------------------------------- \newdimen\dpf@fixedlength% \newdimen delivers a non-elastic length \newcommand\makefixedlength[1]{% \setlength\dpf@fixedlength{#1}% copying length to non-elastic one strips off the elastic part \global\setlength{#1}\dpf@fixedlength}% now copying back %---------------------------------------- % \doublepagefloat{figure/table}{b/t/h/l}{p/l}{<content>{<caption>} is the new user command, to generate one or more double page floats %---------------------------------------- \newcommand\dpf@pagebeforestart{-2}% \newcounter{l@belnumber}% generates distinctive numbers for generating individual labels \newcounter{dpf@l@belnumbershipout}% same for the shipout routine \stepcounter{dpf@l@belnumbershipout}% start with 1 % For \label-\ref-mechanism to determine the right page number floats get an additional label dpf@float made unique by prolonging with the reading of a new counter "dpf@float" \newcounter{dpf@float}% Counter for labeling every float (as the change of totalnumber will affect every float as well, independent of float type) \let\end@floatold\end@float% Save original end of envíronment @float \def\end@float{% \stepcounter{dpf@float}% So starting with one \zlabel{dpf@float\arabic{dpf@float}}% \end@floatold% }% % Save counter totalnumber \AtBeginDocument{% Changes in the preamble will be taken into account as well, as we only save the counter at begin of document \expandafter\edef\expandafter\totalnumber@old\expandafter{\the\value{totalnumber}}% Save state of counter totalnumber }% \newcommand*{\doublepagefloat}[6][\@empty]{% #1: auxiliary caption, #2: figure/table, #3: b/t/h/l, #4: p/l, #5: content, #6: caption %\newcommand*\doublepagefloat[5]{% #1: figure/table, #2: b/t/h/l, #3: p/l, #4: content, #5: caption, #6: auxiliary caption % #1: auxiliary caption, the one for the list of figures % #2: floattype, usually figure or table % #3: b: (b)ottom of page % t: (t)op of page % h: (h)igh, i.e. top of text % l: (l)ow, i.e. bottom of text % % #4: p: (p)aper, i.e. the content may be up to 2\paperwidth wide, will be centered to the gap between both pages and may stretch till the paper boundaries. % It may be narrower though and then will still center. If the width of the content is exactly \doubletextwidth, it stretches from the left border of the left page text to the right border of the right page % text. % l: (l)ine, i.e. the content only uses the width of a line on both pages with a wide gap between both parts % #5: content, i.e. the image itself % #6: main caption, the text under the image % Page number of last float before: \ifnum\value{dpf@float}=0\relax% This will become the first float? \newcommand\dpf@pagelastfloat{0}% fictitious page of last float \else% \expandafter\edef\expandafter\dpf@pagelastfloat\expandafter{\zref@extractdefault{dpf@float\arabic{dpf@float}}{abspage}{-1}}% must be expanded, before counter dpf@float is stepped again \fi% % Page, where \doublepagefloat was run (double page float is now available) \stepcounter{l@belnumber}% the next label should have another number (so counter starts with 1) \zlabel{dpf@run\arabic{l@belnumber}}% Unique label \expandafter\edef\expandafter\dpf@runpage\expandafter{\zref@extractdefault{dpf@run\arabic{l@belnumber}}{abspage}{-1}}% must be expanded, before counter l@belnumber is stepped again % The double page float can only appear on the first coming even page and after the last float before was printed and after \doublepagefloat was run. Calculated is the page BEFORE the first double float page \expandafter\edef\expandafter\dpf@pagebeforestart\expandafter{\dpf@pagelastfloat}% here the last float was printed \ifnum\dpf@pagebeforestart < \dpf@runpage\relax% \expandafter\renewcommand\expandafter\dpf@pagebeforestart\expandafter{\dpf@runpage}% \fi% \ifodd\dpf@pagebeforestart\relax% Then the double page float may already start at the next page \else% otherwise inkrement by 1 to reach an odd page number \expandafter\edef\expandafter\dpf@temp\expandafter{\dpf@pagebeforestart}% \expandafter\expandafter\expandafter\edef\expandafter\expandafter\expandafter\dpf@pagebeforestart\expandafter\expandafter\expandafter{\expandafter\numexpr\dpf@temp +1\relax}% \fi% % Store special pages globally with unique name for later use \expandafter\global\expandafter\edef\csname dpf@pagebeforestart\arabic{l@belnumber}\endcsname{\dpf@pagebeforestart}% Globally stored under unique name for comparison in next run \expandafter\global\expandafter\edef\csname dpf@pagelastfloat\arabic{l@belnumber}\endcsname{\dpf@pagelastfloat}% Globally stored under unique name for altering \floatsep % Now push both halves of double page float to the appropriate pages and print them: \edef\dpf@lastpage{\zref@extractdefault{LastPage}{abspage}{-1}}% \expandafter\pushfloattopage\expandafter{\numexpr\dpf@pagebeforestart +1\relax}{#2}{#3}% \if #3h% \begin{@float}{#2}[!t]% printing the left half of the image ... \else% \if #3l% \begin{@float}{#2}[!b]% printing the left half of the image ... \else% \begin{@float}{#2}[!#3]% printing the left half of the image ... \fi\fi% \leftp@geflo@t[#1]{#3}{#4}{#5\if#3h\else\if#3l\else\zlabel{left#3\arabic{l@belnumber}}\fi\fi}{#6}% Set label only in cases t/b, not in cases h/l \end{@float}% \expandafter\pushfloattopage\expandafter{\numexpr\dpf@pagebeforestart +2\relax}{#2}{#3}% \if #3h% \begin{@float}{#2}[!t]% ... and now the right half \else% \if #3l% \begin{@float}{#2}[!b]% ... and now the right half \else% \begin{@float}{#2}[!#3]% ... and now the right half \fi\fi% \rightp@geflo@t[#1]{#3}{#4}{#5\if#3h\else\if#3l\else\zlabel{right#3\arabic{l@belnumber}}\fi\fi}{#6}% Set label only in cases t/b, not in cases h/l \end{@float}% }% End of \doublepagefloat %------------------------------- % Manipulate counters totalnumber and dpf@erase as well as lengths \floatsep and \textfloatsep via Hooks according to the calculations before % (after an idea of John Kormylo and with the help of Ulrike Fischer): % totalnumber: Helps against other floats on the last double float page in a row (or of a single double page float) if set to 2 % -- and if the double page float is set to the top of the page, not the bottom! % dpf@erase: controls erasing of page head or foot for placement parameters t and b % lengths \floatsep and \textfloatsep: Are temporarily stripped off their elastic parts for better "invisibility" of "invisible floats" and % better symmetric appearance of left and right page text in combination with a double page float -- are set back to their original % elastic values later %------------------------------- \newlength\dpf@floatsepelastic% \setlength\dpf@floatsepelastic{\floatsep}% Save floatsep \newlength\dpf@textfloatsepelastic% \setlength\dpf@textfloatsepelastic{\textfloatsep}% Save textfloatsep \def\dpf@nextpage{-1}% Initializing: Next page (=0) doesn't exist \AddToHook{shipout/after}{% With "after" we are sure to redo changes on the second page of the double page float before % let \textfloatsep unaltered for two pages in total, before setting back \ifnum\dpf@nextpage > 0% If following page shall have fixed \textfloatsep as well, \dpf@nextpage is positive \xdef\dpf@nextpage{0}% Here set back to 0, because only one further page shall have fixed \textfloatsep \makefixedlength{\floatsep}% Strip off the elastic part of \floatsep \makefixedlength{\textfloatsep}% Strip off the elastic part of \textfloatsep \else% \setlength\floatsep\dpf@floatsepelastic% restore elastic length \floatsep \setlength\textfloatsep\dpf@textfloatsepelastic% restore elastic length \textfloatsep \fi% \ifnum\value{l@belnumber} > \numexpr\value{dpf@l@belnumbershipout} - 1\relax\relax% l@belnumber >= dpf@l@belnumbershipout ? \expandafter\expandafter\expandafter\ifnum\csname dpf@pagebeforestart\arabic{dpf@l@belnumbershipout}\endcsname = \value{page}% After shipout of the page before the double page float (for the first double page float page) ... \setcounter{totalnumber}{2}% ... set totalnumber=2 (1 invisible float, one half of the double page float, more are forbidden) \fi% % Make \textfloatsep unelastic, to make invisible floats invisible be compensating their own length (not exactly possible with elastic lengths) \expandafter\expandafter\expandafter\ifnum\csname dpf@pagelastfloat\arabic{dpf@l@belnumbershipout}\endcsname = \value{page}% Page of last float before double page float \makefixedlength{\floatsep}% Strip off the elastic part of \floatsep \makefixedlength{\textfloatsep}% Strip off the elastic part of \textfloatsep \xdef\dpf@nextpage{1}% \fi% \ifnum\numexpr\value{page}+1\relax = \zref@extractdefault{leftt\arabic{dpf@l@belnumbershipout}}{page}{-1}% Left side with t- or h-double page float \makefixedlength{\floatsep}% Strip off the elastic part of \floatsep \makefixedlength{\textfloatsep}% textfloatsep now non-elastic, making calculations easier \xdef\dpf@nextpage{1}% \fi% \ifnum\numexpr\value{page}+1\relax = \zref@extractdefault{leftb\arabic{dpf@l@belnumbershipout}}{page}{-1}% Left side with l- or b-double page float \makefixedlength{\floatsep}% Strip off the elastic part of \floatsep \makefixedlength{\textfloatsep}% textfloatsep now non-elastic, making calculations easier \xdef\dpf@nextpage{1}% \fi% \fi% }% \AddToHook{shipout/before}{% With "before" we are sure that these changes on the second page of the double page float can be redone by a directly following second douböle page float % Set counter dpf@erase =0 on normal pages, =1 for pages with pagewide double page float in the head (leftt, rightt) and =2 for pages with pagewide double page float in the foot (leftb, rightb) \setcounter{dpf@erase}{0}% For normal pages \ifnum\value{l@belnumber} > \numexpr\value{dpf@l@belnumbershipout} - 1\relax\relax% If label exists already % Erase head or bottom of page in case of a double page float, that spans the complete page (\paperwidth) \ifnum\numexpr\value{page} + 1\relax = \zref@extractdefault{leftt\arabic{dpf@l@belnumbershipout}}{page}{-1}\setcounter{dpf@erase}{1}\fi% % If on left page of double page float (top): Erase head (dpf@erase=1) \ifnum\numexpr\value{page} + 1\relax = \zref@extractdefault{rightt\arabic{dpf@l@belnumbershipout}}{page}{-1}\setcounter{dpf@erase}{1}\fi% % If on right page of double page float (top): Erase head (dpf@erase=1) \ifnum\numexpr\value{page} + 1\relax = \zref@extractdefault{leftb\arabic{dpf@l@belnumbershipout}}{page}{-1}\setcounter{dpf@erase}{2}\fi% % If on left page of double page float (bottom): Erase bottom (dpf@erase=2) \ifnum\numexpr\value{page} + 1\relax = \zref@extractdefault{rightb\arabic{dpf@l@belnumbershipout}}{page}{-1}\setcounter{dpf@erase}{2}\fi% % If on right page of double page float (bottom): Erase bottom (dpf@erase=2) % Set totalnumber to original value \expandafter\expandafter\expandafter\ifnum\expandafter\numexpr\csname dpf@pagebeforestart\arabic{dpf@l@belnumbershipout}\endcsname + 2\relax = \value{page}% After shipout of the page before the double page float (for the first double page float page) ... \setcounter{totalnumber}{\totalnumber@old}% ... set totalnumber=2 (1 for invisible float, one half of the double page float) \fi% % Step labelcounter \expandafter\expandafter\expandafter\ifnum\expandafter\numexpr\csname dpf@pagebeforestart\arabic{dpf@l@belnumbershipout}\endcsname + 1\relax = \value{page}% After shipout of the page before the double page float (for the first double page float page) ... \stepcounter{dpf@l@belnumbershipout}% step label counter \fi% \fi% If label exists already }% \AddToHook{shipout/before} %---------------------------------------- % Mechanism for erasing page head or foot based on idea by Ulrike Fischer (see https://tex.stackexchange.com/questions/689322/how-to-transport-code-not-material-with-a-float) % The counter dpf@erase is set in \AddToHook{shipout/before} according to labels in the double page floats themselves, set in doublepagefloats %---------------------------------------- \newcounter{dpf@erase}% % Counter dpf@erase (controlled by shipout/before, see above) controls, whether page head (1), foot (2) or nothing (0) is erased. In the latter case the original macro is called \AtBeginDocument{% That way one can change head and foot in the preamble % Save original head and foot of page \let\@evenheadold\@evenhead% Save even head \let\@oddheadold\@oddhead% Save odd head \let\@evenfootold\@evenfoot% Save even foot \let\@oddfootold\@oddfoot% Save odd foot % Dependand on counter dpf@erase don't show saved head or foot of page, reset dpf@erase immediately, so that the suppression lasts just for one page \def\@evenhead{\ifnum\value{dpf@erase} = 1\relax\else\@evenheadold\fi}% Take saved even head, if not page of labeled figure \def\@oddhead{\ifnum\value{dpf@erase} = 1\relax\else\@oddheadold\fi}% Take saved odd head, if not page of labeled figure \def\@evenfoot{\ifnum\value{dpf@erase} = 2\relax\else\@evenfootold\fi}% Take saved even foot, if not page of labeled figure \def\@oddfoot{\ifnum\value{dpf@erase} = 2\relax\else\@oddfootold\fi}% Take saved odd foot, if not page of labeled figure }% AtBeginDocument \endinput% ```
0
https://tex.stackexchange.com/users/202047
690222
320,186
https://tex.stackexchange.com/questions/333420
6
When expressing a value such as 90 percent by weight, I have seen papers use all of these formats: * 90 wt% * 90 wt.% * 90-wt % * 90 wt.-% * 90 wt. percent * 90 weight percent There are probably still more. How can I use the `siunitx` package to handle these formats without manually reformatting to fit each style?
https://tex.stackexchange.com/users/34023
Format percent by weight (wt.%) with siunitx
false
A slightly different "answer" to your question. ISO and NIST recommend against using percentage by weight/volume/amount of substance or any other variation as it mixes information with units. See 7.10.2 of the guide here: <https://www.nist.gov/publications/guide-use-international-system-units-si> > > Because the symbol % represents simply a number, it is not meaningful to attach information to it (see Sec. 7.4). One must therefore avoid using phrases such as “percentage by weight,” “percentage by mass,” “percentage by volume,” or “percentage by amount of substance.” Similarly, one must avoid writing, for example, “% (m/m),” “% (by weight),” “% (V/V),” “% (by volume),” or “% (mol/mol).” The preferred forms are “the mass fraction is 0.10,” or “the mass fraction is 10 %,” ... > > > Which is a long-winded way of suggesting that you instead use: ``` The mass fraction is \qty{90}{\percent} ``` Personally I prefer the representation which best conveys the meaning, and "wt%" or "% (m/m)" are both quite good at that. But if your goal is to have a solution which is acceptable to all publications, there are many which won't accept any variation of "percentage by mass".
1
https://tex.stackexchange.com/users/255393
690229
320,188
https://tex.stackexchange.com/questions/690231
2
I used the option `si={table-format=3.4}` because I will have integers in the range of hundreds and as many as four decimals, yet neither the decimals nor the ranges are arranged. What could I be missing? ``` \documentclass{scrartcl} \usepackage[margin=20mm]{geometry} \usepackage{pdflscape} \usepackage[version=4]{mhchem} \usepackage{xcolor} \definecolor{dark-blue}{RGB}{28, 69, 135} \definecolor{purple}{rgb}{.82, .1, .26} \definecolor{tableLineOne}{RGB}{255, 253, 233} \definecolor{tableLineTwo}{RGB}{255, 250, 194} \usepackage{tabularray} \UseTblrLibrary{booktabs, siunitx} \NewTableCommand\panelsteel{ \SetCell[c=8]{c,bg=purple,fg=white}} \begin{document} \begin{landscape} \begin{longtblr}[ caption = {Minimal booktabs example.}, label = {tab:table1} ]{ colspec = {*{8}{X[si={table-format=3.4},c, m, cmd={\hskip 0pt}]}}, colsep = 1.2pt, cell{1}{1-2} = {r=2}{m}, row{even[3]} = {bg= black!30}, row{odd[3]} = {bg= black!5}, row{1,2}= {fg=white,bg=dark-blue}, rowhead=2 } \toprule[fg=white] Thickness (in) & Amperage (\unit{\ampere}) & \SetCell[c=3]{c} Voltage (\unit{\volt})& & & \SetCell[c=3]{c} Wire feed speed (ipm)& &\\ \midrule[fg=white] & & \ce{CO2} & \ce{Ar} \qty{75}{\%} \ce{CO2} \qty{25}{\%} & \ce{Ar} \qty{98}{\%}+ \ce{O2} \qty{2}{\%} & Steel 0.030 & Steel 0.035 & Steel 0.045 \\ \bottomrule[fg=white] \panelsteel{Short circuit transfer mode} & & & & & & & \\ \midrule[fg=dark-blue] .028 & 40 - 55 & 16 - 17 & 15 - 16 & - & 90 - 100 & - & - \\ .036 & 50 - 60 & 17 - 18 & 15 - 16 & - & 120 - 135 & 105 - 115 & - \\ .048 & 70 - 80 & 18 - 19 & 16 - 17 & - & 150 - 175 & 140 - 160 & 70 \\ .064 & 90 - 110 & 19 - 20 & 17 - 18 & - & 220 - 250 & 180 - 220 & 90 - 110 \\ .08 & 120 - 130 & 20 - 21 & 17 - 18 & - & 250 - 340 & 240 - 260 & 120 - 130\\ .125 & 140 - 150 & 21 - 22 & 18 - 19 & & - & 280 - 300 & 140 - 150\\ .1875 & 160 - 170 & 21 - 22 & 18 - 19 & - & - & 320 - 340 & 160 - 175\\ .25 & 180 - 190 & 23 - 24 & 21 - 22 & - & - & 360 - 380 & 185 - 195\\ .3125 & 200 - 210 & 23 - 24 & 21 - 22 & - & - & 400 - 420 & 210 - 220\\ .375 & 220 - 250 & 24 - 25 & 23 - 24 & - & - & 420 - 520 & 220 - 270\\ .5 & 300 & - & - & - & - & - & 375\\ \midrule[fg=dark-blue] \panelsteel{Spray arc transfer mode} & & & & & & & \\ \midrule[fg=dark-blue] .028 & 50 - 60 & - & - & - & 120 - 135 & 105 - 115 & - \\ .036 & 70 - 80 & - & - & - & 150 - 175 & 140 - 160 & 70\\ .048 & 90 - 110 & - & - & - & 220 - 250 & 180 - 220 & 90 - 110\\ .064 & 120 - 130 & - & - & - & 250 - 340 & 240 - 260 & 120 - 130\\ .08 & 140 - 150 & - & - & - & - & 280 - 300 & 140 - 150\\ .125 & 160 - 170 & - & - & 23 - 24 & - & 320 - 340 & 160 - 175\\ .1875 & 180 - 190 & - & - & 24 - 25 & - & 360 - 380 & 185 - 195\\ .25 & 200 - 210 & - & - & 24 - 25 & - & 400 - 420 & 210 - 220\\ .3125 & 220 - 250 & - & - & 25 - 26 & - & 420 - 520 & 220 - 270\\ .375 & 300 & - & - & 26 - 27 & - & - & 375\\ .5 & 315 & - & - & 29 - 30 & - & - & 390\\ \bottomrule[fg=dark-blue] \end{longtblr} \end{landscape} \end{document} ```
https://tex.stackexchange.com/users/124155
Align numbers at decimal point using tabulararray package
true
You are very generous with the columns using the `si` option. Rather than using this for all of the columns, you really only want to use it for the first one. Therefore, I replaced ``` colspec = {*{8}{X[si={table-format=3.4},c, m, cmd={\hskip 0pt}]}}, ``` by ``` colspec = colspec = {X[si={table-format=3.4},c]*{7}{X[c]}}, ``` Further, as explained in the manual, you need to use *triple* pairs of curly braces to guard non-numeric cells in that column. ``` \documentclass{scrartcl} \usepackage[margin=20mm]{geometry} \usepackage{pdflscape} \usepackage[version=4]{mhchem} \usepackage{xcolor} \definecolor{dark-blue}{RGB}{28, 69, 135} \definecolor{purple}{rgb}{.82, .1, .26} \definecolor{tableLineOne}{RGB}{255, 253, 233} \definecolor{tableLineTwo}{RGB}{255, 250, 194} \usepackage{tabularray} \UseTblrLibrary{booktabs, siunitx} \NewTableCommand\panelsteel{ \SetCell[c=8]{c,bg=purple,fg=white}} \begin{document} \begin{landscape} \begin{longtblr}[ caption = {Minimal booktabs example.}, label = {tab:table1} ]{ colspec = {X[si={table-format=3.4},c]*{7}{X[c]}},{X[c]}}, colsep = 1.2pt, cell{1}{1-2} = {r=2}{m}, row{even[3]} = {bg= black!30}, row{odd[3]} = {bg= black!5}, row{1,2}= {fg=white,bg=dark-blue}, rowhead=2 } \toprule[fg=white] {{{Thickness (in)}}} & Amperage (\unit{\ampere}) & \SetCell[c=3]{c} Voltage (\unit{\volt})& & & \SetCell[c=3]{c} Wire feed speed (ipm)& &\\ \midrule[fg=white] & & \ce{CO2} & \ce{Ar} \qty{75}{\%} \ce{CO2} \qty{25}{\%} & \ce{Ar} \qty{98}{\%}+ \ce{O2} \qty{2}{\%} & Steel 0.030 & Steel 0.035 & Steel 0.045 \\ \bottomrule[fg=white] \panelsteel{{{{Short circuit transfer mode}}}} & & & & & & & \\ \midrule[fg=dark-blue] .028 & 40 - 55 & 16 - 17 & 15 - 16 & - & 90 - 100 & - & - \\ .036 & 50 - 60 & 17 - 18 & 15 - 16 & - & 120 - 135 & 105 - 115 & - \\ .048 & 70 - 80 & 18 - 19 & 16 - 17 & - & 150 - 175 & 140 - 160 & 70 \\ .064 & 90 - 110 & 19 - 20 & 17 - 18 & - & 220 - 250 & 180 - 220 & 90 - 110 \\ .08 & 120 - 130 & 20 - 21 & 17 - 18 & - & 250 - 340 & 240 - 260 & 120 - 130\\ .125 & 140 - 150 & 21 - 22 & 18 - 19 & & - & 280 - 300 & 140 - 150\\ .1875 & 160 - 170 & 21 - 22 & 18 - 19 & - & - & 320 - 340 & 160 - 175\\ .25 & 180 - 190 & 23 - 24 & 21 - 22 & - & - & 360 - 380 & 185 - 195\\ .3125 & 200 - 210 & 23 - 24 & 21 - 22 & - & - & 400 - 420 & 210 - 220\\ .375 & 220 - 250 & 24 - 25 & 23 - 24 & - & - & 420 - 520 & 220 - 270\\ .5 & 300 & - & - & - & - & - & 375\\ \midrule[fg=dark-blue] \panelsteel{{{{Spray arc transfer mode}}}} & & & & & & & \\ \midrule[fg=dark-blue] .028 & 50 - 60 & - & - & - & 120 - 135 & 105 - 115 & - \\ .036 & 70 - 80 & - & - & - & 150 - 175 & 140 - 160 & 70\\ .048 & 90 - 110 & - & - & - & 220 - 250 & 180 - 220 & 90 - 110\\ .064 & 120 - 130 & - & - & - & 250 - 340 & 240 - 260 & 120 - 130\\ .08 & 140 - 150 & - & - & - & - & 280 - 300 & 140 - 150\\ .125 & 160 - 170 & - & - & 23 - 24 & - & 320 - 340 & 160 - 175\\ .1875 & 180 - 190 & - & - & 24 - 25 & - & 360 - 380 & 185 - 195\\ .25 & 200 - 210 & - & - & 24 - 25 & - & 400 - 420 & 210 - 220\\ .3125 & 220 - 250 & - & - & 25 - 26 & - & 420 - 520 & 220 - 270\\ .375 & 300 & - & - & 26 - 27 & - & - & 375\\ .5 & 315 & - & - & 29 - 30 & - & - & 390\\ \bottomrule[fg=dark-blue] \end{longtblr} \end{landscape} \end{document} ```
2
https://tex.stackexchange.com/users/nan
690233
320,190
https://tex.stackexchange.com/questions/690241
3
``` \documentclass{article} \usepackage{luacode,xkeyval} \makeatletter \define@key{someop}{a}{\def\mop@one{#1}}% \setkeys{someop}{a=0}% \newcommand{\luaTest}[2][]{{% \setkeys{someop}{#1}% \directlua{% local mystr = [[ test ]] tex.print(tostring(#2).." "..\mop@one) }% }% }% \makeatother \begin{document} \luaTest{'First'} \begin{center} \luaTest{'First'} \end{center} \end{document} ``` The above code works as expected and produces the following expected output. ``` First 0 First 0 ``` However the following code does not work. ``` \documentclass{article} \usepackage{luacode,xkeyval} \makeatletter \define@key{someop}{a}{\def\mop@one{#1}}% \setkeys{someop}{a=0}% \newcommand{\luaTest}[2][]{{% \setkeys{someop}{#1}% \directlua{% local mystr = [[ test ]] tex.print(tostring(#2).." "..\mop@one) }% }% }% \makeatother \begin{document} \luaTest{'First'} \begin{center} \luaTest{'First'} \end{center} \end{document} ``` The only difference is one blank line before `tex.print`. It throws the following error. ``` unexpected symbol near '\'. \\luaTest ...print(tostring(#2).." "..\mop@one ) } } ``` The command still works but not inside center environment. If I remove `\begin{center} ...\end{center}`, the document gets compiled. What is the issue? Could someone point out? Though I can get issue solved by removing blank line, I want to understand the issue.
https://tex.stackexchange.com/users/75476
Issue with new command in center environment using direct lua
true
empty lines inside `\directlua` matter. The parsing will insert a `\par` token. It errors in your example because inside a list (and center is a list) `\par` has a special meaning, but that doesn't mean that it does nothing outside the list. So avoid empty lines unless you know really what it will do. As an example ``` \documentclass{article} \begin{document} { \makeatletter \@setpar{tex.print("blub")} \directlua{% tex.print(tostring(1)) tex.print(tostring(2)) } } \end{document} ``` will give
6
https://tex.stackexchange.com/users/2388
690243
320,192
https://tex.stackexchange.com/questions/690247
1
To uncover all itemize environments in a presentation created with Beamer stepwise, I thought of redefining the itemize environment in the following way: ``` \documentclass{beamer} \renewenvironment{itemize}{\begin{itemize}[<+->]}{\end{itemize}} \begin{document} \begin{frame}{Test} \begin{itemize} \item A \item B \end{itemize} \end{frame} \end{document} ``` This gives me the error message `TeX capacity exceeded, sorry`, which leaves me a bit clueless about how I might fix the problem. Any other solution for uncovering itemize environments stepwise by default would be equally fine for me.
https://tex.stackexchange.com/users/163251
Beamer: Stepwise uncover itemize environment
true
You can set the default overlay specification like this: ``` \documentclass{beamer} \beamerdefaultoverlayspecification{<+->} \begin{document} \begin{frame}{Test} \begin{itemize} \item A \item B \end{itemize} \end{frame} \end{document} ```
2
https://tex.stackexchange.com/users/36296
690248
320,194
https://tex.stackexchange.com/questions/690234
3
I want to override the command that prints `Overfull \hbox...`, but it seems that it's not `\GenericWarning`. What is it?
https://tex.stackexchange.com/users/1449
Which LaTeX command prints a warning message about "Overfull \hbox"?
true
This comes from the tex egine and in classical TeX can not be changed. In luatex there is a callback that allows the warning to be replaced by arbitrary Lua code, so here I use it to raise a tex error. ``` \documentclass{article} \makeatletter \directlua{ luatexbase.add_to_callback( "hpack_quality", function(i,d,h,f,l) if(i=="overfull") then tex.error("Overfull line: ".. string.format("\@percentchar.4f",d/65536,3) .. "pt in paragraph lines " .. f .. "-" .. l) end end, "error on overfull hbox" ) } \makeatother \begin{document} One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four One twoxxxxxxxxxxxxxx threexxxxxxxxxxxx four One two xxxxxxxxxxxxxxthree xxxxxxxxxxxx four One two xxxxxxxxxxxxxx three xxxxxxxxxxxx four \begin{quote} \rule{12cm}{1cm} \end{quote} \end{document} ``` Produces three errors: ``` ! Overfull line: 5.4100pt in paragraph lines 22-40. <argument> ...ype:D \tex_hskip:D \c_zero_dim \fi: \tex_par:D \hook_use:n {para/after}\@... l.40 ? ! Overfull line: 7.9400pt in paragraph lines 22-40. <argument> ...ype:D \tex_hskip:D \c_zero_dim \fi: \tex_par:D \hook_use:n {para/after}\@... l.40 ? ! Overfull line: 46.4331pt in paragraph lines 42-43. <argument> ...ype:D \tex_hskip:D \c_zero_dim \fi: \tex_par:D \hook_use:n {para/after}\@... l.43 \end{quote} ? ```
4
https://tex.stackexchange.com/users/1090
690251
320,196
https://tex.stackexchange.com/questions/690236
0
I want to write the bibliography of my Master thesis. My.bib file is this ``` @misc{study1, title={The economic effects of the coronavirus around the world}, url={https://www.weforum.org/agenda/2020/02/coronavirus-economic-effects-global-economy-trade-travel/}, journal={World Economic Forum}, author={Hutt, Rosamond}, year={2020}, month={Feb}} @misc{study2, place={Brussels}, title={The impact of the COVID-19 crisis on poverty and social exclusion in Bulgaria}, institution={ESPN}, author={Bogdanov, George}, year={2020}, note = {\url{https://ec.europa.eu/social/BlobServlet?docId=22934&langId=en}}} @misc{study3, title={The Covid-19 recession in France: The trough is behind us, but let’s stay vigilant}, url={https://cepr.org/voxeu/columns/covid-19-recession-france-trough-behind-us-lets-stay-vigilant}, journal={CEPR}, author={Ferrara, Laurent and Mignon, Valerie}, year={2021}, month={Nov}} @misc{study4, title={Euro area unemployment at 7.3\% EU at 6.5\%}, url={https://ec.europa.eu/eurostat/documents/2995521/10662618/3-01042020-AP-EN.pdf/be3d73ee-6715-824b-2c23-f0512f12bdc6?t=1585657691000}, author={Eurostat}, year={2020}} @misc{study5, title={Online dashboard and data analysis approach for assessing COVID-19 case and death data}, author={Florez, Hector and Singh, Sweta}, journal={F1000Research}, volume={9}, year={2020}, publisher={Faculty of 1000 Ltd}, note ={\url{https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7450472/}}} @misc{study6, title={Euro area unemployment at 7.3\% EU at 6.6\%}, url={https://ec.europa.eu/eurostat/documents/2995521/10294960/3-03062020-AP-EN.pdf/b823ec2b-91af-9b2a-a61c-0d19e30138ef?t=1591123422000}, author={Eurostat}, year={2020}, month={Jun}} @misc{study7, title={Euro area unemployment at 7.9\%}, url={https://ec.europa.eu/eurostat/documents/2995521/10568643/3-01092020-BP-EN.pdf/39668e66-2fd4-4ec0-9fd4-4d7c99306c98?t=1598882965000}, author={Eurostat}, year={2020}, month={Sep}} @misc{study8, title={Assessing the impact of COVID-19 on Africa’s economic development}, author={Gondwe, Grace}, booktitle={United Nations Conference on Trade and Development}, volume={3}, year={2020}, note = {\url{https://unctad.org/system/files/official-document/aldcmisc2020d3_en.pdf}}} @misc{study9, title = {Analyzing COVID-19 pandemic for unequal distribution of tests, identified cases, deaths, and fatality rates in the top 18 countries}, journal = {Diabetes & Metabolic Syndrome: Clinical Research & Reviews}, volume = {14}, number = {5}, pages = {953-961}, year = {2020}, issn = {1871-4021}, doi = {https://doi.org/10.1016/j.dsx.2020.06.051}, url = {https://www.sciencedirect.com/science/article/pii/S1871402120302204}, author = {Shahbaz A. Shams and Abid Haleem and Mohd Javaid}, keywords = {Country-wise analysis, COVID-19, Life expectancy: Pandemic}} @misc{study10, author={Wickham, Hadley and Sievert, Carson and Springer}, title={Ggplot2 : Elegant Graphics For Data Analysis},year={2016}, url = {https://ggplot2.tidyverse.org}} @misc{study11, author = {Hadley Wickham and Jim Hester and Jennifer Bryan}, title = {readr: Read Rectangular Text Data}, year = {2022}, url = {https://CRAN.R-project.org/package=readr}} @misc{study12, author = {Hadley Wickham and Romain François and Lionel Henry and Kirill Müller}, title = {dplyr: A Grammar of Data Manipulation}, year = {2022}, url = {https://CRAN.R-project.org/package=dplyr}} @misc{study13, author = {Ron Ammar}, title = {randomcoloR: Generate Attractive Random Colors}, year = {2019}, url = {https://CRAN.R-project.org/package=randomcoloR} } @book{book1, title={Πολυμεταβλητή Στατιστική Ανάλυση}, ISBN={9603515949}, publisher={Εκδόσεις Σταμούλη}, author={Καρλής, Δημήτρης}, year={2005}} @book{book2, title = {Επιχειρηματική ευφυΐα και εξόρυξη δεδομένων}, editor = {Παπαβασιλείου, Σπυρίδων}, pages = {261-287}, publisher={Εκδόσεις Kallipos, Open Academic Editions}, author={Κύρκος, Ευστάθιος}, chapter = {11. Ανάλυση Συστάδων}, ISBN={978-960-603-109-0}, year={2015}} @misc{study14, author = {Κυριακή Ι. Ιωαννίδου}, title = {Διαχωριστική Ανάλυση και εφαρμογές}, year = {2011}, note = {Προπτ/κή διπλ. εργάσ. Εθνικό Μετσόβιο Πολυτεχνείο Σχολή Εφαρμοσμένων Μαθηματικών και Φυσικών Επιστημών}, url = {https://dspace.lib.ntua.gr/xmlui/bitstream/handle/123456789/5414/\%CE\%B9\%CF\%89\%CE\%B1\%CE\%BD\%CE\%BD\%CE\%B9\%CE\%B4\%CE\%BF\%CF\%85\%CE\%BA_\%CE\%B4\%CE\%B9\%CE\%B1\%CF\%87\%CF\%89\%CF\%81\%CE\%B9\%CF\%83\%CF\%84\%CE\%B9\%CE\%BA\%CE\%AE.pdf?sequence=3}} %study14 is a greek reference @misc{study15, author = {Στρατινάκης, Νικόλαος}, title = {Εφαρμοσμένη Ανάλυση Συστάδων }, year = {2018}, url = {https://dias.library.tuc.gr/view/manf/79057}, note = {Μεταπτ/κή διπλ. εργασ. Πολυτεχνείο Κρήτης Σχολή Μηχανικών Παραγωγής και Διοίκησης Π.Μ.Σ Εφαρμοσμένα Μαθηματικά για μηχανικούς}} %study15 is a greek reference @misc{study16, author = {Καλλιόπη, Παπούλια}, title = {Μέθοδοι Πολυμεταβλητής Ανάλυσης Επιχειρηματικών Δεδομένων}, url ={https://dione.lib.unipi.gr/xmlui/bitstream/handle/unipi/12905/\%CE\%94\%CE\%B9\%CF\%80\%CE\%BB\%CF\%89\%CE\%BC\%CE\%B1\%CF\%84\%CE\%B9\%CE\%BA\%CE\%AE\%20\%CE\%95\%CF\%81\%CE\%B3\%CE\%B1\%CF\%83\%CE\%AF\%CE\%B1\%20\%CE\%A0\%CE\%B1\%CF\%80\%CE\%BF\%CF\%8D\%CE\%BB\%CE\%B9\%CE\%B1\%20\%CE\%9A\%CE\%B1\%CE\%BB\%CE\%BB\%CE\%B9\%CF\%8C\%CF\%80\%CE\%B7-MES18020.pdf?sequence=2&isAllowed=y}, note = {Μεταπτ/κή διπλ. εργασ. Πανεπιστήμιο Πειραιώς Τμήμα Στατιστικής και Ασφαλιστικής Επιστήμης Π.Μ.Σ Εφαρμοσμένη Στατιστική} } %study16 is a greek reference @misc{study17, title = {Our World in Data}, url = {https://github.com/owid}, author = {GitHub}} ``` My .tex file is the following ``` \documentclass[inscr,ack,preface]{dithesis} \usepackage[backend=bibtex,defernumbers=true]{biblatex} \addbibresource{references.bib} %my .bib file is called references.bib %My document % manually include the bibliography \bibliographystyle{plain} %\bibliography{references} % include it also in ToC (do sth on your own) %\addcontentsline{toc}{chapter}{Βιβλιογραφία} \chapter*{\bibname} \addcontentsline{toc}{chapter}{\bibname} \begingroup \let\clearpage\relax % Disable page breaks within this group \printbibliography[type=book, title={Βιβλία}] \printbibliography[type=misc, title={Διαδικτυακή βιβλιογραφία}] \endgroup %\nocite{*} \afterpage{\null\newpage} \end{document} ``` The problem is that I want first the greek references in the "group" with title "Διαδικτυακή βιβλιογραφία" and after the greek references I want to put the english references. You can see in [the picture I attached](https://i.stack.imgur.com/r2IDo.png) that the english references in the "group" with title "Διαδικτυακή βιβλιογραφία" are first and the greek references are second. Do you know how to fix that?
https://tex.stackexchange.com/users/294342
How can I put greek references first and then the english?
false
I found that I should use the `sortkey` argument with the value {A} in the references I want first and the value {B} in the references I want second. I will put the code of .bib file ``` @misc{study1, sortkey = {B}, title={The economic effects of the coronavirus around the world}, url={https://www.weforum.org/agenda/2020/02/coronavirus-economic-effects-global-economy-trade-travel/}, journal={World Economic Forum}, author={Hutt, Rosamond}, year={2020}, month={Feb}} @misc{study2, sortkey = {B}, place={Brussels}, title={The impact of the COVID-19 crisis on poverty and social exclusion in Bulgaria}, institution={ESPN}, author={Bogdanov, George}, year={2020}, note = {\url{https://ec.europa.eu/social/BlobServlet?docId=22934&langId=en}}} @misc{study3, sortkey = {B}, title={The Covid-19 recession in France: The trough is behind us, but let’s stay vigilant}, url={https://cepr.org/voxeu/columns/covid-19-recession-france-trough-behind-us-lets-stay-vigilant}, journal={CEPR}, author={Ferrara, Laurent and Mignon, Valerie}, year={2021}, month={Nov}} @misc{study4, sortkey = {B}, title={Euro area unemployment at 7.3\% EU at 6.5\%}, url={https://ec.europa.eu/eurostat/documents/2995521/10662618/3-01042020-AP-EN.pdf/be3d73ee-6715-824b-2c23-f0512f12bdc6?t=1585657691000}, author={Eurostat}, year={2020}} @misc{study5, sortkey = {B}, title={Online dashboard and data analysis approach for assessing COVID-19 case and death data}, author={Florez, Hector and Singh, Sweta}, journal={F1000Research}, volume={9}, year={2020}, publisher={Faculty of 1000 Ltd}, note ={\url{https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7450472/}}} @misc{study6, sortkey = {B}, title={Euro area unemployment at 7.3\% EU at 6.6\%}, url={https://ec.europa.eu/eurostat/documents/2995521/10294960/3-03062020-AP-EN.pdf/b823ec2b-91af-9b2a-a61c-0d19e30138ef?t=1591123422000}, author={Eurostat}, year={2020}, month={Jun}} @misc{study7, sortkey = {B}, title={Euro area unemployment at 7.9\%}, url={https://ec.europa.eu/eurostat/documents/2995521/10568643/3-01092020-BP-EN.pdf/39668e66-2fd4-4ec0-9fd4-4d7c99306c98?t=1598882965000}, author={Eurostat}, year={2020}, month={Sep}} @misc{study8, sortkey = {B}, title={Assessing the impact of COVID-19 on Africa’s economic development}, author={Gondwe, Grace}, booktitle={United Nations Conference on Trade and Development}, volume={3}, year={2020}, note = {\url{https://unctad.org/system/files/official-document/aldcmisc2020d3_en.pdf}}} @misc{study9, sortkey = {B}, title = {Analyzing COVID-19 pandemic for unequal distribution of tests, identified cases, deaths, and fatality rates in the top 18 countries}, journal = {Diabetes & Metabolic Syndrome: Clinical Research & Reviews}, volume = {14}, number = {5}, pages = {953-961}, year = {2020}, issn = {1871-4021}, doi = {https://doi.org/10.1016/j.dsx.2020.06.051}, url = {https://www.sciencedirect.com/science/article/pii/S1871402120302204}, author = {Shahbaz A. Shams and Abid Haleem and Mohd Javaid}, keywords = {Country-wise analysis, COVID-19, Life expectancy: Pandemic}} @misc{study10, sortkey = {B}, author={Hadley Wickham}, title={Ggplot2 : Elegant Graphics For Data Analysis}, year={2016}, url = {https://ggplot2.tidyverse.org}} @misc{study11, sortkey = {B}, author = {Jim Hester}, title = {readr: Read Rectangular Text Data}, year = {2022}, url = {https://CRAN.R-project.org/package=readr}} @misc{study12, sortkey = {B}, author = {Lionel Henry}, title = {dplyr: A Grammar of Data Manipulation}, year = {2022}, url = {https://CRAN.R-project.org/package=dplyr}} @misc{study13, sortkey = {B}, author = {Ron Ammar}, title = {randomcoloR: Generate Attractive Random Colors}, year = {2019}, url = {https://CRAN.R-project.org/package=randomcoloR}} @book{book1, title={Πολυμεταβλητή Στατιστική Ανάλυση}, ISBN={9603515949}, publisher={Εκδόσεις Σταμούλη}, author={Καρλής, Δημήτρης}, year={2005}} @book{book2, title = {Επιχειρηματική ευφυΐα και εξόρυξη δεδομένων}, editor = {Παπαβασιλείου, Σπυρίδων}, pages = {261-287}, publisher={Εκδόσεις Kallipos, Open Academic Editions}, author={Κύρκος, Ευστάθιος}, chapter = {11. Ανάλυση Συστάδων}, ISBN={978-960-603-109-0}, year={2015}} @misc{study14, sortkey = {A}, author = {Κυριακή Ι. Ιωαννίδου}, title = {Διαχωριστική Ανάλυση και εφαρμογές}, year = {2011}, note = {Προπτ/κή διπλ. εργάσ. Εθνικό Μετσόβιο Πολυτεχνείο Σχολή Εφαρμοσμένων Μαθηματικών και Φυσικών Επιστημών}, url = {https://dspace.lib.ntua.gr/xmlui/bitstream/handle/123456789/5414/\%CE\%B9\%CF\%89\%CE\%B1\%CE\%BD\%CE\%BD\%CE\%B9\%CE\%B4\%CE\%BF\%CF\%85\%CE\%BA_\%CE\%B4\%CE\%B9\%CE\%B1\%CF\%87\%CF\%89\%CF\%81\%CE\%B9\%CF\%83\%CF\%84\%CE\%B9\%CE\%BA\%CE\%AE.pdf?sequence=3}} @misc{study15, sortkey = {A}, author = {Στρατινάκης, Νικόλαος}, title = {Εφαρμοσμένη Ανάλυση Συστάδων }, year = {2018}, url = {https://dias.library.tuc.gr/view/manf/79057}, note = {Μεταπτ/κή διπλ. εργασ. Πολυτεχνείο Κρήτης Σχολή Μηχανικών Παραγωγής και Διοίκησης Π.Μ.Σ Εφαρμοσμένα Μαθηματικά για μηχανικούς}} @misc{study16, sortkey = {A}, author = {Καλλιόπη, Παπούλια}, title = {Μέθοδοι Πολυμεταβλητής Ανάλυσης Επιχειρηματικών Δεδομένων}, year = {2020}, url ={https://dione.lib.unipi.gr/xmlui/bitstream/handle/unipi/12905/\%CE\%94\%CE\%B9\%CF\%80\%CE\%BB\%CF\%89\%CE\%BC\%CE\%B1\%CF\%84\%CE\%B9\%CE\%BA\%CE\%AE\%20\%CE\%95\%CF\%81\%CE\%B3\%CE\%B1\%CF\%83\%CE\%AF\%CE\%B1\%20\%CE\%A0\%CE\%B1\%CF\%80\%CE\%BF\%CF\%8D\%CE\%BB\%CE\%B9\%CE\%B1\%20\%CE\%9A\%CE\%B1\%CE\%BB\%CE\%BB\%CE\%B9\%CF\%8C\%CF\%80\%CE\%B7-MES18020.pdf?sequence=2&isAllowed=y}, note = {Μεταπτ/κή διπλ. εργασ. Πανεπιστήμιο Πειραιώς Τμήμα Στατιστικής και Ασφαλιστικής Επιστήμης Π.Μ.Σ Εφαρμοσμένη Στατιστική}} @misc{study17, sortkey = {B}, title = {Our World in Data}, url = {https://github.com/owid}, author = {GitHub}} ``` Then I compiled multiple times and it worked.
0
https://tex.stackexchange.com/users/294342
690252
320,197
https://tex.stackexchange.com/questions/108693
3
How can I draw with `tikz-cd` 1. two vertical parallel lines 2. two vertical parallel lines pointing in opposite directions?
https://tex.stackexchange.com/users/28756
Vertical parallel lines/arrows
false
The TikZ-CD package/library nowadays come with keys called `shift left` and `shift right`. They accept: 1. no argument, 2. a factor (without units) and 3. a dimension (with units). The key will shift the line orthogonally to the line connecting the original start and end coordinate (usually a point on the border of the nodes) by 1. the default value for `shift left` which is, by default, 0.56ex, 2. said default value multiplied by the given factor or 3. the given length. Nodes along the arrow (called labels by TikZ-CD) will be placed along the new shifted path not the unshifted one. --- The first diagram in the code below shows * two parallel lines without an arrow tip between *A* and *C*, * two parallel forward arrows (between *B* and *D*) where one is drawn from *B* to *D* and one from *D* to *B* (both with `shift left`) and * two parallel arrows drawn from *C* to *B* where one has reversed arrow tips (`leftarrow`). In the second diagram I show how the shifting works: The gray line is the direct connections between the nodes. The thin green line is the unshifted curve whereas the thick green line is the shifted one. The blue dashed line shows the connection between start and end point of the curve, the blue arrows show the shifting direction (orthogonal to the dashed line). Code ---- ``` \documentclass[tikz]{standalone} \usetikzlibrary{cd} \begin{document} \begin{tikzcd} A \ar[d, dash, shift left] \ar[d, dash, shift right] & B \ar[d, shift left]\\ C \ar[u, dash, shift left] \ar[ur, shift left] \ar[ur, shift right, leftarrow] & D \ar[u, shift left] \end{tikzcd} \begin{tikzcd}[ cells={nodes={draw, help lines}}, /tikz/>={Stealth[scale=.5]}, /tikz/c/.style={shape=coordinate, name={#1}}, column sep=tiny, arrows=dash] & A \\ B \ar[ur, help lines] \ar[ur, out=90, in=270, help lines, green, "" {at start, c=A }, "" {at end, c=B }] \ar[ur, out=90, in=270, shift left=3, green, thick, "" {at start, c=A'}, "" {at end, c=B'}] \ar[help lines, from=A, to=B, dashed, blue] \ar[help lines, blue, from=A, to=A', ->] \ar[help lines, blue, from=B, to=B', ->] \end{tikzcd} \end{document} ``` Output ------
0
https://tex.stackexchange.com/users/16595
690255
320,198
https://tex.stackexchange.com/questions/690240
0
In a shell script, I'm doing things like ``` pdflatex <<- EOT \def\something{a} \documentclass{article} \begin{document} \something \end{document} EOT ``` which works as expected. However, when specifying `-interaction=nonstopmode`, latex quits with ``` This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=latex) **entering extended mode LaTeX2e <2023-06-01> patch level 1 L3 programming layer <2023-06-16> ! Emergency stop. <*> \def\something{a} No pages of output. Transcript written on texput.log. ``` The log file is not much enlightening either: ``` This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=latex 2023.6.21) 4 JUL 2023 10:59 entering extended mode %&-line parsing enabled. **\def\something{a} ! Emergency stop. <*> \def\something{a} *** (job aborted, no legal \end found) ``` What am I doing wrong?
https://tex.stackexchange.com/users/27717
passing source to latex on command line
true
`nonstopmode` says don't accept user input from stdin and `<<- EOT` is user input on stdin so it stops with an error as specified. `scrollmode` is perhaps what you are looking for.
3
https://tex.stackexchange.com/users/1090
690259
320,200
https://tex.stackexchange.com/questions/629699
4
During submitting my paper in arxiv as a .zip file, they require the bibliography to be in .bbl format. However, I had prepared my latex using Overleaf that generated a .bib file. I followed [this TeX.SE question](https://tex.stackexchange.com/questions/462314/overleaf-v2-how-to-get-bbl-file) and generated the .zip file for arxiv submission (the answer by @imnothere). Now the .zip that is generated contains both a .bib and a .bbl file and I uploaded the paper in arxiv, but I got the error message that no .tex file is available. I couldn't understand what to do. Should I remove the .bib file from the .zip file? Is there any problem due to the names of the files? Thanks in advance.
https://tex.stackexchange.com/users/232595
Problem with .bib file while submission to arxiv from Overleaf
false
It is explained on the official overleaf website: <https://www.overleaf.com/learn/latex/Questions/The_journal_says_%22don%27t_use_BibTeX%3B_paste_the_contents_of_the_.bbl_file_into_the_.tex_file%22._How_do_I_do_this_on_Overleaf%3F> Downloading files from the cache Files created during compilation are stored in the project’s cache, including any .bbl files. Follow these steps to download a file contained in the cache: click the file icon (Accesslogs.png) beside the Recompile button; scroll down and select Other logs and files; a list of files in the cache is presented; select output.bbl to download it. Downloading the source, including the .bbl file It’s also possible to download the source code with the .bbl included. Use the following steps to do that: select Submit from the menu above the PDF preview window; scroll down to Online Repositories; locate arXiv; select Submit your paper to the arXiv within the pop-up window select Download project ZIP with submission files (e.g. .bbl) extract the .bbl file from the downloaded ZIP file; (see video) comment out the line \bibliography{...} within your .tex file on Overleaf, then paste the contents of the .bbl file.
-1
https://tex.stackexchange.com/users/122617
690264
320,202
https://tex.stackexchange.com/questions/690258
-2
I'm pratically using the multicol-environment with 2 columns and trying to insert a table in-between in a one-page layout (meaning using up the full-page width) and then after start using the multicol-environment again without any page breaks. Is that possible? Would be nice if someone could create a code example :)
https://tex.stackexchange.com/users/300124
Adding graphics in-between a multicol-environment
false
I'm not sure that your question has anything to do with the `multicol` environment. Are you really asking "How do I make a table stretch the full width of the page?" If that is the case, one potential solution is [here](https://tex.stackexchange.com/a/56552/245702) This worked for me. Here is an MWE: ``` \documentclass[letter]{report} \usepackage{multicol} \usepackage{lipsum} \begin{document} \begin{multicols}{2} \lipsum[5] \end{multicols} \setlength\tabcolsep{0pt} \begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} c c c } cell1 & cell2 & cell3 \\ cell4 & cell5 & cell6 \\ cell7 & cell8 & cell9 \end{tabular*} \begin{multicols}{2} \lipsum[5] \end{multicols} \end{document} ``` [full width table between two multicol environments](https://i.stack.imgur.com/zbCjB.png) You did not state which document class you are using, so your results may vary depending on that and other packages you have loaded. I also tried this with the `article` class and it worked.
0
https://tex.stackexchange.com/users/245702
690269
320,205