Comments (10)
Original comment by Clemens Niederberger (Bitbucket: cgnieder, GitHub: cgnieder).
The MWE
#!latex
\documentclass{article}
\usepackage{acro}
\begin{document}
\ac{foo}
\end{document}
gives in the log
#!latex
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! acro error: "undefined"
!
! You've requested acronym `foo' but it seems that it was never defined!
!
! See the acro documentation for further information.
!
! For immediate help type H <return>.
!...............................................
l.5 \ac{foo}
so actually all information obout the mispelling and the input line where the error happens are there.
But if you like you can do something like the following:
#!latex
\documentclass{article}
\usepackage{acro}
\ExplSyntaxOn
\bool_new:N \l_acro_warned_bool
\cs_set_protected:Npn \acro_defined:n #1
{
\bool_if:nTF
{
!\l_acro_warned_bool &&
!\prop_if_in_p:Nn \l__acro_short_prop {#1}
}
{
\msg_warning:nnn {acro} {undefined} {#1}
\textbf {[#1]}
\bool_set_true:N \l_acro_warned_bool
}
{ \bool_set_false:N \l_acro_warned_bool }
}
\ExplSyntaxOff
\begin{document}
\ac{foo}
\end{document}
Now you'll get in the log:
#!latex
*************************************************
* acro warning: "undefined"
*
* You've requested acronym `foo' but it seems that it was never defined!
*************************************************
which unfortunately means that the corresponding line is not recorded.
It would be possible to change that, too:
#!latex
\documentclass{article}
\usepackage{acro}
\ExplSyntaxOn
\bool_new:N \l_acro_warned_bool
\msg_set:nnn {acro} {undefined}
{
You've~requested~acronym~`#1'~\msg_line_context: \c_space_tl
but~you~ apparently~haven't~defined~it,~yet!~
Maybe~you've~mispelled~it?
}
\cs_set_protected:Npn \acro_defined:n #1
{
\bool_if:nTF
{
!\l_acro_warned_bool &&
!\prop_if_in_p:Nn \l__acro_short_prop {#1}
}
{
\msg_warning:nnn {acro} {undefined} {#1}
\textbf {[#1]}
\bool_set_true:N \l_acro_warned_bool
}
{ \bool_set_false:N \l_acro_warned_bool }
}
\ExplSyntaxOff
\begin{document}
\ac{foo}
\end{document}
gives:
#!latex
*************************************************
* acro warning: "undefined"
*
* You've requested acronym `foo' on line 32 but you apparently haven't defined
* it, yet! Maybe you've mispelled it?
*************************************************
from acro.
Original comment by moreen (Bitbucket: moreen, GitHub: moreen).
Thank you for your fast answer.
When I use the lower code-fragment Texniccenter will only write a warning "undefined".
I think the problem is, that you are not using a standard format. For example the amsmath-package i use writes a warning like this:
#!
Package amsmath Warning: Foreign command \atop;
(amsmath) \frac or \genfrac should be used instead
(amsmath) on input line 97.
This whole message is printed very nicely in one line. No other package I use print any stars around their messages.
from acro.
Original comment by Clemens Niederberger (Bitbucket: cgnieder, GitHub: cgnieder).
This is no »problem« really, just a question of convenience and what you're used to. Warnings or errors like the amsmath
one are produced by LaTeX2e's \PackageError
and \PackageWarning
macros. acro
however is written in expl3, the programming layer for a (yet to come) LaTeX3 and uses its messaging module. You'll get the same kind of warnings by other packages as well such as siunitx
or xparse
or any other package written in expl3.
The issue that TeXnicCenter cannot parse those kind of messages is unrelated and not something a package author should need to bother with. Personally I've never used TeXnicCenter. I always take a look at the corresponding log-file of a LaTeX compilation and there the expl3-messages are a lot easier spotted than the »traditional« ones.
from acro.
Original comment by moreen (Bitbucket: moreen, GitHub: moreen).
Ok, thank you. If it is a new format I will write a request for TeXnicCenter.
from acro.
Original comment by moreen (Bitbucket: moreen, GitHub: moreen).
I have made some tests for creating an appropriate report for the texniccenter community and found, that with this code:
#!latex
\documentclass{article}
\usepackage{acro}
\begin{document}
\ac{foo}
\end{document}
Texniccenter together with Miktex creates two entries in the log:
#!latex
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! acro error: "undefined"
!
! You've requested acronym `foo' but it seems that it was never defined!
!
! See the acro documentation for further information.
!
! For immediate help type H <return>.
!...............................................
l.5 \ac{foo}
|'''''''''''''''''''''''''''''''''''''''''''''''
| You've requested acronym `foo' on line 5 but you apperantly haven't defined
| it, yet! Maybe you've mispelled it?
|...............................................
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! acro error: "undefined"
!
! You've requested acronym `foo' but it seems that it was never defined!
!
! See the acro documentation for further information.
!
! For immediate help type H <return>.
!...............................................
l.5 \ac{foo}
|'''''''''''''''''''''''''''''''''''''''''''''''
| You've requested acronym `foo' on line 5 but you apperantly haven't defined
| it, yet! Maybe you've mispelled it?
|...............................................
And according to my dictionary
"apperantly" should be "apparently"
and
"mispelled" should be "misspelled"
When I change it to a warning it is just one report:
#!latex
*************************************************
* acro warning: "undefined"
*
* You've requested acronym `foo' on line 47 but you apparently haven't defined
* it, yet! Maybe you've mispelled it?
*************************************************
from acro.
Original comment by Clemens Niederberger (Bitbucket: cgnieder, GitHub: cgnieder).
Thanks, I'll correct the typos.
I noticed as well that the error is thrown twice and will correct this in the next version.
from acro.
Original comment by moreen (Bitbucket: moreen, GitHub: moreen).
Cool, thank you. Looking forward to a new version. :-)
from acro.
Original comment by Clemens Niederberger (Bitbucket: cgnieder, GitHub: cgnieder).
v1.6 will only issue one error/warning and will have the option messages=loud|silent
which allows to turn all error messages into warnings (and at the same time all warnings into info messages)
from acro.
Original comment by Clemens Niederberger (Bitbucket: cgnieder, GitHub: cgnieder).
resolved in commit d628ba8
from acro.
Original comment by Clemens Niederberger (Bitbucket: cgnieder, GitHub: cgnieder).
Removing version: 1.5 (automated comment)
from acro.
Related Issues (20)
- `Acronym properties may have changed. Rerun to get them synchronized` regardless of how many times I compile HOT 2
- Acronym properties may have changed. Rerun to get them(acro) synchronized. HOT 5
- Page number alignment error
- \scshape only has an effect in \ac{…}, not in \printacronyms HOT 1
- ! Package acro Error: Patching `longtable' failed. Please contact the acro author. HOT 2
- Typo in the "property-unique" message
- `\printacronyms` fails for nested acronyms if inserted thanks to the `\AtEndDocument` hook
- `link-only-first` makes the (first) short appearance of the acronym wrongly linked to the last page of the document
- Missing number, treated as zero with template=tabularray HOT 1
- Printed acronym cannot be written on two lines
- I miss list-short-format HOT 1
- Kerning Bug
- `acro` automatically capitalizes `<id>` when using `\acroupper` HOT 2
- Missin `format-include-endings` flag
- \ace command for printing extra. HOT 2
- tabularray Continuation Header Shown
- `acro` broken with latest release of `l3kernel` HOT 5
- is there any method to change the font of acronyms in \printacronyms?
- Indexing
- Declaring acronyms in v3.7+ takes far longer to process than in v2 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acro.