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/680240 | 3 | I'm trying to put in a LaTeX3 string a text to write later in a file (I also do other processing on that string before writing it, like text replacement, string concatenation…), but this file might **not** be a LaTeX document, but an arbitrary text/code, hence I want to preserve precisely the input, including newlines, spaces, tabulations, and many characters like `_{}$\` like:
```
Hello % This is a comment that should not be removed
I want precisely this spacing, and I want to be allowed to use any text, like 1 + (1*2), héhé,
or:
def mycode(my_variable_with_underscore="hey"): # This is a comment (with a single sharp)
print(my_variable_with_underscore)
or latex macros like $\array{a & b\\c & d}$. And ideally unbalanced {} but I heard it was difficult
(maybe by replacing special tokens like \MYCLOSINGBRACE and \MYOPENINGBRACE in the final string?).
```
For now, I tried to play with `\tl_rescan:nn`, [trying to follow this answer](https://tex.stackexchange.com/questions/619960/use-inside-commands/619983#619983) without much success.
MWE:
```
\documentclass[options]{article}
\ExplSyntaxOn
\iow_new:N \g_my_write
\cs_generate_variant:Nn \iow_now:Nn { NV }
%% Creates a new category table
%% Inspired by https://github.com/latex3/latex3/blob/0b851165c1dba9625f7ab80bb5c4cbd27f3e9af7/l3kernel/l3cctab.dtx
\cctab_const:Nn \c_my_active_cctab
{
\cctab_select:N \c_initex_cctab
\int_set:Nn \tex_endlinechar:D { -1 }
\int_step_inline:nnn { 0 } { 127 }
{ \char_set_catcode_active:n {#1} }
}
\NewDocumentCommand{\myExactWrite}{m}{
\str_new:N \g_my_string
\iow_open:Nn \g_my_write {my-output.txt}
% === Fails: the final string contains \tl_rescan code:
% \str_gset:Nn \g_my_string {\tl_rescan:nn {\cctab_select:N \c_my_active_cctab} { #1 }}
% === Fails: I get errors about missing $
% \def\mygset{\str_gset:Nn}
% \def\mystring{\g_my_string}
% \tl_rescan:nn {\cctab_select:N \c_my_active_cctab} { \mygset \g_my_string {#1} }
% In my code the write might arrives much later, even in another function, hence the use of a string
% === See that the input is not the expected one:
\str_set:Nn \g_my_string {#1}
\iow_now:NV \g_my_write \g_my_string
\iow_close:N \g_my_write
}
\ExplSyntaxOff
\usepackage{verbatim}
\begin{document}
%%% Level 1
\myExactWrite{
Hello % This is a comment that should not be removed
I want precisely this spacing, and I want to be allowed to use any text
}
% %% Level 2
% \myExactWrite{
% Hello % This is a comment that should not be removed
% I want precisely this spacing, and I want to be allowed to use any text, like 1 + (1*2), héhé,
% or:
% def mycode(my_variable_with_underscore="hey"): # This is a comment (with a single sharp)
% print(my_variable_with_underscore)
% or latex macros like $\array{a & b\\c & d}$. And ideally unbalanced {} but I heard it was difficult
% (maybe by replacing special tokens like \MYCLOSINGBRACE and \MYOPENINGBRACE in the final string?).
% }
The content of the file is:
\verbatiminput{my-output.txt}
\end{document}
```
| https://tex.stackexchange.com/users/116348 | Put in a LaTeX3 string the **exact** input string to write in a file | true | Some facts about TeX and LaTeX that should be taken into consideration:
* All programming in TeX actually is based on so-called tokens.
In TeX tokens can be control sequence tokens or explicit character tokens (with properties category and character code).
Tokens can come into being as follows:
+ By having TeX read lines of a .tex-input-file and tokenize them or (in interactive mode) by having TeX read lines typed at the console and tokenize them.
(`\scantokens` can be used for simulating the unexpanded-writing of tokens to file and then loading that file via `\input`.)
+ In the stage of expansion by expanding expandable tokens, e.g., macros or things like `\the*⟨register or parameter⟩*`, etc.
+ With LuaTeX-based TeX-engines by having the Lua-backend push tokens into the token-stream, e.g., via `token.put_next(token.create(...)...)`.A mechanism based on macro-programming in TeX (and thus focussed on tokens!) for exact re-creation of arbitrary portions of .tex-input from tokens that came into being due to tokenizing these portions of .tex-input is not possible because in the stage of processing tokens via macros information about how the tokens processed by the macros came into being is not available. Thus in case these tokens came into being due to having TeX read/pre-process lines of a .tex-file and tokenize them, information on what these lines of .tex-input looked like is not available, either.
Portions of .tex-input can only be re-created if at the time of tokenization it was ensured by adjusting catcode-régime and `\endlinechar`
+ that no character of the source is just dropped during pre-processing and tokenization,
+ that each character of the source only yields a (character-)token from whose properties (character-code) you can deduce the corresponding character in the .tex-input-file,
+ that information about ends of lines/linebreaking is not lost.(No character being dropped during pre-processing is a crucial point because in any case space characters at the right ends of lines of .tex-input are dropped. For more details about pre-processing see below.
Besides this—but these are things which can be handled by adjusting the catcode-régime before tokenization—in case TeX is not gathering the first character of the name of a control sequence token,
+ characters of category code 9 are dropped.
+ characters of category code 10(space) are dropped if TeX's reading-apparatus is in state S(skipping blanks) or N(new line).
(The latter is the reason why under normal catcode-régime you
can use space-characters and horizontal-tab-characters, which
in normal catcode-régime have category code 10, for indenting
your code.)
+ characters of category code 10(space) in case the reading-apparatus is in state M (middle of line) are tokenized as explicit space tokens, i.e., as explicit character tokens of category 10(space) and character code 32. In case a character has category code 10(space), the resulting character token has character code 32 no matter what number the codepoint in TeX's internal character encoding scheme the character in question has.
+ what token comes into being when tokenizing a character of category 5(end of line) depends on the state of the reading-apparatus.
+ characters on the same line following a character of category code 5(end of line) are dropped.
+ characters of category 14(comment) and subsequent characters on the same line are dropped.
+ TeX does not like to encounter characters of category code 15 (invalid).
... )
* The result of (unexpanded) writing a control sequence token depends on the value of the integer-parameter `\escapechar`. This is also the case when applying `\string`, `\detokenize`, `\scantokens`, `\meaning`, `\show`.
* When (unexpanded) writing a control-word-token, TeX appends a space-character. Even if in the .tex-input-file there was no space.
E.g., under normal catcode-regime the input `\TeX\TeX` is tokenized as two control-word-tokens `\TeX`. Unexpanded-writing them yields the character-sequence `\TeX␣\TeX␣`— ␣ denotes a space-character. TeX does not append a space-character when (unexpanded) writing a control-symbol-token. This also applies with `\scantokens` and `\detokenize`.
* Explicit space-*tokens* (explicit character tokens of category 10(space) and character code 32) are dropped while gathering the first token of an undelimited macro argument.
* Hashes, i.e., explicit character tokens of category 6(parameter) are doubled when they get written to text file or screen. This also applies with `\scantokens` and `\detokenize`.
* When LaTeX reads a line of .tex-input, some pre-processing takes place before tokenizing :
1. The characters are converted from the computer-platform's character representation scheme to TeX's internal character representation scheme which with traditional TeX engines is ASCII and which with LuaTeX-based and XeTeX-based TeX-engines is unicode whereof ASCII is a strict subset.
2. **All space characters (and with TeX-implementations based on some Web2C-releases also all horizontal-tab-characters) at the right end of the line are removed. There is no way of getting around that removal of spaces at line-ends, not even with switching to verbatim-mode.** (Switching to verbatim-mode implies temporarily changing the catcode-régime which in turn affects tokenizing which in turn takes place *after* the line of .tex-input is pre-processed.)
3. **A character is appended at the right end of the line whose codepoint in TeX's internal character representation scheme equals the value of the integer parameter `\endlinechar`.**
If `\endlinechar` has a value outside the range of codepoints available in the the TeX-engine's internal character representation scheme, then no character is appended at the right end of the line.
Usually the value of `\endlinechar` is 13 which denotes the carriage-return-character. Usually the category code of the carriage-return-character is 5 (end of line) which means that TeX behaves as follows when encountering it during tokenization:
If TeX is gathering the first character of the name of a control sequence token, TeX will insert into the token stream a control-symbol-token whose name is formed by the carriage-return-character, so-to-say a "control-return".
If TeX is not gathering the first character of the name of a control sequence token, TeX drops the remaining characters of the line and in case the reading-apparatus is in state S (skipping blanks) does not append any token to the token-stream, in case the reading apparatus is in state M (middle of line) does append a space token (character code 32, category 10(space)) to the token-stream, in case the reading apparatus is in state N (new line) does append the control-word-token `\par` to the token-stream no matter what the current meaning of `\par` is.
That's why an empty line usually yields `\par`: Like any line the empty line gets the endline-character appended, which usually is the carriage-return-character. When encountering that carriage-return-character, no other token has been produced from characters of that line, thus the state of the reading-apparatus is in state N while encountering a character of category 5 (end of line). Ergo does TeX append the control-word-token `\par` to the token-stream.
* When TeX writes character-tokens to file, depending on the underlying TeX-engine in use (traditional (pdf)TeX/XeTeX/LuaTeX) and depending on the settings for character-translation (those .tcx-files where you can specify what characters to write in `^^`-notation) character-translation takes place so that with some TeX-engines the carriage-return-character, which is considered somewhat special, is written in `^^`-notation as `^^M` and with other engines the carriage return character is written as the corresponding ASCII-byte/utf8-byte-sequence.
* When TeX writes tokens to file or screen, explicit character tokens whose character code equals the number of the integer-parameter `\newlinechar` are not written but are taken for directives for continuing writing at the begin of another line. Usually `\newlinechar` has the value 10 which denotes the line-feed-character (codepoint 10 both in ASCII and in unicode; `^^J` in `^^` notation; `J` is the 10th letter in the latin alphabet).
* When LaTeX switches to verbatim-catcode-régime, also with `+v`-argument-type, the category-code of the horizontal-tab-character (codepoint 9 in ASCII and in unicode, `\^^I` in TeX's `^^`-notation while I is the 9th letter in the latin alphabet) is left unchanged. I.e., in verbatim-catcode-régime the category code of the horizontal-tab-character is 10(space) which in turn implies that in verbatim-catcode-régime horizontal-tab-characters are tokenized as explicit space tokens (character code 32, category 10(space)) which in turn implies that they are not written as horizontal-tab-characters but are written as space-characters. This can be resolved by switching the category-code of the horizontal-tab-character to 12(other) when having stuff tokenized under verbatim-catcode-régime for writing to external text file.
* When LaTeX switches to verbatim-catcode-régime, the carriage-return-character gets category code 12(other) so that in verbatim-mode carriage-return-characters appended to lines of .tex-input due to the `\endlinechar`-mechanism get tokenized as ordinary character tokens of category 12(other).
When it comes to writing such ordinary return-character-tokens, depending on the engine in use and the character-translation in effect, they might be written either in `^^`-notation as `^^M` or as the corresponding ASCII-byte/utf8-byte-sequence.
* Usually the carriage-return-character within the set of characters that forms a pre-processed line of TeX-input only occurs at the right end, due to the `\endlinechar`-mechanism. **Therefore you can circumvent the need of writing carriage-return-characters completely by saying `\newlinechar=\endlinechar`/`\tex_newlinechar:D=\tex_endlinechar:D` when it comes to writing.** This in turn implies that you need to know the moment in time when it comes to writing, which is easy when writing takes place immediately/in terms of `\immediate`/`\tex_immediate:D`, but which is not that easy when writing is delayed until the output-routine ships out another page.
But this way at writing-time carriage-return-characters are not written explicitly (be it as ASCII-bytes/utf-8-byte-sequences or in `^^`-notation) but they just signal that writing shall be continued at the begin of another line. This way they trigger whatsoever platform-specific action needs to be triggered with your TeX-installation on the computer-platform in use for continuing writing at the begin of another line.
**[As projectmbc pointed out](https://tex.stackexchange.com/questions/680240/put-in-a-latex3-string-the-exact-input-string-to-write-in-a-file/680449?noredirect=1#comment1688239_680355), instead of saying `\newlinechar=\endlinechar`/`\tex_newlinechar:D=\tex_endlinechar:D`, you may consider replacing in the string all `^^M`-characters by `^^J`-characters** as this will also ensure preservation of proper line-breaking when it comes to writing the string to file—s.th. along the lines of `\str_replace_all:Nxx \g_my_string { \iow_char:N \^^M } { \iow_char:N \^^J }` before it comes to writing via some variant of `\iow_now:Nn`. **I suppose that is a better approach because replacing can be done at any time so that this technique can also be used when it is about delayed-writing.**
* A problem with expl3's `\iow_now:Nn` and variants is that these commands internally via `\int_set:Nn` ensure that at writing-time `\newlinechar` denotes the line-feed-character. This makes it hard to have `\newlinechar=\endlinechar` at writing-time. You could temporarily neutralize `\int_set:Nn` by redefining it as a macro which just gobbles its arguments, but that would be an ugly hack. I suggest resorting to TeX-primitives `\tex_immediate:D \tex_write:D` instead.
This is what I might probably do if it must be expl3:
```
\documentclass{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Some margin-adjustments so that the verbatim input fits on the page:
% These adjustments are sloppy and only for this example.
% E.g., parameters for \marginpar are not adjusted as \marginpar
% is not used with this example.
\oddsidemargin=1cm
\textwidth=\paperwidth
\advance\textwidth-2\oddsidemargin
\advance\oddsidemargin-1in
\evensidemargin=\oddsidemargin
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ExplSyntaxOn
\iow_new:N \g_my_write
\str_new:N \g_my_string
\NewDocumentCommand{\myExactWrite}{}{
\group_begin:
% +v-type-argument/verbatim-mode does not do this, so let's
% turn horizontal tab from space to other and then fetch
% the +v-argument by calling another macro. (Otherwise
% horizontal-tabs will be written as space characters.)
\char_set_catcode_other:N \^^I
%
\tex_newlinechar:D=\tex_endlinechar:D
% projectmbc suggested replacing all ^^M by ^^J instead.
% I think that would be a better approach because this can also
% be done in combination with delayed-writing.
\iow_open:Nn \g_my_write {my-output.txt}
\myInnerExactWrite
}
\NewDocumentCommand{\myInnerExactWrite}{+v}{
\str_set:Nn \g_my_string {#1}
%\str_show:N \g_my_string
\exp_args:NnV \use:n {\tex_immediate:D \tex_write:D \g_my_write} \g_my_string
\group_end:
\iow_close:N \g_my_write
}
\ExplSyntaxOff
\usepackage{verbatim}
\begin{document}
%%% Level 1
\myExactWrite{
Hello % This is a comment that should not be removed
I want precisely this spacing, and I want to be allowed to use any text
}
% %% Level 2
\myExactWrite{
Hello % This is a comment that should not be removed
I want precisely this spacing, and I want to be allowed to use any text, like 1 + (1*2), héhé,
or:
def mycode(my_variable_with_underscore="hey"): # This is a comment (with a single sharp)
print(my_variable_with_underscore)
or latex macros like $\array{a & b\\c & d}$. And ideally unbalanced {} but I heard it was difficult
(maybe by replacing special tokens like \MYCLOSINGBRACE and \MYOPENINGBRACE in the final string?).
}
\noindent
The content of the file is:
\verbatiminput{my-output.txt}
\end{document}
```
Be aware:
| 2 | https://tex.stackexchange.com/users/118714 | 680449 | 315,708 |
https://tex.stackexchange.com/questions/680424 | 1 | I am trying to use the AMS Euler fonts in my plain XeTeX document, and by taking inspiration from various sources online (including Knuth's macros for *Concrete Mathematics*), I thought the following would work
```
\font\teneurm=eurm10
\textfont0=\teneurm
$a$
\bye
```
(Of course there are more sizes and families to define, but this is a MNWE)
What did I do wrong?
| https://tex.stackexchange.com/users/nan | Set AMS Euler as the default maths font (XeTeX) | true | In order to change the look of `a` in math mode, it is necessary to change family 1 of fonts (`\textfont1`, `\scriptfont1`, and `\scriptscriptfont1`). To understand why this is, it's necessary to understand how TeX knows how to correctly typeset a character in math mode. Compared to text mode, there are far more fonts in use within math mode. So while in text mode it is (usually) sufficient to simply look at the character in the current font at a specific location, this is not the case for math mode.
Instead TeX utilizes the mathcode of the character, which you can access with, for example, `\the\mathcode`\a`, which prints `29025`. Converting this into hex you get `7161`. To unpack a mathcode:
* The first number (in the hexadecimal representation) is called the *class*. The class of a character dictates the spacing rules for it.
* The next number is the *family*, this is the font family where the character is stored.
* The next two numbers is the location of the character within the font.
In this case, where family=1 and location=61, we can see that when looking at the font table for `cmmi10` (`\textfont1`):
At place `0x61` is the italic `a` character.
So in order to change the font used for the `a` character, you must change font family 1.
---
---
That answers the question about changing the font of a character in math, but I didn't really explain what the class of a character means. This isn't really important to know for your question, but it is useful in general.
There are 8 classes (which a character can be):
0. Ordinary: these are characters like `/`.
1. Large Operator: these are characters like `\sum` and `\int`, they are special in that they are vertically centered and have limits (material which goes above and below them).
2. Binary Operation: these are characters like `+`.
3. Relations: these are characters like `=`.
4. Opening: these are characters like `(`.
5. Closing: these are characters like `)`.
6. Punctuation: these are characters like `,`.
7. Variable: these are mainly letters and numbers.
(There is one more type of class, but it can't be in the value of a `\mathcode`: the Inner Formula class. These are usually generated by `\left...\right` constructs.)
While the main use of these classes is for spacing, some classes have special properties as well, specifically the Big Operator (1) and Variable (7) classes. Big operators are vertically centered and have *limits* (material which goes above and below them), this is why you can do `\sum_{n=1}^\infty` and get `n=1` below and `\infty` above the `\sum`.
But `a` is of the Variable class. The Variable class has no special spacing rules, the rules for an Ordinary class are used; it is almost identical to the Ordinary class except for in one important respect. The family used by a Variable character is dictated by a register `\fam`, when `\fam` is a valid family (between 0 and 15), the family used is `\fam` instead of whatever is specified in the `\mathcode` of the character. This is what allows for changing fonts in math mode without changing the values of `\textfont` and friends. For example, since family 0 is the family of roman fonts, plain TeX defines `\rm` like
```
\def\rm{\fam\z@\tenrm}
```
ie. it both sets `\fam` to 0 (`\z@` is a register which is always zero) and also changes the current font to `cmr10`. Changing `\fam` in text mode doesn't change anything (TeX also automatically sets `\fam` to -1 when math mode is entered, so this really has no effect), and `\tenrm` has no effect in math mode. So both of these are necessary in order for `\rm` to work both in text mode and math mode.
Further information can be found in the TeXbook (like the exact spacing rules used, and how TeX typesets other special characters in math mode like delimiters and accents).
| 1 | https://tex.stackexchange.com/users/287149 | 680450 | 315,709 |
https://tex.stackexchange.com/questions/680346 | 0 | I use pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex)
I put `\label` on sections, figures, etc.
I include `\usepackage[colorlinks=true,urlcolor=blue]{hyperref}`
I had been using texlive 2016. Until I installed texlive 2022, \ref{xyz} produced only the number for xyz.
Now it includes the number, the title (section name, figure caption, ...) what it is (section, figure, ...) and then the number again.
For example, with an equation having \label{Flow}, when I wrote "Equation (\ref{Flow})" I used to get "Equation (2)". Now I get "Equation (2Flowequation.3.2)"
This occurs both using \documentclass{article} and a proprietary class for a professional journal. I haven't tried others.
I've "compiled" in a fresh directory, so it's not due to confusion caused by an old .aux file.
Without including hyperref, I get only the number -- but of course no hyperlink.
Is there a repair for this?
=================================================================
In response to Carlisle's request for an example.
```
\documentclass[10pt]{article}
\usepackage[colorlinks=true,urlcolor=blue]{hyperref}
\begin{document}
as shown by Equation (\ref{Drag}) in section \ref{Flow}.
\section{Flow}\label{Flow}
Equating the drag force on a particle to the force of gravity determines
the velocity at which particles are suspended in equilibrium with upward
fluid flow:
\begin{equation}\label{Drag}
F_d = \frac12\, C_d\, \rho_s\, U_t^2\, \pi\, \frac{d_f^2}4
= F_g = \frac{4\pi}3\, \frac{d_f^3}8\, \rho_f \, g
\end{equation}
\end{document}
```
| https://tex.stackexchange.com/users/168286 | \ref{xyz} with \usepackage{hyperref} not working correctly | false | I made an experiment and copied an older version of `nameref.sty` in the same directory as the example file.
With `nameref` 2021-04-02 v2.47 and `hyperref` 2023-02-07 v7.00v the output is
The `nameref` package is automatically loaded by `hyperref` and it should be in a version compatible with the latter: their updates are coordinated. Having a copy of `nameref.sty` in the local tree is the cause of your problem. Remove it and rerun `mktexlsr`, so the 2022-05-17 v2.50 version will be used (if you have updated your TeX distribution).
In general, having in the local tree something that's also in the main tree is not recommended.
For personal preference, here's the fixed output from
```
\documentclass[10pt]{article}
\usepackage[colorlinks=true,urlcolor=blue]{hyperref}
\begin{document}
as shown by Equation (\ref{Drag}) in section \ref{Flow}.
\section{Flow}\label{Flow}
Equating the drag force on a particle to the force of gravity determines
the velocity at which particles are suspended in equilibrium with upward
fluid flow:
\begin{equation}\label{Drag}
F_d = \frac12 C_d \rho_s U_t^2 \pi \frac{d_f^2}4
= F_g = \frac{4\pi}3 \frac{d_f^3}8 \rho_f g
\end{equation}
\end{document}
```
No `\,` and no blank line before the displayed equation.
| 1 | https://tex.stackexchange.com/users/4427 | 680466 | 315,712 |
https://tex.stackexchange.com/questions/680468 | 0 | I am trying to create a timeline that shows when a policy was implemented in certain states. I am a novice to using tikzpicture. My sample period is 2000 - 2023. With the policy treatment starting in 2003 - 2016 with staggered treament. Is there a way to get the years above the line and the color of the line changed to blue during the staggered policy treatment?
The code I have generated places everything below the line.
```
\begin{frame}
\begin{figure}
\begin{tikzpicture}[x=1.5cm,nodes={text width=1.0cm,align=left}]
\draw[black,->,thick,>=latex,line cap=rect]
(0,0) -- (10,0);
\foreach \Text [count=\Xc starting from 0] in
{{2000.},%
{2001.},%
{2002.},%
{2003. Louisiana. Vermont. Arkansas.},%
{2004. Nebraska.},
{2006. Ohio},
{2007. New Hampshire.},
{2008. Michigan.},
{2010. New York.},
{2012. Florida.},
{2015. New Mexico.},
{2016. Colorado.},
{2018.},
{2019.},
{2021.}}
{\fill (\Xc,0) circle[radius=1.5pt];
\node[below=0.2ex] at (\Xc,0) {\Text};}
\end{tikzpicture}
\end{figure}
\end{frame}
```
| https://tex.stackexchange.com/users/286676 | Tikz Timeline for Staggered Treatment Help | true | You could split your list into a component for the year and one for the text:
```
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
\begin{figure}
\begin{tikzpicture}[x=1.5cm,nodes={text width=1.0cm,align=left},scale=0.45,transform shape]
\draw[black,->,thick,>=latex,line cap=rect]
(0,0) -- (15,0);
\draw[blue,ultra thick,>=latex,line cap=rect]
(3,0) -- (11,0);
\foreach \yr/\Text [count=\Xc starting from 0] in
{{2000/},%
{2001/},%
{2002/},%
{2003/Louisiana Vermont Arkansas},%
{2004/Nebraska},
{2006/Ohio},
{2007/New Hampshire},
{2008/Michigan},
{2010/New York},
{2012/Florida},
{2015/New Mexico},
{2016/Colorado},
{2018/},
{2019/},
{2021/}}
{
\fill (\Xc,0) circle[radius=1.5pt];
\node[above=0.2ex] at (\Xc,0) {\yr};
\node[below=0.2ex,text width=1cm,align=center] at (\Xc,0) {\Text};
}
\end{tikzpicture}
\end{figure}
\end{frame}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/36296 | 680469 | 315,714 |
https://tex.stackexchange.com/questions/680453 | 0 | I was trying to write an equation for equilibrium constant `K`, but I cannot put `Fe(SCN)^2` in the fraction for some reasons. This is what my code was.
```
K=\frac{\ce{[Fe(SCN)^2+]}}{\ce{[Fe^3+][SCN^-]}}
```
| https://tex.stackexchange.com/users/293485 | Chemical Formulae in fraction | false | the \ce command can be used in math mode
```
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage[version=4]{mhchem}
\begin{document}
\[
K=\frac{\ce{[Fe(SCN)^2+]}}{\ce{[Fe^3+][SCN^-]}}
\]
\end{document}
```
| 1 | https://tex.stackexchange.com/users/134993 | 680470 | 315,715 |
https://tex.stackexchange.com/questions/680464 | 3 | Is there a command like `\intertext` or `\shortintertext` that has different vertical space above and below the "intertext"? It would be nice in situations such as a few of those in the example below.
```
\documentclass{article}
\usepackage{amsmath,mathtools}
\begin{document}
\begin{align*}
a^2 + b^2 &= c^2 \\
\shortintertext{and also} % shortintertext works fine
a^2 + b^2 &= c^2 \\
\shortintertext{and also} % space above should be as shortintertext and space below should be as intertext
\sum_{i = 1}^{N} \sum_{j = 1}^{N} \frac{\omega_{i} \omega_{j} Y_{i}}{Y} \!\left(2 \Phi\!\left[\frac{\ln Y_{i} - \ln Y_{j} + 0.5 \sigma_{i}^{2} + 0.5 \sigma_{j}^{2}}{\sqrt{\sigma_{i}^{2} + \sigma_{j}^{2}}}\right]\! - 1\right) &= 0.5 \\
\intertext{and also} % intertext works fine
\sum_{i = 1}^{N} \sum_{j = 1}^{N} \frac{\omega_{i} \omega_{j} Y_{i}}{Y} \!\left(2 \Phi\!\left[\frac{\ln Y_{i} - \ln Y_{j} + 0.5 \sigma_{i}^{2} + 0.5 \sigma_{j}^{2}}{\sqrt{\sigma_{i}^{2} + \sigma_{j}^{2}}}\right]\! - 1\right) &= 0.5 \\
\shortintertext{and also} % space above should be as intertext and space below should be as shortintertext
a^2 &= c^2 - b^2 \\
\end{align*}
\end{document}
```
| https://tex.stackexchange.com/users/71332 | Different space above and below mathtools \intertext | true | You can manually add height or depth.
```
\documentclass{article}
\usepackage{amsmath,mathtools}
\usepackage{mleftright} % https://www.ctan.org/pkg/mleftright
\mleftright
\newcommand{\addheight}[1]{\rule{0pt}{\dimexpr\ht\strutbox+#1}}
\newcommand{\adddepth}[1]{\rule[-#1]{0pt}{0pt}}
\begin{document}
\begin{align*}
a^2 + b^2 &= c^2 \\
\shortintertext{and also} % shortintertext works fine
a^2 + b^2 &= c^2 \\
\shortintertext{and also\adddepth{1.5ex}} % space above should be as shortintertext and space below should be as intertext
\sum_{i = 1}^{N} \sum_{j = 1}^{N} \frac{\omega_{i} \omega_{j} Y_{i}}{Y} \left(2 \Phi\left[\frac{\ln Y_{i} - \ln Y_{j} + 0.5 \sigma_{i}^{2} + 0.5 \sigma_{j}^{2}}{\sqrt{\sigma_{i}^{2} + \sigma_{j}^{2}}}\right] - 1\right) &= 0.5 \\
\intertext{and also} % intertext works fine
\sum_{i = 1}^{N} \sum_{j = 1}^{N} \frac{\omega_{i} \omega_{j} Y_{i}}{Y} \left(2 \Phi\left[\frac{\ln Y_{i} - \ln Y_{j} + 0.5 \sigma_{i}^{2} + 0.5 \sigma_{j}^{2}}{\sqrt{\sigma_{i}^{2} + \sigma_{j}^{2}}}\right] - 1\right) &= 0.5 \\
\shortintertext{and also\addheight{1.5ex}} % space above should be as intertext and space below should be as shortintertext
a^2 &= c^2 - b^2
\end{align*}
\end{document}
```
I incorporated Mico's suggestion about `mleftright`.
| 6 | https://tex.stackexchange.com/users/4427 | 680472 | 315,716 |
https://tex.stackexchange.com/questions/680471 | 4 | I'm writing a document class that uses the `datetime2` package to write a month-year date in the title of the document. Here is a MWE:
```
\begin{filecontents}[overwrite]{customclass.cls}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{customclass}[2014/12/16 Custom class]
\LoadClassWithOptions{article}
\RequirePackage{babel}
\RequirePackage[useregional]{datetime2}
\DTMlangsetup*{showdayofmonth=false}
\renewcommand{\maketitle}[0]{\today}
\end{filecontents}
\documentclass[<language>]{customclass}
\begin{document}
\maketitle
\end{document}
```
I have run into the problem that many languages don't capitalize month names, whereas the desired behavior would be to capitalize them since it is a title (e.g. "Marzo de 2022" instead of "marzo de 2022").
I have tried using `\expandafter\MakeUppercase` and also the `mfirstuc` package as explained [here](https://tex.stackexchange.com/questions/362129/capitalize-first-letter-of-a-defined-variable), but none of those work (I assume it's because the `\today` command is pretty complex so it's not easy to expand?). I also cannot hard-code month names because I expect this class to work independently of language, and because I regularly use four languages to typeset documents (French, Italian, Spanish and English, three of which display this issue).
I would love a bit of help with this!
| https://tex.stackexchange.com/users/293490 | Capitalizing first character of \today independently of the language | true | By creating a new style (e.g. `mydate`) which display month date with a capital (with `\DTMMonthname`) you obtain you target. We need also the package **datetime-calc** which convert the numeric value of the current month date to the month in letters.
In `\DTMdisplaydate`, the second parameter is the number of the month (3 for March), and the first is the year.
**Edit:** Bug fix provided because in italian language, the **datetime2** package don't provide uppercased month names.
**Edit 2:** I have also managed the spanish case, replacing the "Month Year" output by "Month de Year" (e.g. Marzo de 2023).
```
\begin{filecontents}[overwrite]{customclass.cls}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{customclass}[2014/12/16 Custom class]
\LoadClassWithOptions{article}
\RequirePackage{babel}
\RequirePackage{datetime2}
\RequirePackage{datetime2-calc}
%% Correction of a bug: in italian, Uppercase months are missing in datetime2
\newcommand*{\DTMitalianMonthname}[1]{%
\ifcase#1
\or
Gennaio%
\or
Febbraio%
\or
Marzo%
\or
Aprile%
\or
Maggio%
\or
Giugno%
\or
Luglio%
\or
Agosto%
\or
Settembre%
\or
Ottobre%
\or
Novembre%
\or
Dicembre%
\fi
}
%% End of bug correction
\DTMnewdatestyle{mydate}{%
\renewcommand*{\DTMdisplaydate}[4]{%
\DTMMonthname{##2} \iflanguage{spanish}{de }{}##1%
}}
\DTMsetdatestyle{mydate}
\renewcommand{\maketitle}{\today}
\end{filecontents}
\documentclass[french]{customclass}
\begin{document}
\maketitle
\end{document}
```
With `\documentclass[spanish]{customclass}`:
With `\documentclass[english]{customclass}`:
| 4 | https://tex.stackexchange.com/users/132405 | 680473 | 315,717 |
https://tex.stackexchange.com/questions/680420 | 1 | I am making plots in Python and then export them to LaTeX using `tikzplotlib` library. The problem is that `tikzplotlib` converts pairs with (at least one) `NaN` value to `-- --` as shown below
```
\addplot [draw=black, forget plot, mark=o, only marks]
table{%
x y
1.75 -3.2
2 -3.2
2.25 -3
2.5 -2.9
-- --
-- --
};
```
LaTeX responds by issuing the error
```
! Package PGF Math Error: Could not parse input '--' as a floating point number, sorry. The unreadable part was near '-'..
```
Is it possible to teach `pgfplots` to ignore `--` as `NaN`? Or maybe teach `tikzplotlib` to export `NaN`s as `NaN`?
| https://tex.stackexchange.com/users/3450 | How to parse NaNs from tikzplotlib | false | Not an answer, but a MWE for anyone who wants to experiment.
```
\begin{filecontents}{table.dat}
x y
1.75 -3.2
2 -3.2
2.25 -3
2.5 -2.9
-- --
-- --
\end{filecontents}
\documentclass{article}
\usepackage{pgfplotstable}
\usepackage{pgfplots}
\begin{document}
\pgfplotstabletypeset[string replace={--}{}]{table.dat}% works as expected
\pgfplotstableread[string type, string replace={--}{}]{table.dat}\mytable
\pgfplotstabletypeset{\mytable}
\begin{tikzpicture}
\begin{axis}
\addplot [draw=black, forget plot, mark=o, only marks]
table{\mytable};
\end{axis}
\end{tikzpicture}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/34505 | 680476 | 315,718 |
https://tex.stackexchange.com/questions/680475 | 0 |
```
\documentclass[20pt, reqno]{amsart}
\usepackage[margin=1in]{geometry}
\geometry{letterpaper}
%\geometry{landscape} % Activate for for rotated page geometry
\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{amsfonts, amscd, amssymb, amsthm, amsmath}
\usepackage{pdfsync} %leaves makers for tex searching
\usepackage{enumerate}
\usepackage[pdftex,bookmarks]{hyperref}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage[mathscr]{euscript}
%%% Theorems %%%---------------------------------------------------------
\doublespacing
%%% Environments %%%---------------------------------------------------------
\newenvironment{ans}{\medskip \paragraph*{\emph{Answer}.}}{\hfill \break $~\!\!$ \dotfill \medskip }
\newenvironment{sketch}{\medskip \paragraph*{\emph{Proof sketch}.}}{ \medskip }
\newenvironment{summary}{\medskip \paragraph*{\emph{Summary}.}}{ \hfill \break \rule{1.5cm}{0.4pt} \medskip }
\newcommand\Ans[1]{\hfill \emph{Answer:} {#1}}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{color}
\newcommand{\NOTE}[1]{{\color{blue}#1}}
\newcommand{\MOVED}[1]{{\color{gray}#1}}
%%% Alphabets %%%---------------------------------------------------------
%%% Some shortcuts for my commonly used special alphabets and characters.
\def\cA{\mathcal{A}}\def\cB{\mathcal{B}}\def\cC{\mathcal{C}}\def\cD{\mathcal{D}}\def\cE{\mathcal{E}}\def\cF{\mathcal{F}}\def\cG{\mathcal{G}}\def\cH{\mathcal{H}}\def\cI{\mathcal{I}}\def\cJ{\mathcal{J}}\def\cK{\mathcal{K}}\def\cL{\mathcal{L}}\def\cM{\mathcal{M}}\def\cN{\mathcal{N}}\def\cO{\mathcal{O}}\def\cP{\mathcal{P}}\def\cQ{\mathcal{Q}}\def\cR{\mathcal{R}}\def\cS{\mathcal{S}}\def\cT{\mathcal{T}}\def\cU{\mathcal{U}}\def\cV{\mathcal{V}}\def\cW{\mathcal{W}}\def\cX{\mathcal{X}}\def\cY{\mathcal{Y}}\def\cZ{\mathcal{Z}}
\def\AA{\mathbb{A}} \def\BB{\mathbb{B}} \def\CC{\mathbb{C}} \def\DD{\mathbb{D}} \def\EE{\mathbb{E}} \def\FF{\mathbb{F}} \def\GG{\mathbb{G}} \def\HH{\mathbb{H}} \def\II{\mathbb{I}} \def\JJ{\mathbb{J}} \def\KK{\mathbb{K}} \def\LL{\mathbb{L}} \def\MM{\mathbb{M}} \def\NN{\mathbb{N}} \def\OO{\mathbb{O}} \def\PP{\mathbb{P}} \def\QQ{\mathbb{Q}} \def\RR{\mathbb{R}} \def\SS{\mathbb{S}} \def\TT{\mathbb{T}} \def\UU{\mathbb{U}} \def\VV{\mathbb{V}} \def\WW{\mathbb{W}} \def\XX{\mathbb{X}} \def\YY{\mathbb{Y}} \def\ZZ{\mathbb{Z}}
\def\fa{\mathfrak{a}} \def\fb{\mathfrak{b}} \def\fc{\mathfrak{c}} \def\fd{\mathfrak{d}} \def\fe{\mathfrak{e}} \def\ff{\mathfrak{f}} \def\fg{\mathfrak{g}} \def\fh{\mathfrak{h}} \def\fj{\mathfrak{j}} \def\fk{\mathfrak{k}} \def\fl{\mathfrak{l}} \def\fm{\mathfrak{m}} \def\fn{\mathfrak{n}} \def\fo{\mathfrak{o}} \def\fp{\mathfrak{p}} \def\fq{\mathfrak{q}} \def\fr{\mathfrak{r}} \def\fs{\mathfrak{s}} \def\ft{\mathfrak{t}} \def\fu{\mathfrak{u}} \def\fv{\mathfrak{v}} \def\fw{\mathfrak{w}} \def\fx{\mathfrak{x}} \def\fy{\mathfrak{y}} \def\fz{\mathfrak{z}}
\def\fgl{\mathfrak{gl}} \def\fsl{\mathfrak{sl}} \def\fso{\mathfrak{so}} \def\fsp{\mathfrak{sp}}
\def\GL{\mathrm{GL}} \def\SL{\mathrm{SL}} \def\SP{\mathrm{SL}}
\def\<{\langle} \def\>{\rangle}
\usepackage{mathabx}
\def\acts{\lefttorightarrow}
\def\ad{\mathrm{ad}}
\def\Aut{\mathrm{Aut}}
\def\Ann{\mathrm{Ann}}
\def\dim{\mathrm{dim}}
\def\End{\mathrm{End}}
\def\ev{\mathrm{ev}}
\def\half{\hbox{$\frac12$}}
\def\Hom{\mathrm{Hom}}
\def\id{\mathrm{id}}
\def\sgn{\mathrm{sgn}}
\def\Tor{\mathrm{Tor}}
\def\tr{\mathrm{tr}}
\def\vep{\varepsilon}
\def\f{\varphi}
\pgfplotsset{compat = newest}
\title{Practice problem Set for Midterm II part 1}
\begin{document}
\maketitle
\begin{enumerate}[Q1]
\item Solve the linear system using whatever method you like
\begin{equation}
\left\{
\begin{aligned}
x-4y=4 \nonumber
\\3x+2y=7 \nonumber
\end{aligned} \right
\end{equation}
\item
\end{enumerate}
\end{document}
```
The errors I am getting is unclosed \begin{equation} found at \end{enumerate}
But I ended the equation.
| https://tex.stackexchange.com/users/245438 | Errors in latex I cant figure out why | true | * Please, always provide MWE (Minimal Working Example) which reproduce your problem. Most of preamble code is irrelevant to it.
* Your problem is solved by @slurp comment
* So, here is added some off-topic suggestions, how to simplify writing your equation. You may find them helpful:
+ aligned environment expect ampersands, to which equations are aligned
+ instead of `\nonumbers˛at each equation you rathe use` [ ... ]`or`\begin{equation\*} ... \end{equation\*}`
```
\documentclass[20pt, reqno]{amsart}
\usepackage[letterpaper,
margin=1in]{geometry}
\usepackage{amsmath, amscd, amssymb, amsthm,}% amsfonts is loaded by amssymb
\usepackage{enumerate}
\begin{document}
\begin{enumerate}[Q1]
\item Solve the linear system using whatever method you like
\[ % or \begin{equation*} ... \end{equation*}
\left\{
\begin{aligned}
x-4y & = 4 \\
3x+2y & = 7
\end{aligned} \right.
\]
\item \dots
\end{enumerate}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/18189 | 680480 | 315,719 |
https://tex.stackexchange.com/questions/102687 | 13 | Does anyone happen to know how to typeset the special L character found, for example, in eq. 2.41 in this paper: <http://arxiv.org/pdf/1107.5792v2.pdf> that is being used for the Lie derivative? Thanks for the help!
| https://tex.stackexchange.com/users/24592 | Special L for Lie Derivative | false | `\usepackage{amssymb}` gives you a variety of stylized symbols such as `mathcal`, `mathfrak`, and so on. You can get the standard Lie derivative symbol (like [this](https://en.wikipedia.org/wiki/Lie_derivative)) with `\mathcal{L}`.
| 1 | https://tex.stackexchange.com/users/293504 | 680483 | 315,720 |
https://tex.stackexchange.com/questions/680493 | 3 | For the development of a class file I am trying to perform some basic checking on strings (which can contain latex commands).
For this I use the **tokcycle** package.
When I pass a string directly everything works as expected.
For various reasons (we store arguments using **pgfkeys** and later retireve these values if they exist) I need to process the *content* of a macro.
How to pass the content of a macro to a command?
Or get **tokcycle** to work on the content of the macro without expending the macro since we want to detect macro's in the input string (such as "Test\test").
Example:
```
\documentclass{article}
\usepackage{tokcycle}
\newcommand\checkstring[1]{%
\typeout{CHECKING ----------- #1}%
\tokcycle{\typeout{CHARACTER: ##1}}%
{\typeout{GROUP: ##1}}%
{\typeout{MACRO: \string##1}}%
{\typeout{SPACE: ##1}}%
{#1}%
}
\newcommand\good[1]{%
\checkstring{#1}%
}
\newcommand\problem[1]{%
\def\tmp{#1}%
\checkstring{\tmp}%
}
\begin{document}
\good{Test.}
\problem{Test.}
\end{document}
```
This gives:
```
CHECKING ----------- Test.
CHARACTER: T
CHARACTER: e
CHARACTER: s
CHARACTER: t
CHARACTER: .
CHECKING ----------- Test.
MACRO: \tmp
```
I would like to have the output identical in both cases.
| https://tex.stackexchange.com/users/293508 | How to pass the content of a macro to a command? | false | You can step over the expansion of a token by using `\expandafter`. You'll also need to step over the opening brace to get what you want, which is why you'd need `\expandafter\checkstring\expandafter{\tmp}`.
If all that you need is list the contents of the argument for debugging purposes, I suggest to use the build in `expl3`-function `\tl_analysis_log:n` instead of building your own version using the `tokcycle` package:
```
\documentclass{article}
\ExplSyntaxOn
\cs_new_eq:NN \checkstring \tl_analysis_log:n
\ExplSyntaxOff
\newcommand\good[1]{%
\checkstring{#1}%
}
\newcommand\problem[1]{%
\def\tmp{#1}%
\expandafter\checkstring\expandafter{\tmp}%
}
\begin{document}
\good{Test.}
\problem{Test.}
\end{document}
```
Which will print the following to your log file:
```
The token list contains the tokens:
> T (the letter T)
> e (the letter e)
> s (the letter s)
> t (the letter t)
> . (the character .)
The token list contains the tokens:
> T (the letter T)
> e (the letter e)
> s (the letter s)
> t (the letter t)
> . (the character .)
```
| 1 | https://tex.stackexchange.com/users/117050 | 680494 | 315,725 |
https://tex.stackexchange.com/questions/680427 | 1 | The following code, when compiled, produces two side-by-side chord diagrams with the word 'Major' off-center beneath. Is there an automatic way to get the word perfectly centered below the chords?
```
\documentclass{article}
\usepackage{gchords}
\begin{document}
\mediumchords
\begin{center}
\chords{
\chord{}{f4p4,f3p3,f1p1,f1p1,n,n}{}
\chord{}{n,f4p4,f3p3,f1p1,f2p2,n}{}
}
Major
\end{center}
\end{document}
```
Thanks!
| https://tex.stackexchange.com/users/277990 | How to automatically align and center a string of chord diagrams with a word beneath? | true | In this case, the non-centered part is the chord, not the "Major". Somehow the chord includes a left margin. Maybe my "solution" works fine for you.
I tried some things to find out whether there are additional parameters which would cause the shift, but the "centering" seems to start with the lowest snare.
```
\documentclass{article}
\usepackage{gchords}
\usepackage{showframe}
\begin{document}
\mediumchords
\begin{center}%
\chords{%
\hspace{-0.5cm}\chord{{2999999}}{f4p4,f3p3,f1p1,f1p1,n,n}{}}%
Major%
\end{center}%
\begin{center}%
\chords{%
\chord{t}{n,f4p4,f3p3,f1p1,f2p2,n}{}%
}%
Major%
\end{center}%
\begin{center}%
\chords{%
\hspace{-0.5cm}\chord{{2999999}}{f4p4,f3p3,f1p1,f1p1,n,n}{}%
\chord{t}{n,f4p4,f3p3,f1p1,f2p2,n}{}%
}%
Major%
\end{center}%
\begin{center}%
\chords{%
\hspace{-0.5cm}\chord{{2999999}}{f4p4,f3p3,f1p1,f1p1,n,n}{}%
\hspace{-0.5cm}\chord{t}{n,f4p4,f3p3,f1p1,f2p2,n}{}%
}%
Major%
\end{center}%
\end{document}
```
| 2 | https://tex.stackexchange.com/users/239495 | 680495 | 315,726 |
https://tex.stackexchange.com/questions/680509 | 2 | I want to reduce the size of the diode D1 in my circuit, but I can't seem to be able to do that using \ctikzset{diode/scale=0.5} as it gives an error wherever in the document I place it. Here is my code:
```
\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage[american, siunitx]{circuitikz}
\ctikzset{diode/scale=0.5}
\begin{document}
\begin{figure}[h]
\centering
\begin{circuitikz}
\draw (0,0)
to[V,v=$V$, invert] (0,7)
to [short, -o] ++(2,0)
to[cC, l_=$C_i$] (2,0)
to[short, -o] (0,0);
\draw (2,7)
to [short] ++(2,0)
to [V, v=$fet$] ++(0,-3)
to [full diode, l_=$D_1$, invert] ++(0, -4)
to [short, -o] ++(-2,0);
\draw (4, 3.5)
to [L, l_=$L_0$] ++(3,0)
to [cC, l_=$C_0$] ++(0,-3.5)
to [short, -o] ++(-3, 0);
\draw (7, 3.5)
to [short] ++(1.5,0)
to [R, v=$R_0$] ++(0,-3.5)
to [short] ++(-1.5,0);
\draw
[-latex] (5,4) -- (6,4);
\draw
[-latex] (7.25,4) -- (8.25,4);
\draw
(5.5, 4.25) node{$i_{Lo}$}
(7.75, 4.25) node{$i_{o}$};
\end{circuitikz}
\end{figure}
\end{document}
```
| https://tex.stackexchange.com/users/293517 | How do I change the size of a diode in Circuitikz? | true | Look nearer :
The class is `diodes` (plural), so `\ctikzset{diodes/scale=0.5}`...
| 2 | https://tex.stackexchange.com/users/38080 | 680510 | 315,732 |
https://tex.stackexchange.com/questions/680511 | 0 | I've used `\setmainfont{industry-blackitalic}` (after `\usepackage{fontspec}` and all my text are show in `industry-blackitalic` fonts. But I would use another font (industry-Lightitalic) for some block of text. I need to define a function that enclose the way to use this font in some piece of text, so I need to create a \newcommand command, that will set this. Can someone show me how to set it and how to let it work in specific part of text?
Thank you
Renato
| https://tex.stackexchange.com/users/7143 | how to use specific font in specific text | false | I'd say that typesetting the whole document in boldface italic is a peculiar choice.
Anyway, define a font face for the blocks you need to be light. I replaced font names as I don't have your fonts.
```
\documentclass{article}
\usepackage{fontspec}
\setmainfont{texgyreadventor-bolditalic.otf}
\newfontface{\lightfont}{texgyreadventor-italic.otf}
\DeclareTextFontCommand{\textlight}{\lightfont}
\begin{document}
This is all in bold italic \textlight{except for this part} which is not.
\end{document}
```
| 1 | https://tex.stackexchange.com/users/4427 | 680513 | 315,733 |
https://tex.stackexchange.com/questions/680512 | 0 | I am using `hyperref` in `LaTeX` for references. When I have references in footnotes, the entire footnote becomes a link. How do I fix this?
I tried to create an MWE, however this is eliminated the problem somehow!
| https://tex.stackexchange.com/users/203596 | How do I stop footnotes becoming links when I use hyperref? | false | Maybe with the hyperref option `hyperfootnotes=false`?
| 2 | https://tex.stackexchange.com/users/292824 | 680514 | 315,734 |
https://tex.stackexchange.com/questions/680518 | 0 | I have tried quite many methods of getting two figures to compile side by side. Most of these method end up giving this error
```
Emergency stop subcaption.sty 66
```
Which shows this line in the file `subcaption.sty`
```
\subcaption@CheckCompatibility
```
I have tried most of the methods provided in these links:
[Two figures side by side](https://tex.stackexchange.com/questions/5769/two-figures-side-by-side)
[LaTeX figures side by side](https://tex.stackexchange.com/questions/37581/latex-figures-side-by-side)
[Putting two figures side by side](https://tex.stackexchange.com/questions/282869/putting-two-figures-side-by-side)
[Side-by-side images in LaTeX](https://tex.stackexchange.com/questions/246537/side-by-side-images-in-latex)
I have tried changing `\usepackage{subfigure}` with `\usepackage{subfig}` I have tried to change the options provided in front of subfigure.
The code for the two figures as it is now:
```
\begin{figure}[ht]
\centering
\parabox{4cm}{
\includegraphics[width=4cm]{{ example−image−a}}
\caption{Fyrir}
\qquad
\begin{minipage}{4cm}
\includegraphics[width=4cm]{ example−image−b}
\caption{Eftir}
\end{minipage}
\caption{Mismunur í afhendingagetu milli 2019 og 2023 \label{fig:afhendingageta}}
\end{figure}
```
All of the packages (current):
```
\usepackage[utf8]{inputenc}
\usepackage[icelandic]{babel}
\usepackage{t1enc}
\usepackage{graphicx,booktabs}
\usepackage[intoc]{nomencl}
\usepackage{enumerate,color}
\usepackage{url}
\usepackage[pdfborder={0 0 0}]{hyperref}
\BeforeTOCHead[toc]{\cleardoublepage\pdfbookmark{\contentsname}{toc}} % Add Table of Contents to PDF "bookmark" table of contents
\usepackage{appendix}
\usepackage{eso-pic}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{longtable}
\usepackage[sf,normalsize]{subfigure}
\usepackage[format=plain,labelformat=simple,labelsep=colon]{caption}
\usepackage{placeins}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{adjustbox}
\usepackage{subcaption}
\usepackage{subfig}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{external}
% Packages used for title page layout
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{positioning}
```
My LaTeX document is quite massive, so if you want a minimal working document, I'll paste it into pastebin (or similar) and share the link here. If there is a spelling mistake in my code, I am not seeing it.
I am pretty sure all of me system is up to date (on a rolling release Linux).
| https://tex.stackexchange.com/users/289862 | Can't get two figures side by side to work | true | Just FWI this compiles
```
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[icelandic]{babel}
% \usepackage{t1enc}
\usepackage[T1]{fontenc}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx,booktabs}
\usepackage[intoc]{nomencl}
\usepackage{enumerate,color}
\usepackage{url}
\usepackage{appendix}
\usepackage{eso-pic}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{longtable}
%\usepackage[sf,normalsize]{subfigure}
\usepackage[format=plain,labelformat=simple,labelsep=colon]{caption}
\usepackage{placeins}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{adjustbox}
\usepackage{subcaption}
%\usepackage{subfig}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{external}
% Packages used for title page layout
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage[pdfborder={0 0 0}]{hyperref}
\BeforeTOCHead[toc]{\cleardoublepage\pdfbookmark{\contentsname}{toc}} % Add Table of Contents to PDF "bookmark" table of contents
\begin{document}
\begin{figure}[ht]
\centering
\parbox{4cm}{
\includegraphics[width=4cm]{example-image-a}}
\caption{Fyrir}
\qquad
\begin{minipage}{4cm}
\includegraphics[width=4cm]{example-image-b}
\caption{Eftir}
\end{minipage}
\caption{Mismunur í afhendingagetu milli 2019 og 2023 \label{fig:afhendingageta}}
\end{figure}
\end{document}
```
Comments
* use `\usepackage[T1]{fontenc}` instead of `t1enc`
* use `enumitem` over `enumerate`
* use `xcolor` over `color`
* I'd probably use `subcaption` instead of the others
* load `hyperref` last
* There were several spelling errors in the code provided.
* Load only packages that you actually need.
* It is good advise to write a small note above each package explaining why it is used. Then if the doc is given to someone else to use as a template they can decide if they need it.
| 1 | https://tex.stackexchange.com/users/3929 | 680523 | 315,736 |
https://tex.stackexchange.com/questions/25105 | 20 | I would like to add labels to pages inserted with the pdfpages package.
It sort of works right now, but it is not possible to link to the labels with `\ref` and `\pageref` commands. In spite of that not working, it **is** possible to link to the page with the `hyperlink` command from hyperref.
The goal is to compile a list of things to read in a course and then later say 'read from page xx to yy'. The pagenumbers should of course be determined automatically.
In the document below, the pageref expands to ?? while the text Hello links to the correct page.
```
\documentclass{article}
\usepackage{hyperref}
\usepackage{pdfpages}
\begin{document}
See page \pageref{testing.1}.
\hyperlink{testing.1}{Hello.}
\includepdf[pages=-,link,linkname=testing]{test.pdf}
\end{document}
```
For reference, the inserted document (test.pdf) can be any valid PDF document.
| https://tex.stackexchange.com/users/1366 | Unable to link to inserted pages with pdfpages | false | Maybe late to the party.
Iterating on [@martin-scharrer](https://tex.stackexchange.com/users/2975/martin-scharrer)'s idea, we can use `pdfpages`' variable `\AM@linkname`, so the user may opt to not change the linkname.
```
\documentclass{article}
\usepackage{hyperref}
\usepackage{pdfpages}
\newcounter{includepdfpage}
\makeatletter
\newcommand{\stepincluded}{
\refstepcounter{includepdfpage}%
\label{\AM@linkname.\theincludepdfpage}%
}
\makeatother
\begin{document}
See page \pageref{test.pdf.1} till \pageref{test.pdf.10}.
\hyperlink{test.pdf.1}{Hello.}
\includepdf[pages=-,link,pagecommand={\stepincluded}]{test.pdf}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/162943 | 680526 | 315,738 |
https://tex.stackexchange.com/questions/32466 | 22 | Using the `babel` package to write Hebrew text exposes incompatibilities with all sorts of other packages. This questions is about the incompatibility with `hyperref`.
Basically, you can't get links with right-to-left text. It's about the direction rather than the non-Latin language - somehow the link-start command is placed at the end due to some sort of reversal. The problem is described in Guy Rutenberg's blog, [here](http://www.guyrutenberg.com/2009/06/27/getting-hyperref-to-work-with-hebrew-in-xetex/#more-389).
Here's an MWEs for `\cite` and `\ref`:
```
\documentclass{article}
\usepackage[hebrew,english]{babel}
\usepackage{hyperref}
\begin{document}
\section{A section}
\label{mysection}
LTR English cite \cite{MYSRC}. And now in RTL Hebrew:
\selectlanguage{hebrew}
\cite{MYSRC}
\selectlanguage{english}
Let's refer to the current section:
\selectlanguage{hebrew}
\ref{mysection}
\begin{thebibliography}{MYSRC}
\bibitem[MYSRC01]{MYSRC}
The bibliography entry for MYSRC.
\end{thebibliography}
\end{document}
```
For both of these (and for `\autoref`), you get:
```
! pdfTeX error (ext4): pdf_link_stack empty, \pdfendlink used without \pdfstart
link?.
\AtBegShi@Output ...ipout \box \AtBeginShipoutBox
\fi \fi
```
**Notes**:
* Vafa Khaligi's [comment below](https://tex.stackexchange.com/q/36287/5640) may be useful in isolating the minimum offending code out of everything 'babel' does, although I can't say for sure.
* The blog entry I linked to has a workaround - which only works with xetex. Can it be adapted somehow?
* Stefan Kottwitz suggested a workaround which won a bounty on this question. But what I would really like is to make hyperref get such links correctly somehow.
| https://tex.stackexchange.com/users/5640 | hyperref links break with pdftex + babel + Hebrew (or right-to-left language) | false | This is not a practical solution, but more of a proof of concept. I did not bother to robustify any of the commands, or typeset the citation text in the correct order (I think? what should be the order?).
Anyway, here is a possible starting point:
```
\documentclass{article}
\usepackage[hebrew,english]{babel}
\usepackage{hyperref}
\let\origcite\cite
\def\cite#1{\beginL\hbox{\origcite{#1}}\endL}
\makeatletter
\def\@cite#1#2{[{#1\if@tempswa , #2\fi }]}
\makeatother
\let\origref\ref
\AtBeginDocument{%
\def\ref#1{\beginL\hbox{\origref{#1}}\endL}
}
\begin{document}
\section{A section}\label{mysection}
LTR English cite \cite{MYSRC}. And now in RTL Hebrew:
\selectlanguage{hebrew}
\cite{MYSRC}
\selectlanguage{english}
Let's refer to the current section:
\selectlanguage{hebrew}
\ref{mysection}
\begin{thebibliography}{MYSRC}
\bibitem[MYSRC01]{MYSRC}
The bibliography entry for MYSRC.
\end{thebibliography}
\end{document}
```
Hope you will find it useful 11 years later...:)
| 0 | https://tex.stackexchange.com/users/264024 | 680528 | 315,739 |
https://tex.stackexchange.com/questions/680530 | 1 | I am trying to compile a latex document and I am getting a weird error from the bbl file.
Specifically a certain reference snippet gives the compiler an error:
```
@inproceedings{FEPPS04,
author = {Paola Flocchini and
Antonio Mesa Enriques and
Linda Pagli and
Giuseppe Prencipe and
Nicola Santoro},
title = {Efficient Protocols for Computing the Optimal Swap Edges of a Shortest Path Tree},
booktitle = {Exploring New Frontiers of Theoretical Informatics, {IFIP} 18th World
Computer Congress, {TC1} 3rd International Conference on Theoretical
Computer Science (TCS2004), 22-27 August 2004, Toulouse, France},
pages = {153--166},
year = {2004},
url = {http://dx.doi.org/10.1007/1-4020-8141-3_14},
doi = {10.1007/1-4020-8141-3_14},
timestamp = {Wed, 16 Jul 2014 12:43:29 +0200},
biburl = {http://dblp.uni-trier.de/rec/bib/conf/ifipTCS/FlocchiniEPPS04},
bibsource = {dblp computer science bibliography, http://dblp.org}
}
```
Any idea of what might be the problem? I have several references in the bbl but none other causes any problems during compilation.
If nothing else works I will replace this reference by another but I was wondering of what might be the problem with it, thus my question here.
| https://tex.stackexchange.com/users/293528 | What's wrong with this reference code? | true | Because the URL strings are fairly long, and because both the `url` field and the `doi` field contain an `_` (underscore) character, I suggest you load the [xurl](https://ctan.org/pkg/xurl) package.
```
\documentclass{article} % or some other document class
\begin{filecontents}[overwrite]{mybib.bib}
@inproceedings{FEPPS04,
author = {Paola Flocchini and Antonio Mesa Enriques and Linda Pagli and Giuseppe Prencipe and Nicola Santoro},
title = {Efficient Protocols for Computing the Optimal Swap Edges of a Shortest Path Tree},
booktitle = {Exploring New Frontiers of Theoretical Informatics, {IFIP} 18th World Computer Congress, {TC1} 3rd International Conference on Theoretical Computer Science (TCS2004), 22--27 August 2004, Toulouse, France},
pages = {153--166},
year = {2004},
url = {http://dx.doi.org/10.1007/1-4020-8141-3_14},
doi = {10.1007/1-4020-8141-3_14},
timestamp = {Wed, 16 Jul 2014 12:43:29 +0200},
biburl = {http://dblp.uni-trier.de/rec/bib/conf/ifipTCS/FlocchiniEPPS04},
bibsource = {dblp computer science bibliography, http://dblp.org}
}
\end{filecontents}
\usepackage[T1]{fontenc}
\usepackage[maxbibnames=5]{biblatex}
\addbibresource{mybib.bib}
\usepackage{xurl}
\usepackage[colorlinks,allcolors=blue]{hyperref} % optional
\begin{document}
\cite{FEPPS04}
\printbibliography
\end{document}
```
| 0 | https://tex.stackexchange.com/users/5001 | 680539 | 315,746 |
https://tex.stackexchange.com/questions/570153 | 1 | How do I define a beamer overlay specification like `beamer:0` as `beamerframe key`? Something like:
```
\documentclass{beamer}
\makeatletter
\define@key{beamerframe}{hide}[true]{%
%<--- definition of the beamer:0 switch??
}
\makeatother
\begin{document}
\begin{frame}[hide] %<-- has now overlay specification beamer:0
example text
\end{frame}
\end{document}
```
Thx in advance!
| https://tex.stackexchange.com/users/201756 | Define beamer frame overlay specification for beamerframe key | false |
```
\documentclass{beamer}
\usepackage{xpatch}
\makeatletter
\newif\ifbeamer@hide
\define@key{beamerframe}{hide}[true]{\beamer@hidetrue}
\BeforeBeginEnvironment{frame}{\beamer@hidefalse}
\xpatchcmd{\beamer@@@@frame}{%
\gdef\beamer@whichframes{#1}%
}{
\ifbeamer@hide
\gdef\beamer@whichframes{beamer:0}%
\else
\gdef\beamer@whichframes{#1}%
\fi
}{}{}
\makeatother
\begin{document}
\begin{frame}
content...
\end{frame}
\begin{frame}[hide] %<-- has now overlay specification beamer:0
example text
\end{frame}
\begin{frame}
content...s
\end{frame}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/36296 | 680547 | 315,748 |
https://tex.stackexchange.com/questions/680541 | 1 | I require two citation lists with the following format...
1. Main report reference list
[1] [2] [3] etc
2. Appendix References
[A1] [A2] [A3] etc
I have approx. 50 different references which are cited throughout the report.
I currently use these lines of code to produce two reference lists...
```
\printbibliography[keyword={MainRep},notkeyword={Appendix},title={Main Report References}]
\printbibliography[keyword={Appendix},notkeyword={MainRep},title={Appendix References}]
```
How can I change the citation numbering format?
| https://tex.stackexchange.com/users/293533 | Two reference lists with custom citation numbers | true | You want to set a new `refcontext` with the [`labelprefix` key](https://tex.stackexchange.com/a/389228/106162) to add prefix numbers.
However, it sounds like you also want to set a new `refsection` to avoid having to set `keywords` in your bib entries to filter the `\printbibliography` statements.
```
\documentclass{article}
\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
\section{Main}
\cite{aksin}
\printbibliography
\newrefsection
\section{Appendix}
\cite{angenendt}
\newrefcontext[labelprefix=A]
\printbibliography
\end{document}
```
Or if both bibliographies should go after the appendix use
```
\printbibliography[section=0]
\newrefcontext[labelprefix=A]
\printbibliography[section=1]
```
| 1 | https://tex.stackexchange.com/users/106162 | 680552 | 315,750 |
https://tex.stackexchange.com/questions/680562 | 0 | I needed to remake the footline in the Szeged theme, I did it according to [this](https://tex.stackexchange.com/questions/104548/customize-footer-in-the-szeged-beamer-theme) thread. But I'm getting this error:
>
> presentatie\_template.tex|90 error| Undefined control sequence.
>
>
>
>
> ! Undefined control sequence. \beamer@@tmpl@footline ...\insertauthor
> ~~\beamer
> {\insertshortinstitute }{}...
>
>
> l.31 \begin{document}
>
>
> ? ! Emergency stop. \beamer@@tmpl@footline ...\insertauthor ~~\beamer
> {\insertshortinstitute }{}...
>
>
> l.31 \begin{document}
>
>
> 885 words of node memory still in use: 11 hlist, 2 vlist, 3 rule,
> 2 local\_par, 8 dir, 6 glue, 4 kern, 3 penalty, 5 glyph, 25 attribute,
> 70 glue\_spec, 25 attribute\_list, 8 temp, 1 write, 1 pdf\_de st, 10
> pdf\_colorstack nodes avail lists: 2:1,5:1 ! ==> Fatal error
> occurred, no output PDF file produced! Transcript written on
> presentatie\_template.log.
>
>
> shell returned 1
>
>
>
Here is the full sample code:
```
\documentclass[compress]{beamer}
\setbeameroption{show notes}
\useinnertheme{default}
\usefonttheme{professionalfonts}
\usetheme{Szeged}
\usecolortheme{beaver}
\setbeamertemplate{footline}
{
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}
\end{beamercolorbox}
\hbox{
\begin{beamercolorbox}[wd=0.5\paperwidth, ht=2.5ex, dp=1.125ex, center]{title in head/foot}
\usebeamerfont{author in head/foot}\insertauthor~~\beamer{\insertshortinstitute}{}
\end{beamercolorbox}
\begin{beamercolorbox}[wd=0.333333\paperwidth, ht=2.5ex, dp=1.125ex, center]{title in head/foot}
\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}
\begin{beamercolorbox}[wd=0.166666\paperwidth, ht=2.5ex, dp=1.125ex, center]{title in head/foot}
\usebeamerfont{title in head/foot}\insertframenumber/\inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}}
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
\end{beamercolorbox}
}
\title{Sample presentation}
\author{Some}
\institute{Some}
\date{Thu Mar 23 07:00:41 PM CET 2023}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\section{First frame}
\frame{ \frametitle{First frame}
Some text and
\begin{enumerate}
\item{one}
\item{two}
\item{three}
\end{enumerate}
}
\end{document}
```
Any thoughts on how to resolve this?
| https://tex.stackexchange.com/users/292544 | Undefined control sequence because of custom beamer footline | false | I figured it out by trial and error. Changed the line:
```
\usebeamerfont{author in head/foot}\insertauthor~~\beamer{\insertshortinstitute}{}
```
to:
```
\usebeamerfont{author in head/foot}\insertauthor \hspace{5pt} \insertshortinstitute{}
```
And the error was resolved.
| 0 | https://tex.stackexchange.com/users/292544 | 680565 | 315,755 |
https://tex.stackexchange.com/questions/680562 | 0 | I needed to remake the footline in the Szeged theme, I did it according to [this](https://tex.stackexchange.com/questions/104548/customize-footer-in-the-szeged-beamer-theme) thread. But I'm getting this error:
>
> presentatie\_template.tex|90 error| Undefined control sequence.
>
>
>
>
> ! Undefined control sequence. \beamer@@tmpl@footline ...\insertauthor
> ~~\beamer
> {\insertshortinstitute }{}...
>
>
> l.31 \begin{document}
>
>
> ? ! Emergency stop. \beamer@@tmpl@footline ...\insertauthor ~~\beamer
> {\insertshortinstitute }{}...
>
>
> l.31 \begin{document}
>
>
> 885 words of node memory still in use: 11 hlist, 2 vlist, 3 rule,
> 2 local\_par, 8 dir, 6 glue, 4 kern, 3 penalty, 5 glyph, 25 attribute,
> 70 glue\_spec, 25 attribute\_list, 8 temp, 1 write, 1 pdf\_de st, 10
> pdf\_colorstack nodes avail lists: 2:1,5:1 ! ==> Fatal error
> occurred, no output PDF file produced! Transcript written on
> presentatie\_template.log.
>
>
> shell returned 1
>
>
>
Here is the full sample code:
```
\documentclass[compress]{beamer}
\setbeameroption{show notes}
\useinnertheme{default}
\usefonttheme{professionalfonts}
\usetheme{Szeged}
\usecolortheme{beaver}
\setbeamertemplate{footline}
{
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}
\end{beamercolorbox}
\hbox{
\begin{beamercolorbox}[wd=0.5\paperwidth, ht=2.5ex, dp=1.125ex, center]{title in head/foot}
\usebeamerfont{author in head/foot}\insertauthor~~\beamer{\insertshortinstitute}{}
\end{beamercolorbox}
\begin{beamercolorbox}[wd=0.333333\paperwidth, ht=2.5ex, dp=1.125ex, center]{title in head/foot}
\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}
\begin{beamercolorbox}[wd=0.166666\paperwidth, ht=2.5ex, dp=1.125ex, center]{title in head/foot}
\usebeamerfont{title in head/foot}\insertframenumber/\inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}}
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
\end{beamercolorbox}
}
\title{Sample presentation}
\author{Some}
\institute{Some}
\date{Thu Mar 23 07:00:41 PM CET 2023}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\section{First frame}
\frame{ \frametitle{First frame}
Some text and
\begin{enumerate}
\item{one}
\item{two}
\item{three}
\end{enumerate}
}
\end{document}
```
Any thoughts on how to resolve this?
| https://tex.stackexchange.com/users/292544 | Undefined control sequence because of custom beamer footline | true | There is an important difference between the answer you linked to and your code. You have
```
\beamer{\insertshortinstitute}{}
```
This will cause an error because the macro `\beamer` is not defined (the macro is actually called `\beamer@ifempty`). It also takes 3 arguments, not just 2 as in your code.
In the linked answer the actual code is
```
\beamer@ifempty{\insertshortinstitute}{}{(\insertshortinstitute)}
```
Which will check if the institute is empty and only insert it if it is not empty (this avoids empty `()` in case it is empty)
---
```
\documentclass[compress]{beamer}
\setbeameroption{show notes}
\useinnertheme{default}
\usefonttheme{professionalfonts}
\usetheme{Szeged}
\usecolortheme{beaver}
\makeatletter
\setbeamertemplate{footline}
{%
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}
\end{beamercolorbox}
\hbox{%
\begin{beamercolorbox}[wd=0.333333\paperwidth, ht=2.5ex, dp=1.125ex, center]{title in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor~~\beamer@ifempty{\insertshortinstitute}{}{(\insertshortinstitute)}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=0.333333\paperwidth, ht=2.5ex, dp=1.125ex, center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=0.333333\paperwidth, ht=2.5ex, dp=1.125ex, center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertframenumber/\inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}}
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
\end{beamercolorbox}
}
\makeatother
\title{Sample presentation}
\author{Some}
\institute{Some}
\date{Thu Mar 23 07:00:41 PM CET 2023}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\section{First frame}
\frame{ \frametitle{First frame}
Some text and
\begin{enumerate}
\item{one}
\item{two}
\item{three}
\end{enumerate}
}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/36296 | 680567 | 315,757 |
https://tex.stackexchange.com/questions/617886 | 5 | I want to use the [AMS Euler](https://en.wikipedia.org/wiki/AMS_Euler) font designed by Zapf in my document. I looked for packages on CTAN (e.g., the [*euler* package](https://cs.brown.edu/about/system/managed/latex/doc/euler.pdf)), but they are specifically designed for LaTeX.
I took a look at the `gkpmac.tex` file [Knuth](https://en.wikipedia.org/wiki/Donald_Knuth) wrote from *Concrete Mathematics* and it is likely to contain the answer I am looking for, but I can't fully understand it and determine what lines to extract to an `eumac.tex` or `euler.tex` file (I don't know what the naming convention is in that case).
| https://tex.stackexchange.com/users/nan | How can I use the AMS Euler font in plain TeX? | false | There is a package [mtbe](https://ctan.org/tex-archive/macros/plain/contrib/mtbe) on CTAN that was created for the book *Mathematical TeX by Example* by Arvind Borde to use the AMS Euler fonts together with the Concrete fonts.
```
\input eulconc
```
License:
>
> The six files in the MTBE package may be copied, distributed and used freely.
>
>
>
Note that it also defines a lot of (imho irrelevant) other macros:
```
...
\def\adj{\relbar\joinrel\relbar} % adjacent in a graph
\let\<=\langle \let \>=\rangle
\def\Pr{\mathop{\rm Pr}\nolimits}
\def\Mean{\mathop{\rm Mean}\nolimits}
\def\Var{\mathop{\rm Var}\nolimits}
...
```
| 0 | https://tex.stackexchange.com/users/nan | 680570 | 315,759 |
https://tex.stackexchange.com/questions/680420 | 1 | I am making plots in Python and then export them to LaTeX using `tikzplotlib` library. The problem is that `tikzplotlib` converts pairs with (at least one) `NaN` value to `-- --` as shown below
```
\addplot [draw=black, forget plot, mark=o, only marks]
table{%
x y
1.75 -3.2
2 -3.2
2.25 -3
2.5 -2.9
-- --
-- --
};
```
LaTeX responds by issuing the error
```
! Package PGF Math Error: Could not parse input '--' as a floating point number, sorry. The unreadable part was near '-'..
```
Is it possible to teach `pgfplots` to ignore `--` as `NaN`? Or maybe teach `tikzplotlib` to export `NaN`s as `NaN`?
| https://tex.stackexchange.com/users/3450 | How to parse NaNs from tikzplotlib | false | I realised that Python as a programming language is much more flexible, so I simply excluded `NaN` data using
```
pyplot.scatter(x[~numpy.isnan(y)],y[~numpy.isnan(y)])
```
where `x` and `y` are `numpy` data arrays.
| 0 | https://tex.stackexchange.com/users/3450 | 680585 | 315,765 |
https://tex.stackexchange.com/questions/680056 | 1 | I'm using tcolorbox to make some 3x5 cards with lots of text on them. These cards usually consist of a few boxes that don't change much and one final box (containing descriptive text) that fills the rest of the card (using the `[height fill]` option). I usually use `tcboxfit` for the final box so that all the descriptive text fits nicely, but sometimes it just ends up too small.
I would like to somehow condition the options/type of the last box on its content---that is, if the fitted text is below a defined size threshold (in this example, 6pt), then nix the fitting and make a `breakable` box with a fixed text size (probably the 6pt lower threshold) where the second page will eventually be printed on the backside of my 3x5 card.
I've figured out how to condition something on the fitted text size using `\tcbfitdim`. I also discovered the `nirvana` option, which will execute everything given but not draw the box/contents. So far so good.
I thought to use a boolean flag to track whether or not the fitted text is too small and construct the appropriate box afterward, but the result doesn't want to propagate outside of the box itself. The following example always prints "false" regardless of what happened inside `tcboxfit`.
```
%%%%%%%%%% PREAMBLE %%%%%%%%%%
\documentclass{article}
\usepackage[many]{tcolorbox}
\usepackage{lipsum}
\usepackage{geometry}
\usepackage{printlen}
\usepackage{xifthen}
\newboolean{fittoosmall}
\geometry{paperwidth=3in,paperheight=5in,margin=0.05in,bottom=0.03in}
%%%%%%%%%% DOCUMENT %%%%%%%%%%
\begin{document}
\tcbset{colback=white, colframe=black, beforeafter skip=0em}
\newcommand{\boxcontent}{
\lipsum[5]
\lipsum[5]
\lipsum[5]
\lipsum[5]
\par
}
\begin{tcolorbox}
static box here
\end{tcolorbox}
\tcboxfit[height fill, fit basedim=12pt]{
\boxcontent
\ifthenelse{\lengthtest{\tcbfitdim<6pt}}{
too small! \printlength{\tcbfitdim}
\setboolean{fittoosmall}{true}
}{
all good! \printlength{\tcbfitdim}
\setboolean{fittoosmall}{false}
}
}
\ifthenelse{\boolean{fittoosmall}}{true}{false}
\end{document}
```
Beyond that, all I have is a vague sense that I might need to use `pgfkeys` somehow, but I'd rather not go there if I don't have to. Any tcolorbox aficionados care to weigh in? Is there a way to get my boolean strategy to work? Another strategy I should consider? I'm using LuaLaTeX for other parts of the project, so Lua-based ideas/solutions are welcome.
| https://tex.stackexchange.com/users/285366 | Conditioning tcolorbox options/type on box content—fit or break depending on fitted text size | false | It's not incredibly elegant, but I found a solution. The TeX boolean didn't want to propagate outside of the tcolorbox environment, but assigning a Lua boolean variable instead did the trick. Do a test `tcboxfit` with the `nirvana` option to set the boolean and then make the real box afterward depending on the result. Example:
```
%%%%%%%%%% PREAMBLE %%%%%%%%%%
\documentclass{article}
\usepackage[many]{tcolorbox}
\usepackage{lipsum}
\usepackage{geometry}
\usepackage{printlen}
\usepackage{xifthen}
\usepackage{luacode}
\newboolean{fittoosmall}
\geometry{paperwidth=3in,paperheight=5in,margin=0.05in,bottom=0.03in}
%%%%%%%%%% DOCUMENT %%%%%%%%%%
\begin{document}
\tcbset{colback=white, colframe=black, beforeafter skip=0em}
\newcommand{\boxcontent}{
\lipsum[5]
\lipsum[5]
\lipsum[5]
\lipsum[5]
\par
}
\begin{tcolorbox}
static box here
\end{tcolorbox}
\tcboxfit[height fill, fit basedim=12pt, nirvana]{
\boxcontent
\ifthenelse{\lengthtest{\tcbfitdim<6pt}}{
too small! \printlength{\tcbfitdim}
\directlua{fittoosmallbool="true"}
}{
all good! \printlength{\tcbfitdim}
\directlua{fittoosmallbool="false"}
}
}
\ifthenelse{\equal{\directlua{tex.sprint(fittoosmallbool)}}{true}}{
\begin{tcolorbox}[breakable,fontupper=\scriptsize]
\boxcontent
\end{tcolorbox}
}{
\tcboxfit[height fill, fit basedim=12pt]{\boxcontent}
}
\end{document}
```
This only works if you're using LuaLaTeX and probably isn't the best solution for every use case, but it fits my needs just fine. Hopefully this is useful information for others in the future.
| 1 | https://tex.stackexchange.com/users/285366 | 680600 | 315,772 |
https://tex.stackexchange.com/questions/680594 | 0 | (I didn't immediately see this question already asked, but perhaps it has, since it seems an obvious question to me!)
This is more of a typographical/style/best-practices question, but I am wondering when to use in-line vs equation environment when you have stacked exponents.
Here's an example:
```
By applying Theorem 1, we have that the graph $G$ has at most $n^{d\cdot k^{d+1}} = n^{d\cdot (2^{d-1})^{d+1}} = n ^{d\cdot 2^{d^2-1}}$
maximal cliques.
```
Would this be better typeset in-line or as a separate equation?
| https://tex.stackexchange.com/users/255732 | Should one put nested exponents in-line, or displayed as an equation? | false | Placing such an expression inline forces inconsistent vertical spacing, as seen between the third and fourth lines here:
This should generally be avoided when you can. (Of course, if a journal editor insists on this spacing to save some length of the article, that's out of your hands.) Better to place the tall mathematics in display:
```
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
By applying Theorem 1, we have that the graph $G$ has at most $n^{d\cdot k^{d+1}} = n^{d\cdot (2^{d-1})^{d+1}} = n ^{d\cdot 2^{d^2-1}}$ maximal cliques.
\lipsum[2]
By applying Theorem 1, we have that the graph $G$ has at most
\[n^{d\cdot k^{d+1}} = n^{d\cdot (2^{d-1})^{d+1}} = n ^{d\cdot 2^{d^2-1}}\]
maximal cliques.
\end{document}
```
| 4 | https://tex.stackexchange.com/users/125871 | 680602 | 315,773 |
https://tex.stackexchange.com/questions/680460 | 1 | For some (stupid) report, I have to put a bibliography with some authors in bold and some authors underlined.
Thanks to some posts/answer here, I succeed to make a specific one bold.
However, all other tricks tested here to make other underlined failed (either not compiling or not producing anything).
Here is a MWE for the bold. Let say I would like Billy Bob and Jane Doe underlined.
```
\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage{ulem}
\usepackage[style=alphabetic, maxnames=99, sorting=ydnt, backend=bibtex]{biblatex}
\begin{filecontents}{\jobname.bib}
@article{article1,
author={Smith, John and Doe, Jane and Foo, Bar},
title={Title},
journal={Journal}
}
@article{article2,
author={Smith, John and Billy, Bob},
title={Title2},
journal={Journal2}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\DeclareBibliographyDriver{article}{%
\printfield{title} %
\par
\newblock%
\printnames{author}%
\par%
\newblock%
{%
\footnotesize\itshape%
\usebibmacro{journal}%
}
\par\vspace{0.3\baselineskip}
}
\newcommand*{\boldname}[3]{%
\def\lastname{#1}%
\def\firstname{#2}%
\def\firstinit{#3}}
\renewcommand{\mkbibnamegiven}[1]{%
\ifboolexpr{ ( test {\ifdefequal{\firstname}{\namepartgiven}} or test {\ifdefequal{\firstinit}{\namepartgiven}} ) and test {\ifdefequal{\lastname}{\namepartfamily}} }
{\mkbibbold{#1}}{#1}%
}
\renewcommand{\mkbibnamefamily}[1]{%
\ifboolexpr{ ( test {\ifdefequal{\firstname}{\namepartgiven}} or test {\ifdefequal{\firstinit}{\namepartgiven}} ) and test {\ifdefequal{\lastname}{\namepartfamily}} }
{\mkbibbold{#1}}{#1}%
}
\boldname{Smith}{John}{}
\begin{document}
\nocite{*}
\printbibliography[type={article}]
\end{document}
```
| https://tex.stackexchange.com/users/45856 | Underline and make bold some authors in a bib file | true | You can use the approach from [Bold certain authors and dagger other authors](https://tex.stackexchange.com/q/676542/35864), which parametrises [my answer](https://tex.stackexchange.com/a/416416/35864) to [Make specific author bold using biblatex](https://tex.stackexchange.com/q/73136/35864).
This approach requires Biber instead of BibTeX. Note that breakable underlining is *very* tricky in LaTeX. The best solution for underlining that I'm aware of is [Marcel Krüger](https://tex.stackexchange.com/users/80496/marcel-kr%c3%bcger)'s `lua-ul` package (see e.g. [Underline part of a word while preserving kerning](https://tex.stackexchange.com/q/446444/35864)), which requires LuaLaTeX.
```
\documentclass{article}
\usepackage{lua-ul}
\usepackage[style=alphabetic, maxnames=99, sorting=ydnt, backend=biber]{biblatex}
\makeatletter
\def\nhblx@bibfile@name{\jobname -nhblx.bib}
\newwrite\nhblx@bibfile
\immediate\openout\nhblx@bibfile=\nhblx@bibfile@name
\immediate\write\nhblx@bibfile{%
@comment{Auto-generated file}\blx@nl}
\newcounter{nhblx@name}
\setcounter{nhblx@name}{0}
\newcommand*{\nhblx@writenametobib}[2]{%
\ifcsundef{nhblx@#1list}
{\csdef{nhblx@#1list}{}}
{}%
\stepcounter{nhblx@name}%
\edef\nhblx@tmp@nocite{%
\noexpand\AfterPreamble{%
\noexpand\setbox0\noexpand\vbox{%
\noexpand\def\noexpand\nhblx@listname{nhblx@#1list}%
\noexpand\nhblx@getmethehash{nhblx@name@\the\value{nhblx@name}}}}%
}%
\nhblx@tmp@nocite
\immediate\write\nhblx@bibfile{%
@misc{nhblx@name@\the\value{nhblx@name}, author = {\unexpanded{#2}}, %
options = {dataonly=true},}%
}%
}
\AtEndDocument{%
\closeout\nhblx@bibfile}
\addbibresource{\nhblx@bibfile@name}
\DeclareNameFormat{nhblx@hashextract}{%
\xifinlistcs{\thefield{hash}}{\nhblx@listname}
{}
{\listcsxadd{\nhblx@listname}{\thefield{hash}}}}
\DeclareCiteCommand{\nhblx@getmethehash}
{}
{\typeout{\nhblx@listname}\printnames[nhblx@hashextract][1-999]{author}}
{}
{}
\newcommand*{\markname}[1]{\forcsvlist{\nhblx@writenametobib{#1}}}
\newcommand*{\resetmark}[1]{\csdef{nhblx@#1list}{}}
\newcommand*{\ifnamemarked}[1]{%
\xifinlistcs{\thefield{hash}}{nhblx@#1list}}
\makeatother
\newcommand*{\nameformatter}[1]{%
\ifnamemarked{bold}
{\mkbibbold{#1}}
{\ifnamemarked{underline}
{\underLine{#1}}
{#1}}}
\DeclareNameWrapperFormat{nameformatter}{%
\renewcommand*{\mkbibcompletename}{\nameformatter}%
#1}
\DeclareNameWrapperAlias{sortname}{default}
\DeclareNameWrapperAlias{default}{nameformatter}
\markname{bold}{John Smith}
\markname{underline}{Jane Doe}
\begin{filecontents}{\jobname.bib}
@article{article1,
author = {Smith, John and Doe, Jane and Foo, Bar},
title = {Title},
journal = {Journal},
}
@article{article2,
author = {Smith, John and Billy, Bob},
title = {Title2},
journal = {Journal2},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
```
| 2 | https://tex.stackexchange.com/users/35864 | 680612 | 315,778 |
https://tex.stackexchange.com/questions/680615 | 0 | I have an french-arabic belangual document, where the french version should be appear at left odd pages when arabic version sould appear at right even pages like as described [here](https://tex.stackexchange.com/questions/630811/make-paracol-left-column-on-even-and-right-column-on-odd-pages).
But, I discover the command `\setotherlanguages{arabic}` makes parallel-Paging of paracol not work at all. It is not necessary to use arabic inside the `paracol` environement to make it fail as you can see bellow in my MWE. Just declaring arabic as second language somewhere in the document makes all the `paracol` with `numleft` option fail.
#### MWE
```
\documentclass{book}
\RequirePackage{polyglossia}
\usepackage{paracol}
\setotherlanguages{arabic} % ← Comment this line and the Parallel paging works again
\begin{document}
\begin{paracol}[1]{2}
\switchcolumn[0]*
Lorem ipusm
\switchcolumn[1]
Dolor
\end{paracol}
\end{document}
```
### The question
So how can I use paracol’s Parallel-Paging with arabic inside a same document?
| https://tex.stackexchange.com/users/30933 | Parallel-Paging with paracol totally fail with polyglossia | false | Just put the `paracol` call after the arabic declaration like this:
```
\documentclass{book}
\RequirePackage{polyglossia}
\setotherlanguages{arabic} % ← Comment this line and the Parallel paging works again
\usepackage{paracol} % ← Paracol should be here
\begin{document}
\begin{paracol}[1]{2}
\switchcolumn[0]*
Lorem ipusm
\switchcolumn[1]
Dolor
\end{paracol}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/30933 | 680616 | 315,780 |
https://tex.stackexchange.com/questions/680529 | 1 | tikzexternalize seems to respect local definitions. For example,
```
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize
\begin{document}
\tikzset{every picture/.style={red}}
\begin{tikzpicture}
\draw (0,0) rectangle (1,1);
\end{tikzpicture}
\end{document}
```
draws the square in red as expected. How does tikzexternalize do that? If I look at the output, I see
```
\write18 enabled.
entering extended mode
===== 'mode=convert with system call': Invoking 'pdflatex -shell-escape -halt-o
n-error -interaction=batchmode -jobname "...-figure0" "\def\tikzex
ternalrealjob{...}\input{...}"' ========
```
where `...` is the name of my tex file. So latex seems to be called on the very same file, and then some magic seems to ensure that latex outputs only the picture in question. But does it have to process all code before that? I guess yes, but that goes much faster than actually compiling all the pages before the picture appears.
Can someone clarify this?
*Edit:* Is the mechanism by which tikzexternaize achieves this hard to understand? Is it possible, for instance, to define an environment `myexternalize` that does the same as tikzexternalize for `tikzpicture`, but for general content?
| https://tex.stackexchange.com/users/27717 | How does tikzexternalize work? | false | Qrrbrbirlbel's comment explained what is going on correctly.
To demonstrate:
```
\documentclass{article}
\usepackage{tikz}
\usepackage{shellesc}
\usetikzlibrary{external}
\tikzexternalize
\begin{document}
\begin{tikzpicture}
\ShellEscape{sleep 5s}
\draw (0,0) rectangle (1,1);
\end{tikzpicture}
\tikzset{every picture/.style={red}}
\begin{tikzpicture}
\draw (0,0) rectangle (1,1);
\end{tikzpicture}
\end{document}
```
Save into `a.tex`, delete all auxiliary files (including `a-figure0.pdf` etc.), then `pdflatex -shell-escape a.tex`.
This takes approximately 5 seconds to compile, and subsequent compilations take approximately 0 seconds.
Which means the 5s sleep is not processed when the second image is processed.
On the other hand if it's moved outside...
```
\documentclass{article}
\usepackage{tikz}
\usepackage{shellesc}
\usetikzlibrary{external}
\tikzexternalize
\begin{document}
\begin{tikzpicture}
\draw (0,0) rectangle (1,1);
\end{tikzpicture}
\ShellEscape{sleep 5s}
\tikzset{every picture/.style={red}}
\begin{tikzpicture}
\draw (0,0) rectangle (1,1);
\end{tikzpicture}
\end{document}
```
This takes approximately 15 seconds, and if all figures are already generated then it takes approximately 5 seconds.
Anyway, the key point is that the speed-up is made by skipping through the body of `tikzpicture` environments,
and this can be controlled because it's TikZ's environments.
No magic is needed.
On the other hand, this means other environments e.g. `tabular` are not skipped through. You can try it yourself.
| 2 | https://tex.stackexchange.com/users/250119 | 680620 | 315,782 |
https://tex.stackexchange.com/questions/680186 | 0 | I have been working on a project, where I'm compiling a single document into differents .pdf, thanks to a trick I found. In my .tex file, I'm creating an empty .pdf to make LaTeX happy thanks to luacode, then I'm opening three Shells in a row, asking to compile the current document, with a different parameter, and outputing .pdf files with different names.
My main question is : is it be possible to run the differents `\ShellEscape` at the time, in order to gain compilation time for larger projects. At the moment, the second document starts compiling only when the first one is done, because of the linear structure.
My secondary question is : is it possible to delete the \jobname.pdf at the end of the compilation, without making LaTeX unhappy ?
My code :
```
\documentclass{standalone}
\RequirePackage{luacode}
\RequirePackage{shellesc}
%Creating an empty pdf to make LaTeX happy
\ifx\conditionmacro\undefined
\begin{luacode*}
function create_empty_pdf()
local pdf_file = io.open(tex.jobname .. ".pdf", "wb")
pdf_file:write("%PDF-1.5\n%%\n%%EOF")
pdf_file:close()
end
create_empty_pdf()
\end{luacode*}
\fi
\ifx\conditionmacro\undefined
\newcommand{\runlualatex}[2]{%#1=file name ; #2=macro value ; ShellEscape > compiling document and defining \conditionmacro
\ShellEscape{%
lualatex --interaction=nonstopmode --halt-on-error --shell-escape --jobname="\jobname#1"
"\gdef\string\conditionmacro{#2}\string\input\space\jobname"
}%
\ShellEscape{%
lualatex --interaction=nonstopmode --halt-on-error --shell-escape --jobname="\jobname#1"
"\gdef\string\conditionmacro{#2}\string\input\space\jobname"
}%
\ShellEscape{%
lualatex --interaction=nonstopmode --halt-on-error --shell-escape --jobname="\jobname#1"
"\gdef\string\conditionmacro{#2}\string\input\space\jobname"
}%
}%
\fi
%Creating three .pdf \jobname-fileX
\ifx\conditionmacro\undefined
\runlualatex{-file1}{macro1}
\runlualatex{-file2}{macro2}
\runlualatex{-file3}{macro3}
\expandafter\stop
\fi
\begin{document}
Value of the \conditionmacro
\end{document}
```
| https://tex.stackexchange.com/users/293286 | Multiple ShellEscape compiling at the same time in .tex file | false | I recommend using Lua if possible (how to do that is a Lua programming question, I think e.g. <https://stackoverflow.com/q/9480315/5267751> has an answer)
But if you want to use TeX anyway it's also possible:
```
\documentclass{article}
\begin{document}
\ExplSyntaxOn
% allocate new streams
\ior_new:N \__vince_tmpa_ior
\ior_new:N \__vince_tmpb_ior
\ior_new:N \__vince_tmpc_ior
% spawn processes
\ior_shell_open:Nn \__vince_tmpa_ior {sleep~2s; touch~a1.pdf}
\ior_shell_open:Nn \__vince_tmpb_ior {sleep~2s; touch~a2.pdf}
\ior_shell_open:Nn \__vince_tmpc_ior {sleep~2s; touch~a3.pdf}
% wait for processes to finish
\ior_close:N \__vince_tmpa_ior
\ior_close:N \__vince_tmpb_ior
\ior_close:N \__vince_tmpc_ior
\ExplSyntaxOff
\end{document}
```
If you time the compilation, it only take 2s.
| 2 | https://tex.stackexchange.com/users/250119 | 680622 | 315,784 |
https://tex.stackexchange.com/questions/679962 | 1 | When `\item` is inside a theorem-type environment, but not inside an enumerate or itemize environment, LaTeX does not give an error. Is there a way to make compiling stricter so that one receives an error when this happens?
Here is a minimal working example:
```
\documentclass{amsart}
\usepackage{enumitem}
\theoremstyle{plain}
\newtheorem{lemma}{Lemma}
\begin{document}
\begin{lemma}
Hello
\item abcd
\item This compiles without error.
\end{lemma}
\end{document}
```
Here is the version of TeX that I'm using, if it's important:
```
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex
restricted \write18 enabled.
entering extended mode
Processing: test.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-02-22>
```
| https://tex.stackexchange.com/users/965 | How does one make the latex compiler stricter with '\item's missing an enumerate or itemize environment? | true | If you try hard enough, you can probably do this:
```
\documentclass{amsart}
\usepackage{enumitem}
\theoremstyle{plain}
\newtheorem{lemma}{Lemma}
\begin{document}
\ExplSyntaxOn
\makeatletter
\AddToHook{cmd/item/before}{
\str_if_eq:VnT \@currenvir {lemma} {\errmessage{oh~no}}
}
\makeatother
\ExplSyntaxOff
\begin{lemma}
Hello
\item abcd
\item This compiles with error.
\end{lemma}
\end{document}
```
Just a proof of concept, documentation in `texdoc lthooks`.
You may want to use `\str_case` or something else (e.g. use TeX's hash table for "constant"-time checking)
if you want to check multiple environments etc. but compiling a whitelist (or a blacklist) appears to be unavoidable to me.
| 2 | https://tex.stackexchange.com/users/250119 | 680624 | 315,785 |
https://tex.stackexchange.com/questions/680623 | 0 | I am trying to use p specification to get text in my table to wrap. I have looked at examples and other questions but can not get it to work. I generated my table with a latex tables generator and I am using some colours so the table code is quite messy. I have tried to put the p-code,
```
p{40mm},
```
in the table. More specifically where code colour is specified for columns, as follows,
```
\begin{table}[H]
\begin{tabular}{
>{\columncolor[HTML]{8E7CC3}} p{40mm} l
>{\columncolor[HTML]{D9D2E9}} p{40mm} l
>{\columncolor[HTML]{FFF2CC}} p{40mm} l
>{\columncolor[HTML]{EA9999}} p{40mm} l}
\cline{1-3}
... more code,
```
but this just makes the text wrap in one of the rows. Where do I set the column width?
I have provided a working example below (with no attempts of text wrapping).
```
\documentclass[12pt,a4paper,swedish]{report}
\usepackage[table]{xcolor} % For tables (color)
\usepackage{moreverb} % List settings
\usepackage{textcomp} % Fonts, symbols etc.
\usepackage[T1]{fontenc} % Output settings
\usepackage[utf8]{inputenc} % Input settings
\usepackage{amsmath} % Mathematical expressions (American mathematical society)
\usepackage{amssymb} % Mathematical symbols (American mathematical society)
\usepackage{graphicx} % Figures
\numberwithin{equation}{chapter} % Numbering order for equations
\numberwithin{figure}{chapter} % Numbering order for figures
\numberwithin{table}{chapter} % Numbering order for tables
\usepackage[top=3cm, bottom=3cm,
inner=3cm, outer=3cm]{geometry} % Page margin lengths
\usepackage{float} % Enables object position enforcement using [H]
\usepackage{siunitx} % For units
\usepackage{gensymb} % For certain symbols such as \degree
\usepackage{parskip} % Enables vertical spaces correctly
\begin{document}
\begin{table}[H]
\begin{tabular}{
>{\columncolor[HTML]{8E7CC3}}l
>{\columncolor[HTML]{D9D2E9}}l
>{\columncolor[HTML]{FFF2CC}}l
>{\columncolor[HTML]{EA9999}}l}
\cline{1-3}
\multicolumn{1}{|l|}{\cellcolor[HTML]{8E7CC3}\textbf{Krav}} & \multicolumn{1}{l|}{\cellcolor[HTML]{D9D2E9}\textbf{Mått}} & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}\textbf{Beskrivning}} & \textbf{Kravtyp} \\ \cline{1-3}
\multicolumn{1}{|l}{\cellcolor[HTML]{8E7CC3}First thing} & $50-54\degree C$ & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this} & Krav \\
\multicolumn{1}{|l}{\cellcolor[HTML]{8E7CC3}Second thing} & $x mAh (5V)$ & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this} & Krav \\
\multicolumn{1}{|l}{\cellcolor[HTML]{8E7CC3}Third thing} & - & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this} & Krav \\
\cellcolor[HTML]{8E7CC3}Fourth thing & \cellcolor[HTML]{D9D2E9}{\color[HTML]{000000} \textgreater{}$100\degree C$} & \cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this & \cellcolor[HTML]{EA9999}Krav \\
\multicolumn{1}{|l}{\cellcolor[HTML]{8E7CC3}Fifth thing} & - & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this} & Krav \\
\multicolumn{1}{|l}{\cellcolor[HTML]{8E7CC3}Sixth thing} & - & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this} & Önskemål \\
\multicolumn{1}{|l}{\cellcolor[HTML]{8E7CC3}Seventh thing} & - & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this} & Önskemål \\
\multicolumn{1}{|l}{\cellcolor[HTML]{8E7CC3}Eighth thing} & - & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this} & Önskemål
\end{tabular}
\end{table}
\end{document}
```
I am writing in overleaf.
| https://tex.stackexchange.com/users/282391 | Text wrapping inside table using p{} specification | false | I realized what I said in my comment and also typesetted the units correctly using `siunitx`'s `\qty`.
```
\documentclass[12pt,a4paper,swedish]{report}
\usepackage[table]{xcolor} % For tables (color)
\usepackage{moreverb} % List settings
\usepackage{textcomp} % Fonts, symbols etc.
\usepackage[T1]{fontenc} % Output settings
\usepackage[utf8]{inputenc} % Input settings
\usepackage{amsmath} % Mathematical expressions (American mathematical society)
\usepackage{amssymb} % Mathematical symbols (American mathematical society)
\usepackage{graphicx} % Figures
\numberwithin{equation}{chapter} % Numbering order for equations
\numberwithin{figure}{chapter} % Numbering order for figures
\numberwithin{table}{chapter} % Numbering order for tables
\usepackage[top=3cm, bottom=3cm,
inner=3cm, outer=3cm]{geometry} % Page margin lengths
\usepackage{float} % Enables object position enforcement using [H]
\usepackage{siunitx} % For units
\usepackage{gensymb} % For certain symbols such as \degree
\usepackage{parskip} % Enables vertical spaces correctly
\begin{document}
\begin{table}[H]
\begin{tabular}{
|>{\columncolor[HTML]{8E7CC3}}p{3cm}
|>{\columncolor[HTML]{D9D2E9}}p{3cm}
|>{\columncolor[HTML]{FFF2CC}}p{4cm}
|>{\columncolor[HTML]{EA9999}}p{3cm}|}
\cline{1-3}
\textbf{Krav} & \textbf{Mått} & \textbf{Beskrivning} & \textbf{Kravtyp} \\ \cline{1-3}
First thing & \qtyrange{50}{54}{\celsius} & This is how the thing works and so on. These cells have much text. Kind of like this & Krav \\
Second thing & \qty[parse-numbers=false]{x}{\milli\ampere\hour} (\qty{5}{\volt}) & This is how the thing works and so on. These cells have much text. Kind of like this & Krav \\
Third thing & - & This is how the thing works and so on. These cells have much text. Kind of like this & Krav \\
Fourth thing & \qty{>100}{\celsius} & This is how the thing works and so on. These cells have much text. Kind of like this & Krav \\
Fifth thing & - & This is how the thing works and so on. These cells have much text. Kind of like this & Krav \\
Sixth thing & - & This is how the thing works and so on. These cells have much text. Kind of like this & Önskemål \\
Seventh thing & - & This is how the thing works and so on. These cells have much text. Kind of like this & Önskemål \\
Eighth thing & - & This is how the thing works and so on. These cells have much text. Kind of like this & Önskemål
\end{tabular}
\end{table}
\end{document}
```
Is there a reason why you do not want horizontal lines over the last column?
| 2 | https://tex.stackexchange.com/users/237192 | 680628 | 315,787 |
https://tex.stackexchange.com/questions/680583 | 1 | Since I like to make the end of a book with a nice looking end-sign to close the text finally and visually, I want to use the package `bbding`. But my choosen sign is not visible in the epub done by tex4ebook when viewed in Adobe Digital Edition laptop version. The following shows a little MWE:
```
\documentclass[11pt,a4paper]{report}
\usepackage{ebgaramond-maths}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{bbding}
\usepackage{verbatim}
\usepackage{tex4ebook}
\begin{document}
Package bbding use in \TeX4ebook:\\
\verb+\AsteriskCenterOpen+: \AsteriskCenterOpen \quad will not be shown in epub \\
\verb+\EightStarTaper+: \EightStarTaper \quad will be shown in epub, but not so nice\\
\verb+\AsteriskThinCenterOpen+: \AsteriskThinCenterOpen \quad will not be shown in epub
Package bbding does work with pdflatex but not completely right with \TeX4ebook. Why?
\end{document}
```
Is the problem a systematic problem with tex4ebook or with Adobe Digital Edition laptop version?
| https://tex.stackexchange.com/users/292824 | bbding seems not to be completely transmitted via tex4ebook does not show all signs in epub | true | The symbols used by `bbding` are supported by TeX4ht, but it outputs Unicode characters for them. I can see the result in Calibre, but it is possible that your Epub reader doesn't have a font that supports them. In this case, you can convert these symbols to pictures. Try this file, `bbding.4ht`:
```
\NewConfigure{bbding}{2}
\def\:tempa#1{\a:bbding\o:@chooseSymbol:{#1}\b:bbding}
\HLet\@chooseSymbol\:tempa
\Configure{bbding}{\Picture+{}}{\EndPicture}
\endinput
```
It attaches TeX4ht instructions for the picture conversion to the `\@chooseSymbol` command. This command is used by `bbding` to print symbols.
This is the result:
| 0 | https://tex.stackexchange.com/users/2891 | 680632 | 315,789 |
https://tex.stackexchange.com/questions/680626 | 4 | So a while ago I wanted to change the font for my integrals, but not any other part of the font. What I ended up doing is just putting the following into my .sty file.
```
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{<->mathx10}{}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareMathSymbol{\intop} {\mathop}{mathx}{"B3}
\DeclareMathSymbol{\iintop} {\mathop}{mathx}{"B4}
\DeclareMathSymbol{\iiintop}{\mathop}{mathx}{"B5}
\DeclareMathSymbol{\ointop} {\mathop}{mathx}{"B6}
\DeclareMathSymbol{\oiintop}{\mathop}{mathx}{"B7}
```
This does work, but I get 5 (essentially equivalent) error messages saying, e.g., "\iint already defined." The errors aren't exactly hurting anything---everything compiles just fine---but it would be nice to get rid of them and possibly learn something about TeX on the way. Does anyone know how to get rid of these error messages?
Thanks!
Edit: Below is an example of something that compiles but produces the aforementioned error.
```
\documentclass{article}
\usepackage{pxfonts}
\usepackage{amsmath}
\usepackage{mathpazo}
\usepackage{amsthm}
% Different integral font
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{<->mathx10}{}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareMathSymbol{\intop} {\mathop}{mathx}{"B3}
\DeclareMathSymbol{\iintop} {\mathop}{mathx}{"B4}
\DeclareMathSymbol{\iiintop}{\mathop}{mathx}{"B5}
\DeclareMathSymbol{\ointop} {\mathop}{mathx}{"B6}
\DeclareMathSymbol{\oiintop}{\mathop}{mathx}{"B7}
\begin{document}
We say that a measurable function $f$ is of bounded mean oscillation if
\begin{align*}
\|f\|_{BMO} := \sup_{B \text{ ball}} \left( \frac{1}{\mu(B)} \inf_{a\in\mathbb{R}} \int_B |f - a| \, d\mu \right) < \infty .
\end{align*}
\end{document}
```
| https://tex.stackexchange.com/users/293586 | Changing font for integrals without errors | false | I have removed all the error messages. Look into the code the done differences.
```
\documentclass{article}
\usepackage{amsmath}
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{<->mathx10}{}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareMathSymbol{\intop} {\mathop}{mathx}{"B3}
\DeclareMathSymbol{\iintop} {\mathop}{mathx}{"B4}
\DeclareMathSymbol{\iiintop}{\mathop}{mathx}{"B5}
\DeclareMathSymbol{\ointop} {\mathop}{mathx}{"B6}
\DeclareMathSymbol{\oiintop}{\mathop}{mathx}{"B7}
\usepackage{pxfonts}
\usepackage{mathpazo}
\let\openbox\relax
\let\proof\relax
\let\endproof\relax
\usepackage{amsthm}
\begin{document}
We say that a measurable function $f$ is of bounded mean oscillation if
\begin{align*}
\|f\|_{BMO} := \sup_{B \text{ ball}} \left( \frac{1}{\mu(B)} \inf_{a\in\mathbb{R}} \int_B |f - a| \, d\mu \right) < \infty .
\end{align*}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/117876 | 680639 | 315,791 |
https://tex.stackexchange.com/questions/680626 | 4 | So a while ago I wanted to change the font for my integrals, but not any other part of the font. What I ended up doing is just putting the following into my .sty file.
```
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{<->mathx10}{}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareMathSymbol{\intop} {\mathop}{mathx}{"B3}
\DeclareMathSymbol{\iintop} {\mathop}{mathx}{"B4}
\DeclareMathSymbol{\iiintop}{\mathop}{mathx}{"B5}
\DeclareMathSymbol{\ointop} {\mathop}{mathx}{"B6}
\DeclareMathSymbol{\oiintop}{\mathop}{mathx}{"B7}
```
This does work, but I get 5 (essentially equivalent) error messages saying, e.g., "\iint already defined." The errors aren't exactly hurting anything---everything compiles just fine---but it would be nice to get rid of them and possibly learn something about TeX on the way. Does anyone know how to get rid of these error messages?
Thanks!
Edit: Below is an example of something that compiles but produces the aforementioned error.
```
\documentclass{article}
\usepackage{pxfonts}
\usepackage{amsmath}
\usepackage{mathpazo}
\usepackage{amsthm}
% Different integral font
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{<->mathx10}{}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareMathSymbol{\intop} {\mathop}{mathx}{"B3}
\DeclareMathSymbol{\iintop} {\mathop}{mathx}{"B4}
\DeclareMathSymbol{\iiintop}{\mathop}{mathx}{"B5}
\DeclareMathSymbol{\ointop} {\mathop}{mathx}{"B6}
\DeclareMathSymbol{\oiintop}{\mathop}{mathx}{"B7}
\begin{document}
We say that a measurable function $f$ is of bounded mean oscillation if
\begin{align*}
\|f\|_{BMO} := \sup_{B \text{ ball}} \left( \frac{1}{\mu(B)} \inf_{a\in\mathbb{R}} \int_B |f - a| \, d\mu \right) < \infty .
\end{align*}
\end{document}
```
| https://tex.stackexchange.com/users/293586 | Changing font for integrals without errors | false | You need put `pxfonts` on the behind.
```
\usepackage{amsmath}
\usepackage{mathpazo}
\usepackage{amsthm}
\usepackage{pxfonts}
```
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathpazo}
\usepackage{amsthm}
\usepackage{pxfonts}
% Different integral font
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{<->mathx10}{}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareMathSymbol{\intop} {\mathop}{mathx}{"B3}
\DeclareMathSymbol{\iintop} {\mathop}{mathx}{"B4}
\DeclareMathSymbol{\iiintop}{\mathop}{mathx}{"B5}
\DeclareMathSymbol{\ointop} {\mathop}{mathx}{"B6}
\DeclareMathSymbol{\oiintop}{\mathop}{mathx}{"B7}
\begin{document}
We say that a measurable function $f$ is of bounded mean oscillation if
\begin{align*}
\|f\|_{BMO} := \sup_{B \text{ ball}} \left( \frac{1}{\mu(B)} \inf_{a\in\mathbb{R}} \int_B |f - a| \, d\mu \right) < \infty .
\end{align*}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/238422 | 680640 | 315,792 |
https://tex.stackexchange.com/questions/680626 | 4 | So a while ago I wanted to change the font for my integrals, but not any other part of the font. What I ended up doing is just putting the following into my .sty file.
```
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{<->mathx10}{}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareMathSymbol{\intop} {\mathop}{mathx}{"B3}
\DeclareMathSymbol{\iintop} {\mathop}{mathx}{"B4}
\DeclareMathSymbol{\iiintop}{\mathop}{mathx}{"B5}
\DeclareMathSymbol{\ointop} {\mathop}{mathx}{"B6}
\DeclareMathSymbol{\oiintop}{\mathop}{mathx}{"B7}
```
This does work, but I get 5 (essentially equivalent) error messages saying, e.g., "\iint already defined." The errors aren't exactly hurting anything---everything compiles just fine---but it would be nice to get rid of them and possibly learn something about TeX on the way. Does anyone know how to get rid of these error messages?
Thanks!
Edit: Below is an example of something that compiles but produces the aforementioned error.
```
\documentclass{article}
\usepackage{pxfonts}
\usepackage{amsmath}
\usepackage{mathpazo}
\usepackage{amsthm}
% Different integral font
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{<->mathx10}{}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareMathSymbol{\intop} {\mathop}{mathx}{"B3}
\DeclareMathSymbol{\iintop} {\mathop}{mathx}{"B4}
\DeclareMathSymbol{\iiintop}{\mathop}{mathx}{"B5}
\DeclareMathSymbol{\ointop} {\mathop}{mathx}{"B6}
\DeclareMathSymbol{\oiintop}{\mathop}{mathx}{"B7}
\begin{document}
We say that a measurable function $f$ is of bounded mean oscillation if
\begin{align*}
\|f\|_{BMO} := \sup_{B \text{ ball}} \left( \frac{1}{\mu(B)} \inf_{a\in\mathbb{R}} \int_B |f - a| \, d\mu \right) < \infty .
\end{align*}
\end{document}
```
| https://tex.stackexchange.com/users/293586 | Changing font for integrals without errors | false | It makes no sense to load both `pxfonts` and `mathpazo`. Both will select their own version of Palatino for text and math and loading one after the other will override any of the fonts chosen by the first loaded one.
Besides, `pxfonts` suffers from really bad kerning in the math fonts and `mathpazo` is old and unmaintained.
Why not loading NewPX instead?
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{newpxtext,newpxmath}
% Different integral font
\DeclareFontFamily{U}{mathx}{}
\DeclareFontShape{U}{mathx}{m}{n}{<->mathx10}{}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareMathSymbol{\intop} {\mathop}{mathx}{"B3}
\DeclareMathSymbol{\iintop} {\mathop}{mathx}{"B4}
\DeclareMathSymbol{\iiintop}{\mathop}{mathx}{"B5}
\DeclareMathSymbol{\ointop} {\mathop}{mathx}{"B6}
\DeclareMathSymbol{\oiintop}{\mathop}{mathx}{"B7}
\begin{document}
We say that a measurable function $f$ is of bounded mean oscillation if
\begin{equation*}
\|f\|_{\mathrm{BMO}} := \sup_{B \text{ ball}}
\left( \frac{1}{\mu(B)} \inf_{a\in\mathbb{R}} \int_B |f - a| \, d\mu \right) < \infty .
\end{equation*}
\end{document}
```
This is the output with `mathpazo` instead of NewPX
This is the output with `pxfonts` (only), which is really cramped:
| 4 | https://tex.stackexchange.com/users/4427 | 680642 | 315,794 |
https://tex.stackexchange.com/questions/680631 | 2 | I am using Sublime Text 3 with LatexTools and Texlive. If, after compiling with biber I get an error due to an undefined citation, the next compile runs automatically with bibtex instead, in which case all citations are wrong.
MWE:
```
\begin{filecontents}{test-bib.bib}
@article{test,
author = {A. Author},
title = {Paper},
year = {2023},
journal = {Journal},
number = {1},
pages = {1-10},
}
\end{filecontents}
\documentclass{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{test-bib.bib}
\begin{document}
\cite{test}
\cite{bibid}
\printbibliography
\end{document}
```
Compiling this once with Ctrl+B runs pdflatex, biber, pdflatex, pdflatex and gives the error:
```
Package biblatex Warning: The following entry could not be found(biblatex) in the database:(biblatex) bibid(biblatex) Please verify the spelling and rerun(biblatex) LaTeX afterwards.
LaTeX Warning: Citation 'bibid' on page 1 undefined on input line 18.
```
Immediately compiling again with Ctrl+B runs pdflatex, bibtex, pdflatex, pdflatex and gives the error:
```
LaTeX Warning: Citation 'test' on page 1 undefined on input line 17.
LaTeX Warning: Citation 'bibid' on page 1 undefined on input line 18.
LaTeX Warning: Empty bibliography on input line 20.
LaTeX Warning: There were undefined references.
Package biblatex Warning: Please (re)run Biber on the file:(biblatex) test_bib(biblatex) and rerun LaTeX afterwards.
```
Compiling again reruns with biber and cycles through the two options.
The expected output should instead be the error:
```
LaTeX Warning: Citation 'bibid' on page 1 undefined on input line 18.
LaTeX Warning: There were undefined references.
Package biblatex Warning: Please (re)run Biber on the file:(biblatex) test_bib(biblatex) and rerun LaTeX afterwards.
```
and that pressing Ctrl+B would rerun with biber.
I have tried both the traditional, basic and simple builders - they all give this result.
How do I fix this? Alternatively, is there a way of forcing a compile with biber?
| https://tex.stackexchange.com/users/293590 | Sublime text changing from biber to bibtex upon error | true | As it stands there are potential pitfalls with all of the simple/traditional/basic builders in [LaTeXTools](https://github.com/SublimeText/LaTeXTools/)
The [simple builder](https://github.com/SublimeText/LaTeXTools/blob/b27fc391b2e0c7298d7e2be2472f3642e25ed3d2/builders/simpleBuilder.py) always runs `bibtex`. This cannot be used with `biber` and will mess up any previous `biber` compilations.
The [traditional builder](https://github.com/SublimeText/LaTeXTools/blob/b27fc391b2e0c7298d7e2be2472f3642e25ed3d2/builders/traditionalBuilder.py) runs `texify` if it detects MiKTeX on Windows, otherwise it uses `latexmk`. I believe `texify` will only ever compile `bibtex`, however `latexmk` should reliably auto-compile `biber`.
The [basic builer](https://github.com/SublimeText/LaTeXTools/blob/b27fc391b2e0c7298d7e2be2472f3642e25ed3d2/builders/basicBuilder.py) (which seems the most complex as it tries to manage everything itself) will run `bibtex` or `biber` as long as there is a citation undefined warning in the log.
Unfortunately it will run `bibtex` unless the log file explicitly contains a warning from [`biblatex`](https://www.ctan.org/pkg/biblatex) to rerun `biber`, which is not sufficient.
In your example, after `biber` has been run, it places in the `.bbl` file a note that the reference `bibid` was missing from the supplied bib files, so [`biblatex`](https://www.ctan.org/pkg/biblatex) just logs the citation as not found, it knows `biber` has been run and failed to find the log file so just re-running `biber` won't help.
Then, finding a "citation undefined" warning but this time no "(re)run biber" warning, the basic builder executes `bibtex` which breaks the bibliography, but returns the "(re)run biber" notice, hence the return to running `biber` on the subsequent compilation.
Obviously you can just run `biber` on the command line as necessary, but all three of the builders will try and fix any undefined citation errors, which is liable to trigger a `bibtex` run, breaking the bibliography.
<https://latextools.readthedocs.io/en/latest/available-builders/#script-builder> seems to allow you to provide your own set of compilation instructions which would appear to allow you to set a compilation that always run `pdflatex` then `biber` then `pdlfatex`.
| 2 | https://tex.stackexchange.com/users/106162 | 680643 | 315,795 |
https://tex.stackexchange.com/questions/680645 | 4 | The following MWE produces the expected index entries for Q and Z but none for N. I guess this must be some strange interaction between `\footnote`, `\mathbb`, and `\index`, but how do I fix it?
```
\documentclass{book}
\usepackage{fourier}
\usepackage{imakeidx}
\makeindex
\begin{document}
Some\index{Q@$\mathbb{Q}$} text.\footnote{Here we explain $\mathbb{N}$\index{N@$\mathbb{N}$} and Z.\index{Z@$Z$}}
\printindex
\end{document}
```
| https://tex.stackexchange.com/users/52582 | Index entry with blackboard font in footnote ignored | true | The `fourier` package does a “bad thing”™, namely
```
\DeclareSymbolFontAlphabet{\math@bb}{Ufutm}
\AtBeginDocument{\let\mathbb\math@bb}
```
Fix it.
```
\documentclass{book}
\usepackage{fourier}
\usepackage{imakeidx}
\makeindex
\AtBeginDocument{\DeclareSymbolFontAlphabet{\mathbb}{Ufutm}}
\begin{document}
Some\index{Q@$\mathbb{Q}$} text.\footnote{Here we explain $\mathbb{N}$\index{N@$\mathbb{N}$} and Z.\index{Z@$Z$}}
\printindex
\end{document}
```
But beware that another call of `\index{N@$\mathbb{N}$}` not in a footnote might produce another entry in the index, so it's better to use
```
\index{N@$\string\mathbb{N}$}
```
when in a footnote.
| 5 | https://tex.stackexchange.com/users/4427 | 680648 | 315,797 |
https://tex.stackexchange.com/questions/424200 | 64 | I see several users in this forum talk about `\smash`. It is apparently defined in base TeX.
What does `\smash` do?
For future reference, is there online documentation where I could find this?
| https://tex.stackexchange.com/users/2562 | What does \smash do, and where is it documented? | false | For what it's worth, from [User’s Guide for the amsmath Package](http://www.ams.org/arc/tex/amsmath/amsldoc.pdf):
>
> The command \smash is used to typeset a subformula with an effective height and depth of zero, which is sometimes useful in adjusting the subformula’s position with respect to adjacent symbols.
>
>
>
>
> With the amsmath package \smash has optional arguments [t] and [b] because occasionally it is advantageous to be able to “smash” only the top or only the bottom of something while retaining the natural depth or height.
>
>
>
>
> For example, when adjacent radical symbols are
> unevenly sized or positioned because of differences in the height and depth of their contents, \smash can be employed to make them more consistent.
>
>
>
And they provide an example using `\smash[b]` under the square root symbol:
Without this option:
With it:
```
\sqrt{x} + \sqrt{\smash[b]{y}} + \sqrt{z}
```
The second radicand has reduced vertical limits for its bounding box.
| 0 | https://tex.stackexchange.com/users/289991 | 680650 | 315,798 |
https://tex.stackexchange.com/questions/83204 | 20 | Is it possible to make source code with minted copyable?
Here is a minimal example how I include source code (completely, with minimal java code, on [GitHub](https://github.com/MartinThoma/LaTeX-examples/tree/master/documents/source-code-minted)):
```
\documentclass{beamer}
\usepackage[utf8]{inputenc} % this is needed for german umlauts
\usepackage[ngerman]{babel} % this is needed for german umlauts
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
\usepackage{minted} % needed for the inclusion of source code
\begin{document}
\section{Section}
\subsection{MySubSection}
\begin{frame}{Blubtitle}
\inputminted[linenos=true, numbersep=5pt, tabsize=4, fontsize=\small]{java}{IataCode.java}
\end{frame}
\end{document}
```
When I copy the results, I get this:
```
public class IataCode {
public static void printIATACodes(String[] myArray) {
for (int i = 0; i < myArray.length; i++) {
System.out.println(myArray[i]);
}
}
7
public static void main(String[] args) {
String[] iataCodes = new String[4];
// Flughafen München
iataCodes[0] = "MUC";
// Flughafen Berlin Brandenburg
iataCodes[1] = "BER";
// Flughafen Augsburg
iataCodes[2] = "AGB";
printIATACodes(iataCodes);
}
8
9
10
11
12
13
14
15
16
17
18
}
```
But I would like to get this:
```
public class IataCode {
public static void printIATACodes(String[] myArray) {
for (int i = 0; i < myArray.length; i++) {
System.out.println(myArray[i]);
}
}
public static void main(String[] args) {
String[] iataCodes = new String[4];
// Flughafen München
iataCodes[0] = "MUC";
// Flughafen Berlin Brandenburg
iataCodes[1] = "BER";
// Flughafen Augsburg
iataCodes[2] = "AGB";
printIATACodes(iataCodes);
}
}
```
So, I basicly want to know if I can achieve [this](https://tex.stackexchange.com/a/30310/5645) (see [compiled PDF and minimal source code example](https://github.com/MartinThoma/LaTeX-examples/tree/master/documents/source-code-listings) to try it yourself) for minted, too.
| https://tex.stackexchange.com/users/5645 | How can I make source code included with minted copyable? | false | I port my answer <https://tex.stackexchange.com/a/680651/250119> for `listings` package to `minted` package. Explanation how it works etc. is in that answer.
```
\documentclass{article}
\usepackage{minted}
\usepackage{graphicx}
\usepackage{tikz}
\begin{document}
\RenewDocumentCommand\theFancyVerbLine{}{%
\tikz[remember picture] \coordinate (line\the\value{FancyVerbLine});% remember this location
% --
\rmfamily\tiny\phantom{\arabic{FancyVerbLine}}% leave space equal to the line number itself
% \tiny must be outside any group so that it applies to the following \kern
% --
\xappto\typesetPendingLineNumbers{\actualTypesetLineNumber{\the\value{FancyVerbLine}}}% remember to typeset it later
}
% this command must be robust because it's used inside \xappto
\NewDocumentCommand\actualTypesetLineNumber{m}{%
\node [anchor=south west, inner sep=0pt] at (line#1){\rmfamily\tiny#1};% actually typeset it now, need to copy the \tiny here
}
\AddToHook{env/minted/begin}{%
\gdef\typesetPendingLineNumbers{}%
}
\AddToHook{env/minted/after}{%
\begin{tikzpicture}[remember picture, overlay]%
\typesetPendingLineNumbers
\end{tikzpicture}%
}
\begin{minted}[linenos]{java}
public class IataCode {
public static void printIATACodes(String[] myArray) {
for (int i = 0; i < myArray.length; i++) {
System.out.println(myArray[i]);
}
}
public static void main(String[] args) {
String[] iataCodes = new String[4];
// Flughafen München
iataCodes[0] = "MUC";
// Flughafen Berlin Brandenburg
iataCodes[1] = "BER";
// Flughafen Augsburg
iataCodes[2] = "AGB";
printIATACodes(iataCodes);
}
}
\end{minted}
\RenewDocumentCommand\theFancyVerbLine{}{\rmfamily \tiny \arabic {FancyVerbLine}} % default definition
\begin{minted}[linenos]{java}
public class IataCode {
public static void printIATACodes(String[] myArray) {
for (int i = 0; i < myArray.length; i++) {
System.out.println(myArray[i]);
}
}
public static void main(String[] args) {
String[] iataCodes = new String[4];
// Flughafen München
iataCodes[0] = "MUC";
// Flughafen Berlin Brandenburg
iataCodes[1] = "BER";
// Flughafen Augsburg
iataCodes[2] = "AGB";
printIATACodes(iataCodes);
}
}
\end{minted}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/250119 | 680652 | 315,800 |
https://tex.stackexchange.com/questions/680653 | 0 | I want boxes A,C,D and E have the same color as box B. Also I want the arrow between A and E point from E to A. I also want the arrow from B to A to be of color blue. Below is the MWE that I adopted from [smartdiagram tabular inside additions nodes](https://tex.stackexchange.com/questions/321809/smartdiagram-tabular-inside-additions-nodes):
```
\documentclass[12pt,a4paper,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[rgb]{xcolor}
\usepackage{tikz}
\usetikzlibrary{shadows}
\usetikzlibrary{mindmap,arrows}
\usepackage{smartdiagram}
\usesmartdiagramlibrary{additions}
\begin{document}
\definecolorseries{colours}{hsb}{grad}[hsb]{.575,1,1}{.987,-.234,0}
\resetcolorseries[12]{colours}
\smartdiagramset{%
back arrow disabled=true,
module minimum width=4cm,
module minimum height=4cm,
module x sep=5cm,
text width=4cm,
arrow style=<-,
additions={
additional item offset=1cm,
additional item fill color=orange!36,
additional item border color=blue,
additional arrow color=blue,
additional item width=4cm,
additional item height=4cm,
additional item text width=4cm,
additional item bottom color=orange!36,
additional item shadow=drop shadow,
}
}
\vspace*{50mm}
\newsavebox\outputbox
\sbox\outputbox{%
\begin{tabular}{c}
E \\ \hline
\end{tabular}%
}
\smartdiagramadd[flow diagram:horizontal]{
\begin{tabular}{c}
B \\ \hline
\\
\\
\\
\end{tabular}, A
}{%
below of module2/ \usebox\outputbox,
right of module2/\underline{D}, above of module2/C
}
\smartdiagramconnect{->}{module2/additional-module1} \smartdiagramconnect{->}{additional-module2/module2}
\smartdiagramconnect{->}{additional-module3/module2}
\end{document}
```
| https://tex.stackexchange.com/users/218479 | Coloring and arrow orientation of smart diagram | true | You could do the following:
```
\documentclass[12pt,a4paper]{report}
\usepackage{smartdiagram}
\usesmartdiagramlibrary{additions}
\begin{document}
\smartdiagramset{%
back arrow disabled=true,
module minimum width=4cm,
module minimum height=4cm,
module x sep=5cm,
text width=4cm,
arrow style=<-,
uniform arrow color=true,
arrow color=blue,
uniform color list={red!50 for 2 items},
additions={
additional item offset=1cm,
additional item border color=blue,
additional arrow color=blue,
additional item width=4cm,
additional item height=4cm,
additional item text width=4cm,
additional item bottom color=red!50,
additional item shadow=drop shadow,
}
}
\vspace*{50mm}
\newsavebox\outputboxx
\sbox\outputboxx{%
\begin{tabular}{c}
E \\ \hline
\end{tabular}%
}
\smartdiagramadd[flow diagram:horizontal]{
\begin{tabular}{c}
B \\ \hline
\\
\\
\\
\end{tabular}, A
}{%
below of module2/\usebox\outputboxx,
right of module2/\underline{D}, above of module2/C
}
\smartdiagramconnect{<-}{module2/additional-module1}
\smartdiagramconnect{->}{additional-module2/module2}
\smartdiagramconnect{->}{additional-module3/module2}
\end{document}
```
However, the distance between A and B is not the same as the distance between the other boxes and also, boxes C, D and E have a blue border. I am not sure whether you want it this way.
---
I think that it is at least as easy to directly draw this using Ti*k*Z which also makes it easier to exactly position things (while at the same time having as much flexibility as possible):
```
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning, shadows}
\begin{document}
\begin{tikzpicture}[
mybox/.style={
minimum width=4cm,
minimum height=4cm,
rounded corners,
draw=gray,
top color=red!0,
bottom color=red!50,
drop shadow,
},
myconnect/.style={
-latex,
ultra thick,
blue,
}]
\node[mybox] at (0,0) (A) {
A
};
\node[mybox, left=7.5mm of A] (B) {
\begin{tabular}{c}
B \\ \hline
\\
\\
\\
\end{tabular}
};
\node[mybox, above=7.5mm of A] (C) {
C
};
\node[mybox, right=7.5mm of A] (D) {
\underline{D}
};
\node[mybox, below=7.5mm of A] (E) {
\begin{tabular}{c}
E \\ \hline
\end{tabular}
};
\draw[myconnect] (B) -- (A);
\draw[myconnect] (C) -- (A);
\draw[myconnect] (D) -- (A);
\draw[myconnect] (E) -- (A);
\end{tikzpicture}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/47927 | 680655 | 315,801 |
https://tex.stackexchange.com/questions/680654 | 1 | I'm citing a scientific data set for which the "official" BibTeX entry supplied by the data provider looks like this:
```
@misc{ds548.0,
address = {Boulder CO},
author = {{Research Data Archive, Computational and Information Systems Laboratory, National Center for Atmospheric Research, University Corporation for Atmospheric Research}
and
{Physical Sciences Division, Earth System Research Laboratory, OAR, NOAA, U.S. Department of Commerce}
and
{Cooperative Institute for Research in Environmental Sciences, University of Colorado}
and
{National Oceanography Centre, University of Southampton}
and
{Met Office, Ministry of Defence, United Kingdom}
and
{Deutscher Wetterdienst (German Meteorological Service), Germany}
and
{Department of Atmospheric Science, University of Washington}
and
{Center for Ocean-Atmospheric Prediction Studies, Florida State University}
and
{National Centers for Environmental Information, NESDIS, NOAA, U.S. Department of Commerce}},
date-added = {2020-07-06 18:21:38 -0500},
date-modified = {2020-07-06 18:23:20 -0500},
publisher = {Research Data Archive at the National Center for Atmospheric Research, Computational and Information Systems Laboratory},
title = {{International Comprehensive Ocean-Atmosphere Data Set (ICOADS) Release 3, Individual Observations}},
url = {https://doi.org/10.5065/D6ZS2TR3},
year = {2016},
Bdsk-Url-1 = {https://doi.org/10.5065/D6ZS2TR3}}
```
The problem lies in the length of the first author: "Research Data Archive, Computational and Information Systems Laboratory, National Center for Atmospheric Research, University Corporation for Atmospheric Research".
Among other things, the LaTeX engine in Overleaf raises the following error: "you've exceeded 250, the entry-string-size, for entry ds548.0". But even apart from that, an author-year citation that uses the first author as shown will look ungainly in print.
My question is whether there's a way to preserve the "author" information in the citation as it appears in the bibliography at the end while shortening the citation as it appears in the body of the text and also circumventing the 250-character limit. Note that AGU publications only permit the \cite and \citeA commands, and they don't permit \nocite, which precludes one possible workaround.
I'm using the journal-supplied document class 'agujournal2019', which in turn appears to use the 'apacite' bibliography style.
| https://tex.stackexchange.com/users/25086 | How can I sanely format a problem .bib entry? | true | Since you employ the `apacite` citation management package -- with the option `natbibapa`, right? -- and the eponymous bibliography style, I suggest you make use of natbib's citation aliasing capabilities. E.g., run
```
\defcitealias{ds548.0}{Research Data Archive et~al. (2016)}
```
in the preamble and
```
\citetalias{ds548.0}
```
in the body of the document.
A separate comment: For an entry of type `@misc`, all bibliography styles I'm aware of know what to do if they encounter a field called `howpublished`; however, none of them are programmed to handle a field called `publisher`. I would therefore rename the `publisher` field to `howpublished`. I'd also copy the contents of the `address` field into the `howpublished` field, and I'd encase the contents of the `title` field in a pair of curly braces, to prevent the field's contents from being converted to lowercase. (If nothing else, you should encase the ICOADS acronym in curly braces.)
The following screenshot shows the resulting citation call-out and the first three lines of the associated formatted bibliographic entry.
```
\documentclass{article} % or 'agujournal2019', if available
\begin{filecontents}[overwrite]{mybib.bib}
% from https://rda.ucar.edu/datasets/ds548.0/citation/
@misc{ds548.0,
author = "{Research Data Archive, Computational and Information Systems Laboratory, National Center for Atmospheric Research, University Corporation for Atmospheric Research} and {Physical Sciences Laboratory, Earth System Research Laboratory, OAR, NOAA, U.S. Department of Commerce} and {Cooperative Institute for Research in Environmental Sciences, University of Colorado} and {National Oceanography Centre, University of Southampton} and {Met Office, Ministry of Defence, United Kingdom} and {Deutscher Wetterdienst (German Meteorological Service), Germany} and {Department of Atmospheric Science, University of Washington} and {Center for Ocean-Atmospheric Prediction Studies, Florida State University} and {National Centers for Environmental Information, NESDIS, NOAA, U.S. Department of Commerce}",
title = "{International Comprehensive Ocean-Atmosphere Data Set (ICOADS) Release 3, Individual Observations}",
howpublished = "Research Data Archive at the National Center for Atmospheric Research, Computational and Information Systems Laboratory, Boulder CO",
xaddress = {Boulder CO},
year = "2016",
url = "https://doi.org/10.5065/D6ZS2TR3"
}
\end{filecontents}
\usepackage[natbibapa]{apacite}
\defcitealias{ds548.0}{Research Data Archive et~al. (2016)}
\bibliographystyle{apacite}
\usepackage{xurl} % for long and complicated URL strings
\begin{document}
\citetalias{ds548.0}
\bibliography{mybib}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/5001 | 680656 | 315,802 |
https://tex.stackexchange.com/questions/680658 | 1 | I am trying to reference to an element inside an `align` environment inside a `subequations` environment. The reference number using is shown correctly by the
`eqref` command, but when clicked points to the incorrect equation. I report a minimal sample that reproduces the problem, and I would love some help.
```
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{amsmath,bm}
\begin{document}
First NLP
\begin{subequations}\label{eq:opt_00}
\begin{align}
&\min_{\bm{x}} J(\bm{x}) \\
&\text{subject to:} \nonumber \\
&\bm{x}_{min} \le \bm{x} \le \bm{x}_{max} \label{eq:opt_kin_bounds}\\
&\textit{some constraint on } \bm{x} \label{eq:opt_kin_ballistic}
\end{align}
\end{subequations}
Then another NLP
\begin{subequations}\label{eq:opt_0}
\begin{align}
&\min_{\bm{w}} J(\bm{w}) \\
&\text{subject to:} \nonumber \\
&\bm{x}_{i+1}-\bm{\phi}^L_{d\text{-}t}(\bm{x}_i,\bm{u}_i)=\ \bm{0} \quad i=0 \hdots N-1 \label{eq:opt_0_dynamics} \\
&\bm{x}_0-\bm{x}_{init}= \ \bm{0} \label{eq:opt_0_xinit}\\
&\bm{x}_N - \bm{x}_{th}=\bm{0} \label{eq:opt_0_xthrow}\\
&\bm{x}_{min} \le \bm{x}_i \le \bm{x}_{max} \quad i=0 \hdots N \label{eq:opt_0_xbound}\\
&\bm{u}_{min} \le \bm{u}_i \le \bm{u}_{max} \quad i=0 \hdots N-1 \label{eq:opt_0_ubound}\\
&\textit{some constraints at } i=0 \hdots N \label{eq:opt_0_bal}.
\end{align}
\end{subequations}
Ref to the constraints \eqref{eq:opt_0_dynamics}, \eqref{eq:opt_0_xinit} are wrong, but \eqref{eq:opt_0_xthrow}, \eqref{eq:opt_0_xbound}, \eqref{eq:opt_0_ubound}, and \eqref{eq:opt_0_bal} are correct.
\end{document}
```
| https://tex.stackexchange.com/users/293610 | Command eqref links to incorrect equation but shows correct numbering | false | The solution is just to put `\usepackage{hyperref}` as last package to include, as replied in [hyperref pointing to the wrong equation using subequations](https://tex.stackexchange.com/questions/217679/hyperref-pointing-to-the-wrong-equation-using-subequations)
I will leave this here if someone else needs this in the future
| 0 | https://tex.stackexchange.com/users/293610 | 680660 | 315,803 |
https://tex.stackexchange.com/questions/680623 | 0 | I am trying to use p specification to get text in my table to wrap. I have looked at examples and other questions but can not get it to work. I generated my table with a latex tables generator and I am using some colours so the table code is quite messy. I have tried to put the p-code,
```
p{40mm},
```
in the table. More specifically where code colour is specified for columns, as follows,
```
\begin{table}[H]
\begin{tabular}{
>{\columncolor[HTML]{8E7CC3}} p{40mm} l
>{\columncolor[HTML]{D9D2E9}} p{40mm} l
>{\columncolor[HTML]{FFF2CC}} p{40mm} l
>{\columncolor[HTML]{EA9999}} p{40mm} l}
\cline{1-3}
... more code,
```
but this just makes the text wrap in one of the rows. Where do I set the column width?
I have provided a working example below (with no attempts of text wrapping).
```
\documentclass[12pt,a4paper,swedish]{report}
\usepackage[table]{xcolor} % For tables (color)
\usepackage{moreverb} % List settings
\usepackage{textcomp} % Fonts, symbols etc.
\usepackage[T1]{fontenc} % Output settings
\usepackage[utf8]{inputenc} % Input settings
\usepackage{amsmath} % Mathematical expressions (American mathematical society)
\usepackage{amssymb} % Mathematical symbols (American mathematical society)
\usepackage{graphicx} % Figures
\numberwithin{equation}{chapter} % Numbering order for equations
\numberwithin{figure}{chapter} % Numbering order for figures
\numberwithin{table}{chapter} % Numbering order for tables
\usepackage[top=3cm, bottom=3cm,
inner=3cm, outer=3cm]{geometry} % Page margin lengths
\usepackage{float} % Enables object position enforcement using [H]
\usepackage{siunitx} % For units
\usepackage{gensymb} % For certain symbols such as \degree
\usepackage{parskip} % Enables vertical spaces correctly
\begin{document}
\begin{table}[H]
\begin{tabular}{
>{\columncolor[HTML]{8E7CC3}}l
>{\columncolor[HTML]{D9D2E9}}l
>{\columncolor[HTML]{FFF2CC}}l
>{\columncolor[HTML]{EA9999}}l}
\cline{1-3}
\multicolumn{1}{|l|}{\cellcolor[HTML]{8E7CC3}\textbf{Krav}} & \multicolumn{1}{l|}{\cellcolor[HTML]{D9D2E9}\textbf{Mått}} & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}\textbf{Beskrivning}} & \textbf{Kravtyp} \\ \cline{1-3}
\multicolumn{1}{|l}{\cellcolor[HTML]{8E7CC3}First thing} & $50-54\degree C$ & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this} & Krav \\
\multicolumn{1}{|l}{\cellcolor[HTML]{8E7CC3}Second thing} & $x mAh (5V)$ & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this} & Krav \\
\multicolumn{1}{|l}{\cellcolor[HTML]{8E7CC3}Third thing} & - & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this} & Krav \\
\cellcolor[HTML]{8E7CC3}Fourth thing & \cellcolor[HTML]{D9D2E9}{\color[HTML]{000000} \textgreater{}$100\degree C$} & \cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this & \cellcolor[HTML]{EA9999}Krav \\
\multicolumn{1}{|l}{\cellcolor[HTML]{8E7CC3}Fifth thing} & - & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this} & Krav \\
\multicolumn{1}{|l}{\cellcolor[HTML]{8E7CC3}Sixth thing} & - & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this} & Önskemål \\
\multicolumn{1}{|l}{\cellcolor[HTML]{8E7CC3}Seventh thing} & - & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this} & Önskemål \\
\multicolumn{1}{|l}{\cellcolor[HTML]{8E7CC3}Eighth thing} & - & \multicolumn{1}{l|}{\cellcolor[HTML]{FFF2CC}This is how the thing works and so on. These cells have much text. Kind of like this} & Önskemål
\end{tabular}
\end{table}
\end{document}
```
I am writing in overleaf.
| https://tex.stackexchange.com/users/282391 | Text wrapping inside table using p{} specification | false | If you plan to create more complex tables, consider using `tblr` environment from `tabularray`. It has much simplified interface. For instance, I have added alternating colours in rows each columns to your table.
You could define global colours and use their names across the table with tints, instead of repeating absolute values in cells.
If the middle column contains long texts, it might look better in a wider column. Additionally, consider loading `microtype` package to improve texts in narrower environments.
Here's slightly altered table:
```
\documentclass[12pt,a4paper,swedish]{report}
\usepackage[svgnames]{xcolor} % For tables (color)
\usepackage{amssymb,amsmath} % Mathematical expressions (American mathematical society)
\usepackage[
top=3cm,
bottom=3cm,
inner=3cm,
outer=3cm,
]{geometry} % Page margin lengths
\usepackage{microtype}
\usepackage{siunitx}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}
% \usepackage{textcomp} % Fonts, symbols etc.
% \usepackage{moreverb} % List settings
% \usepackage{graphicx} % Figures
% \usepackage[T1]{fontenc} % Output settings
% \usepackage[utf8]{inputenc} % Input settings
% \usepackage{float} % Enables object position enforcement using [H]
% \usepackage{gensymb} % For certain symbols such as \degree
% \usepackage{parskip} % Enables vertical spaces correctly
\numberwithin{equation}{chapter} % Numbering order for equations
\numberwithin{figure}{chapter} % Numbering order for figures
\numberwithin{table}{chapter} % Numbering order for tables
\colorlet{kravmcol}{BlueViolet!80}
\colorlet{mattcol}{Blue!50}
\colorlet{beskcol}{red!20!yellow!60}
\colorlet{kravtcol}{LightCoral}
\sisetup{
range-units=single,
range-phrase={-},
}
\begin{document}
\begin{table}[tbh]
\footnotesize
\renewcommand{\arraystretch}{1.5}
\begin{tblr}{
colspec = {*2{X[l]} X[3,l] X[l]},
row{1} = {font=\bfseries, halign=c},
hline{1,Z} = {wd=0.8pt},
hline{2} = {wd=0.5pt},
hline{3-Y} = {wd=0.2pt},
cell{1}{1} = {bg=kravmcol!80},
cell{1}{2} = {bg=mattcol!80},
cell{1}{3} = {bg=beskcol!80},
cell{1}{4} = {bg=kravtcol!80},
cell{even[2-Z]}{1} = {bg=kravmcol!50}, cell{odd[2-Z]}{1} = {bg=kravmcol!30},
cell{even[2-Z]}{2} = {bg=mattcol!50}, cell{odd[2-Z]}{2} = {bg=mattcol!30},
cell{even[2-Z]}{3} = {bg=beskcol!50}, cell{odd[2-Z]}{3} = {bg=beskcol!30},
cell{even[2-Z]}{4} = {bg=kravtcol!50}, cell{odd[2-Z]}{4} = {bg=kravtcol!30},
}
Krav & Mått
& Beskrivning & Kravtyp \\
First thing & $\qtyrange{50}{54}{\celsius}$
& This is how the thing works and so on. These cells have much text. Kind of like this & Krav \\
Second thing & $\mathop{x} \unit{\mA}(5)\unit{\hour}$
& This is how the thing works and so on. These cells have much text. Kind of like this & Krav \\
Third thing & -
& This is how the thing works and so on. These cells have much text. Kind of like this & Krav \\
Fourth thing & $> 100\unit{\celsius}$
& This is how the thing works and so on. These cells have much text. Kind of like this & Krav \\
Fifth thing & -
& This is how the thing works and so on. These cells have much text. Kind of like this & Krav \\
Sixth thing & -
& This is how the thing works and so on. These cells have much text. Kind of like this & Önskemål \\
Seventh thing & -
& This is how the thing works and so on. These cells have much text. Kind of like this & Önskemål \\
Eighth thing & -
& This is how the thing works and so on. These cells have much text. Kind of like & Önskemål \\
\end{tblr}
\end{table}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/31283 | 680668 | 315,807 |
https://tex.stackexchange.com/questions/680608 | 1 | Running latexdiff-vc -r rev1 -r rev2 file.tex --pdf produces a pdf highlighting the changes in the tex but it does not show the changes in the bibliography. Is there something that needs to be enabled for this to work?
My tex file uses bibtex i.e.,
\bibliographystyle{IEEEtran}
\bibliography{references}
where the bibliography file is references.bib.
| https://tex.stackexchange.com/users/72111 | latexdiff-vc does not show differences in the bibliography | false | In order to make this possible you need to make sure to include the .bbl file in the repository, i.e., keep track of the revisions of that file. Note that this deviates from normal procedure; as the .bbl file is derived one would normally not revise it separately. If you have done this then
```
latexdiff-vc --flatten -r rev1 -r rev2 file.tex --pdf
```
should show changes to the bibliography, too (although some bibliography styles do not play well with latexdiff, see [the .bbl file generated by latexdiff causes errors](https://tex.stackexchange.com/questions/545079/the-bbl-file-generated-by-latexdiff-causes-errors?rq=1) for further hints
).
Otherwise, it will get more complicated, and you are probably best off retrieving the two revisions and bbl files for the two revisions manually. Note that you can generally (depending on bibliography style) run latexdiff separately on the bbl files.
| 0 | https://tex.stackexchange.com/users/38437 | 680675 | 315,810 |
https://tex.stackexchange.com/questions/673676 | 0 | I want to know if the following is allowed, not just in LaTeX, but in some "writing rules", I guess it's a typography matter or some kind of, maybe it could be even different between publications types, anyway I'm writing a thesis.
The example is:
```
\section{Section}
\subsection{Subsection}
\par Thesis content only here...
```
So the output will be like:
>
> 1.1 Section
>
>
> 1.1.1 Subsection
>
>
> Thesis content only here...
>
>
>
Is the "blank content" between section and subsection a bad practice or not?
| https://tex.stackexchange.com/users/288553 | Could there be a blank space between a section and a subsection? | false | I'd say it is the normal situation.
Your `\par` after `\subsection` is odd though, although it does nothing.
Section headings commands, even run-in headings like `\paragraph` always end in vertical mode so a following blank line (or `\par`) does nothing.
| 1 | https://tex.stackexchange.com/users/1090 | 680679 | 315,812 |
https://tex.stackexchange.com/questions/680682 | 0 | I'm in the process of trying to understand how `l3build` tests work.
For this, I created the files of [this question](https://tex.stackexchange.com/q/329743/18401) and here is my sandbox directory:
```
$ tree
.
├── build.lua
├── doublefoo.dtx
├── doublefoo.ins
├── doublefoo.log
├── doublefoo.sty
└── testfiles
├── Versuch2.lve
├── Versuch2.lvt
└── Versuch.lvt
1 directory, 8 files
```
where `Versuch.lvt` is the one [rectified by Joseph Wright](https://tex.stackexchange.com/a/329767/18401):
```
\input{regression-test}
\documentclass{article}
\usepackage{doublefoo}
\begin{document}
\ExplSyntaxOn
\START
\OMIT
\box_new:N \l_tmp_box
\hbox_set:Nn \l_tmp_box {\DoubleIt{Hallo}}
\TIMO
\box_show:N \l_tmp_box
\END
```
Now, the command `texlua build.lua save Versuch` fails with the error:
>
> ...ocal/texlive/2023/texmf-dist/scripts/l3build/l3build.lua:157: too many C levels (limit is 200) in main function near 'i'
>
>
>
There's a similar error with the command `l3build save Versuch`:
>
> ...ocal/texlive/2023/texmf-dist/scripts/l3build/l3build.lua:176: too many C levels (limit is 200) in main function near '"
> "'
>
>
>
Why this test cannot be run and how to run it?
| https://tex.stackexchange.com/users/18401 | Impossible to run l3build tests | true | Do not run
```
texlua build.lua save Versuch
```
use
```
l3build save Versuch
```
Also remove
```
kpse.set_program_name("kpsewhich")
dofile(kpse.lookup("l3build.lua"))
```
Very early versions of l3build required the first form
your `build.lua` just needs one line and can be, in full:
```
module = "doublefoo"
```
| 2 | https://tex.stackexchange.com/users/1090 | 680684 | 315,814 |
https://tex.stackexchange.com/questions/452498 | 1 | The command `\tcolorboxenvironment` can modify an environment to change the way it appears and add around it some graphical elements (background color, etc.)
From the doc:
```
\newenvironment{myitemize}
{\begin{itemize}}
{\end{itemize}}
\tcolorboxenvironment{myitemize}{blanker,
before skip=6pt,
after skip=6pt,
borderline west={3mm}{0pt}{red}}
```
I wonder if it is possible to cancel such an alteration of the `myitemize` environment.
My goal is to have an environment that can be customised when some "variables" are put to "True" and otherwise left in their "original" form.
Presently, I want to be able to put a background color to the environment, depending on the value of some "variables".
| https://tex.stackexchange.com/users/8323 | Cancel the modification of an environment by `\tcolorboxenvironment` | false | The definition of `\tcolorboxenvironment` is
```
\newcommand{\tcolorboxenvironment}[2]{%
\AddToHook{env/#1/before}{%
\begin{tcolorbox}[savedelimiter={#1},#2,wrap@environment,%
code={\def\tcb@end@tcolorboxenvironment{\end{tcolorbox}}}]%
}%
\AddToHook{env/#1/after}{%
\tcb@end@tcolorboxenvironment%
}%
}
```
So applying `\RemoveFromHook` before and after the environment should do the trick.
```
\documentclass{article}
\usepackage[skins]{tcolorbox}
\newenvironment{myitemize}
{\begin{itemize}}
{\end{itemize}}
\tcolorboxenvironment{myitemize}{blanker,
before skip=6pt,
after skip=6pt,
borderline west={3mm}{0pt}{red}}
\begin{document}
\begin{myitemize}
\item text
\item more text
\end{myitemize}
\RemoveFromHook{env/myitemize/before}
\RemoveFromHook{env/myitemize/after}
\begin{myitemize}
\item text
\item more text
\end{myitemize}
\end{document}
```
For convenience you can also define a command that removes the hooks:
```
\newcommand{\untcolorboxenvironment}[1]{
\RemoveFromHook{env/#1/before}
\RemoveFromHook{env/#1/after}
}
```
Then replace the `\RemoveFromHook`'s in the document above with `\untcolorboxenvironment{myitemize}`.
| 2 | https://tex.stackexchange.com/users/208544 | 680688 | 315,815 |
https://tex.stackexchange.com/questions/680691 | 3 | In my answer to [this question](https://tex.stackexchange.com/a/680688/208544), something occurred that I don't understand about the hook system. If the code that adds a hook is directly in the main tex file (`\tcolorboxenvironment` in this example), it works as I expect:
```
\documentclass{article}
\usepackage[skins]{tcolorbox}
\newenvironment{myitemize}
{\begin{itemize}}
{\end{itemize}}
\tcolorboxenvironment{myitemize}{blanker,
before skip=6pt,
after skip=6pt,
borderline west={3mm}{0pt}{red}}
\begin{document}
\begin{myitemize}
\item text
\item more text
\end{myitemize}
\RemoveFromHook{env/myitemize/before}
\RemoveFromHook{env/myitemize/after}
\begin{myitemize}
\item text
\item more text
\end{myitemize}
\end{document}
```
produces one list with a red border, one without. Note the definition of `\tcolorboxenvironment`:
```
\newcommand{\tcolorboxenvironment}[2]{%
\AddToHook{env/#1/before}{%
\begin{tcolorbox}[savedelimiter={#1},#2,wrap@environment,%
code={\def\tcb@end@tcolorboxenvironment{\end{tcolorbox}}}]%
}%
\AddToHook{env/#1/after}{%
\tcb@end@tcolorboxenvironment%
}%
}
```
However if I move this code into `mytest.sty`:
```
\ProvidesPackage{mytest}
\RequirePackage[skins]{tcolorbox}
\newenvironment{myitemize}
{\begin{itemize}}
{\end{itemize}}
\tcolorboxenvironment{myitemize}{blanker,
before skip=6pt,
after skip=6pt,
borderline west={3mm}{0pt}{red}}
```
then try
```
\documentclass{article}
\usepackage{mytest}
\begin{document}
\begin{myitemize}
\item text
\item more text
\end{myitemize}
\RemoveFromHook{env/myitemize/before}
\RemoveFromHook{env/myitemize/after}
\begin{myitemize}
\item text
\item more text
\end{myitemize}
\end{document}
```
I get both lists having a red border. What difference should it make if the code is in a package or directly in the preamble?
| https://tex.stackexchange.com/users/208544 | \RemoveFromHook not working as expected if code placed in package file | true |
You need the package label as the default label is `mytest` inside the package, but `top-level` outside.
```
\documentclass{article}
\usepackage{mytest}
\begin{document}
\begin{myitemize}
\item text
\item more text
\end{myitemize}
\RemoveFromHook{env/myitemize/before}[mytest]
\RemoveFromHook{env/myitemize/after}[mytest]
\begin{myitemize}
\item text
\item more text
\end{myitemize}
\end{document}
```
| 4 | https://tex.stackexchange.com/users/1090 | 680694 | 315,817 |
https://tex.stackexchange.com/questions/680678 | 1 | Am posting two in one as I suspect these may be related. Following on from [my previous question](https://tex.stackexchange.com/questions/680665/tikz-changing-node-background-colour), I am putting them in a matrix:
```
\documentclass{standalone}
\usepackage{tikz}
\usepackage{milsymb}
\usetikzlibrary{matrix}
\makeatletter
\protected\def\tikz@fig@main#1{%
\expandafter\gdef\csname labeltextof@\tikz@fig@name\endcsname{#1}%
\iftikz@node@is@pic%
\tikz@node@is@picfalse%
\tikz@subpicture@handle{#1}%
\else%
\tikz@@fig@main#1\egroup%
\fi}
\makeatother
\newcommand\labeltextof[1]{\csname labeltextof@#1\endcsname}
\newcommand{\aftercolorof}[2]{% #1 is the color, #2 us the node
\path (#2.center) node[#1] (#2-2) {\labeltextof{#2}};
}
\begin{document}
\begin{tikzpicture}
\matrix[row sep=2mm, column sep=1mm]{
\node (nA) {\tikz{\MilLand[faction=friendly,monochrome,echelon=division,main=armoured,fill=green]{}}};
\node (nA) {\tikz{\MilLand[faction=friendly,monochrome,echelon=division,main=armoured,fill=yellow]{}}};
&
\node (nA) {\tikz{\MilLand[faction=friendly,monochrome,echelon=division,main=armoured,fill=green]{}}};
\node (nA) {\tikz{\MilLand[faction=friendly,monochrome,echelon=division,main=armoured,fill=yellow]{}}};
\\
};
%\aftercolorof{red}{nA}
\end{tikzpicture}
\end{document}
```
This produces an error at the end of the matrix:
```
! Undefined control sequence.
<argument> \pgf@matrix@last@nextcell@options
l.33 }
;
? x
```
And if I try to remove the inner `\tikz` command, as suggested in the answer to the linked question, I get another error:
```
! LaTeX Error: Environment scope undefined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.25 ...elon=division,main=armoured,fill=green]{}}
;
?
```
There is a third problem also, that the echelon symbol (ie XX for division) is put too far away vertically. This seems to happen only in matrix.
Any ideas anybody?
| https://tex.stackexchange.com/users/123965 | Tikz milsymbs in a matrix, with colours (getting errors) | false | You can easily place the symbols at predefined coordinates using the location key:
```
\documentclass{standalone}
\usepackage{milsymb}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix[matrix of nodes,
every node/.style={minimum width=1.75cm, minimum height=1.75cm}
] (m) {
{} & {} \\
{} & {} \\
};
\MilLand[faction=friendly, echelon=division, main=armoured, fill=green] (m-1-1)
\MilLand[faction=friendly, echelon=division, main=armoured, fill=yellow] (m-1-2)
\MilLand[faction=friendly, echelon=division, main=armoured, fill=green] (m-2-1)
\MilLand[faction=friendly, echelon=division, main=armoured, fill=yellow] (m-2-2)
\end{tikzpicture}
\end{document}
```
---
Assuming that you might wish to change the color of the lines and text as per your other linked question:
```
\documentclass{standalone}
\usepackage{milsymb}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix[matrix of nodes,
every node/.style={minimum width=1.75cm, minimum height=1.75cm}
] (m) {
{} & {} \\
{} & {} \\
};
\begin{scope}
\pgfsetstrokecolor{red}
\MilLand[faction=friendly, echelon=division, main=armoured, fill=green, red] (m-1-1)
\MilLand[faction=friendly, echelon=division, main=armoured, fill=yellow, red] (m-1-2)
\end{scope}
\MilLand[faction=friendly, echelon=division, main=armoured, fill=green] (m-2-1)
\MilLand[faction=friendly, echelon=division, main=armoured, fill=yellow] (m-2-2)
\end{tikzpicture}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/47927 | 680695 | 315,818 |
https://tex.stackexchange.com/questions/680701 | 2 | Suppose I have defined two commands, e.g.
`\newcommand{\commandA}{\alpha}`
`\newcommand{\commandAB}{\alpha^2}`
I would like to define a command that makes `\commandA` into `\commandAB` by simply adding the letter B to this command, so that the output is
`\endswithB{\commandA}=\commandAB`
My naive try to define
`\endswithB{\desiredcommand}[1]{#1B}`
only produces `\endswithB{\commandA}={\commandA}B`.
To give context, I have a set of around thirty commands for certain mathematical symbols. These are all of the form `\commandA`.
I have a related set of commands for a related set of symbols, such that all these commands are exactly as the previous commands but with the extra letter B in the end, i.e. `\commandAB` (but they produce quite different symbols).
There are currently situations where I am unsure which symbol I actually want to use, so I would prefer if I could just work for now with a command for these situations
`\newcommand{\unsure}[1]{#1}`
that I later on could simply change to
`\newcommand{\unsure}[1]{\endswithB{#1}}`
if I decide that that's better.
| https://tex.stackexchange.com/users/293622 | Defining a command that adds a letter to another command | true | Not sure if this is what you want, but it works without errors.
```
\documentclass{article}
\makeatletter
\newcommand{\withB}[1]{\csname\expandafter\@gobble\string#1B\endcsname}
\makeatother
\newcommand{\fooA}{A}
\newcommand{\fooAB}{B}
\begin{document}
\withB{\fooA}
\end{document}
```
| 4 | https://tex.stackexchange.com/users/34505 | 680706 | 315,821 |
https://tex.stackexchange.com/questions/680701 | 2 | Suppose I have defined two commands, e.g.
`\newcommand{\commandA}{\alpha}`
`\newcommand{\commandAB}{\alpha^2}`
I would like to define a command that makes `\commandA` into `\commandAB` by simply adding the letter B to this command, so that the output is
`\endswithB{\commandA}=\commandAB`
My naive try to define
`\endswithB{\desiredcommand}[1]{#1B}`
only produces `\endswithB{\commandA}={\commandA}B`.
To give context, I have a set of around thirty commands for certain mathematical symbols. These are all of the form `\commandA`.
I have a related set of commands for a related set of symbols, such that all these commands are exactly as the previous commands but with the extra letter B in the end, i.e. `\commandAB` (but they produce quite different symbols).
There are currently situations where I am unsure which symbol I actually want to use, so I would prefer if I could just work for now with a command for these situations
`\newcommand{\unsure}[1]{#1}`
that I later on could simply change to
`\newcommand{\unsure}[1]{\endswithB{#1}}`
if I decide that that's better.
| https://tex.stackexchange.com/users/293622 | Defining a command that adds a letter to another command | false |
```
\documentclass{article}
\newcommand{\commandA}{\alpha}
\newcommand{\commandAB}{\alpha^2}
%\newcommand{\unsure}[1]{#1}% this is easy
\newcommand{\unsure}[1]{\EndsWithB{#1}}
\ExplSyntaxOn
\NewDocumentCommand{\EndsWithB}{m}
{
\use:c { \cs_to_str:N #1 B }
}
\ExplSyntaxOff
\begin{document}
$\commandA$
$\commandAB$
$\unsure{\commandA}$
\end{document}
```
With `\use:c` you tell LaTeX to form a command name from its argument, which is the argument to `\EndsWithB` deprived of the backslash and with a `B` appended to it.
| 3 | https://tex.stackexchange.com/users/4427 | 680708 | 315,822 |
https://tex.stackexchange.com/questions/680700 | 2 | I'm (still) in the process of trying to understand how `l3build` tests work, *more specifically for classes*.
For this, I created a `sandbox` directory, the content of which being:
```
$ tree sandbox/
sandbox/
├── build.lua
├── myclass.cls
└── testfiles
└── myclass-test.lvt
```
This directory structure and the content of these various files may be generated with the following commands:
```
mkdir -p sandbox/testfiles
pdflatex generate-sandbox.tex
```
where `generate-sandbox.tex` has the following content:
```
\begin{filecontents*}[overwrite]{sandbox/build.lua}
#!/usr/bin/env texlua
module = "myclass"
sourcefiles = {"*.cls"}
installfiles = sourcefiles
\end{filecontents*}
\begin{filecontents*}[overwrite]{sandbox/myclass.cls}
\ProvidesExplClass
{myclass}
{2023/03/24}
{0.1}
{
My~Nice~Class.
}
\NeedsTeXFormat{LaTeX2e}
\LoadClass { article }
\RequirePackage{tcolorbox}
\endinput
\end{filecontents*}
\begin{filecontents*}[overwrite]{sandbox/testfiles/myclass-test.lvt}
\input{regression-test}
\documentclass{myclass}
\begin{document}
\START
Foo.
\end{document}
\end{filecontents*}
\documentclass{article}
\begin{document}
\end{document}
```
So far, so good. Now I want to save the output of the test `myclass-test.lvt` to a `.tlg` file:
```
cd sandbox
l3build save myclass-test
```
The output is very verbose:
```
Creating and copying myclass-test.tlg
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdflatex)
restricted \write18 enabled.
(./ascii.tcx)
entering extended mode
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-02-22> (./myclass-test.lvt (/usr/local/texlive/2023/texmf-dist/tex/latex/l3build/regression-test.tex{/usr/local/texlive/2023/texmf-var/fonts/map/pdftex/updmap/pdftex.map}) (./myclass.cls
Document Class: myclass 2023/03/24 v0.1 My\nobreakspace {}Nice\nobreakspace {}Class.
(/usr/local/texlive/2023/texmf-dist/tex/latex/base/article.cls
Document Class: article 2022/07/02 v1.4n Standard LaTeX document class
(/usr/local/texlive/2023/texmf-dist/tex/latex/base/size10.clo)) (/usr/local/texlive/2023/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty (/usr/local/texlive/2023/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty (/usr/local/texlive/2023/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/pgf.revision.tex))) (/usr/local/texlive/2023/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty (/usr/local/texlive/2023/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/local/texlive/2023/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/local/texlive/2023/texmf-dist/tex/latex/graphics/graphics.sty (/usr/local/texlive/2023/texmf-dist/tex/latex/graphics/trig.sty) (/usr/local/texlive/2023/texmf-dist/tex/latex/graphics-cfg/graphics.cfg) (/usr/local/texlive/2023/texmf-dist/tex/latex/graphics-def/pdftex.def))) (/usr/local/texlive/2023/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/utilities/pgfkeyslibraryfiltered.code.tex)) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def))) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex)) (/usr/local/texlive/2023/texmf-dist/tex/latex/xcolor/xcolor.sty (/usr/local/texlive/2023/texmf-dist/tex/latex/graphics-cfg/color.cfg) (/usr/local/texlive/2023/texmf-dist/tex/latex/graphics/mathcolor.ltx)) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex)) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/math/pgfint.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex))) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex) (/usr/local/texlive/2023/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty) (/usr/local/texlive/2023/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty)) (/usr/local/texlive/2023/texmf-dist/tex/latex/tools/verbatim.sty) (/usr/local/texlive/2023/texmf-dist/tex/latex/environ/environ.sty (/usr/local/texlive/2023/texmf-dist/tex/latex/trimspaces/trimspaces.sty)) (/usr/local/texlive/2023/texmf-dist/tex/latex/etoolbox/etoolbox.sty))) (/usr/local/texlive/2023/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
No file myclass-test.aux.
(/usr/local/texlive/2023/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/local/texlive/2023/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty (/usr/local/texlive/2023/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
START-TEST-LOG
This is a generated file for the l3build validation system.
Don't change this file in any respect.
[1] (./myclass-test.aux)
END-TEST-LOG
)</usr/local/texlive/2023/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on myclass-test.pdf (1 page, 13363 bytes).
Transcript written on myclass-test.log.
```
But the content of the `myclass-test.tlg` file looks pretty useless:
```
This is a generated file for the l3build validation system.
Don't change this file in any respect.
[1
] (myclass-test.aux)
```
Am I missing something?
| https://tex.stackexchange.com/users/18401 | What's the proper way to run l3build tests for classes? | true | Your test is
```
\START
Foo.
\end{document}
```
so the normalised log is more or less empty, but not necessarily useless,perhaps a future release generates an error and the log becomes non empty and l3build will warn you.
specifically add
```
\AtEndDocument{\oops}
```
to your .cls file. Now test your new feature with
```
l3build check
```
You will be warned
```
Check failed with difference files
- ./build/test/myclass-test.luatex.diff
- ./build/test/myclass-test.pdftex.diff
- ./build/test/myclass-test.xetex.diff
```
so the tlg is not useless.
```
*** ./build/test/myclass-test.tlg Fri Mar 24 22:31:53 2023
--- ./build/test/myclass-test.pdftex.log Fri Mar 24 22:31:55 2023
***************
*** 1,4 ****
--- 1,13 ----
This is a generated file for the l3build validation system.
Don't change this file in any respect.
+ ! Undefined control sequence.
+ \__hook enddocument ->\oops
+ \ifpgf@external@grabshipout \pgfutil@ifundefined...
+ l. ...\end{document}
+ 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.
[1
] (myclass-test.aux)
```
Usually though you want to put some test output to the log,you can use `\typeout` or `\showoutput` or `regression-test` has specific `\TEST...` commands for making structured log output
| 2 | https://tex.stackexchange.com/users/1090 | 680709 | 315,823 |
https://tex.stackexchange.com/questions/680678 | 1 | Am posting two in one as I suspect these may be related. Following on from [my previous question](https://tex.stackexchange.com/questions/680665/tikz-changing-node-background-colour), I am putting them in a matrix:
```
\documentclass{standalone}
\usepackage{tikz}
\usepackage{milsymb}
\usetikzlibrary{matrix}
\makeatletter
\protected\def\tikz@fig@main#1{%
\expandafter\gdef\csname labeltextof@\tikz@fig@name\endcsname{#1}%
\iftikz@node@is@pic%
\tikz@node@is@picfalse%
\tikz@subpicture@handle{#1}%
\else%
\tikz@@fig@main#1\egroup%
\fi}
\makeatother
\newcommand\labeltextof[1]{\csname labeltextof@#1\endcsname}
\newcommand{\aftercolorof}[2]{% #1 is the color, #2 us the node
\path (#2.center) node[#1] (#2-2) {\labeltextof{#2}};
}
\begin{document}
\begin{tikzpicture}
\matrix[row sep=2mm, column sep=1mm]{
\node (nA) {\tikz{\MilLand[faction=friendly,monochrome,echelon=division,main=armoured,fill=green]{}}};
\node (nA) {\tikz{\MilLand[faction=friendly,monochrome,echelon=division,main=armoured,fill=yellow]{}}};
&
\node (nA) {\tikz{\MilLand[faction=friendly,monochrome,echelon=division,main=armoured,fill=green]{}}};
\node (nA) {\tikz{\MilLand[faction=friendly,monochrome,echelon=division,main=armoured,fill=yellow]{}}};
\\
};
%\aftercolorof{red}{nA}
\end{tikzpicture}
\end{document}
```
This produces an error at the end of the matrix:
```
! Undefined control sequence.
<argument> \pgf@matrix@last@nextcell@options
l.33 }
;
? x
```
And if I try to remove the inner `\tikz` command, as suggested in the answer to the linked question, I get another error:
```
! LaTeX Error: Environment scope undefined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.25 ...elon=division,main=armoured,fill=green]{}}
;
?
```
There is a third problem also, that the echelon symbol (ie XX for division) is put too far away vertically. This seems to happen only in matrix.
Any ideas anybody?
| https://tex.stackexchange.com/users/123965 | Tikz milsymbs in a matrix, with colours (getting errors) | true | The commands that `milsymb` provide seem to be ordinary TikZ drawings, you can just put those in the cells of a matrix.
The package doesn't provide nice interfaces to change various things but in your case it's as easy as using just the ordinary TikZ keys `/tikz/color` and `/tikz/nodes` (which is a shortcut to `/tikz/every node/.append style`).
In the second example, I've used my own definition of `/MilSymb/color` that forwards its argument to TikZ and its nodes.
Code
----
```
% temporary workaround for
% https://github.com/ralphieraccoon/MilSymb/commit/72df32af60b99e4213fdf244e41407de27f8ca0a
\begin{filecontents}{tikzlibraryshapes.Symbols.code.tex}
\usetikzlibrary{shapes.symbols}
\end{filecontents}
%
\documentclass{standalone}
\usepackage{tikz}
\usepackage{milsymb}
\pgfqkeys{/MilSymb}{color/.style={/tikz/color={#1},/tikz/nodes={/tikz/color={#1}}}}
\begin{document}
\begin{tikzpicture}
\matrix[row sep=2mm, column sep=1mm]{
\MilLand[faction=friendly, monochrome, echelon=division, main=armoured,
/tikz/red, /tikz/nodes=red, fill=green]{}
& \MilLand[faction=friendly, monochrome, echelon=division, main=armoured,
color=red, fill=yellow]{}
\\
\MilLand[faction=friendly, monochrome, echelon=division,
main=armoured, fill=green]{}
& \MilLand[faction=friendly, monochrome, echelon=division,
main=armoured, fill=yellow]{}
\\};
\end{tikzpicture}
\end{document}
```
Output
------
| 2 | https://tex.stackexchange.com/users/16595 | 680713 | 315,825 |
https://tex.stackexchange.com/questions/116670 | 28 | When I want to globally modify a command in my document, I will often use a duplicated version of the original in the stencil, with the help of the `\let` macro. For example, if I wanted to do something every time I created a section, I might say:
```
\let\svsection\section
\renewcommand\section[1]{\mychanges\svsection{#1}}
```
It just dawned on me that I don't know how or if something similar can be done for environments. What I would hope for is something like (I'm omitting arguments for the sake of simplicity, don't focus on that):
```
\let\svfigure\figure
\renewenvironment{figure}{\blahblah\begin{svfigure}}
{\end{svfigure}\moreblah}
```
Of course, this syntax won't work because `\figure` isn't a command.
But, I was hoping that the creation of environment `abc` would always be accompanied by the creation of associated constructed commands, for example, `\start@abc` and `\end@abc`, such that these associated commands could be `\let` to duplicate the original environment.
I also realize that one approach may be to "patch" the original environment, but I don't think that is really what I'm asking, since I'm not sure a patch can be easily undone, whereas redoing a `\let` in the opposite direction (e.g., `\let\section\svsection`) will totally undo the effects of redefinition.
It would be a handy feature to know how to duplicate an environment, so that the original copy can be `\renew`ed in the fashion I describe.
| https://tex.stackexchange.com/users/25858 | Duplicating Environments | false | `\NewCommandCopy` works. However, it has the disadvantage of requiring annoying syntax when e.g. environment name containing `*` is needed.
You can implement your own `\NewEnvironmentCopy` as follows (in newer LaTeX kernels `\NewEnvironmentCopy` is built-in so it may be a better idea to use `\ProvideDocumentCommand` that will silently fallback to use the existing command if it's already defined):
```
%! TEX program = lualatex
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\NewDocumentEnvironment{test}{m}{hello #1}{end #1}
\begin{test}{aaa}
environment body
\end{test}
\ExplSyntaxOn
\ProvideDocumentCommand \NewEnvironmentCopy {mm} {
\expandafter \NewCommandCopy \csname#1\expandafter\endcsname \csname#2\endcsname
\expandafter \NewCommandCopy \csname end#1\expandafter\endcsname \csname end#2\endcsname
}
\ProvideDocumentCommand \RenewEnvironmentCopy {mm} {
\expandafter \RenewCommandCopy \csname#1\expandafter\endcsname \csname#2\endcsname
\expandafter \RenewCommandCopy \csname end#1\expandafter\endcsname \csname end#2\endcsname
}
\ExplSyntaxOff
\NewEnvironmentCopy{testb}{test}
\RenewEnvironmentCopy{testb}{test}
\NewEnvironmentCopy{oldalign*}{align*}
\begin{testb}{aaa}
environment body
\end{testb}
\RenewDocumentEnvironment{test}{m}{redefined #1}{stop #1}
\begin{testb}{aaa}
environment body
\end{testb}
\begin{oldalign*}
1 &= 1
\end{oldalign*}
\end{document}
```
Note that if you use `\let` instead of `\NewCommandCopy` then the behavior would be different and unexpected (try it yourself).
---
Alternatively (which may or may not be applicable depends on the specific use case), you can use the hook system in LaTeX:
```
%! TEX program = lualatex
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\AddToHook{env/align*/begin}{x}
\AddToHook{env/align*/end}{y}
\begin{align*}
1 &= 1 \\
2 &= 2
\end{align*}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/250119 | 680717 | 315,828 |
https://tex.stackexchange.com/questions/42301 | 10 | I am in constant search for an alternative to LaTeX, but it seems I am stuck for it for a long time, and I am trying to see the bright side of it.
The other day one thought struck me, I think, LaTeX is missing many reasonable defaults, especially math environment. For example, it is very unlikely that you have three variables named `l`, `o` and `g` at the same time, and you are writing product of those three variables in that order. But still you have to write `\log` to indicate you meant the function `log()`. In other words, when someone writes `log`, they (almost) always mean the `log` function.
Same is true for parentheses and braces, in math environment when one uses a parenthesis again they most probably mean a `\left(`. I know, I can introduce my own `\(` commands but again they are not by default.
Because I am using LaTeX mostly for math typesetting, I am only aware of those kind of non-defaults. My question is why are the things are not designed such that these most basic, fundamental things are not handled by default? I read that Knuth is considered math typesetting specialist, he should have noticed these burdens while he is using TeX in my opinion.
| https://tex.stackexchange.com/users/1782 | Why doesn't TeX/LaTeX interpret multi-letter sequences as functions / parentheses as \left/\right in math mode by default? | false | This can also be manually redefined with enough effort.
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{luacode}
\begin{document}
\begin{luacode*}
cmdname_blacklist={relax=1, undefined_cs=1}
function preprocessFormula(formula, before, after)
tex.print(before .. (
formula:gsub('%a+', function(s)
if #s>1 and not cmdname_blacklist[token.create(s).cmdname] then
return '\\'..s..' '
else
return s
end
end)) .. after)
end
\end{luacode*}
\makeatletter
\def\@preprocessFormulaAdvanced#1#2#3{\directlua{preprocessFormula(
"\luaescapestring{\unexpanded{#1}}",
"\luaescapestring{\unexpanded{#2}}",
"\luaescapestring{\unexpanded{#3}}"
)}}
\def\@preprocessFormula#1{\@preprocessFormulaAdvanced{#1}{}{}}
\NewCommandCopy\oldOpenBracket\[
\NewCommandCopy\oldOpenParen\(
\def\[#1\]{\oldOpenBracket\@preprocessFormula{#1}\]}
\def\(#1\){\oldOpenParen\@preprocessFormula{#1}\)}
\ExplSyntaxOn
\NewDocumentCommand \NewEnvironmentCopy {mm} { % https://tex.stackexchange.com/a/680717/250119
\expandafter \NewCommandCopy \csname#1\expandafter\endcsname \csname#2\endcsname
\expandafter \NewCommandCopy \csname end#1\expandafter\endcsname \csname end#2\endcsname
}
\ExplSyntaxOff
\NewEnvironmentCopy{oldalign*}{align*}
\RenewDocumentEnvironment{align*}{b}{%
\@preprocessFormulaAdvanced{#1}%
{\begin{oldalign*}}%
{\end{oldalign*}}%
}{}
% redefine the dollar: https://tex.stackexchange.com/a/60395/250119
\catcode`$=\active
\protected\def${\@ifnextchar$\@doubledollar\@singledollar}
\def\@doubledollar$#1$${\[#1\]}
\def\@singledollar#1${\(#1\)}
\makeatother
\begin{align*}
sum_{x=1}^{10} x^2 &> int_{x=1}^9 x^2 \, dx
\end{align*}
$a+b=b+a$
$$a-b ne b-a$$
\[a-b ne b-a\]
$sin x+cos y=tan theta$
$Pr[x=a wedge y=b]$
$undefined multiple characters$
\end{document}
```
Basically for each multi-letter word it checks whether the control sequence is "defined" and replace it with the control sequence.
For `\left( ... \right)` it's a bit more complicated to implement, but in theory it's also implementable, see <https://tex.stackexchange.com/a/31529/250119> for an example.
| 0 | https://tex.stackexchange.com/users/250119 | 680719 | 315,829 |
https://tex.stackexchange.com/questions/116670 | 28 | When I want to globally modify a command in my document, I will often use a duplicated version of the original in the stencil, with the help of the `\let` macro. For example, if I wanted to do something every time I created a section, I might say:
```
\let\svsection\section
\renewcommand\section[1]{\mychanges\svsection{#1}}
```
It just dawned on me that I don't know how or if something similar can be done for environments. What I would hope for is something like (I'm omitting arguments for the sake of simplicity, don't focus on that):
```
\let\svfigure\figure
\renewenvironment{figure}{\blahblah\begin{svfigure}}
{\end{svfigure}\moreblah}
```
Of course, this syntax won't work because `\figure` isn't a command.
But, I was hoping that the creation of environment `abc` would always be accompanied by the creation of associated constructed commands, for example, `\start@abc` and `\end@abc`, such that these associated commands could be `\let` to duplicate the original environment.
I also realize that one approach may be to "patch" the original environment, but I don't think that is really what I'm asking, since I'm not sure a patch can be easily undone, whereas redoing a `\let` in the opposite direction (e.g., `\let\section\svsection`) will totally undo the effects of redefinition.
It would be a handy feature to know how to duplicate an environment, so that the original copy can be `\renew`ed in the fashion I describe.
| https://tex.stackexchange.com/users/25858 | Duplicating Environments | false | If you're using LaTeX 2023-06-01 or later1, the commands `\NewEnvironmentCopy`, `\RenewEnvironmentCopy`, and `\DeclareEnvironmentCopy` are built into the kernel, so you can use:
```
\NewEnvironmentCopy{<new env>}{<existing env>}
```
to make a copy. This will work regardless if the environment was defined using `\newenvironment` or `\NewDocumentEnvironment`. This method should be preferred over using `\let`, because it won't fail in case the environment takes optional arguments or things like that.
The same release adds `\ShowEnvironment{<env>}` to see the definition of an environment on the terminal.
1 Meanwhile you can use the [`-dev` format](https://www.latex-project.org//news/2023/03/13/latex-dev-1/).
| 4 | https://tex.stackexchange.com/users/134574 | 680721 | 315,830 |
https://tex.stackexchange.com/questions/659215 | 1 | How do I quickly compile LaTeX in vscode workshop without having to go to the TeX tab everytime?
I know the `CTRL + ALT + B` hotkey but I can't select the recipe I want.
| https://tex.stackexchange.com/users/267039 | How to (quickly) compile LaTeX in Vscode Workshop | false | If your recipe uses LuaLaTeX, you could also install the [LaTeX Previewer](https://marketplace.visualstudio.com/items?itemName=mjpvs.latex-previewer) extension alongside Workshop.
It has a keyboard shortcut Ctrl+Shift+L to preview and also re-complies on save when the preview window is open.
| 0 | https://tex.stackexchange.com/users/283962 | 680722 | 315,831 |
https://tex.stackexchange.com/questions/680728 | 1 | I have 3 pages long table in my latex **two column document**. I used longtable package it shows error cant use is two column mode and when I use
```
> \usepackage{supertabular}
```
The table become overlap rather than in 3
Separate pages , It looks like here
[![enter image description here][1]][1]
Code:
```
\begin{center}
\begin{supertabular}{|p{4cm}|l|p{3cm}|l|l|p{2cm}|l|}
\caption{A sample long table.} \label{tab:long} \\
\hline \multicolumn{1}{|c|}{\textbf{Category}} & \multicolumn{1}{c|}{\textbf{Diagnosis}} & \multicolumn{1}{c|}{\textbf{Frequency}}& \multicolumn{1}{c|}{\textbf{Location }} \\ \hline
\endfirsthead
\multicolumn{3}{c}%
{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
\hline \multicolumn{1}{|c|}{\textbf{Category}} & \multicolumn{1}{c|}{\textbf{Diagnosis}} & \multicolumn{1}{c|}{\textbf{Frequency}}& \multicolumn{1}{c|}{\textbf{Location }} \\ \hline
\endhead
\hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline
\endfoot
\hline \hline
\endlastfoot
\textit{\textbf{\footnotesize bone \& bone bone}}& bone & 7(0) & bone , bone , bone\\
& bone & 1 (0) & bone \\
bone & bone & 0(0) \\
& bone & 0(0) & bone , bone , bone \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
\end{supertabular}
\end{center}
```
| https://tex.stackexchange.com/users/nan | Multiple Long table single page in two column mode? | false | * Instead of code fragment you should provide MWE (Minimal Working Example), a small but complete document with your table, which we can test as it is.
* Your code framned has more issues:
+ your table is to wide that can be fit in one column
+ you determine six columns but use only four
+ how numbers are formating
Possible solution based on guessing ...
```
\documentclass[twocolumn]{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{tabularray}
\UseTblrLibrary{booktabs}
\begin{document}
\lipsum[1-3]
\onecolumn
\begin{longtblr}[
caption = {A sample long table.},
label = {tab:long}
]{vlines,
colspec = {X[l] X[l] l X[l] },
%cells = {font=\footnotesize},
row{1} = {font=\bfseries},
rowhead=1
}
\toprule
Category & Diagnosis & Frequency & Location \\
\midrule
\textit{\textbf{\footnotesize bone \& bone}}
& bone
& 0(0)
& bone , bone , bone\\
& bone
& 0 (0.) & bone \\ bone
& bone
& 0(0) \\
& bone
& 0(0)
& bone , bone , bone \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
\bottomrule
\end{longtblr}
\twocolumn
\lipsum[4-7]
\end{document}
```
[![enter image description here][1]][1]
[![enter image description here][2]][2]
| 1 | https://tex.stackexchange.com/users/18189 | 680734 | 315,834 |
https://tex.stackexchange.com/questions/680728 | 1 | I have 3 pages long table in my latex **two column document**. I used longtable package it shows error cant use is two column mode and when I use
```
> \usepackage{supertabular}
```
The table become overlap rather than in 3
Separate pages , It looks like here
[![enter image description here][1]][1]
Code:
```
\begin{center}
\begin{supertabular}{|p{4cm}|l|p{3cm}|l|l|p{2cm}|l|}
\caption{A sample long table.} \label{tab:long} \\
\hline \multicolumn{1}{|c|}{\textbf{Category}} & \multicolumn{1}{c|}{\textbf{Diagnosis}} & \multicolumn{1}{c|}{\textbf{Frequency}}& \multicolumn{1}{c|}{\textbf{Location }} \\ \hline
\endfirsthead
\multicolumn{3}{c}%
{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
\hline \multicolumn{1}{|c|}{\textbf{Category}} & \multicolumn{1}{c|}{\textbf{Diagnosis}} & \multicolumn{1}{c|}{\textbf{Frequency}}& \multicolumn{1}{c|}{\textbf{Location }} \\ \hline
\endhead
\hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline
\endfoot
\hline \hline
\endlastfoot
\textit{\textbf{\footnotesize bone \& bone bone}}& bone & 7(0) & bone , bone , bone\\
& bone & 1 (0) & bone \\
bone & bone & 0(0) \\
& bone & 0(0) & bone , bone , bone \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
One & abcdef ghjijklmn & 123.456778 \\
\end{supertabular}
\end{center}
```
| https://tex.stackexchange.com/users/nan | Multiple Long table single page in two column mode? | false | Here's another solution that builds on a lot of guesswork as the OP hasn't specified lots of important document parameters (such as the document class, with width and height of the textblock, the document font and font size, etc). The solution employs the `xltabular` package and its eponymous environment, which combines the strengths of the `longtable` and `tabularx` environments. It also employs the `afterpage` package to delay the start of the single-column material until the start of the next page.
Note that I've also eliminated the table's vertical lines as they don't do anything useful. Automatic line breaking is enabled in three of the four columns, as that's what's needed to be able to fit the table inside the textblock. And, for further make it easy to discern cell contents and cell boundaries, hanging indentation of lines beyond the first line in a cell is enabled as well.
[![enter image description here][1]][1]
[![enter image description here][2]][2]
```
\documentclass[twocolumn]{article}
\usepackage{xltabular,booktabs,afterpage,lipsum}
\newcolumntype{L}{%
>{\raggedright\arraybackslash\hangafter=1\hangindent=1em}X}
\begin{document}
\lipsum[1-4] % filler text
\afterpage{%
\onecolumn % switch to single-column mode
\begin{xltabular}{\textwidth}{@{} LLcL @{}}
\caption{A sample very long table.} \label{tab:long} \\
\toprule
\textbf{Category} & \textbf{Diagnosis} & \textbf{Frequency} & \textbf{Location} \\
\midrule
\endfirsthead
\multicolumn{4}{@{}l}{\tablename\ \thetable, continued} \\[0.5ex]
\toprule
\textbf{Category} & \textbf{Diagnosis} & \textbf{Frequency} & \textbf{Location} \\
\midrule
\endhead
\midrule
\multicolumn{4}{r@{}}{(Continued on next page)} \\
\endfoot
\bottomrule
\endlastfoot
\textit{\textbf{bone}} &
bone & 0 (0) &
bone, bone, bone \\
& bone & 0 (0) & bone \\
\addlinespace
bone & bone & 0 (0) & \\
& bone & 0 (0) & bone, bone, bone \\
\addlinespace
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
One & abcdef ghjijklmn & 123.456778 & \\
\end{xltabular}
\twocolumn } % back to two-column mode (and force a page break)
\lipsum[5-55] % more filler text
\end{document}
```
| 0 | https://tex.stackexchange.com/users/5001 | 680736 | 315,835 |
https://tex.stackexchange.com/questions/680711 | 0 | How would I type the following diagram in LaTeX (perhaps Ti*k*Z)?: I want 10 bullet points, arranged as the points in the lower triangular part of a 5 times 5 matrix. Then I want arrows pointing from every node to the one directly above it. Thanks in advance!
| https://tex.stackexchange.com/users/293036 | A lower triangular diagram in TikZ | true | Like this?
```
\documentclass[tikz, border=1cm]{standalone}
\newlength\radius
\setlength\radius{2pt}
\begin{document}
\begin{tikzpicture}
\foreach \i in {0,...,4}{ % rows
\foreach \j in {0,...,4}{ % columns
\ifnum\numexpr\j-\i<0\relax % check for lower triangle
\def\fill{fill}
\else
\def\fill{}
\fi
\draw[\fill] (\j, -\i) circle (\radius);
\ifnum\i>0\relax % if not in first row, draw arrow
\draw[->, blue, shorten <=\radius, shorten >=\radius] (\j, -\i) -- +(0,1);
\fi
}
}
\end{tikzpicture}
\end{document}
```
### Code after removing white dots.
```
\documentclass[tikz, border=1cm]{standalone}
\newlength\radius
\setlength\radius{2pt}
\begin{document}
\begin{tikzpicture}
\foreach \i in {0,...,4}{ % rows
\foreach \j in {0,...,4}{ % columns
\ifnum\numexpr\j-\i<0\relax % check for lower triangle
\filldraw (\j, -\i) circle (\radius);
\ifnum\i>0\relax % if not in first row, draw arrow
\draw[->, blue, shorten <=\radius, shorten >=\radius] (\j, -\i) -- +(0,1);
\fi
\fi
}
}
\end{tikzpicture}
\end{document}
```
| 4 | https://tex.stackexchange.com/users/237192 | 680738 | 315,837 |
https://tex.stackexchange.com/questions/679182 | 0 | Thank you Micha for reminding me to this new question.
I followed the first steps for tex4ebook this weekend for the first time and got close to the finish. I follow a discussion here some years after the origin, and tried using tex4ebook. I think a last step seems not to work.
The last run of tex4ebook gives a problem with the encoding of german special characters, like ä, ü, ä, ß in the \index{Abhängigkeiten}.
In the .ind file you find this: Which says that xindy worked fine.
```
\begin{theindex}
\providecommand*\lettergroupDefault[1]{}
\providecommand*\lettergroup[1]{%
\par\textbf{#1}\par
\nopagebreak
}
\lettergroup{A}
\item \idxkeyword{Abhängigkeiten}, \idxlocator{173}
\item \idxkeyword{Absolutisten}, \idxlocator{127}
```
The ! message show the following lines:
```
Missing \endcsname inserted.
<to be read again>
\let
l.9 \item \idxkeyword{Abhngigkeiten}
, \idxlocator{173}
```
Obviously the character ä is omitted and give the problem.
My tex files is big, but the relevant code seems to be:
```
\documentclass[11pt]{report}
\usepackage[some options to set the page]{geometry}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage[ngermen]{babel}
... and some others which might be irrelevant here
```
Maybe some of you can say how to handle this last problem to get my first epub?
I really follow the advice oe Micha for tex4ebook, used the source codes presented here.
Thank you,
Thomkrates
| https://tex.stackexchange.com/users/292824 | How can in tex4ebook special characters be managed, like german Umlaute? | true | In the comments the answer is hidden. Here in short:
I installed notepad++ editor and converted my sourcename.tex (which had been in ansinew encoding) all in utf8 encoding. And additionally changed the ansinew encoding of the sourcename.tex in `\usepackage[utf8]{ìnputenc}` which solved the problem here addressed.
| 1 | https://tex.stackexchange.com/users/292824 | 680741 | 315,840 |
https://tex.stackexchange.com/questions/679856 | 0 | I used the following MWE in the `Testdocument.tex`:
```
\documentclass[11pt,a4paper]{report}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{tex4ebook}
\providecommand\phantomsection{}
\ifdefined\HCode
\usepackage[xindy,noautomatic]{imakeidx}
\else
\usepackage{imakeidx}
\fi
\makeindex[intoc=false,columns=1,noautomatic,title=Alphabetisches Verzeichnis]
\ifdefined\HCode
\usepackage[hyperindex=true,
pdfauthor={Autor},
pdftitle={Titel},
pdfkeywords={Philosophy}]{hyperref}
\else\fi
\usepackage[sortlocale=auto,bibstyle=authoryear,citestyle=authortitle-ticomp]{biblatex}
\addbibresource{Bibliographie.bib}
\usepackage{endnotes}
\let\footnote=\endnote
\begin{document}
"`Ein zitierter Satz eines Autors."'\footcite{AG1986}
\nocite{AG1987}
\clearpage
\theendnotes
\clearpage
\defbibnote{BibVorwort}{Erläuterung zum Literaturverzeichnis.}
\defbibheading{TestBib}{%
\chapter*{\scshape #1}\thispagestyle{empty}%
\ifdefined\HCode\else\addcontentsline{toc}{chapter}{Literatur}\fi}
\printbibliography[title=Literatur,prenote=BibVorwort,heading=TestBib]
\end{document}
```
It gives a correct output in the epub file, only if I ignore the following error message:
```
Package biblatex Warning: Patching footnotes failed.
(biblatex) Footnote detection will not work.
! Package biblatex Error: Patching 'endnotes' package failed.
See the biblatex package documentation for explanation.
Type H <return> for immediate help.
...
l.41 \begin{document}
```
I would like to know how I can fix the error with getting the same correct output. Does anybody know what to do?
Update 1:
The `sample.tex` file looks minimized like this:
```
\documentclass[11pt,a4paper]{report}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{tex4ebook}
\ifdefined\HCode
\usepackage[hyperindex=true,
pdfauthor={Autor},
pdftitle={Titel},
pdfkeywords={Philosophy}]{hyperref}
\else\fi
\usepackage[sortlocale=auto,bibstyle=authoryear,citestyle=authortitle-ticomp]{biblatex}
\addbibresource{biblatex-examples.bib}
\usepackage{endnotes}
\let\footnote=\endnote
\begin{document}
"`Ein zitierter Satz eines Autors."'\footcite{sigfridsson}
\clearpage
\theendnotes
\clearpage
\printbibliography
\end{document}
```
The `myconfig.cfg` file is as follows:
```
\Preamble{xhtml}
\begin{document}
\Configure{DocumentLanguage}{de}
\EndPreamble
```
As a result there is still the above error message, but the epub file seems correct with hyperlinks made.
Update 2:
This is the further reduced code for Testdocument.tex (which corresponds to the `Testdocument.log` file on `gist.github.com`, see below)
```
\documentclass[11pt,a4paper]{report}
\usepackage{ebgaramond-maths}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{tex4ebook}
\usepackage[sortlocale=auto,bibstyle=authoryear,citestyle=authortitle-ticomp]{biblatex}
\addbibresource{biblatex-examples.bib}
\usepackage{endnotes}
\let\footnote=\endnote
\begin{document}
"`Ein zitierter Satz eines Autors."'\footcite{sigfridsson}
\theendnotes
\printbibliography
\end{document}
```
| https://tex.stackexchange.com/users/292824 | tex4ebook, biblatex and footnotes/endnotes with correct output, but errormessage | true | In the comments the answer is hidden. Here in short:
I waited some days for the newest version of TeX Live 2023, installed it, and tried it again. It solved the addressed problem.
| 1 | https://tex.stackexchange.com/users/292824 | 680742 | 315,841 |
https://tex.stackexchange.com/questions/680591 | 0 | When using the package `pagenote` with the following MWE, the pdflatex output contains an `Kapitel` (chapter) text in the pagenotes (Notes=Anmerkungen und Verweise), which seems to be at wrong position and is not possible to omit by `\renewcommand*{\chaptername}{}`...
```
\documentclass[11pt,a4paper]{report}
\usepackage{ebgaramond-maths}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[continuous,page]{pagenote}
\makepagenote
\let\footnote=\pagenote
\newcommand*{\addtonotesnewcommand}[1]{\addtonotes{\large\vspace*{0.7\baselineskip}\protect\noindent\textsc{\vspace*{0.35\baselineskip} #1}}}
\renewcommand*{\notesname}{Anmerkungen und Verweise}
\renewcommand*{\chaptername}{}% This seems not to work correctly!
\renewcommand*{\thechapter}{}
\renewcommand{\thesection}{\arabic{section}}
\renewcommand*{\notedivision}{\section*{\notesname}}
\begin{document}
\section{Beginn einer Freundschaft}
\addtonotesnewcommand{\thesection. Beginn einer Freundschaft}
A sentence with a footnote that becomes a pagenote.\footnote{Some text in a footnote/pagenote}
\clearpage
\printnotes
\end{document}
```
Does anybody has experience with the pagenote package and can suggest some ideas to solve the task?
| https://tex.stackexchange.com/users/292824 | Package pagenote works insufficent and puts a 'chapter' at an unintended position in Notes | true | The problem and question has been answered by user and developer michal.h21 in:
<https://tex.stackexchange.com/a/680395/292824>
| 1 | https://tex.stackexchange.com/users/292824 | 680743 | 315,842 |
https://tex.stackexchange.com/questions/230278 | 4 | I found many applications which claim to a reference manager for Android. Some of which are:
* [RefMaster](https://play.google.com/store/apps/details?id=me.bares.refmaster) (removed from AppStore),
* [Library](https://play.google.com/store/apps/details?id=com.cgogolin.library) (last edit on [Github](https://github.com/cgogolin/library) in 2018),
* [Erasthotenes](https://play.google.com/store/apps/details?id=com.mm.eratos) (removed from AppStore).
Which one do you use which works with OwnCloud, uses the BibTex Format and can handle links to PDF files similar to JabRef?
| https://tex.stackexchange.com/users/7396 | Edit and view BibTex database on Android | false | Try BibTex Manager for Android
It can handle pdf files and links. You need to synchronize your bibtex file and zotero storage on pc.
[Play Store](https://play.google.com/store/apps/details?id=org.eu.thedoc.bibtexmanager)
| 0 | https://tex.stackexchange.com/users/293642 | 680748 | 315,847 |
https://tex.stackexchange.com/questions/680711 | 0 | How would I type the following diagram in LaTeX (perhaps Ti*k*Z)?: I want 10 bullet points, arranged as the points in the lower triangular part of a 5 times 5 matrix. Then I want arrows pointing from every node to the one directly above it. Thanks in advance!
| https://tex.stackexchange.com/users/293036 | A lower triangular diagram in TikZ | false | A variation of Οὖτις's nice answer, using `node`s instead of `circle`s to simplify drawing the arrows a bit:
```
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\foreach \i [evaluate=\i as \u using int(\i-1)] in {0,...,3}{
\foreach \j [evaluate=\j as \v using int(\j-\i)] in {\i,...,3}{
\node[circle, fill, inner sep=2pt] at (\v, \i) (n-\v-\i) {};
\ifnum\i>0\relax
\draw[->, blue] (n-\v-\u) -- (n-\v-\i);
\fi
}
}
\end{tikzpicture}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/47927 | 680751 | 315,848 |
https://tex.stackexchange.com/questions/680749 | 0 | I am trying to use the `stix2` package in together with the Russian language. But when I enable Russian language support, the font of the plain text becomes CM instead of STIX.
Work:
```
\documentclass{article}
\usepackage[T1, T2A]{fontenc}
\usepackage{babel}
\usepackage{stix2}
\begin{document}
text $math$
\end{document}
```
Not work:
```
\documentclass{article}
\usepackage[T1, T2A]{fontenc}
\usepackage[russian]{babel}
\usepackage{stix2}
\begin{document}
text $math$
\end{document}
```
If I add the `OT2` encoding at the same time, the word `text` will turn into the word `тешт`, typed in STIX font:
```
\documentclass{article}
\usepackage[T1, T2A, OT2]{fontenc}
\usepackage[russian]{babel}
\usepackage{stix2}
\begin{document}
text $math$
\end{document}
```
Is it possible to use `stix2` together with the Russian language and if so, how?
All I could find on the internet is [this answer](https://tex.stackexchange.com/a/532213/171124), which suggests using a third-party font. I would like to do with the stix font.
| https://tex.stackexchange.com/users/171124 | stix2 not work with Russian language | true | The STIX2 fonts don't support the T2A encoding, so you want to replace the text font with one that does and is Times-compatible.
```
\documentclass{article}
\usepackage[T1, T2A]{fontenc}
\usepackage[russian]{babel}
\usepackage{stix2}
\usepackage{tempora}% replace the text font
\begin{document}
text $a+b=2$ русский язык
\end{document}
```
| 1 | https://tex.stackexchange.com/users/4427 | 680755 | 315,850 |
https://tex.stackexchange.com/questions/572247 | 3 | I want to cite an archive paper, which doesn't have a journal name. If I do something like this,
```
@article{article,
author = "Author",
title = "Title",
year = "2003",
url = "arXiv:000112"
}
```
my bibliography get generated like this:
```
Author. “Title”. In: (2015). URL : arXiv:1409.1556.
```
There"s no journal name in front of **In**. Is it possible to simply remove this "in"?
| https://tex.stackexchange.com/users/228932 | remove "In" field from bibliography | false | To specify the Entry Type use the following syntax
```
\renewbibmacro{in:}{\ifentrytype{article}
{}
{\bibstring{in}\printunit{\intitlepunct}}
}
```
where you can replace "article" with any Entry Type (book, collection, periodical, proceeding . . .).
The empty braces in the second line means replacing "In:" with empty, thus deleting it (Note: you can replace the word "In:" with any other word).
"\bibstring{in}" it's just the word "In", and "\intitlepunct" it's the two points of "In".
| 1 | https://tex.stackexchange.com/users/293624 | 680756 | 315,851 |
https://tex.stackexchange.com/questions/680657 | 0 | Good morning, I am writing my thesis and should insert an A3 page in the A4 document to be folded once printed in order to insert a very large diagram. I need to keep the layout of the A4 page and then write on the left of the A3 page horizontally, with only the image exceeding the A4 size expanding to the right.
I am using the following code:
```
\documentclass[%
corpo=11pt,
twoside,
stile=classica,
oldstyle,
tipotesi=custom,
greek,
evenboxes,
]{toptesi}
\usepackage[paper=A4,pagesize]{typearea}
\usepackage{pdflscape}
\usepackage{graphicx}
\usepackage{afterpage}
\usepackage{setspace}
\usepackage{booktabs}
\usepackage{multicol}
\usepackage{multirow}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{hyperref}
\hypersetup{%
pdfpagemode={UseOutlines},
bookmarksopen,
pdfstartview={FitH},
colorlinks,
linkcolor={blue},
citecolor={blue},
urlcolor={blue}
}
\usepackage[table,xcdraw]{xcolor}
\usepackage{lipsum}
\usepackage{geometry}
\newcommand\fillin[1][4cm]{\makebox[#1]{\dotfill}}
\usepackage{dcolumn}
\newcolumntype{d}{D{.}{.}{-1} }
\usepackage{amsmath}
\newtheorem{osservazione}{Osservazione}
\newtheorem{observation}{Observation}
\usepackage[
backend=biber,
style= numeric,
sorting=none,
defernumbers=true
]{biblatex}
\addbibresource{references.bib}
\usepackage{csquotes}
\begin{document}\errorcontextlines=9
\figurespagetrue
\indici
\mainmatter
\chapter{AAA}
\section{BBB}
\lipsum[150]
\afterpage{% Insert after the current page
\clearpage
\begin{landscape}
\begin{sideways}
\KOMAoptions{paper=A3,pagesize}
\recalctypearea
\section{lalala}
\lipsum[100] \newline
\begin{figure}
\includegraphics[scale=0.4]{Picture}
\caption{caption}\label{caption}
\end{figure}
\end{sideways}
\end{landscape}
\clearpage
\KOMAoptions{paper=A4,pagesize}
\recalctypearea
}
\newpage
\section{CCC}
\end{document}
```
What I get is text printed on the left side of the page and not on the right, and header and page number printed rotated by 90°.
| https://tex.stackexchange.com/users/293609 | Rotate header and page number on a horizontal A3 page within an A4 document | true | Unfortunately your example was neither working (there are several error messages) nor minimal (there are several unused and even multiply loaded packages). So I have had to make my own example:
```
\documentclass[%
corpo=11pt,% unknown option
twoside,
stile=classica,% unknown option
oldstyle,
tipotesi=custom,% unknown option
greek,
evenboxes,
]{toptesi}
\usepackage[paper=A4,usegeometry]{typearea}
\usepackage{geometry}
\usepackage{mwe}
\begin{document}
\errorcontextlines=\maxdimen
\chapter{AAA}
\section{BBB}
\lipsum[150]
\clearpage
\storeareas\Aivarea% see KOMA-Script manual section 20.2
\KOMAoption{paper}{a3,landscape}% -"-
\areaset[current]{\dimexpr\textwidth+.5\paperwidth\relax}{\textheight}% -"-
\restoregeometry% But dont use, the enlarged area, use the area of geometry
\section{lalala}
\lipsum[100]
\begin{figure}
\makebox[\textwidth][l]{% avoid overfull \hbox
\begin{minipage}{\dimexpr\textwidth+.5\paperwidth\relax}% extend the width
% for the image and caption
\includegraphics[angle=90,width=\textwidth,height=.7\textheight]{example-image}% Just an example image
\caption{Example image}\label{fig:example}
\end{minipage}%
}
\end{figure}
\clearpage
\Aivarea
\section{CCC}
\end{document}
```
See section 20.2 of the KOMA-Script manuals for more information about inserting an A3-landscape-page into a A4-document.
| 0 | https://tex.stackexchange.com/users/277964 | 680759 | 315,852 |
https://tex.stackexchange.com/questions/680757 | 0 | I thought the new installation of TeXLive 2023 seemed to have set everything needed, but I have discovered a problem with the systems path variable. I worked before with TeXLive 2022 and now both path settings (for 2022 and 2023) are shown with the informative path command.
The problem arises since my running of tex4ebook showed that it is directed to the TeXLive 2022 installation and not the new one of 2023, which I need to get out of an error.
I looked up in the path setting of Win11 and removed the bin path for TeXLive 2022, started the computer anew, found that it is now not shown in the menu for path settings under Win11. But when I go to the TeX command line and look for the PATH variables, the path for TeXLive 2022 is still there.
Do I need to remove TeXLive 2022? Will this remove the path and get me access to TexLive 2023?
| https://tex.stackexchange.com/users/292824 | New installation of TexLive 2023, PATH setting problem under Windows 11 | true | You can try run `where tex` on cmd. If TeX Live 2022 is in front of 2023. You should remove the path of 2022 from environment variables. Or just unistall TeX Live 2022 if you don't need it.
| 1 | https://tex.stackexchange.com/users/238422 | 680760 | 315,853 |
https://tex.stackexchange.com/questions/680758 | 4 | I need to show the following Private exponent in overleaf:
```
25895107538405649688030348996832713569445142790008475239637397869318784772667910655793716697799988593837576806840542707041271719702620953276919316028023188172858715581748693955423981219211598229098207640461515095150909429377751547299151096360584320956677376726662632688048877225179958200801974706011616367315862498611926410040512147744526352916435462209101103537694846510922824847023862008422155278088141453891428873975315666229324633723121265174758771509620329121402787550477990418192871933144340836905002232237390458813578151790533395549611841467387066143850419849217555661401483288249447617461025564522092185741861
```
I tried to implement solution from [this link](https://tex.stackexchange.com/a/88922/293652).
But it is giving me many errors such as:
```
Extra }, or forgotten $.
<argument> $25\ifmmode \egroup
\egroup \)\egroup \ \bgroup \(\bgroup \bgroup...
l.6 ...401483288249447617461025564522092185741861}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
<inserted text>
}
l.6 ...401483288249447617461025564522092185741861}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
...
```
Could you please help me work?
| https://tex.stackexchange.com/users/293652 | How to show extremely large number in overleaf? | true | The example fails with newer versions of `siunitx`. But you can use, e.g., `\linebreak[1]` to allow line breaks instead of temporary end the math mode:
```
\documentclass{article}
\usepackage{siunitx}
\begin{document}
\num[group-separator={\ \linebreak[1]}]{14510219094756835443971804257188873072794015545666081939388855749525896884654481242616934781472275243051888663874155206933903154198120231191628992301817135048200098980176752739362987878664059532850107984545109970319612751146817229127042379603090727086757619024725981449720739503384463675281844597701405345770843465000975070415089613332211172182623690270574999349969317078016313807025422481160546843537968347603649315792489605777834323805460413034900278406748673158431279064662352847958818691708253398792960152785338035354737318651122455328213785355488400398210887854142389370989758234640130506260675874047790025842440885467711037139174297690267704869910896371907830244052230101607377315283106967320104784230128581678356733651972721303261927010476541549034821238262101145454460744235581503300804731781313297449779427755185487515045090431608215979542642856019280583688925217816428602650546812760023727355869719417344689058172044429829389003403686273002229187524537247634918086547752450203224546712251149064592155973342626090620714944165674055016953473475341294887308595629097007472410431532121906108088957572282026310714783107497418246512593517465039367233934654168224981093602413155513695182786967364980581565478119065103575984826265255862323181676653416967689802233214088349730947331994599695181920268130161299405995782565629800468000440941288170069450580804552732721486676013741611681944793619673798886562111764156394552401369401761640290957237757115523776564496524398167632743424880002194878959906134022876584000151040026186364933922729445416063033887021748096756407502273874073139311897811267095400718994554595717706599595291309840369068932559458206582023161200627335416474012488815016172330337260587349246890637716151044386991611573955523916598749709975716622679748797842147158726687759796825231375555889423050904597779670669542392325007347450602190569159391485653708628977505864044630073984857552417164766694174007446237442294526801441688015836679834960908965063795498787911525043365680105157251534733012502707949586129922040981734237315570322398309605732325741869439738326210465859465676096641936226281199767693354773928874388433433619697484325389804752325569617438122436340776811759892840966332713004452194028293166786594323316988588540548337522771148090464530294831596457585835024566018309518347915085787882246767059251983592015486463678669596438592049008314992556342253597099170817261519193110958315582579579612590897973375077675322925722167305656337802318288366746967854216485913798801485378624760127419739516066805063615298186443155714847814227168397129307200659528151215347298459700123443326572253651823725673379629800162640998646395994184482388600983767597362373264516098864159026279963726949742425428965389974474206288539025523008779505101179403183530399923607128711649749417952856834146668247431995446772474542494576842294761706230522253316484353430938708094756603913651373251537309372016056269711748597099537816245334412718722673658907648750157979936216611490736992538374477600849705624013181091770128676485069581054048874685904083050140375491505461484946125125451337979611764072862286605372712106006826370411836898330301429634452349794501412248777505760614344490849783569014504371505461770328495059377607202264878613571439464276520675474725198021564621051600119505652211213532992622202360790091815754312912492831778390646659560040690459901136056449162132579354760291911193820625422431352244142409372672255981998554730721402236896068017291399002608524659494733156458560468454286972744117043980326910174676178911707063103605254915304021061697977849611533820629613317114846889476696181908015744691773684581421721766116278136401642504413267688296553061773640889487079941079523319237250497373798734700149432993920460571528295808178065313882435208470362653529114065796062572729665041898351559680918279839147245393054880997783582680218593925594607624500090379662522764884879472497228739168678792217895918597323042889902923183460534005812014216501363645976671584231574633653237845999560572585757923903205441980717507754148387516844031980736798705250383427695858961777809551804058339251044381692967273519833836087499347445601294743806210482771755946615364138025776699592214328553465384862908829172871443071701627260637948355406567656586196261571857797351973872753455115341974403208689931822888840618095837856835836394220964167373693182043337821269170972524622932791811888912799516823430014684735838761857776779589974226842805074532243035588934778154324933509023535093506616335938383230021260887567310329094908408756605538385397234006271831785200944648397254513110833878153213909414855156147406580199544926314022129562346840811295917348374741554351275966099497539583772438559776254413455134392518272577650575336568062777244668565133254732650588948151145265262483174452321786600631078667589115400895685481443896662624596421972072634179998128521551328524409147039181155195254079054125314833707693253478332206243285173108787414261108600363476728627922180452603493453425271127307705393556306352032635208921648129782670552618600278257768436977627400984290219034868885655233425867631329453946124234192945444292062390064139287501070023602474691217791123210303476034915878041468974260381740828122980062146438949536001669362613825058563639940617077400121977921846377164005316723309241731235427352206528561532205796843631685579889554180615071319939092634080756482668988152398561724049845236882408823368740724293855662938714848076386745237708153888259668172851739419865414324087115957051254617425968124768603533017735321784079001850457325218829987911483131047432710646357341089726726268908301963807638384000153712817560155006091798147666549321736102030430275572850304627126716322739932121477170815946271923065311867369532267887377248219996879400509573450413921221205456088819521230510667781563476106206963190199926903895644156241024327814735639665740125951619966598339326080242254271213340903963049744522583041693089877597632573932526178555920706300304747852396865431378278487499260694027311870364355410328667112749998467439373896003064860381390956802707851152642580551808484506908569732595512165106587801736771619118518777303548767371525823564478594570943150422943471819366503424051758233597273684831997197296226005537112653183943361132860240388669248557201867337362480675098941420786903330080052975972994678444503888277589320711001095589217883075728263558182980761933023136478190685967473848614410589586742282218929572405880168032768662254225628649076169101399729794796356267028950517111994339221184328582454650116709719362617008710352054818584996741050395663202561403165353399920824824813672014368423783327933853524295735698077629063531327012611}
\end{document}
```
| 6 | https://tex.stackexchange.com/users/277964 | 680761 | 315,854 |
https://tex.stackexchange.com/questions/680752 | 0 | I' writing a test macro to evaluate the Lettrine arguments for
different letters & different sizes (lines). The scenario is this:
1. The main prog calls a one arg macro to test the Lettrine for a given letter: `\TestLettrine{A}`
2. The `\TestLettrine` macro calls another macro to get the right options passing it the letter & the size (line numbers) to pass it to Lettrine:
`\LettrineOpts{A}{3}`.
When I compile this (I'm using LuaLatex) I get the message:
```
! Argument of \xs_IfStringCase_ii has an extra }.
<inserted text>
\par
l.179 \TestLettrine{A}
```
Ran it on Overleaf got more errors including the one mentioned here.
Here's my MWE:
```
\documentclass{article}
\usepackage{lettrine}
\usepackage{xstring}
\usepackage{lipsum}
\newcommand{\LettrineOpts}[2]{%
\IfStrEqCase{#1}{%
{A}{lines=#2,lraise=0.1,slope=0.6em}%
{C}{lines=#2,findent=0.1em,nindent=0.18em,slope=-0.5em}
}%
}%
\newcommand{\TestLettrine}[1]{%
\providecommand{\opts}{\LettrineOpts{#1}{3}}
Opts for char #1 and size 3:\\ \opts
\lettrine[\opts]{#1}{}3 lines (\opts). One liner.
\let\opts\relax
\vspace*{3ex}
\providecommand{\opts}{\LettrineOpts{#1}{4}}
Opts for char #1 and size 4:\\ \opts
\lettrine[\opts]{#1}{}4 lignes. \\ \lipsum
\let\opts\relax
\vspace*{3ex}
}%
\begin{document}
\TestLettrine{A} \par
\TestLettrine{C}
% covering all the letters
\end{document}
```
| https://tex.stackexchange.com/users/282784 | Write a tester for Lettrine options for each letter/size | false | Your code generates another error and does not allow me to play the size variation
(lines=n).
In the meantime I found another solution which I'm going to adopt. It uses the
Lettrine config file where I can define the options for every char I want. I though
initially that defining the size will override those definitions. Which is not the
case. Lettrine MERGES my options with those already in the config file.
Excellent work of Daniel Flipo!
In case this solution might help someone here is the snippets of the final code.
Config file (options.cfl):
```
\LettrineOptionsFor{A}{slope=0.1\LettrineWidth, findent=-.5em, nindent=.7em}
\LettrineOptionsFor{À}{slope=0.1\LettrineWidth, findent=-.5em, nindent=0.7em}
\LettrineOptionsFor{V}{slope=-0.1\LettrineWidth, lhang=0.5, nindent=0pt}
\LettrineOptionsFor{C'}{nindent=-0.5em}
\LettrineOptionsFor{Q}{loversize=-0.1, lraise=0.1}
```
And the macros and their call:
```
\newcommand{\blah}{\lipsum*[1-2][1-5]}
\newcommand{\TestLettrine}[1]{%
\lettrine[lines=3]{#1}{} lines: 3 \\ \blah
\vspace*{3ex}
\lettrine[lines=4]{#1}{} lines: 4 \\ \blah
\clearpage
}%
\newcommand{\TestAllLettrines}{%
\foreach \char in {A, À, C', Q, V }{%
\TestLettrine{\char} \par%
}%
}%
\TestAllLettrines
```
The options are given for the example.
| 1 | https://tex.stackexchange.com/users/282784 | 680769 | 315,855 |
https://tex.stackexchange.com/questions/680762 | 0 | To be honest, I do not really understand the documentation of the `bmpsize` package.
I have it on older sources but without reference why it was needed.
So my first question is why it is needed,
because seemingly all what I compile works fine without it.
Is the background maybe creating dvi files? or using htlatex or something?
The second question is why compilation with `xelatex` fails
if applied to this minimal example:
```
\documentclass{article}
\usepackage{bmpsize}
\begin{document}
Test
\end{document}
```
The result is:
```
his is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022/TeX Live for SUSE Linux) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-02-24> (/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/latex/base/inputenc.sty
Package inputenc Warning: inputenc package ignored with utf8 based engines.
) (/usr/share/texmf/tex/latex/base/fontenc.sty
(/usr/share/texmf/tex/latex/lm/t1lmr.fd))
(/usr/share/texmf/tex/latex/oberdiek/bmpsize.sty
(/usr/share/texmf/tex/generic/iftex/iftex.sty)
(/usr/share/texmf/tex/generic/pdftexcmds/pdftexcmds.sty
(/usr/share/texmf/tex/generic/infwarerr/infwarerr.sty)
(/usr/share/texmf/tex/generic/ltxcmds/ltxcmds.sty))
! Package bmpsize Error: You need pdfTeX 1.30.0 or newer.
See the bmpsize package documentation for explanation.
Type H <return> for immediate help.
...
l.53 }{Package loading is aborted.}
%
```
The core seems `! Package bmpsize Error: You need pdfTeX 1.30.0 or newer.`
Well, I do have pdftex much newer and `xelatex` does not rely on `pdftex`, does it?
So, does this hint mean, that bmpsize is needed for pdflatex only??
What about `lualatex`?
I checked the version of xelatex:
```
$ xelatex -version
XeTeX 3.141592653-2.6-0.999994 (TeX Live 2022/TeX Live for SUSE Linux)
kpathsea version 6.3.4
Copyright 2022 SIL International, Jonathan Kew and Khaled Hosny.
There is NO warranty. Redistribution of this software is
covered by the terms of both the XeTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the XeTeX source.
Primary author of XeTeX: Jonathan Kew.
Compiled with ICU version 72.1; using 72.1
Compiled with zlib version 1.2.13; using 1.2.13
Compiled with FreeType2 version 2.12.1; using 2.13.0
Compiled with Graphite2 version 1.3.14; using 1.3.14
Compiled with HarfBuzz version 6.0.0; using 7.1.0
Compiled with libpng version 1.6.39; using 1.6.39
Compiled with pplib version v2.05 less toxic i hope
Compiled with fontconfig version 2.14.2; using 2.14.2
```
| https://tex.stackexchange.com/users/60463 | is package bmpsize still needed | false | You almost certainly do not need this, `graphicx` (or rather its use of `extractbb`) means most formats are handled.
However it should work.
The supplied file runs without error in pdflatex and lualatex but gives a spurious error in xelatex as `pdftexmds` failed to define a wrapper for `\filedump`
```
\documentclass{article}
\makeatletter
\def\pdf@filedump#1#2#3{\filedump offset#1 length#2{#3}}
\makeatother
\usepackage{bmpsize}
\begin{document}
test
\end{document}
```
Runs without error
| 2 | https://tex.stackexchange.com/users/1090 | 680774 | 315,858 |
https://tex.stackexchange.com/questions/135484 | 31 | I have read all the related questions and taken all the suggested steps (well, the ones that had anything to do with my situation since for example I am not using `XeLaTeX`). As far as I can see, this file ought to produce a pdf with one citation in it and a bibliography with that entry.
```
\documentclass{amsart}
\usepackage[]{biblatex}
\addbibresource{refs.bib}
\begin{document}
\cite{FefCF}
\printbibliography
\end{document}
```
Instead it produces a pdf with the name `FefCF` printed in boldface and no bibliography.
I am using `TeXworks` and have run both `BibTeX` and pdfLaTex+MakeIndex+BibTeX repeatedly in many combinations.
To be clear, the reference FefCF is indeed in the file refs.bib (and has been used many time with `BibTeX`) and it is in the same folder as this file, namely `C:/Users/Colin/Documents/TeX Files`. I have also tried the full location name `C:/Users/Colin/Documents/TeX Files/refs.bib` to specify the bib resource. That makes no difference.
| https://tex.stackexchange.com/users/37424 | Biblatex still won't print bibliography | false | For some reason, they above answers did not work for me. So I provide an alternative, in case others experience the same issue:
Files:
```
report.tex
refs.bib
```
The relevant sections from `report.tex`:
```
\documentclass[a4paper]{article}
% For using bibtex
%
% The `noadjust` parameter turns off the behaviour when this package
% inserts spaces before references.
\usepackage[noadjust]{cite}
\begin{document}
% ...
\bibliography{refs}{}
\bibliographystyle{alpha}
\end{document}
```
The compilation command is two-fold, that is I need to compile both with `pdflatex` and with `bibtex` - both are done from the (Linux-)terminal:
```
pdflatex report.tex
bibtex report.aux
pdflatex report.tex
```
This will, in my case, compile the reference database and properly display a list of references in the pdf-output.
| 0 | https://tex.stackexchange.com/users/123228 | 680783 | 315,862 |
https://tex.stackexchange.com/questions/680785 | 3 | I wanted to make a shape called "dynamometer" like rectangle, circle or so on with some anchors and options. But I can't figure out how to achieve such goal.
I've taken the dynamometer shape from this [topic](https://tex.stackexchange.com/questions/630364/dynamometer-ask-for-improvement-suggestions) and to make it a shape I've some questions.
1. How to declare a shape for TikZ? Such that I'm allowed to write `\node[dynamo, rectangle, F={65~N}] at (5,0)`.
2. In a declared shape, how to create nodes?
3. In a declared shape, how to define options as "rectangle" or "F={65~N}"?
Here is "my" MWE :
```
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
%%
%% Key wanted : - Newton value to label the red marker.
%% - Option to use the rectangle or circle boundaries shape.
%% - Node wanted : - red marker node
%% - bottom of the hook
%% - Upper part of the hook
%% - center of the hook
%% - upper part of the ring
%% -
%% Ring
\draw[line width=6pt] (2,24) circle (1.5);
\draw[line width=3pt] (2,22.5) -- ++(0,-3);
%% Hook
\draw[line width=6pt, gray, rounded corners] (2,9) -- ++(0,-1.5) arc (90:360:1.7);
%% Shape of the dynamometer
% \draw[line width=3pt, fill=lightgray] (4,20) arc (0:180:2) -- ++(0,-10) arc (180:360:2) -- cycle; %% bords en cercle
\draw[line width=3pt, fill=lightgray, rounded corners] (3.5,21) rectangle ++(-3,-12); %% bord rectangle arrondi
%% Scale
% Vertical line
\draw[line width=3pt] (2,20) -- ++(0,-10);
% Graduation with red marker
\foreach \i in {0,...,20}{
\ifnum\i=5
\draw[line width=5pt, red]
\else
\draw[line width=0.5pt]
\fi
(1.5,{10+0.5*\i}) -- ++(1,0);
}
\end{tikzpicture}
\end{document}
```
| https://tex.stackexchange.com/users/169294 | Dynamometer - Creating custom shapes with anchor and options | true | You could create a node shape (you might want to look into the PGF/Ti*k*Z manual to learn about how to do this in general) if you want to reuse this drawing several times (what I assume is your aim actually), but I am not sure whether a shape is flexible enough to meet your requirements. In my opinion, it is better to create a `pic` from it, since it would allow you to change the marker position easily:
```
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\tikzset{
pics/dynamometer/.style={
code={
\tikzset{dynamometer/.cd, #1}
%% Ring
\draw[line width=6pt] (2,24) circle (1.5);
\draw[line width=3pt] (2,22.5) -- ++(0,-3);
\coordinate (-ring-top) at (2,25.5);
%% Hook
\draw[line width=6pt, gray, rounded corners] (2,9) -- ++(0,-1.5) arc (90:360:1.7);
\coordinate (-hook-top) at (2,7.5);
\coordinate (-hook-center) at (2,5.8);
\coordinate (-hook-bottom) at (2,4.1);
%% Shape of the dynamometer
\draw[line width=3pt, fill=lightgray, rounded corners] (3.5,21) rectangle ++(-3,-12);
%% Scale
% Vertical line
\draw[line width=3pt] (2,20) -- ++(0,-10);
% Graduation with red marker
\foreach \i in {0,...,20} {
\draw[line width=0.5pt] (1.5,{10+0.5*\i}) -- ++(1,0);
}
\coordinate (-marker) at (2,{10+0.5*\pgfkeysvalueof{/tikz/dynamometer/marker position}});
\draw[line width=5pt, red] (1.5,{10+0.5*\pgfkeysvalueof{/tikz/dynamometer/marker position}}) -- ++(1,0);
}
},
dynamometer/marker position/.initial={5}
}
\begin{document}
\begin{tikzpicture}
%%
%% Key wanted : - Newton value to label the red marker.
%% - Option to use the rectangle or circle boundaries shape.
%% - Node wanted : - red marker node
%% - bottom of the hook
%% - Upper part of the hook
%% - center of the hook
%% - upper part of the ring
%%
\pic (mymeter) at (0,0) {dynamometer};
\node[circle, inner sep=3pt, fill=yellow] at (mymeter-ring-top) {};
\node[circle, inner sep=3pt, fill=green] at (mymeter-marker) {};
\node[circle, inner sep=3pt, fill=cyan] at (mymeter-hook-top) {};
\node[circle, inner sep=3pt, fill=blue] at (mymeter-hook-center) {};
\node[circle, inner sep=3pt, fill=magenta] at (mymeter-hook-bottom) {};
\pic at (5,0) {dynamometer={marker position=15}};
\end{tikzpicture}
\end{document}
```
I don't know what unit the scale displays, so I opted for a neutral `marker position` as option to the pic.
---
If you want to have a highly stylable variant, you could maybe use this (which also extends the hook according to the marker position):
```
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\tikzset{
pics/dynamometer/.style={
code={
\tikzset{dynamometer/.cd, #1}
%% Ring
\draw[dynamometer/ring] (2,24) circle[radius=1.5];
\draw[dynamometer/ring connection] (2,22.5) -- ++(0,-3);
\coordinate (-ring-top) at (2,25.5);
%% Hook
\draw[dynamometer/hook] (2,{10+0.5*\pgfkeysvalueof{/tikz/dynamometer/marker position}}) -- ++(0,-11.5) arc[start angle=90, end angle=360, radius=1.7];
\coordinate (-hook-top) at (2,{-1.5+0.5*\pgfkeysvalueof{/tikz/dynamometer/marker position}});
\coordinate (-hook-center) at (2,{-3.2+0.5*\pgfkeysvalueof{/tikz/dynamometer/marker position}});
\coordinate (-hook-bottom) at (2,{-4.9+0.5*\pgfkeysvalueof{/tikz/dynamometer/marker position}});
%% Shape of the dynamometer
\draw[dynamometer/meter] (3.5,21) rectangle ++(-3,-12);
%% Scale
% Vertical line
\draw[dynamometer/scale] (2,20) -- ++(0,-10);
% Graduation with red marker
\foreach \i in {0,...,20} {
\draw[dynamometer/tick] (1.5,{10+0.5*\i}) -- ++(1,0);
}
\coordinate (-marker) at (2,{10+0.5*\pgfkeysvalueof{/tikz/dynamometer/marker position}});
\draw[dynamometer/marker] (1.5,{10+0.5*\pgfkeysvalueof{/tikz/dynamometer/marker position}}) -- ++(1,0);
}
},
dynamometer/marker position/.initial={5},
dynamometer/ring/.style={line width=6pt},
dynamometer/ring connection/.style={line width=3pt},
dynamometer/hook/.style={line width=6pt, gray, rounded corners},
dynamometer/meter/.style={line width=3pt, fill=lightgray, rounded corners},
dynamometer/scale/.style={line width=3pt},
dynamometer/tick/.style={line width=0.5pt},
dynamometer/marker/.style={line width=5pt, red},
}
\begin{document}
\begin{tikzpicture}
%%
%% Key wanted : - Newton value to label the red marker.
%% - Option to use the rectangle or circle boundaries shape.
%% - Node wanted : - red marker node
%% - bottom of the hook
%% - Upper part of the hook
%% - center of the hook
%% - upper part of the ring
%%
\pic (mymeter) at (0,0) {dynamometer};
\node[circle, inner sep=3pt, fill=yellow] at (mymeter-ring-top) {};
\node[circle, inner sep=3pt, fill=green] at (mymeter-marker) {};
\node[circle, inner sep=3pt, fill=cyan] at (mymeter-hook-top) {};
\node[circle, inner sep=3pt, fill=blue] at (mymeter-hook-center) {};
\node[circle, inner sep=3pt, fill=magenta] at (mymeter-hook-bottom) {};
\pic at (5,0) {dynamometer={marker position=20, meter/.append style={sharp corners, fill=white}, hook/.append style={draw=blue}}};
\end{tikzpicture}
\end{document}
```
---
Added a few options for a label:
```
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usepackage{siunitx}
\tikzset{
pics/dynamometer/.style={
code={
\tikzset{dynamometer/.cd, #1}
%% Ring
\draw[dynamometer/ring] (2,24) circle[radius=1.5];
\draw[dynamometer/ring connection] (2,22.5) -- ++(0,-3);
\coordinate (-ring-top) at (2,25.5);
%% Hook
\draw[dynamometer/hook] (2,{10+0.5*\pgfkeysvalueof{/tikz/dynamometer/marker position}}) -- ++(0,-11.5) arc[start angle=90, end angle=360, radius=1.7];
\coordinate (-hook-top) at (2,{-1.5+0.5*\pgfkeysvalueof{/tikz/dynamometer/marker position}});
\coordinate (-hook-center) at (2,{-3.2+0.5*\pgfkeysvalueof{/tikz/dynamometer/marker position}});
\coordinate (-hook-bottom) at (2,{-4.9+0.5*\pgfkeysvalueof{/tikz/dynamometer/marker position}});
%% Shape of the dynamometer
\draw[dynamometer/meter] (3.5,21) rectangle ++(-3,-12);
%% Scale
% Vertical line
\draw[dynamometer/scale] (2,20) -- ++(0,-10);
% Graduation with red marker
\foreach \i in {0,...,20} {
\draw[dynamometer/tick] (1.5,{10+0.5*\i}) -- ++(1,0);
}
\coordinate (-marker) at (2,{10+0.5*\pgfkeysvalueof{/tikz/dynamometer/marker position}});
\draw[dynamometer/marker] (1.5,{10+0.5*\pgfkeysvalueof{/tikz/dynamometer/marker position}}) -- ++(1,0);
\node[dynamometer/marker label] at (-marker) (-marker-label) {\pgfkeysvalueof{/tikz/dynamometer/marker label content}};
}
},
dynamometer/marker position/.initial={5},
dynamometer/ring/.style={line width=6pt},
dynamometer/ring connection/.style={line width=3pt},
dynamometer/hook/.style={line width=6pt, gray, rounded corners},
dynamometer/meter/.style={line width=3pt, fill=lightgray, rounded corners},
dynamometer/scale/.style={line width=3pt},
dynamometer/tick/.style={line width=0.5pt},
dynamometer/marker/.style={line width=5pt, red},
dynamometer/marker label/.style={right=0.5cm},
dynamometer/marker label content/.initial={},
}
\begin{document}
\begin{tikzpicture}
%%
%% Key wanted : - Newton value to label the red marker.
%% - Option to use the rectangle or circle boundaries shape.
%% - Node wanted : - red marker node
%% - bottom of the hook
%% - Upper part of the hook
%% - center of the hook
%% - upper part of the ring
%%
\pic (mymeter) at (0,0) {dynamometer={marker label content={\Huge\qty{65}{\newton}}, marker label/.append style={circle, fill=yellow}}};
\end{tikzpicture}
\end{document}
```
| 4 | https://tex.stackexchange.com/users/47927 | 680786 | 315,863 |
https://tex.stackexchange.com/questions/680785 | 3 | I wanted to make a shape called "dynamometer" like rectangle, circle or so on with some anchors and options. But I can't figure out how to achieve such goal.
I've taken the dynamometer shape from this [topic](https://tex.stackexchange.com/questions/630364/dynamometer-ask-for-improvement-suggestions) and to make it a shape I've some questions.
1. How to declare a shape for TikZ? Such that I'm allowed to write `\node[dynamo, rectangle, F={65~N}] at (5,0)`.
2. In a declared shape, how to create nodes?
3. In a declared shape, how to define options as "rectangle" or "F={65~N}"?
Here is "my" MWE :
```
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
%%
%% Key wanted : - Newton value to label the red marker.
%% - Option to use the rectangle or circle boundaries shape.
%% - Node wanted : - red marker node
%% - bottom of the hook
%% - Upper part of the hook
%% - center of the hook
%% - upper part of the ring
%% -
%% Ring
\draw[line width=6pt] (2,24) circle (1.5);
\draw[line width=3pt] (2,22.5) -- ++(0,-3);
%% Hook
\draw[line width=6pt, gray, rounded corners] (2,9) -- ++(0,-1.5) arc (90:360:1.7);
%% Shape of the dynamometer
% \draw[line width=3pt, fill=lightgray] (4,20) arc (0:180:2) -- ++(0,-10) arc (180:360:2) -- cycle; %% bords en cercle
\draw[line width=3pt, fill=lightgray, rounded corners] (3.5,21) rectangle ++(-3,-12); %% bord rectangle arrondi
%% Scale
% Vertical line
\draw[line width=3pt] (2,20) -- ++(0,-10);
% Graduation with red marker
\foreach \i in {0,...,20}{
\ifnum\i=5
\draw[line width=5pt, red]
\else
\draw[line width=0.5pt]
\fi
(1.5,{10+0.5*\i}) -- ++(1,0);
}
\end{tikzpicture}
\end{document}
```
| https://tex.stackexchange.com/users/169294 | Dynamometer - Creating custom shapes with anchor and options | false | Like this:
Code:
```
\documentclass[border=10pt]{standalone}
\usepackage{tikz,siunitx,calc}
\usetikzlibrary{decorations.pathmorphing,patterns}
\sisetup{round-mode = places, round-precision = 3}
\begin{document}
\begin{tikzpicture}[scale=.65]
\draw[gray,line width=12pt] (0,0) arc (180:0:2);
\filldraw[brown] (-1,0) rectangle (5,-22);
\node[white] at (2.1,-1.5) (a) {\bfseries \large Range: 0-1.800 kg};
\node[white] at (2.1,-2.3) (a) {\bfseries 8 mm $\rightarrow$ 100 g};
\draw[decoration={aspect=0.2, segment length=1mm, amplitude=2mm,coil},decorate] (2.08,-3) -- (2.05,-4);
\draw[gray,line width=10pt] (2.1,-4)--(2.1,-21);
\draw[cyan,line width=20pt,opacity=.4] (2.1,-3)--(2.1,-21);
\foreach \i in {0,1,...,18}{
\pgfmathsetmacro\h{-4-.8*\i};
\pgfmathsetmacro\j{-4.5-.8*\i};
%\pgfmathsetmacro{\j}{int(90-\i)}
\pgfmathsetmacro{\k}{.1*\i};
\draw[white,line width=3pt] (1.6,\h)--(1.2,\h) node[left] (\i) {\bfseries \large $\i$};
\draw[white,line width=3pt] (2.6,\h)--(3.0,\h) node[right] (\i) {\bfseries \large \num{\k}};
}
\draw[red,line width=3,-latex] (1.5,-4)--(2.7,-4);
\draw[gray,line width=10pt,rounded corners] (2.1,-22)--(2.1,-23) arc (90:350:2);
\end{tikzpicture}
\end{document}
```
| 5 | https://tex.stackexchange.com/users/24644 | 680797 | 315,868 |
https://tex.stackexchange.com/questions/680794 | 1 | In a section I want to describe some aspects with their respective time and place via the format below, ie with a bold heading, some (italic) text below and on the RHS of the doc the time and place.
My problem: The text I need to insert is too long to fit on one line and would need a line break. However, doing this via eg // causes problems and I suspect I've to adjust the actual command but don't know how. Atm the text flows over the RHS of the page and makes the TIME and PLACE information disappear.
**MRE:**
*Command implementation:*
```
\newcommand{\resumeSubheading}[4]{
\vspace{-1pt}\item[]
\begin{tabular*}{0.97\textwidth}{l@{\extracolsep{\fill}}r}
\textbf{#1} & #2 \\
\textit{#3} & \textit{#4} \\
\end{tabular*}\vspace{-5pt}
}
\newcommand{\resumeSubHeadingListStart}{\begin{itemize}[leftmargin=*]}
\newcommand{\resumeSubHeadingListEnd}{\end{itemize}}
\newcommand{\resumeItemListStart}{\begin{itemize}}
\newcommand{\resumeItemListEnd}{\end{itemize}\vspace{-5pt}}
```
*In-text implementation:*
```
\section{Some section name}
\resumeSubHeadingListStart
\resumeSubheading
{Some heading name}{Somewhere PLACE}
{long description of something and something else, so long that it does not fit on one line and would need a line break but that does not work unfortunately}{YEAR1-YEAR2}
\resumeSubHeadingListEnd
```
**Reference to older question on this:**
This has been already asked here but without an answer:
[resumeSubHeadingListStart - Split into new line inside resumeSubheading](https://tex.stackexchange.com/questions/604653/resumesubheadingliststart-split-into-new-line-inside-resumesubheading)
| https://tex.stackexchange.com/users/293667 | How can I split text into a new line inside resumeSubheading? | false | You can use a fixed-width column (`p` column doesn't need additional package but I think you might prefer `m` column from the `array` package) instead of the `l` column.
```
\documentclass{article}
\usepackage{array}
\usepackage{enumitem}
\newcommand{\resumeSubheading}[4]{
\vspace{-1pt}\item[]
\begin{tabular*}{0.97\textwidth}{m{7cm}@{\extracolsep{\fill}}r}
\textbf{#1} & #2 \\
\textit{#3} & \textit{#4} \\
\end{tabular*}\vspace{-5pt}
}
\newcommand{\resumeSubHeadingListStart}{\begin{itemize}[leftmargin=*]}
\newcommand{\resumeSubHeadingListEnd}{\end{itemize}}
\newcommand{\resumeItemListStart}{\begin{itemize}}
\newcommand{\resumeItemListEnd}{\end{itemize}\vspace{-5pt}}
\begin{document}
\section{Some section name}
\resumeSubHeadingListStart
\resumeSubheading
{Some heading name}{Somewhere PLACE}
{long description of something and something else, so long that it does not fit on one line and would need a line break but that does not work unfortunately}{YEAR1-YEAR2}
\resumeSubHeadingListEnd
\end{document}
```
| 0 | https://tex.stackexchange.com/users/219947 | 680800 | 315,869 |
https://tex.stackexchange.com/questions/680779 | 3 | I'm using the [kaobook](https://github.com/fmarotta/kaobook/) class, which in turn uses the [`etoc`](https://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/etoc/etoc.pdf) package to create local TOCs in my document. Because the local TOCs should be in the margin of the page where where they are called (typically at the beginning of a chapter), they are essentially included like this:
```
\documentclass{scrbook}
\usepackage{etoc}
\usepackage{marginnote}
\usepackage[hidelinks]{hyperref}
\newcounter{margintocdepth} % Set the depth of the margintoc
\setcounter{margintocdepth}{\sectiontocdepth}
\newlength{\mtocshift} % Length of the vertical offset used for margin tocs
\setlength{\mtocshift}{-52mm}
% Command to print a table of contents in the margin
\newcommand{\margintoc}[1][\mtocshift]{ % The first parameter is the vertical offset; by default it is \mtocshift
\begingroup
% Set the style for chapter entries
\etocsetstyle{chapter}
{\parindent -10pt \parskip 0pt}
{\leftskip 0pt}
{\makebox[.5cm]{}
\hangindent=0.5cm\etoclink{\etocthename}\nobreak\hbox{\hbox to 1.5ex {\hss\hss}}\hfill\makebox[5mm][l]{\etocpage}\nobreak
\par}
{}
% Set the style for section entries
\etocsetstyle{section}
{\parindent 0pt \parskip 0pt}
{\leftskip 0pt}
{\makebox[.5cm]{}
\hangindent=0.5cm\etoclink{\etocthename}\nobreak\hbox{\hbox to 1.5ex {\hss\hss}}\hfill\makebox[5mm][l]{\etocpage}\nobreak
\par}
{}
% Set the global style of the toc
\etocsettocstyle{\usekomafont{section}\small\raggedright}{}
\etocsetnexttocdepth{\themargintocdepth}
% Print the table of contents in the margin
\marginnote[#1]{
\parbox[b]{\marginparwidth}{Contents\vspace{-0.65\baselineskip}\\\vspace{0.1\baselineskip}\rule{\marginparwidth}{0.5pt}}
\localtableofcontents
}
\endgroup
}
\begin{document}
\tableofcontents
\part{First Part}
\setchapterpreamble[u]{\margintoc}
\chapter{Introduction}
\section{Section 1}
\section{Section 2}
\chapter{Body}
\section{Section 1}
\section{Section 2}
\chapter{Conclusion}
\section{Section 1}
\section{Section 2}
\part{Second Part}
\chapter{Introduction}
\chapter{Body}
\chapter{Conclusion}
\end{document}
```
This works well, but the local TOC only includes the elements from within the chapter (which I guess is usually exactly what you want). But instead, I would like the local TOC to include everyting from the parts level. Is there any way to do that?
Using `\etocsetnexttocdepth` unfortunately doesn't work and calling `\localtableofcontents` without `\setchapterpreamble` will create a local TOC with the corect scope, but it will be printed on its own page.
| https://tex.stackexchange.com/users/182643 | Create a local TOC with arbitrary scope | true | According to the package documentation section `15. Labeling and reusing elsewhere`
>
> etoc allows to typeset at some location a local table of contents
> which is defined elsewhere. For this, two simple steps:
>
>
> 1. insert `\localtableofcontents`at the distant place, and follow it by some `\label{foo}`.
> 2. insert `\tableofcontents\ref{foo}` at the place where you want this distant table of contents to appear.
> 3. in step 1, if you use `\invisiblelocaltableofcontents` in place of `\localtableofcontents`, there will be no typesetting at its place of
> definition.
>
>
>
You need some way to generate automatically this mark-up with some suitable lables, for example `\label{part:1}`, but then you will need your chapter to know in which part it is. Ok I tested with `\the\value{part}` both to generate the label and use as reference for chapters in that part, and it appears to work indeed.
first chapter in first part
first chapter in second part
```
\documentclass{scrbook}
\usepackage{etoc}
\usepackage{marginnote}
\usepackage[hidelinks]{hyperref}
\newcounter{margintocdepth} % Set the depth of the margintoc
\setcounter{margintocdepth}{\sectiontocdepth}
\newlength{\mtocshift} % Length of the vertical offset used for margin tocs
\setlength{\mtocshift}{-52mm}
% Command to print a table of contents in the margin
\newcommand{\margintoc}[1][\mtocshift]{ % The first parameter is the vertical offset; by default it is \mtocshift
\begingroup
% Set the style for chapter entries
\etocsetstyle{chapter}
{\parindent -10pt \parskip 0pt}
{\leftskip 0pt}
{\makebox[.5cm]{}
\hangindent=0.5cm\etoclink{\etocthename}\nobreak\hbox{\hbox to 1.5ex {\hss\hss}}\hfill\makebox[5mm][l]{\etocpage}\nobreak
\par}
{}
% Set the style for section entries
\etocsetstyle{section}
{\parindent 0pt \parskip 0pt}
{\leftskip 0pt}
{\makebox[.5cm]{}
\hangindent=0.5cm\etoclink{\etocthename}\nobreak\hbox{\hbox to 1.5ex {\hss\hss}}\hfill\makebox[5mm][l]{\etocpage}\nobreak
\par}
{}
% Set the global style of the toc
\etocsettocstyle{\usekomafont{section}\small\raggedright}{}
\etocsetnexttocdepth{\themargintocdepth}
% Print the table of contents in the margin
\marginnote[#1]{
\parbox[b]{\marginparwidth}{Contents\vspace{-0.65\baselineskip}\\\vspace{0.1\baselineskip}\rule{\marginparwidth}{0.5pt}}
\localtableofcontents\ref{part:\the\value{part}}
}
\endgroup
}
\begin{document}
\tableofcontents
\part{First Part}
\invisiblelocaltableofcontents\label{part:\the\value{part}}
\setchapterpreamble[u]{\margintoc}
\chapter{Introduction}
\section{Section 1}
\section{Section 2}
\chapter{Body}
\section{Section 1}
\section{Section 2}
\chapter{Conclusion}
\section{Section 1}
\section{Section 2}
\part{Second Part}
\invisiblelocaltableofcontents\label{part:\the\value{part}}
\setchapterpreamble[u]{\margintoc}
\chapter{Introduction}
\chapter{Body}
\chapter{Conclusion}
\end{document}
```
---
Update: the above is for using `\part`. It will fail with `\part*`. Then use rather than `\the\value{part}` something such as `\the\value{mycounter}` having done `\newcounter{mycounter}` and issuing `\stepcounter{mycounter}` or `\refstepcounter{mycounter}` at each `\part*`. You can also do `\refstepcounter{part}` as you mention in a comment but this appears to be reasonable only if you include only unnumbered parts in the document, else the numbering of the numbered ones will get shifted. Beware that `\part*` may have another issue of not correctly delimiting the local table of contents according to the [etoc](https://ctan.org/pkg/etoc) documentation, section `21. The \etocsetlocaltop.toc and \etocimmediatesetlocaltop.toc commands`. I have not tested and your comment (I don't know how to link to it) seemingly indicates you had no issues, but you may have to do things such as that for unnumbered parts, which I found looking for `part*` in the [etoc](https://ctan.org/pkg/etoc) documentation.
```
\part*{Extra unnumbered part}
\etocsetlocaltop.toc{part}
\invisiblelocaltableofcontents
```
In retrospect as your comment seemed to indicate all ok, maybe this is not needed and possibly even detrimental.
| 2 | https://tex.stackexchange.com/users/293669 | 680804 | 315,871 |
https://tex.stackexchange.com/questions/680809 | 1 | I'm using a template for my presentation and I want the table of contents to show in the frame defined for it below, and nowhere else. But it keeps showing at the start of every section and i do not understand which part of the template's code does this.
```
\documentclass[xcolor=table]{beamer}
% \usepackage[table]{xcolor}
\usepackage{ctex, hyperref}
\usepackage[T1]{fontenc}
% other packages
\usepackage{latexsym,amsmath,xcolor,multicol,booktabs,calligra}
\usepackage{graphicx,pstricks,listings,stackengine}
\usepackage{wrapfig,tikz}
\author{My name}
\title{My title}
\institute{My school}
\date{the date}
\usepackage{whu}
% defs
\def\cmd#1{\texttt{\color{red}\footnotesize $\backslash$#1}}
\def\env#1{\texttt{\color{blue}\footnotesize #1}}
\definecolor{deepblue}{rgb}{0,0,0.5}
\definecolor{deepred}{rgb}{0.6,0,0}
\definecolor{deepgreen}{rgb}{0,0.5,0}
\definecolor{halfgray}{gray}{0.55}
\lstset{
basicstyle=\ttfamily\small,
keywordstyle=\bfseries\color{deepblue},
emphstyle=\ttfamily\color{deepred}, % Custom highlighting style
stringstyle=\color{deepgreen},
numbers=left,
numberstyle=\small\color{halfgray},
rulesepcolor=\color{red!20!green!20!blue!20},
frame=shadowbox,
}
\begin{document}
\kaishu
\begin{frame}
\titlepage
\begin{figure}[htpb]
\begin{center}
\includegraphics[width=0.15\linewidth]{pic/whulogo.jpeg}
\end{center}
\end{figure}
\end{frame}
\begin{frame}
\tableofcontents[sectionstyle=show,subsectionstyle=show/shaded/hide,subsubsectionstyle=show/shaded/hide]
\end{frame}
% \section{thing}
% [...]
\end{document}
```
It seems other people's questions about it on StackExchange are more interested in showing the toc everywhere except at the start of a specific section. How do i get it to go away everywhere except it's dedicated frame?
| https://tex.stackexchange.com/users/285610 | TOC shows up everywhere in a beamer template | true | Assuming that this is the `whu` theme you are using <https://github.com/Xinchen-Fan/WHU-Beamer-Theme/blob/master/whu.sty> then you can suppress the toc at the start of new sections with `\AtBeginSection{}`
```
\documentclass[xcolor=table]{beamer}
% \usepackage[table]{xcolor}
%\usepackage{ctex, hyperref}
\usepackage[T1]{fontenc}
% other packages
\usepackage{latexsym,amsmath,xcolor,multicol,booktabs,calligra}
\usepackage{graphicx,pstricks,listings,stackengine}
\usepackage{wrapfig,tikz}
\author{My name}
\title{My title}
\institute{My school}
\date{the date}
\usepackage{whu}
% defs
\def\cmd#1{\texttt{\color{red}\footnotesize $\backslash$#1}}
\def\env#1{\texttt{\color{blue}\footnotesize #1}}
\definecolor{deepblue}{rgb}{0,0,0.5}
\definecolor{deepred}{rgb}{0.6,0,0}
\definecolor{deepgreen}{rgb}{0,0.5,0}
\definecolor{halfgray}{gray}{0.55}
\lstset{
basicstyle=\ttfamily\small,
keywordstyle=\bfseries\color{deepblue},
emphstyle=\ttfamily\color{deepred}, % Custom highlighting style
stringstyle=\color{deepgreen},
numbers=left,
numberstyle=\small\color{halfgray},
rulesepcolor=\color{red!20!green!20!blue!20},
frame=shadowbox,
}
\AtBeginSection{}
\begin{document}
%\kaishu
\begin{frame}
\titlepage
\begin{figure}[htpb]
\begin{center}
\includegraphics[width=0.15\linewidth]{example-image-duck}
\end{center}
\end{figure}
\end{frame}
\begin{frame}
\tableofcontents[sectionstyle=show,subsectionstyle=show/shaded/hide,subsubsectionstyle=show/shaded/hide]
\end{frame}
\section{thing}
\begin{frame}
content...
\end{frame}
% [...]
\end{document}
```
| 0 | https://tex.stackexchange.com/users/36296 | 680810 | 315,874 |
https://tex.stackexchange.com/questions/680805 | 3 | The command `\DeclarePairedDelimiter` (from the `mathtools` package) allows to use the delimiter size commands `\big,\Big,\bigg,\Bigg`, and allows to define custom paired delimiters. For example, the macro`\DeclarePairedDelimiter{\Paren}{\lparen}{\rparen}` (which uses the `mathtools` commands `\lparen` and `\rparen`) allows to write expressions like `\Paren[\Bigg]{x}`, whose output is the letter "x" enclosed by the biggest parentheses (not a very interesting example of "custom" paired delimiters, of course).
However, sometimes one might want to invoke the custom opening and closing delimiters with independent commands: for example, I prefer this whenever the content between the delimiters is too long, like
```
\customleftdelimiter A very long math expression \customrightdelimiter
```
instead of
```
\customdelimiter{A very long long math expression}
```
In the `mathtools` user manual (version 2022/06/29), p. 28, one reads:
>
> **Note 2:** If you want to define your own manual scaler macros, it is important that
> you besides `\foo` also define `\fool` and `\foor`. When a scaler is specified, in say
> `\abs[\big]{〈arg〉}`, we actually use \bigl and `\bigr`.
>
>
>
The problem is that no instructions are given to do this. Perhaps a `DeclareOpeningDelimiter` command exists, but it is not described in the `mathtools` documentation.
Question
========
How to define the `\fool` and `\foor` commands, **in the spirit of the** `mathtools` **package**?
**Note:** This is a rephrasing of a previous question I asked, which I deleted because it was mixed with another issue (I will ask a separate question about that).
| https://tex.stackexchange.com/users/32352 | Definition of individual (nonpaired) delimiters with mathtools | false | You can use `\customldel` and `\customrdel` to define left and right delimiters. The left delimiter can take a parameter like `\big` in order to scale the delimiter and whatever right delimiter it is paired with.
You need to match up left and right delimiters (ie. every custom left delimiter must be paired with a custom right delimiter), but you can use the predefined `\lempty` and `\rempty` custom delimiters for null delimiters (`\lempty` can also be used to set the scale of whatever right delimiter it is paired with).
```
\documentclass{article}
\def\noscale#1{\ifx.#1 \else#1\fi}
\makeatletter
\def\mstrip{\expandafter\@gobble\string}
\let\customscale=\noscale
\def\customldel#1#2{%
\expandafter\def\csname \mstrip#1@help\endcsname[##1]{%
\begingroup%
\edef\customscale{\expandafter\noexpand\csname \mstrip##1r\endcsname}%
\csname \mstrip##1l\endcsname{#2}%
}%
\def#1{\@ifnextchar[ {\csname \mstrip#1@help\endcsname}%
{\begingroup\let\customscale=\noscale#2}}%
}
\def\customrdel#1#2{%
\def#1{\customscale{#2}\endgroup}%
}
\makeatother
\begin{document}
\customldel{\lempty}.
\customrdel{\rempty}.
\customldel{\lcparen}(
\customrdel{\rcparen})
\[ \lempty[\bigg]\lcparen[\big] a\lcparen b\rempty c \rcparen\rcparen \]
\[ \bigl( a(b c \bigr) \biggr) \]
\end{document}
```
This works by storing the current amount of scale in a register `\customscale`, which is reverted after a custom right delimiter. `\noscale` is used in the case that there is no scaling, and it checks for the null delimiter (`.`) and prints if not.
| 1 | https://tex.stackexchange.com/users/287149 | 680816 | 315,876 |
https://tex.stackexchange.com/questions/680805 | 3 | The command `\DeclarePairedDelimiter` (from the `mathtools` package) allows to use the delimiter size commands `\big,\Big,\bigg,\Bigg`, and allows to define custom paired delimiters. For example, the macro`\DeclarePairedDelimiter{\Paren}{\lparen}{\rparen}` (which uses the `mathtools` commands `\lparen` and `\rparen`) allows to write expressions like `\Paren[\Bigg]{x}`, whose output is the letter "x" enclosed by the biggest parentheses (not a very interesting example of "custom" paired delimiters, of course).
However, sometimes one might want to invoke the custom opening and closing delimiters with independent commands: for example, I prefer this whenever the content between the delimiters is too long, like
```
\customleftdelimiter A very long math expression \customrightdelimiter
```
instead of
```
\customdelimiter{A very long long math expression}
```
In the `mathtools` user manual (version 2022/06/29), p. 28, one reads:
>
> **Note 2:** If you want to define your own manual scaler macros, it is important that
> you besides `\foo` also define `\fool` and `\foor`. When a scaler is specified, in say
> `\abs[\big]{〈arg〉}`, we actually use \bigl and `\bigr`.
>
>
>
The problem is that no instructions are given to do this. Perhaps a `DeclareOpeningDelimiter` command exists, but it is not described in the `mathtools` documentation.
Question
========
How to define the `\fool` and `\foor` commands, **in the spirit of the** `mathtools` **package**?
**Note:** This is a rephrasing of a previous question I asked, which I deleted because it was mixed with another issue (I will ask a separate question about that).
| https://tex.stackexchange.com/users/32352 | Definition of individual (nonpaired) delimiters with mathtools | false | Here's a version that respects the nesting levels.
```
\documentclass{article}
\usepackage{mathtools}
\ExplSyntaxOn
\NewDocumentCommand{\definegenericpaired}{mmm}
{% #1 = name, #2 = left delimiter, #3 = right delimiter
\chibchas_lr_new:nnn { #1 } { #2 } { #3 }
}
\int_new:N \g__chibchas_lr_nestlevel_int
\cs_new_protected:Nn \chibchas_lr_new:nnn
{
\ExpandArgs{c}\NewDocumentCommand{#1l}{so}
{
% store the star or the optional argument
\tl_gclear_new:c { g__chibchas_lr_\int_to_arabic:n { \g__chibchas_lr_nestlevel_int }_tl }
\IfBooleanTF{##1}
{
\tl_gset:cn { g__chibchas_lr_\int_to_arabic:n { \g__chibchas_lr_nestlevel_int }_tl } { \right }
}
{
\IfNoValueF{##2}
{
\tl_gset:cn { g__chibchas_lr_\int_to_arabic:n { \g__chibchas_lr_nestlevel_int }_tl }
{ \use:c { \cs_to_str:N ##2 r } }
}
}
% increase the nest level
\int_gincr:N \g__chibchas_lr_nestlevel_int
% deliver the left delimiter
\IfBooleanTF{##1}
{ \left }
{ \IfNoValueF{##2} { \use:c { \cs_to_str:N ##2 l } } }
#2
}
\ExpandArgs{c}\NewDocumentCommand{#1r}{}
{
% decrease the nest level
\int_gdecr:N \g__chibchas_lr_nestlevel_int
% deliver the right delimiter
\tl_use:c { g__chibchas_lr_\int_to_arabic:n { \g__chibchas_lr_nestlevel_int }_tl } #3
}
}
\ExplSyntaxOff
\definegenericpaired{foo}{(}{)}
\definegenericpaired{baz}{[}{]}
\begin{document}
\[
\fool* \frac{1}{2} + \bazl[\Big] x + \fool y \foor - z \bazr - 1 \foor
\]
\end{document}
```
For each left delimiter, the requested size is saved in a global token list variable, so it can be used at the matching right delimiter. If you forget some, you're doomed…
| 3 | https://tex.stackexchange.com/users/4427 | 680818 | 315,877 |
https://tex.stackexchange.com/questions/680811 | 2 | When i click update wizard, it says "MiKTeX encountered an internal error."
This is why I can’t load any packages automatically.
What is the solution????
| https://tex.stackexchange.com/users/285645 | MiKTeX encountered an internal error | false | It is possible (only possible!) that this is a temporary issue with TeXlive databases.
TeXlive was updated from 2022 to 2023 within the past week. Normally, a TeXlive 2022 user (including MiKTeX, if that version) will get a message saying that TeXlive is frozen for 2022, so no updates are available.
I just tried the Linux equivalent to MiKTeX update. Instead of the usual frozen message, I get an error saying that cryptographic signatures are wrong. That is unusual.
This suggests that there is a temporary problem with the package databases.
If so, it is the kind of thing that will "sooner or later" be fixed by the mirrors.
| 1 | https://tex.stackexchange.com/users/287367 | 680822 | 315,880 |
https://tex.stackexchange.com/questions/680823 | 4 | I hope this is not a duplicate; I tried to search around and didn't find anything, but perhaps I used the wrong keywords. I'm using Plain TeX and have the following defined:
```
\newskip\hugeskipamount
\hugeskipamount=24pt plus 8pt minus 8pt
\def\hugeskip{\vskip\hugeskipamount}
```
This is all fine and well, however sometimes when I have
```
A
\hugeskip
B
```
and B starts a new page, the `vskip` disappears at the bottom of the page, and the page becomes all streched out, giving an underfull `vbox`. Is there a way to define `hugeskip` in such a way that if it turns up at the end of a page, it just functions like a `vfill`, i.e., there'll be a bit of a gap at the end of the page (which I find better than increased gaps between paragraphs). Thanks!
| https://tex.stackexchange.com/users/216667 | Defining a vskip that possibly becomes vfill | true | Your question would have been clearer with an example but if I understand correctly
```
\def\hugeskip{\vskip\hugeskipamount\filbreak}
```
`\filbreak` is plain macro `\vfil\penalty-200\vfilneg` so normally it does nothing but if a page break happens at the penalty you get vfil at the bottom of the page, the `\vfilneg` is discarded before the next page starts.
| 9 | https://tex.stackexchange.com/users/1090 | 680825 | 315,881 |
https://tex.stackexchange.com/questions/680116 | 2 | Im wondering how to make Latex sort last names with double a in a last name at the top of the reference list. As of now, my reference "Aasly" is sorted at the bottom of the list.
```
@article{aasly2019forundersokelser,
title = {Forundersøkelser og bruk av kortreist stein. En geologisk veileder},
author = {Aasly, Kari Aslaksen and Margreth, Annina and Erichsen, Eyolf and Rise, Torun and Alnæs, Lisbeth-Ingrid},
year={2019},
journal={SINTEF akademisk forlag},
URL = {https://sintef.brage.unit.no/sintef-xmlui/bitstream/handle/11250/2641011/SFag\%2062_rettet\%20navn\%20(1).pdf?sequence=1}
}
```
Im using this reference style:
```
\usepackage[backend = biber,
style = authoryear-comp,
urldate = long,
maxcitenames = 3,
]{biblatex}
\addbibresource{references.bib}
```
Something to add in the reference itself to force it on top?
| https://tex.stackexchange.com/users/288812 | Double a in last name | false | As you can realize from Marijn's and Mico's comments, if you're using `babel` with `danish`, Aasly will come after Zorro.
However, you can always change the order the references are printed by using `sortkey`.
Compare the result with `sortkey={Asly}`:
```
\documentclass{book}
\usepackage[danish]{babel}
\usepackage{csquotes}
\begin{filecontents}{\jobname.bib}
@article{aasly2019forundersokelser,
title = {Forundersøkelser og bruk av kortreist stein. En geologisk veileder},
author = {Aasly, Kari Aslaksen and Margreth, Annina and Erichsen, Eyolf and Rise, Torun and Alnæs, Lisbeth-Ingrid},
sortkey={Asly},
year={2019},
journal={SINTEF akademisk forlag},
URL = {https://sintef.brage.unit.no/sintef-xmlui/bitstream/handle/11250/2641011/SFag\%2062_rettet\%20navn\%20(1).pdf?sequence=1}
}
@article{zorro,
title = {Something},
author = {Zorro, Diego},
year={2019},
journal={De La Vega publishing}
}
\end{filecontents}
\usepackage[backend = biber,
style = authoryear-comp,
urldate = long,
maxcitenames = 3,
]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
A citation \textcite{aasly2019forundersokelser}
another citation \textcite{zorro}
\printbibliography
\end{document}
```
with the default behavior without `sortkey`:
```
\documentclass{book}
\usepackage[danish]{babel}
\usepackage{csquotes}
\begin{filecontents}[overwrite]{\jobname.bib}
@article{aasly2019forundersokelser,
title = {Forundersøkelser og bruk av kortreist stein. En geologisk veileder},
author = {Aasly, Kari Aslaksen and Margreth, Annina and Erichsen, Eyolf and Rise, Torun and Alnæs, Lisbeth-Ingrid},
year={2019},
journal={SINTEF akademisk forlag},
URL = {https://sintef.brage.unit.no/sintef-xmlui/bitstream/handle/11250/2641011/SFag\%2062_rettet\%20navn\%20(1).pdf?sequence=1}
}
@article{zorro,
title = {Something},
author = {Zorro, Diego},
year={2019},
journal={De La Vega publishing}
}
\end{filecontents}
\usepackage[backend = biber,
style = authoryear-comp,
urldate = long,
maxcitenames = 3,
]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
A citation \textcite{aasly2019forundersokelser}
another citation \textcite{zorro}
\printbibliography
\end{document}
```
| 6 | https://tex.stackexchange.com/users/101651 | 680843 | 315,888 |
https://tex.stackexchange.com/questions/680763 | 1 | I have included Arabic in the package. but I can't display the headline of the newspaper.
```
\documentclass{article}
%In the preamble section include the arabtex and utf8 packages
\usepackage[utf8]{inputenc}
\usepackage[T1,LFE,LAE]{fontenc}
\usepackage[english,arabic]{babel}
\usepackage{arabtex} % Required for arab
\usepackage{utf8}
```
I'm assuming that I need to change the gothic font in the headline of the newspaper. Gothic font does not support Arabic.
```
\usepackage{newspaper}
\renewcommand{\sfdefault}{phv}
\renewcommand{\rmdefault}{ptm}
\renewcommand{\ttdefault}{pcr}
\date{\today}
\currentvolume{1}
\currentissue{1}
\SetPaperName{اويغور گازتي}
\SetHeaderName{اويغور گازتي}
\SetPaperLocation{اورومچي}
\SetPaperSlogan{اورومچي الغه}
\SetPaperPrice{1.7}
\usepackage{graphicx}
\usepackage{multicol}
%%%
\usepackage{picinpar}
\usepackage{newspaper-mod}
\usepackage{lipsum}
\begin{document}
\maketitle
\setcode{utf8}
\begin{multicols}{3}
\closearticle
\end{multicols}
\end{document}
```
Some Uighur letters are not in Arabic or Persian, can I add them to the text?
I summarize:
1. Most important: Arabic(Uyghur) newspaper headline compiled successfully.
2. If it is possible to add Uighur and Arabic, then add.
| https://tex.stackexchange.com/users/293654 | I'm using the newspaper package, How do I make the title of my newspaper title in Uyghur or Farsi or Arabic | false | How's this?
The columns are still LTR left-to-right, though.
MWE
```
\documentclass{article}
\usepackage{xcolor}
\usepackage{fontspec}
\newfontfamily\uyg[Script=Arabic]{UKIJBasma}
\usepackage{newspaper}
\renewcommand{\sfdefault}{phv}
\renewcommand{\rmdefault}{ptm}
\renewcommand{\ttdefault}{pcr}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{arabic}
\newfontfamily\arabicfont[Color=blue,Scale=1.1,Script=Arabic]{UKIJTuz}
\date{\today}
\currentvolume{1}
\currentissue{1}
\SetPaperName{{\uyg اويغور گازتي}}
\SetHeaderName{{ \uyg اويغور گازتي}}
\SetPaperLocation{{\uyg اورومچي}}
\SetPaperSlogan{\uyg اورومچي الغه}
\SetPaperPrice{1.7}
\usepackage{graphicx}
\usepackage{multicol}
%%%
\usepackage{picinpar}
%\usepackage{newspaper-mod}
\usepackage{lipsum}
\begin{document}
\maketitle
%\setcode{utf8}
\begin{Arabic}
\begin{multicols}{3}
x x x
{\uyg اويغور گازتي}
{ \uyg اويغور گازتي}
{\uyg اورومچي}
{\uyg اورومچي الغه}
x x x
{\uyg اويغور گازتي}
{ \uyg اويغور گازتي}
{\uyg اورومچي}
{\uyg اورومچي الغه}
\closearticle
\textenglish{From Wikipedia: Solar system}
{
قۇياش سىستېمىسىنىڭ ئاساسلىق ئەزالىرى ئىچىدىن سىرتىغا : مېركۇرىي ، ۋىنىرا ، يەرشارى ، مارس ، يۇپىتېر ، ساتۇرن ، ئۇران ، نېپتۇن . قۇياش سىستىمىسى قۇياشنى مەركەز قىلغان ، ھەمدە بارلىق قۇياشنىڭ ئېغىرلىق كۇچ تەسىرىگە ئۇچرايدىغان ئاسمان جىسىمىنىڭ بىرلەشمىسى : 8 سەييارە ، ئاز دىگەندىمۇ 165 دانە ھەمراھى بار ، 5 دانە بايقالغان پەتەك يۇلتۇز ۋە مىليونلىغان قۇياش سىستېمىسى كىچىك ئاسمان جىسىملىرىدىن تۇزەلگەن . بۇ كىچىك ئاسمان جى ...
}
\closearticle
\end{multicols}
\end{Arabic}
\end{document}
```
---
Added `luabidi`:
MWE
```
\documentclass{article}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{picinpar}
\usepackage{multicol}
\usepackage{fontspec}
\newfontfamily\uyg[Script=Arabic]{UKIJ Basma}
\newfontfamily\uygb[Script=Arabic,Color=red,Scale=2]{UKIJ Ekran}\usepackage{newspaper}
%\renewcommand{\sfdefault}{phv}
%\renewcommand{\rmdefault}{ptm}
%\renewcommand{\ttdefault}{pcr}
%\usepackage[bidi=basic,english,Arabic]{babel}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{arabic}
\newfontfamily\arabicfont[Color=blue,Scale=1.1,Script=Arabic]{UKIJ Tuz}
%\usepackage{bidi} % compile with xelatex
\usepackage{luabidi} % compile with lualatex
\date{\today}
\currentvolume{1}
\currentissue{1}
\newcommand\loc{\uyg اورومچي}
\SetPaperName{{\Huge\uyg\textarabic{اويغور گازتي}}}
\SetHeaderName{\textarabic{{\Large\uygb اويغور گازتي}}}
\SetPaperLocation{{\loc}}
\SetPaperSlogan{{\large\textarabic{ اورومچي الغه}}}
\SetPaperPrice{1.7}
\title{}
\setRTLmain
\begin{document}
\maketitle
\begin{Arabic}
%\begin{RTL}\RTLmulticolumns
\begin{multicols}{3}
x x x
{\uyg اويغور گازتي}
{ \uyg اويغور گازتي}
{\uyg اورومچي}
{\uyg اورومچي الغه}
x x x
{\uyg اويغور گازتي}
{ \uyg اويغور گازتي}
{\uyg اورومچي}
{\uyg اورومچي الغه}
\closearticle
\textenglish{From Wikipedia: Solar system}
{
قۇياش سىستېمىسىنىڭ ئاساسلىق ئەزالىرى ئىچىدىن سىرتىغا : مېركۇرىي ، ۋىنىرا ، يەرشارى ، مارس ، يۇپىتېر ، ساتۇرن ، ئۇران ، نېپتۇن . قۇياش سىستىمىسى قۇياشنى مەركەز قىلغان ، ھەمدە بارلىق قۇياشنىڭ ئېغىرلىق كۇچ تەسىرىگە ئۇچرايدىغان ئاسمان جىسىمىنىڭ بىرلەشمىسى : 8 سەييارە ، ئاز دىگەندىمۇ 165 دانە ھەمراھى بار ، 5 دانە بايقالغان پەتەك يۇلتۇز ۋە مىليونلىغان قۇياش سىستېمىسى كىچىك ئاسمان جىسىملىرىدىن تۇزەلگەن . بۇ كىچىك ئاسمان جى ...
}
\closearticle
\uyg
قۇياش سىستېمىسىنىڭ ئاساسلىق ئەزالىرى ئىچىدىن سىرتىغا : مېركۇرىي ، ۋىنىرا ، يەرشارى ، مارس ، يۇپىتېر ، ساتۇرن ، ئۇران ، نېپتۇن . قۇياش سىستىمىسى قۇياشنى مەركەز قىلغان ، ھەمدە بارلىق قۇياشنىڭ ئېغىرلىق كۇچ تەسىرىگە ئۇچرايدىغان ئاسمان جىسىمىنىڭ بىرلەشمىسى : 8 سەييارە ، ئاز دىگەندىمۇ 165 دانە ھەمراھى بار ، 5 دانە بايقالغان پەتەك يۇلتۇز ۋە مىليونلىغان قۇياش سىستېمىسى كىچىك ئاسمان جىسىملىرىدىن تۇزەلگەن . بۇ كىچىك ئاسمان جى ...
قۇياش سىستېمىسىنىڭ ئاساسلىق ئەزالىرى ئىچىدىن سىرتىغا : مېركۇرىي ، ۋىنىرا ، يەرشارى ، مارس ، يۇپىتېر ، ساتۇرن ، ئۇران ، نېپتۇن . قۇياش سىستىمىسى قۇياشنى مەركەز قىلغان ، ھەمدە بارلىق قۇياشنىڭ ئېغىرلىق كۇچ تەسىرىگە ئۇچرايدىغان ئاسمان جىسىمىنىڭ بىرلەشمىسى : 8 سەييارە ، ئاز دىگەندىمۇ 165 دانە ھەمراھى بار ، 5 دانە بايقالغان پەتەك يۇلتۇز ۋە مىليونلىغان قۇياش سىستېمىسى كىچىك ئاسمان جىسىملىرىدىن تۇزەلگەن . بۇ كىچىك ئاسمان جى ...
\closearticle
\end{multicols}
\end{Arabic}
\end{document}
```
| 2 | https://tex.stackexchange.com/users/182648 | 680846 | 315,890 |
https://tex.stackexchange.com/questions/680841 | 0 | I am currently using Miktex and Texstudio on Mac, how should I configure it in "Commands" so it also downloads the missing packages on the fly? If you can share the configs or a screenshot of the config details, that would be really helpful!
| https://tex.stackexchange.com/users/293696 | How to config TexStudio on Mac when I am using Miktex? | false | `TeXStudio` uses the packages loaded by `MikTeX`, so it's `MikTeX` you need to configure to add additional packages on-the-fly. To do that follow these steps:
1. open the `MikTeX Console`
2. go to the `Settings` option (bottom one in sidebar)
3. in the tab `General` you'll see three choices how missing packages should be handled
4. choose either one of the first two as the last one won't install any packages automatically
Success!
*Answer to the link question*
1. open `TeXStudio`
2. click on `Help`
3. select the option `Check LaTeX installation`
4. A new document opens containing all relevant information about your system, the MikTeX installation, path, TeXStudio etc.
Usually TeXStudio locates the MikTeX installation automatically as MikTeX adds its main directory to the path.
| 0 | https://tex.stackexchange.com/users/189383 | 680848 | 315,892 |
https://tex.stackexchange.com/questions/680832 | 1 | I found this two-column template for research paper on Overleaf.
<https://www.overleaf.com/latex/templates/isecure-draft/tmkjrydcqbfx>
I love the style of the paper and I would like to write my paper in a similar format but it seems I cannot get rid of the heading. This is the documentclass
```
\documentclass[Print]{../Style/isecure-v24}
```
Can someone help me please? If not, could someone help me locate a similar **two-column** template? Overleaf did not have good options besides this one.
| https://tex.stackexchange.com/users/293689 | Keeping this Latex Style | false | Overleaf runs a standard texlive so if you have a project using one of their templates you can download it and use locally.
From the link you gave select `Open as Template` which gives you a project using that class.
Then in the left menu select Download `Source`
and you will get a zip file you can unzip and use locally.
Note the warnings suggest the class has serious bugs but that's a different issue.
| 1 | https://tex.stackexchange.com/users/1090 | 680849 | 315,893 |
https://tex.stackexchange.com/questions/680820 | 0 | In Beamer, I need to make parts of text and/or pictures appear periodically in a loop, each part having a different beginning and end within this loop.
This is the kind of code I normally use.
```
\uncover<5-8,17-20,29-32>{First,} \uncover<7-14,19-26,31-38>{second.}
```
I would like to parameterize the values, so that the above code looks something like this:
```
\def\startLoop{4}
\def\nLoop{12}
\def\startA{1}
\def\stopA{4}
\def\startB{3}
\def\stopB{10}
\uncover<{\startLoop+\startA} - {\startLoop+\stopA} , {\startLoop+\startA+\nLoop} - {\startLoop+\stopA+\nLoop}, {\startLoop+\startA+2*\nLoop} - {\startLoop+\stopA+2*\nLoop}>{First,} \uncover<{\startLoop+\startB} - {\startLoop+\stopB} , {\startLoop+\startB+\nLoop} - {\startLoop+\stopB+\nLoop}, {\startLoop+\startB+2*\nLoop} - {\startLoop+\stopB+2*\nLoop}>{second.}
```
Is there a way to get calculated uncover?
| https://tex.stackexchange.com/users/192491 | Uncover with calculated values? | false | I would calculate the values before the uncover macro, e.g.
```
\documentclass{beamer}
\newcounter{counta}
\newcounter{countb}
\begin{document}
\begin{frame}
\def\startLoop{4}
\def\nLoop{12}
\def\startA{1}
\def\stopA{4}
\def\startB{3}
\def\stopB{10}
\setcounter{counta}{\numexpr\startLoop+\startA}
\setcounter{countb}{\numexpr\startLoop+\stopA}
\uncover<\thecounta-\thecountb>{second.}
\end{frame}
\end{document}
```
| 0 | https://tex.stackexchange.com/users/36296 | 680851 | 315,894 |
https://tex.stackexchange.com/questions/680831 | 1 | Installed MacTex2023 on a new Mac and all is well except for a nagging issue with "pygmentize" that I've already installed. I cannot find how to adjust system to recognise the installed "pygmentize" that exists in my "/Users//Library/Python/3.9/bin" folder.
I have upgraded to Python 3.11 and used pip3 to confirm that Pygments 2.14.0 is installed.
I've already checked those SE pages that discuss Pygmentize issues, e.g. at [Pygmentize not working properly with minted package in TexShop on OS X](https://tex.stackexchange.com/questions/279214/pygmentize-not-working-properly-with-minted-package-in-texshop-on-os-x/281188#281188)
Additional specs via 'pip3 list':
Package Version
---
1. altgraph 0.17.2
2. future 0.18.2
3. macholib 1.15.2
4. pip 23.0.1
5. Pygments 2.14.0
6. setuptools 67.6.0
7. six 1.15.0
8. wheel 0.40.0
Note: When I run the following minimal LaTeX package, I see the same error:
```
\documentclass{article}
\usepackage{minted}
\begin{document}
\begin{minted}{c}
int main() {
printf("hello, world");
return 0;
}
\end{minted}
\end{document}
```
e.g.: 'Package minted Error: You must have `pygmentize' installed to use this package.'
Note 2: I Typeset to LaTeX using TexShop.
| https://tex.stackexchange.com/users/213365 | Package minted Error: You must have `pygmentize' installed to use this package, while Pygments is already installed? | true | Eureka (I wish this would have been easier, e.g. from [this TeXShop
page](https://pages.uoregon.edu/koch/texshop/changes_3.html)).
Caveat: I tested this with a TeXShop 3.89 which is nowadays an old version.
To let TeXShop use `--shell-escape` for only one specific document you can:
* instead of hitting "Compile" (or whatever is English word), go to `Macros>Claus Gerhardt Macros` and then choose `pdflatexc`. It launches the compilation using `--shell-escape` flag. (I discovered that by digging into `~/Library/TeXShop/bin/`).
I tried many `% !TeX` variants such as `% !TEX TS-program="pdflatex --shell-escape"` but this fails, and perhaps there is a parameter `TS-program-options` but I stopped my search after above workaround.
But first you also need that TeXShop finds pygmentize.
An answer is given at <https://tex.stackexchange.com/a/281188/293669> which worked for me.
On my installation (which is a direct TeXLive install) I do not need the `sudo` so simply
```
ln -s "$(which pygmentize)" /Library/TeX/texbin/pygmentize
```
in Terminal.
Perhaps execute first `which pygmentize` and `pygmentize -V` to confirm it
is correctly installed, prior to symlink it to the directory where TeXShop
finds TeX binaries. The above should apply on MacTeX based installations.
For direct TeXLive installations on (old) Macs, replace
`/Library/TeX/texbin/pygmentize` by something such as
`/usr/local/texlive/2023/bin/x86_64-darwinlegacy/pygmentize`.
| 1 | https://tex.stackexchange.com/users/293669 | 680855 | 315,896 |
https://tex.stackexchange.com/questions/680853 | 3 | <https://www.bcb.gov.br/acessoinformacao/legado?url=https:%2F%2Fwww4.bcb.gov.br%2Fglossario.asp%3FDefinicao%3D1676%26idioma%3DP%26idpai%3DGLOSSARIO>
I've tried href, hyperref, URL, or none at all, just \footnote{https://www.bcb.gov.br/acessoinformacao/legado?url=https:%2F%2Fwww4.bcb.gov.br%2Fglossario.asp%3FDefinicao%3D1676%26idioma%3DP%26idpai%3DGLOSSARIO}
or \footnote[1]{https://www.bcb.gov.br/acessoinformacao/legado?url=https:%2F%2Fwww4.bcb.gov.br%2Fglossario.asp%3FDefinicao%3D1676%26idioma%3DP%26idpai%3DGLOSSARIO}
Can't put the entire link without being clickable because latex things the "%" it's part of the code.
| https://tex.stackexchange.com/users/293713 | How do I insert this url in a footnote | false |
```
\documentclass{article}
\usepackage{hyperref}
\usepackage{xurl}
\begin{document}
\footnote{\url{https://www.bcb.gov.br/acessoinformacao/legado?url=https:\%2F\%2Fwww4.bcb.gov.br\%2Fglossario.asp\%3FDefinicao\%3D1676\%26idioma\%3DP\%26idpai\%3DGLOSSARIO}}
\end{document}
```
| 3 | https://tex.stackexchange.com/users/238422 | 680857 | 315,897 |
https://tex.stackexchange.com/questions/680820 | 0 | In Beamer, I need to make parts of text and/or pictures appear periodically in a loop, each part having a different beginning and end within this loop.
This is the kind of code I normally use.
```
\uncover<5-8,17-20,29-32>{First,} \uncover<7-14,19-26,31-38>{second.}
```
I would like to parameterize the values, so that the above code looks something like this:
```
\def\startLoop{4}
\def\nLoop{12}
\def\startA{1}
\def\stopA{4}
\def\startB{3}
\def\stopB{10}
\uncover<{\startLoop+\startA} - {\startLoop+\stopA} , {\startLoop+\startA+\nLoop} - {\startLoop+\stopA+\nLoop}, {\startLoop+\startA+2*\nLoop} - {\startLoop+\stopA+2*\nLoop}>{First,} \uncover<{\startLoop+\startB} - {\startLoop+\stopB} , {\startLoop+\startB+\nLoop} - {\startLoop+\stopB+\nLoop}, {\startLoop+\startB+2*\nLoop} - {\startLoop+\stopB+2*\nLoop}>{second.}
```
Is there a way to get calculated uncover?
| https://tex.stackexchange.com/users/192491 | Uncover with calculated values? | true | We can prepare the argument at expand processor level by `\expanded` eTeX primitive and then run `\uncover` macro. Use `\euncover` instead `\uncover`, it means "evaluated uncover".
```
\def\startLoop{4}
\def\nLoop{12}
\def\startA{1}
\def\stopA{4}
\def\startB{3}
\def\stopB{10}
\def\euncover<#1>{\expandafter\uncover\expanded{<\euncoverA#1\end>}}
\def\euncoverA#1#2{\the\numexpr#1\relax
\ifx\end#2\else #2\expandafter\euncoverA\fi}
\euncover<{\startLoop+\startA} - {\startLoop+\stopA} , {\startLoop+\startA+\nLoop} - {\startLoop+\stopA+\nLoop}, {\startLoop+\startA+2*\nLoop} - {\startLoop+\stopA+2*\nLoop}>{First,}
\euncover<{\startLoop+\startB} - {\startLoop+\stopB} , {\startLoop+\startB+\nLoop} - {\startLoop+\stopB+\nLoop}, {\startLoop+\startB+2*\nLoop} - {\startLoop+\stopB+2*\nLoop}>{second.}
```
| 3 | https://tex.stackexchange.com/users/51799 | 680861 | 315,899 |
https://tex.stackexchange.com/questions/680853 | 3 | <https://www.bcb.gov.br/acessoinformacao/legado?url=https:%2F%2Fwww4.bcb.gov.br%2Fglossario.asp%3FDefinicao%3D1676%26idioma%3DP%26idpai%3DGLOSSARIO>
I've tried href, hyperref, URL, or none at all, just \footnote{https://www.bcb.gov.br/acessoinformacao/legado?url=https:%2F%2Fwww4.bcb.gov.br%2Fglossario.asp%3FDefinicao%3D1676%26idioma%3DP%26idpai%3DGLOSSARIO}
or \footnote[1]{https://www.bcb.gov.br/acessoinformacao/legado?url=https:%2F%2Fwww4.bcb.gov.br%2Fglossario.asp%3FDefinicao%3D1676%26idioma%3DP%26idpai%3DGLOSSARIO}
Can't put the entire link without being clickable because latex things the "%" it's part of the code.
| https://tex.stackexchange.com/users/293713 | How do I insert this url in a footnote | true | The following code will return error:
```
\documentclass{article}
\usepackage{hyperref,xurl}
\begin{document}
text\footnote{\url{https://www.bcb.gov.br/acessoinformacao/legado?url=https:%2F%2Fwww4.bcb.gov.br%2Fglossario.asp%3FDefinicao%3D1676%26idioma%3DP%26idpai%3DGLOSSARIO}}
\end{document}
```
In such a case, you can use the `\urldef` command. See the page 2 in [url.pdf](http://mirrors.ctan.org/macros/latex/contrib/url/url.pdf):
>
> Take for example the email address “myself%node@gateway.net" which
> could not be given (using “\url” or “\verb”) in a caption or parbox
> due to the percent sign. This address can be predefined with
> \urldef{\myself}\url{myself%node@gateway.net} and then you may use
> “\myself” instead of “\url{myself%node@gateway.net}” in an argument,
> and even in a moving argument like a caption because a defined-url is
> robust.
>
>
>
For example:
```
\documentclass{article}
\usepackage{hyperref,xurl}
\begin{document}
\urldef{\myurl}\url{https://www.bcb.gov.br/acessoinformacao/legado?url=https:%2F%2Fwww4.bcb.gov.br%2Fglossario.asp%3FDefinicao%3D1676%26idioma%3DP%26idpai%3DGLOSSARIO}
text\footnote{\myurl}
\end{document}
```
| 1 | https://tex.stackexchange.com/users/123653 | 680863 | 315,900 |
https://tex.stackexchange.com/questions/680872 | 2 | We all know that "restatable" package can help repeat theorems in exactly the same format. However, what I need is to restate a theorem while changing its name in the parentheses. For example, the original theorem displays like "Theorem 1 (Name Here)"; later when I restate it, I want "Theorem 1 (Restated)." Is it possible to achieve that?
I noticed that in the document of "thmtools" there is a parameter called "restate". But there was not enough explanation and I do not know how to use it.
Thanks for any help!
| https://tex.stackexchange.com/users/293723 | Restating Theorems while Changing its Name (Title) | true | `thmtools` provides an environment called `restatable` with the following syntax
```
\begin{restatable}[theorm-title]{envname}{commandtorestate}
<some text>
\end{restatable}
```
On page 7 of the documentation we have to following example
```
\documentclass{article}
\usepackage{thmtools, thm-restate}
\declaretheorem{theorem}
\begin{document}
\begin{restatable}[Euclid]{theorem}{firsteuclid}
\label{thm:euclid}%
For every prime $p$, there is a prime $p'>p$.
In particular, the list of primes,
\begin{equation}\label{eq:1}
2,3,45,7,\dots
\end{equation}
is infinite.
\end{restatable}
\firsteuclid*
\vdots
\firsteuclid*
\end{document}
```
which produce the following
If I understand you correctly, the following patch is what you want
```
\documentclass{article}
\usepackage{thmtools,thm-restate}
\declaretheorem{theorem}
\usepackage{regexpatch}
\makeatletter
\xpatchcmd\thmt@restatable{%
\csname #2\@xa\endcsname\ifx\@nx#1\@nx\else[{#1}]\fi
}{%
\ifthmt@thisistheone
\csname #2\@xa\endcsname\ifx\@nx#1\@nx\else[{#1}]\fi
\else
\csname #2\@xa\endcsname[{Restated}]
\fi}{}{}
\makeatother
\begin{document}
\begin{restatable}[Euclid]{theorem}{firsteuclid}
\label{thm:euclid}%
For every prime $p$, there is a prime $p'>p$.
In particular, the list of primes,
\begin{equation}\label{eq:1}
2,3,45,7,\dots
\end{equation}
is infinite.
\end{restatable}
\firsteuclid*
\vdots
\firsteuclid*
\end{document}
```
| 2 | https://tex.stackexchange.com/users/264024 | 680878 | 315,904 |
https://tex.stackexchange.com/questions/680303 | 2 | I want to optimize my CV to be ATS-friendly. Modern Applicant Tracking Systems use programmable stupidity to parse resumes and decide, whether present them to a human reader.
To my surprise I discovered that the engine LinkedIn uses accepts `from - to`, but not `from -- to`. That makes my beautiful *Experience* and *Education* section a lump of a madman gibberish instead of well-separated entries. That does not help when you are looking for a job. ;)
To address the issue I have tried the approach from <https://tex.stackexchange.com/a/442814/123888> :
```
FROM \protect\BeginAccSupp{ActualText=-}--\protect\EndAccSupp{} TO
```
that hides an n-dash form `pdftotext`, but not from `pdf2txt.py`.
As I have commented [the horse is still there](https://tex.stackexchange.com/a/213950/123888).
The other problem is string replacement. I decided to define a macro `\cvdates` with tex code from <https://tex.stackexchange.com/a/213950/123888> (other answers does not work with n-dash):
```
\def\replace#1#2#3{%
\def\tmp##1#2{##1#3\tmp}%
\tmp#1\stopreplace#2\stopreplace}
\def\stopreplace#1\stopreplace{}
\newcommand{\cvdates}[1]{\replace{#1}{--}{\protect\BeginAccSupp{ActualText=-}--\protect\EndAccSupp{}}}
```
But then with
```
\cvdates{FROM2 -- TO2}
\cvdates{FROM3 --- TO3}
```
I get
```
FROM2 - TO2
FROM3 -- TO3
```
when I run `pdftotext test.pdf -`
One possible solution I can think about is to display `from -- to` to humans as graphics with an associated invisible text ([How do I create an invisible character?](https://tex.stackexchange.com/questions/4519/how-do-i-create-an-invisible-character)). But I have no idea how can I remove machine-readable text from `from -- to`.
| https://tex.stackexchange.com/users/123888 | How to convert a dash (--/---) to a minus (-) for Applicant Tracking Systems only? | false | If you can compile with lualatex (or xetex) and use the `fontspec` package, you can do something like this MWE:
```
\documentclass{article}
\RequirePackage{fontspec}
\setmainfont{Latin Modern Roman}
\begin{document}
1984-2001\par
1984{\addfontfeature{FakeStretch=2.5}-}2001\par
\end{document}
```
The first line shows an ordinary hyphen. The second line has the hyphen stretched, so it looks like a dash. The fake dash looks correct in paper print, in a PDF Reader, and probably to OCR. But if text is extracted from the PDF, the fake dash is still a hyphen.
Another strategy would be to use a font editor, and stretch the hyphen. But this is not necessary, since `fontspec` does all that is needed.
If you cannot use `fontspec` then try what I suggested in a comment (above): Use a font editor, and change the width of the hyphen. Disadvantage is that it will then be long, everywhere a hyphen appears.
EDIT: At the request of the OP, I add that solution:
In preamble: `\RequirePackage{graphicx}` (or `\usepackage{graphicx`)
In document:
```
\protect\raisebox{0.44ex}{\scalebox{1.88}[0.35]{-}}
```
Both the original solution, and this edit,do something similar: They re-draw the shape of the glyph, but preserve its identity as hyphen.
EDIT2: The OP realized that `\scalebox` has a propblem with `pdftotext`
I firmly (VERY firmly) encourage the OP, and anyone with a similar issue, to use `lualatex` instead of `pdftex`. That requires using utf-8 characters (nowadays, standard). It requires loading package `fontspec` rather than `fontenc`. It requires NOT declaring `OT1` or any similar encoding. And, it requires OpenType or TrueType fonts, not Type 1. None of this is exotic. It does not require learning Lua programming. There are many math fonts that will work, and a wide choice of text fonts. Many Type 1 fonts have alternative OpenType formats.
| 3 | https://tex.stackexchange.com/users/287367 | 680885 | 315,906 |
https://tex.stackexchange.com/questions/680881 | 0 | I am getting errors while compiling my files, but the errors are not mentioning the line numbers where I can check and correct them. Can someone tell me what are these errors about?
```
enter code here
```
**Error:**
```
Package transparent Warning: Loading aborted, because pdfTeX is not running in PDF mode.
/usr/local/texlive/2021/texmf-dist/tex/latex/transparent/transparent.sty
Package caption Warning: Unknown document class (or package), standard defaults will be used. See the caption package documentation for explanation.
/usr/local/texlive/2021/texmf-dist/tex/latex/caption/caption.sty
Unused global option(s):
```
**My preamble looks like this:**
```
\documentclass[
superscriptaddress,
aps,border=5cm, article
]{revtex4-2}
%\usepackage[preprint]{nips_2018} % so I can compile without the nips format
\usepackage{natbib} % this is probably into you nips_2018 format file
\usepackage{tikz}
%\usepackage[utf8]{inputenc} % allow utf-8 input
\usepackage[T1]{fontenc} % use 8-bit T1 fonts
\usepackage{url} % simple URL typesetting
\usepackage{mathtools,amsmath}
\usepackage{array}
\usepackage{booktabs}
\usepackage{adjustbox}
\usepackage{graphicx}
\usepackage{epsf}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{stmaryrd}
\usepackage{setspace}
\usepackage{enumerate}
\usepackage{float}
\usepackage{footnote}
\usepackage{microtype}
\usepackage{scalefnt}
\usepackage{xfrac}
\usepackage{transparent}
\usepackage{rotate}
\usepackage{tabu}
\usepackage{xcolor}
\usepackage{etoolbox}
\usepackage{bm}
\usepackage[margin=25mm]{geometry} % for setting page layout
\usepackage{siunitx}
\usepackage[font=small]{subcaption}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
%\documentclass{scrbook}
\usepackage{pst-func}
\psset{xunit=0.25,yunit=5}
\newcommand{\ve}[1]{\bm{#1}}
\newcommand{\ba}{\ve{a}}
\newcommand{\bb}{\ve{b}}
\newcommand{\bu}{\ve{u}}
\newcommand{\bv}{\ve{v}}
\newcommand{\br}{\ve{r}}
\newcommand{\bp}{\ve{p}}
\newcommand{\bt}{\ve{t}}
\newcommand{\bn}{\ve{n}}
\newcommand{\bc}{\ve{c}}
\newcommand{\bq}{\ve{q}}
\newcommand{\bff}{\ve{f}}
\newcommand{\bw}{\ve{w}}
\newcommand{\by}{\ve{y}}
\newcommand{\be}{\ve{e}}
\newcommand{\bg}{\ve{g}}
\newcommand{\bs}{\ve{s}}
\newcommand{\bx}{\ve{x}}
\newcommand{\bA}{\ve{A}}
\newcommand{\bS}{\ve{S}}
\newcommand{\bB}{\ve{B}}
\newcommand{\bU}{\ve{U}}
\newcommand{\bV}{\ve{V}}
\newcommand{\bQ}{\ve{Q}}
\newcommand{\bP}{\ve{P}}
\newcommand{\bGG}{\ve{G}}
\newcommand{\bRR}{\ve{R}}
\newcommand{\bX}{\ve{X}}
\newcommand{\bC}{\ve{C}}
\newcommand{\bF}{\ve{F}}
\newcommand{\bI}{\ve{I}}
\newcommand{\ddd}{\dd R \dd \dot{R}}
\newcommand{\bbE}{\mathbb{E}}
\newcommand{\Rdot}{\dot{R}}
\newcommand{\Rddot}{\ddot{R}}
\newcommand{\muR}{\mu_R}
\newcommand{\muRdot}{\mu_{\dot{R}}}
\newcommand{\sigmaR}{\sigma_R}
\newcommand{\sigmaRdot}{\sigma_{\dot{R}}}
\newcommand{\bmu}{\vec{\boldsymbol{\mu}}}
\newcommand{\btheta}{\vec{\boldsymbol{\theta}}}
\newcommand{\bLambda}{\boldsymbol{\Lambda}}
\newcommand{\blambda}{\boldsymbol{\lambda}}
\newcommand{\bSigma}{\boldsymbol{\Sigma}}
\newcommand{\bEps}{\boldsymbol{\varepsilon}}
\newcommand{\beps}{\boldsymbol{\varepsilon}}
%\newcommand{\bmu}{\boldsymbol{\mu}}
\newcommand{\balpha}{\boldsymbol{\alpha}}
\newcommand{\heps}{\hat{\varepsilon}}
\newcommand{\bdelta}{\boldsymbol{\delta}}
\newcommand{\vblambda}{\vec{\boldsymbol{\lambda}}}
\newcommand{\vbsigma}{\vec{\boldsymbol{\sigma}}}
\newcommand{\vbEps}{\vec{\boldsymbol{\varepsilon}}}
\newcommand{\vbdelta}{\vec{\boldsymbol{\delta}}}
\newcommand{\eps}{\varepsilon}
\newcommand{\vba}{\vec{\ve{a}}}
\newcommand{\vbu}{\vec{\ve{u}}}
\newcommand{\vbx}{\vec{\ve{x}}}
\newcommand{\vbv}{\vec{\ve{v}}}
\newcommand{\vbh}{\vec{\ve{h}}}
\newcommand{\vbbh}{\vec{\bar{\ve{h}}}}
\newcommand{\vbs}{\vec{\ve{s}}}
\newcommand{\vbf}{\vec{\ve{f}}}
\newcommand{\vq}{\vec{q}}
\newcommand{\hbx}{\hat{\ve{x}}}
\newcommand{\hby}{\hat{\ve{y}}}
\newcommand{\hbz}{\hat{\ve{z}}}
\newcommand{\tx}{\widetilde{\ve{x}}}
\newcommand{\tbB}{\widetilde{\ve{B}}}
\newcommand{\mom}{\mu'}
\newcommand{\bmom}{\vec{\boldsymbol{\mu}}'}
\newcommand{\Rt}{R}
\newcommand{\hR}{\hat{R}}
\newcommand{\dd}{\text{d}}
\newcommand{\gdot}{\dot\gamma}
\newcommand\Rey{\mbox{\text{Re}}} % Reynolds number
\newcommand\Ca{\mbox{\text{Ca}}} % Cavitation number
\newcommand{\overbar}[1]{\mkern 1.5mu\overline{\mkern-1.5mu#1\mkern-1.5mu}\mkern 1.5mu}
% Making colors nice
\definecolor{lightblue}{rgb}{0.63, 0.74, 0.78}
\definecolor{seagreen}{rgb}{0.18, 0.42, 0.41}
\definecolor{orange}{rgb}{0.85, 0.55, 0.13}
\definecolor{silver}{rgb}{0.69, 0.67, 0.66}
\definecolor{rust}{rgb}{0.72, 0.26, 0.06}
\colorlet{lightsilver}{silver!30!white}
\colorlet{darkorange}{orange!75!black}
\colorlet{darksilver}{silver!65!black}
\colorlet{darklightblue}{lightblue!65!black}
\colorlet{darkrust}{rust!85!black}
\usepackage[colorlinks=true,linkcolor=darkrust,citecolor=darklightblue,urlcolor=darksilver]{hyperref}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{matrix}
\usetikzlibrary{positioning}
\usepackage[strict]{changepage} % < added
\usetikzlibrary{arrows.meta,
calc, chains,
quotes} % added
```
| https://tex.stackexchange.com/users/288406 | Error in preamble while compiling | true | In Overleaf, I get three warnings (not errors):
1. Package caption Warning: Unknown document class (or package), standard defaults will be used. See the caption package documentation for explanation.
2. Unused global option(s):
3. jnrlst (dependency: not reversed) set 1
The caption warning is referring you to the [documentation](https://ctan.org/pkg/caption?lang=en). But it's also plain enough to read: (sub)caption isn't familiar with revtex4-2, and isn't making any guarantees about what will happen. (You can also cut out everything else in your preamble to verify that's the problem.) If you don't need the subcaption package, then take it out. If you do need to use it, then you'll need to ignore the warning, or tell TeX to ignore the warning.
Expanding the "Raw logs", we find that the unused global options are "border" and "article". Taking them out of the `\documentclass[options]` removes that warning.
For jnrlst, a web search for that string leads to <https://tex.stackexchange.com/a/567691/107497>, which says to add `\bibliographystyle{apsrev4-2}` to your preamble.
I will echo enkorvaks's comment that this appears to be a preamble that you've copied over (the two packages that have been `% added` at the end also point to that). If a copied preamble is giving you problems, are you sure you want to use it?
| 1 | https://tex.stackexchange.com/users/107497 | 680901 | 315,912 |
https://tex.stackexchange.com/questions/680904 | 1 | I was wondering if there is a way to make a command to generate a BibLatex blank entry to be filled easily (instead of typing all the fields I need).
**Context to what I am thinking**:
I know JabRef and Zotero (the ones I use) produces the sort of entries according to the config./style I need, but, imagine that I just want to create my bibliog. entries directly in a .bib file. So, instead of writing:
```
@book{ ,
author = ,
title = ,
location = ,
etc ...,
}
```
I could type, **for example**, \book -- into a .bib file -- and then generate the type of entry (book, article, inbook, etc).
If there's a way, please, indicate me the way for achieving that. Ig there's not, thanks anyway.
Thanks.
| https://tex.stackexchange.com/users/288236 | Is there a way to make a command to create blank BibLatex entry? | true | This would have to be a feature of the editor you use to create your `.bib` files. The `.bib` file syntax is fairly rigid and does not allow for macros and macro definitions in the same way `.tex` files do (which does not mean that you cannot use macros you have defined in your `.tex` document in your `.bib` file, mind).
There are plenty of editors out there ([LaTeX Editors/IDEs](https://tex.stackexchange.com/q/339/35864)). Some will have a feature like this built in, others might allow you to install an external add-on/plug-in for the job, for another subset there might be no such function.
Just off the top of my head, the following editors can do this.
* TeXStudio has a feature to insert stubs of `.bib` entries via its *Bibliography* menu. (See <https://texstudio-org.github.io/advanced.html#bibliography.>)
* So does Texmaker (<https://www.xm1math.net/texmaker/doc.html#SECTION32>)
* Emacs has BibTeX mode to edit `.bib` file to insert stubs of `.bib` entries. (See <http://www.jonathanleroux.org/bibtex-mode.html>, [Library for generating bibtex entries](https://tex.stackexchange.com/q/78656/35864), [Biblatex entries in bibtex-mode (emacs)](https://tex.stackexchange.com/q/285904/35864.))
| 0 | https://tex.stackexchange.com/users/35864 | 680911 | 315,917 |
https://tex.stackexchange.com/questions/680899 | 1 | When using an unnumbered part (`\part*`), added to TOC using `\addcontentsline`, the page number for the part page is wrong.
See this MWE :
```
\documentclass{book}
\begin{document}
\tableofcontents
\part*{First part}
\addcontentsline{toc}{part}{First part}
\chapter{Chapter 1}
\end{document}
```
The "Part 1" page is page 3, but the TOC says 5, like the beginning of the first chapter. If we adds `hyperref` the anchor for the internal link will be similar (page 5 instead of page 3).
It seems basic, but I can't figure out how to fix this behavior, and to my surprise I've found no answer, here or in regular latex manuals… Does someone know what is going wrong here?
| https://tex.stackexchange.com/users/101712 | Wrong TOC page number with starred part + \addcontentsline | true | The problem comes from the fact that `\part*`, unlike `\chapter*`, not only starts a new page and prints the heading on it, it also starts another new page after the heading. In double-sided printing, this page remains empty, so another new page is started. Only then your `\addcontentsline` statement is executed and thus comes two pages too late.
To solve this, you should, as indicated in Ulrike's comment, first start a new right page, then place the `\addcontentsline` statement and only after that the heading with `\part*`:
```
\documentclass{book}
\begin{document}
\tableofcontents
\cleardoublepage
\addcontentsline{toc}{part}{First part}
\part*{First part}
\chapter{Chapter 1}
\end{document}
```
`\addcontentsline` before the heading also has the advantage that when `hyperref` is used, the link actually points before the heading instead of after it.
BTW: The KOMA-Script class `scrbook` has an additional command `\addpart`, that is used like `\chapter*` but automatically adds a toc entry:
```
\documentclass[emulatestandardclasses]{scrbook}
\begin{document}
\tableofcontents
\addpart{First part}
\chapter{Chapter 1}
\end{document}
```
I've used option `emulatestandardclasses` to emulate the lookalike of the standard `book` class. Without the option page header and footer and the chapter headings would be different.
| 1 | https://tex.stackexchange.com/users/277964 | 680914 | 315,919 |
https://tex.stackexchange.com/questions/680907 | 2 | The question: possibility of using of working `python` scripts embedded in LaTeX.
When I was using `\usepackage{python}`, it did wonders to my dissertation (although I am very new to LaTeX, but some thousands of lines of code have been written in python). Python was drawing plots and putting them on hard drive, then LaTeX was putting them inside the document. After serious problem with the system (linux Mint), I was forced to reinstall, and `python` + `LaTeX` stopped working. I was looking for a solution and `pythontex` was promising. It turned out, eventually, there is some serious conflict between `mwrep` and `pythontex`.
Is it possible to use `pythontex` with `mwrep`? (`mwrep` is a must *[EDIT: On second thought I don't know if it really is required -- I thought that the printing house wants the document of this class -- to tell the truth I do not know the difference. I'll ask about it the editor.]*)
Or is there a better possibility of emmbeding python scripts inside LaTeX (i.e. working scripts)?
P.S.
I was looking for an answer, but I found no definitive solution.
**UPDATE**
Minimal working example.
*.TEX file:*
```
% !TEX options=--shell-escape
\documentclass[11pt]{mwrep}%
\usepackage{pythontex}
\usepackage{graphicx}
\begin{document}
\section{pythontex try}
% \begin{pyconsole}
% x = 987.27
% x = x**2
% print(f"{x = }")
% print("Hello Seba :)")
% \end{pyconsole}
\end{document}
```
*Sublime Text message:*
```
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./mwrepPythontryMini.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-01-21>
(/usr/share/texlive/texmf-dist/tex/latex/mwcls/mwrep.cls
Document Class: mwrep 2017/05/13 v0.75 A LaTeX document class (MW)
*** Beta version. Formatting may change
*** in future versions of this class.
(/usr/share/texlive/texmf-dist/tex/latex/mwcls/mw11.clo))
(... cut ...)
(./mwrepPythontryMini.aux)
No file pythontex-files-mwrepPythontryMini/mwrepPythontryMini.pytxmcr.
Run PythonTeX to create it.
! Undefined control sequence.
\newfloat@setwithin ...apter}\@chapterlistsgap@on
{#1}\newfloat@@setwithin {...
l.9 \begin{document}
?
```
*\*.sublime-build:*
```
{
"shell_cmd": "pdflatex $file_name && pythontex $file_name --interpreter python:python3 && pdflatex $file_name && xreader $file_base_name.pdf "
}
```
| https://tex.stackexchange.com/users/266782 | mwrep and pythontex -- is it possible to use | true | Looks like some weird interfacing between `newfloat` and `mwrep`. This is my understanding:
* Unlike `article` documentclass, `mwrep` documentclass does not define `\@chapter`.
* This breaks the `\DeclareFloatingEnvironment` command for some reason.
* `pythontex` package defines a `listing` environment `\AtBeginDocument` if it's not defined before:
```
\AtBeginDocument{
\ifcsname listing\endcsname
\ifbool{pytx@listingenv}{}%
{\PackageWarning{\pytx@packagename}%
{A "listing" environment already exists \MessageBreak
\pytx@packagename\space will not create one \MessageBreak
Use \string\setpythontexlistingenv\space to create a custom listing environment}}%
\else
\ifbool{pytx@listingenv}{}{\DeclareFloatingEnvironment[fileext=lopytx]{listing}}
\fi
}
```
You can also reproduce the issue without `newfloat`:
```
\documentclass{mwrep}
\usepackage{newfloat}
\DeclareFloatingEnvironment{diagram}
\begin{document}
Text
\end{document}
```
So, apparently a workaround (at least in the current version) is to force pythontex to declare that floating environment
very early on:
```
\RequirePackage{pythontex}
\setpythontexlistingenv{listing}
\documentclass[11pt]{mwrep}%
\begin{document}
\section{pythontex try}
\begin{pyconsole}
x = 987.27
x = x**2
print(f"{x = }")
print("Hello Seba :)")
\end{pyconsole}
\end{document}
```
Another workaround is to add
```
\csname @chapter\endcsname
```
to the very start of the document.
Looks like it was caused by some other unrelated change: <https://gitlab.com/axelsommerfeldt/newfloat/-/issues/13>
| 4 | https://tex.stackexchange.com/users/250119 | 680916 | 315,920 |
https://tex.stackexchange.com/questions/680913 | 4 | I have a simple tree. I cannot figure out how to align children vertically.
```
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node {0}
child {node {a}}
child {node {b}}
child {node {c}
child {node {a1}}
child {node {b1}}
child {node {c1}}
child {node {d1}}
}
child {node {d}}
;
\end{tikzpicture}
\end{document}
```
Compiling the code gives a subtree under node c, but I want x and x1 to align vertically.
Do I have to manually place every node? Options like `below of=a` miss align the remaining children. I'm looking for something like `leftalign` whole tree.
| https://tex.stackexchange.com/users/293665 | Latex Tikz align children vertically | true | I am not sure whether this is what you want, but you can shift the nodes of a certain level to the left and right (since the default sibling distance is 15mm, in order to vertically align the nodes, you would need to shift all nodes by the half of this value which is 7.5mm):
```
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[level 2/.style={every node/.style={xshift=-7.5mm}}]
\node {0}
child {node {a}}
child {node {b}}
child {node {c}
child {node {a1}}
child {node {b1}}
child {node {c1}}
child {node {d1}}
}
child {node {d}}
;
\end{tikzpicture}
\end{document}
```
---
Variations of the above if one node is missing:
```
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[level 2/.style={sibling distance=22.5mm, every node/.style={xshift=-7.5mm}}]
\node {0}
child {node {a}}
child {node {b}}
child {node {c}
child {node {a1}}
child {node {b1}}
child {node {d1}}
}
child {node {d}}
;
\end{tikzpicture}
\end{document}
```
```
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[level 2/.style={every node/.style={xshift=-7.5mm}}]
\node {0}
child {node {a}}
child {node {b}}
child {node {c}
child {node {a1}}
child {node {b1}}
child[missing] {}
child {node {d1}}
}
child {node {d}}
;
\end{tikzpicture}
\end{document}
```
---
Maybe, you could also try the `forest` package:
```
\documentclass[border=10pt]{standalone}
\usepackage{forest}
\begin{document}
\begin{forest} for tree={node options={text width=1.25em, align=center}}
[0
[a]
[b]
[c
[a1]
[b1]
[c1, calign with current]
[d1]
]
[d]
]
\end{forest}
\end{document}
```
```
\documentclass[border=10pt]{standalone}
\usepackage{forest}
\begin{document}
\begin{forest} for tree={node options={text width=1.25em, align=center}}
[0
[a]
[b]
[c
[a1]
[b1]
[, phantom, calign with current]
[d1]
]
[d]
]
\end{forest}
\end{document}
```
| 5 | https://tex.stackexchange.com/users/47927 | 680918 | 315,921 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.